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 3 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
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
6 changes: 3 additions & 3 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,8 +31,8 @@ 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..." });
test("Verify that clicking on Self-service button opens the Software Templates page", async () => {
await uiHelper.clickLink({ ariaLabel: "Self-service" });
await uiHelper.verifyHeading("Software Templates");
});

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
2 changes: 1 addition & 1 deletion 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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ 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 () => {
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
4 changes: 2 additions & 2 deletions e2e-tests/playwright/utils/navbar.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export type SidebarTabs =
| "Catalog"
| "Create"
| "Self-service"
| "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/catalog-translations/catalog';

Choose a reason for hiding this comment

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

Please rename the folder
packages/app/src/components/catalog/catalog-translations
to
packages/app/src/components/catalog/translations

This is aligned with https://backstage.io/docs/plugins/internationalization/#for-an-application-developer-overwrite-plugin-messages

Choose a reason for hiding this comment

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

Still open!

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

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
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;
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
Loading