Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: renaming Create to Self-service #2574

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dynamicPlugins:
config:
priority: 90
props:
title: Create...
title: Self-service
icon: add
to: create
- mountPoint: global.header/component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
config:
priority: 90
props:
title: Create...
title: Self-service
icon: add
to: create
- mountPoint: global.header/component
Expand Down
2 changes: 1 addition & 1 deletion dynamic-plugins.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ plugins:
config:
priority: 90
props:
title: Create...
title: Self-service
icon: add
to: create
- mountPoint: global.header/component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"@mui/material": "5.16.14",
"@red-hat-developer-hub/backstage-plugin-global-header": "1.0.0"
"@red-hat-developer-hub/backstage-plugin-global-header": "1.1.0"
},
"devDependencies": {
"@backstage/cli": "0.29.6",
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/playwright/e2e/audit-log/catalog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ test.describe("Audit Log check for Catalog Plugin", () => {
});

test("Should fetch logs for QueriedCatalogEntityFetch event and validate log structure and values", async () => {
await uiHelper.clickButton("Create");
await uiHelper.clickButton("Self-service");
await validateCatalogLogEvent(
"QueriedCatalogEntityFetch",
"Queried entity fetch attempt",
Expand All @@ -101,7 +101,7 @@ test.describe("Audit Log check for Catalog Plugin", () => {
test("Should fetch logs for CatalogLocationCreation event and validate log structure and values", async () => {
const template =
"https://github.com/RoadieHQ/sample-service/blob/main/demo_template.yaml";
await uiHelper.clickButton("Create");
await uiHelper.clickButton("Self-service");
await uiHelper.clickButton("Register Existing Component");
await catalogImport.analyzeComponent(template);

Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/playwright/e2e/audit-log/scaffold.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test.describe("Audit Log check for Catalog Plugin", () => {
common = new Common(page);
catalogImport = new CatalogImport(page);
await common.loginAsGuest();
await uiHelper.clickLink({ ariaLabel: "Create..." });
await uiHelper.clickLink({ ariaLabel: "Self-service" });
});

test("Should fetch logs for ScaffolderParameterSchemaFetch event and validate log structure and values", async ({
Expand All @@ -32,7 +32,7 @@ test.describe("Audit Log check for Catalog Plugin", () => {
await uiHelper.clickButton("Register Existing Component");
await catalogImport.registerExistingComponent(template, false);
await page.waitForTimeout(1000);
await uiHelper.clickLink({ ariaLabel: "Create..." });
await uiHelper.clickLink({ ariaLabel: "Self-service" });
await common.waitForLoad();
await uiHelper.clickBtnInCard("Hello World 2", "Choose");
await LogUtils.validateLogEvent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ test.describe.serial("GitHub Happy path", () => {
test("Register an existing component", async () => {
await uiHelper.openSidebar("Catalog");
await uiHelper.selectMuiBox("Kind", "Component");
await uiHelper.clickButton("Create");
await uiHelper.clickButton("Self-service");
await uiHelper.clickButton("Register Existing Component");
await catalogImport.registerExistingComponent(component);
});
Expand Down Expand Up @@ -161,7 +161,7 @@ test.describe.serial("GitHub Happy path", () => {
});

test("Verify all 12 Software Templates appear in the Create page", async () => {
await uiHelper.clickLink({ ariaLabel: "Create..." });
await uiHelper.clickLink({ ariaLabel: "Self-service" });
await uiHelper.verifyHeading("Templates");

for (const template of TEMPLATES) {
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/playwright/e2e/catalog-scaffolded-from-link.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ test.describe.serial("Link Scaffolded Templates to Catalog Items", () => {

test("Register an Template", async () => {
await uiHelper.openSidebar("Catalog");
await uiHelper.clickButton("Create");
await uiHelper.clickButton("Self-service");
await uiHelper.clickButton("Register Existing Component");
await catalogImport.registerExistingComponent(template, false);
});

test("Create a React App using the newly registered Template", async () => {
test.setTimeout(130000);
await uiHelper.openSidebar("Catalog");
await uiHelper.clickButton("Create");
await uiHelper.clickButton("Self-service");
await uiHelper.searchInputPlaceholder("Create React App Template");
await uiHelper.verifyText("Create React App Template");
await uiHelper.waitForTextDisappear("Add ArgoCD to an existing project");
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/playwright/e2e/catalog-timestamp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test.describe("Test timestamp column on Catalog", () => {
});

test("Register an existing component and verify `Created At` column and value in the Catalog Page", async () => {
await uiHelper.clickButton("Create");
await uiHelper.clickButton("Self-service");
await uiHelper.clickButton("Register Existing Component");
await catalogImport.registerExistingComponent(component);
await uiHelper.openSidebar("Catalog");
Expand Down
8 changes: 4 additions & 4 deletions e2e-tests/playwright/e2e/default-global-header.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test.describe("Default Global Header", () => {
page,
}) => {
await expect(page.locator(`input[placeholder="Search..."]`)).toBeVisible();
await uiHelper.verifyLink({ label: "Create..." });
await uiHelper.verifyLink({ label: "Self-service" });
await uiHelper.verifyLink({ label: "Support (external link)" });
await uiHelper.verifyLink({ label: "Notifications" });
expect(await uiHelper.isBtnVisible("rhdh-qe-2")).toBeTruthy();
Expand All @@ -31,9 +31,9 @@ test.describe("Default Global Header", () => {
expect(await uiHelper.isBtnVisible("Settings")).toBeFalsy();
});

test("Verify that clicking on Create button opens the Software Templates page", async () => {
await uiHelper.clickLink({ ariaLabel: "Create..." });
await uiHelper.verifyHeading("Software Templates");
test("Verify that clicking on Self-service button opens the Templates page", async () => {
await uiHelper.clickLink({ ariaLabel: "Self-service" });
await uiHelper.verifyHeading("Self-service");
});

test("Verify that clicking on Support button opens a new tab", async ({
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/playwright/e2e/plugins/bulk-import.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ test.describe
test('Verify repo from "register existing component" are displayed in bulk import Added repositories', async () => {
// Register Existing Component
await uiHelper.openSidebar("Catalog");
await uiHelper.clickButton("Create");
await uiHelper.clickButton("Self-service");
await uiHelper.clickButton("Register Existing Component");
await catalogImport.registerExistingComponent(
existingComponentDetails.url,
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/playwright/e2e/plugins/http-request.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test.describe("Testing scaffolder-backend-module-http-request to invoke an exter

test("Create a software template using http-request plugin", async () => {
test.setTimeout(130000);
await uiHelper.clickLink({ ariaLabel: "Create..." });
await uiHelper.clickLink({ ariaLabel: "Self-service" });
await uiHelper.verifyHeading("Templates");
await uiHelper.clickButton("Register Existing Component");
await catalogImport.registerExistingComponent(template, false);
Expand All @@ -34,7 +34,7 @@ test.describe("Testing scaffolder-backend-module-http-request to invoke an exter
await uiHelper.clickLink("Test HTTP Request");
await uiHelper.verifyHeading("Test HTTP Request");
await uiHelper.clickLink("Launch Template");
await uiHelper.verifyHeading("Software Templates");
await uiHelper.verifyHeading("Self-service");
await uiHelper.clickButton("Create");
//Checking for Http Status 200
await uiHelper.verifyText("200", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ test.describe("Test Kubernetes Actions plugin", () => {
kubeClient = new KubeClient();

await common.loginAsGuest();
await uiHelper.clickLink({ ariaLabel: "Create..." });
await uiHelper.clickLink({ ariaLabel: "Self-service" });
});

test("Creates kubernetes namespace", async () => {
namespace = `test-kubernetes-actions-${Date.now()}`;
await uiHelper.verifyHeading("Software Templates");
await uiHelper.verifyHeading("Self-service");
await uiHelper.clickBtnInCard("Create a kubernetes namespace", "Choose");
await uiHelper.waitForTitle("Create a kubernetes namespace", 2);

Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/playwright/e2e/plugins/rbac/rbac.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ test.describe.serial("Test RBAC", () => {
await uiHelper.openSidebar("Catalog");
await uiHelper.selectMuiBox("Kind", "Component");
await uiHelper.verifyTableIsEmpty();
await uiHelper.clickLink({ ariaLabel: "Create..." });
await uiHelper.clickLink({ ariaLabel: "Self-service" });
await page.reload();
await uiHelper.verifyText(
"No templates found that match your filter. Learn more about",
Expand All @@ -495,7 +495,7 @@ test.describe.serial("Test RBAC", () => {
});

test("Test catalog-entity create is allowed", async () => {
await uiHelper.clickLink({ ariaLabel: "Create..." });
await uiHelper.clickLink({ ariaLabel: "Self-service" });
expect(await uiHelper.isLinkVisible("Register Existing Component"));
await uiHelper.clickButton("Register Existing Component");
const catalogImport = new CatalogImport(page);
Expand Down
3 changes: 1 addition & 2 deletions e2e-tests/playwright/utils/navbar.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
export type SidebarTabs =
| "Catalog"
| "Create"
| "Settings"
| "My Group"
| "Home"
| "Create..."
| "Self-service"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think one Self-service is enough here. Please remove one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

| "Learning Paths"
| "Extensions"
| "Bulk import"
Expand Down
4 changes: 1 addition & 3 deletions packages/app/src/components/AppBase/AppBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ const AppBase = () => {
<Route
path="/create"
element={
<ScaffolderPage
headerOptions={{ title: 'Software Templates' }}
/>
<ScaffolderPage headerOptions={{ title: 'Self-service' }} />
}
>
<ScaffolderFieldExtensions>
Expand Down
5 changes: 5 additions & 0 deletions packages/app/src/components/DynamicRoot/DynamicRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import extractDynamicConfig, {
DynamicRoute,
} from '../../utils/dynamicUI/extractDynamicConfig';
import initializeRemotePlugins from '../../utils/dynamicUI/initializeRemotePlugins';
import { catalogTranslations } from '../catalog/translations/catalog';
import { MenuIcon } from '../Root/MenuIcon';
import CommonIcons from './CommonIcons';
import defaultAppComponents from './defaultAppComponents';
Expand Down Expand Up @@ -458,6 +459,10 @@ export const DynamicRoot = ({
api => !remoteApis.some(remoteApi => remoteApi.api.id === api.api.id),
);
app.current = createApp({
__experimentalTranslations: {
availableLanguages: ['en'],
resources: [catalogTranslations],
},
apis: [...filteredStaticApis, ...remoteApis],
bindRoutes({ bind }) {
bindAppRoutes(bind, resolvedRouteBindingTargets, routeBindings);
Expand Down
12 changes: 12 additions & 0 deletions packages/app/src/components/catalog/translations/catalog-en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { createTranslationMessages } from '@backstage/core-plugin-api/alpha';
import { catalogTranslationRef } from '@backstage/plugin-catalog/alpha';

const en = createTranslationMessages({
ref: catalogTranslationRef,
full: false, // False means that this is a partial translation
messages: {
'indexPage.createButtonTitle': 'Self-service',
},
});

export default en;
9 changes: 9 additions & 0 deletions packages/app/src/components/catalog/translations/catalog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createTranslationResource } from '@backstage/core-plugin-api/alpha';
import { catalogTranslationRef } from '@backstage/plugin-catalog/alpha';

export const catalogTranslations = createTranslationResource({
ref: catalogTranslationRef,
translations: {
en: () => import('./catalog-en'),
},
});
2 changes: 1 addition & 1 deletion packages/app/src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const DefaultMainMenuItems = {
priority: 60,
},
'default.create': {
title: 'Create...',
title: 'Self-service',
icon: 'add',
to: 'create',
priority: 50,
Expand Down
37 changes: 8 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13148,27 +13148,6 @@ __metadata:
languageName: node
linkType: hard

"@mui/styled-engine@npm:5.16.13":
version: 5.16.13
resolution: "@mui/styled-engine@npm:5.16.13"
dependencies:
"@babel/runtime": ^7.23.9
"@emotion/cache": ^11.13.5
csstype: ^3.1.3
prop-types: ^15.8.1
peerDependencies:
"@emotion/react": ^11.4.1
"@emotion/styled": ^11.3.0
react: ^17.0.0 || ^18.0.0 || ^19.0.0
peerDependenciesMeta:
"@emotion/react":
optional: true
"@emotion/styled":
optional: true
checksum: d9459ef4baac056d1a65e351e084b2fe1eb30516907fc48166f570c60e3db3cb30de2d0af2bf22a8caa004bf2c37a1b831ccad1069b1d03cfae202c247967e44
languageName: node
linkType: hard

"@mui/styled-engine@npm:5.16.14, @mui/styled-engine@npm:^5.16.14":
version: 5.16.14
resolution: "@mui/styled-engine@npm:5.16.14"
Expand Down Expand Up @@ -16902,9 +16881,9 @@ __metadata:
languageName: node
linkType: hard

"@red-hat-developer-hub/backstage-plugin-global-header@npm:1.0.0":
version: 1.0.0
resolution: "@red-hat-developer-hub/backstage-plugin-global-header@npm:1.0.0"
"@red-hat-developer-hub/backstage-plugin-global-header@npm:1.1.0":
version: 1.1.0
resolution: "@red-hat-developer-hub/backstage-plugin-global-header@npm:1.1.0"
dependencies:
"@backstage/catalog-model": ^1.7.3
"@backstage/core-components": ^0.16.3
Expand All @@ -16921,15 +16900,15 @@ __metadata:
"@backstage/plugin-search-react": ^1.8.5
"@backstage/plugin-signals-react": ^0.0.9
"@backstage/theme": ^0.6.3
"@mui/icons-material": 5.16.13
"@mui/material": 5.16.13
"@mui/styled-engine": 5.16.13
"@mui/icons-material": 5.16.14
"@mui/material": 5.16.14
"@mui/styled-engine": 5.16.14
"@scalprum/react-core": 0.9.3
react-use: ^17.5.0
peerDependencies:
react: ^16.13.1 || ^17.0.0 || ^18.0.0
react-router-dom: ^6.0.0
checksum: 6500dfcac091608b4eb466c1702f28934a276dd7cbf04aaafca167c74c605c6a520dfaa425f8669d21f5365e46b830a6acbb291206fe5b67bf7fde742823a586
checksum: 1ea671962219deb0a927d3bc93c54cc5e369824b3cf316f2bb1a6c0d2e0577a058d7449bd6dcd146ef2ad513ecd62b6a48356424a0372605a7e7ce397ab46b43
languageName: node
linkType: hard

Expand Down Expand Up @@ -41054,7 +41033,7 @@ __metadata:
"@backstage/cli": 0.29.6
"@janus-idp/cli": 3.3.0
"@mui/material": 5.16.14
"@red-hat-developer-hub/backstage-plugin-global-header": 1.0.0
"@red-hat-developer-hub/backstage-plugin-global-header": 1.1.0
typescript: 5.8.2
languageName: unknown
linkType: soft
Expand Down
Loading