From 1a142ae8a42fb018e9c746f853e3d5c460dc544d Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 26 Apr 2021 21:36:50 +0200 Subject: [PATCH 1/5] catalog: switch out time-based greeting for plain title Signed-off-by: Patrik Oldsberg --- .changeset/witty-lies-shave.md | 5 +++++ .../src/components/CatalogPage/CatalogLayout.tsx | 13 ++++--------- .../src}/utils/locales/goodAfternoon.locales.json | 0 .../src}/utils/locales/goodEvening.locales.json | 0 .../src}/utils/locales/goodMorning.locales.json | 0 .../CatalogPage => welcome/src}/utils/timeUtil.js | 0 .../src}/utils/timeUtil.test.js | 0 7 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 .changeset/witty-lies-shave.md rename plugins/{catalog/src/components/CatalogPage => welcome/src}/utils/locales/goodAfternoon.locales.json (100%) rename plugins/{catalog/src/components/CatalogPage => welcome/src}/utils/locales/goodEvening.locales.json (100%) rename plugins/{catalog/src/components/CatalogPage => welcome/src}/utils/locales/goodMorning.locales.json (100%) rename plugins/{catalog/src/components/CatalogPage => welcome/src}/utils/timeUtil.js (100%) rename plugins/{catalog/src/components/CatalogPage => welcome/src}/utils/timeUtil.test.js (100%) diff --git a/.changeset/witty-lies-shave.md b/.changeset/witty-lies-shave.md new file mode 100644 index 0000000000..4c0aeef80a --- /dev/null +++ b/.changeset/witty-lies-shave.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +Switch out the time-based personal greeting for a plain title on the catalog index page. diff --git a/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx b/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx index 298aeacfec..c038f3f08c 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx @@ -18,29 +18,24 @@ import { configApiRef, Header, HomepageTimer, - identityApiRef, Page, useApi, } from '@backstage/core'; import React from 'react'; -import { getTimeBasedGreeting } from './utils/timeUtil'; type Props = { children?: React.ReactNode; }; const CatalogLayout = ({ children }: Props) => { - const greeting = getTimeBasedGreeting(); - const profile = useApi(identityApiRef).getProfile(); - const userId = useApi(identityApiRef).getUserId(); - const orgName = useApi(configApiRef).getOptionalString('organization.name'); + const orgName = + useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage'; return (
diff --git a/plugins/catalog/src/components/CatalogPage/utils/locales/goodAfternoon.locales.json b/plugins/welcome/src/utils/locales/goodAfternoon.locales.json similarity index 100% rename from plugins/catalog/src/components/CatalogPage/utils/locales/goodAfternoon.locales.json rename to plugins/welcome/src/utils/locales/goodAfternoon.locales.json diff --git a/plugins/catalog/src/components/CatalogPage/utils/locales/goodEvening.locales.json b/plugins/welcome/src/utils/locales/goodEvening.locales.json similarity index 100% rename from plugins/catalog/src/components/CatalogPage/utils/locales/goodEvening.locales.json rename to plugins/welcome/src/utils/locales/goodEvening.locales.json diff --git a/plugins/catalog/src/components/CatalogPage/utils/locales/goodMorning.locales.json b/plugins/welcome/src/utils/locales/goodMorning.locales.json similarity index 100% rename from plugins/catalog/src/components/CatalogPage/utils/locales/goodMorning.locales.json rename to plugins/welcome/src/utils/locales/goodMorning.locales.json diff --git a/plugins/catalog/src/components/CatalogPage/utils/timeUtil.js b/plugins/welcome/src/utils/timeUtil.js similarity index 100% rename from plugins/catalog/src/components/CatalogPage/utils/timeUtil.js rename to plugins/welcome/src/utils/timeUtil.js diff --git a/plugins/catalog/src/components/CatalogPage/utils/timeUtil.test.js b/plugins/welcome/src/utils/timeUtil.test.js similarity index 100% rename from plugins/catalog/src/components/CatalogPage/utils/timeUtil.test.js rename to plugins/welcome/src/utils/timeUtil.test.js From 8b43d5f8a231ba58be5cbbad0467834c13e23f6d Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 26 Apr 2021 21:45:51 +0200 Subject: [PATCH 2/5] catalog: remove home page clocks Signed-off-by: Patrik Oldsberg --- .changeset/witty-lies-shave.md | 2 +- .../src/components/CatalogPage/CatalogLayout.tsx | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.changeset/witty-lies-shave.md b/.changeset/witty-lies-shave.md index 4c0aeef80a..68fd4b1137 100644 --- a/.changeset/witty-lies-shave.md +++ b/.changeset/witty-lies-shave.md @@ -2,4 +2,4 @@ '@backstage/plugin-catalog': patch --- -Switch out the time-based personal greeting for a plain title on the catalog index page. +Switch out the time-based personal greeting for a plain title on the catalog index page, and remove the clocks for different timezones. diff --git a/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx b/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx index c038f3f08c..e762efdee8 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx @@ -14,13 +14,7 @@ * limitations under the License. */ -import { - configApiRef, - Header, - HomepageTimer, - Page, - useApi, -} from '@backstage/core'; +import { configApiRef, Header, Page, useApi } from '@backstage/core'; import React from 'react'; type Props = { @@ -37,9 +31,7 @@ const CatalogLayout = ({ children }: Props) => { title={`${orgName} Catalog`} subtitle={`Index of software components in ${orgName}`} pageTitleOverride="Home" - > - -
+ /> {children}
); From f2a5ed93b68927475fbb6cb57c129f113e0d9a40 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 27 Apr 2021 12:25:28 +0200 Subject: [PATCH 3/5] catalog: tweak index page subtitle Signed-off-by: Patrik Oldsberg --- plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx b/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx index e762efdee8..a57b223afe 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx @@ -29,7 +29,7 @@ const CatalogLayout = ({ children }: Props) => {
{children} From 4bfff07eaec3b7255bc56c48acd0cf8b2210def9 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 27 Apr 2021 12:27:06 +0200 Subject: [PATCH 4/5] e2e-test: update to search for new catalog index page title Signed-off-by: Patrik Oldsberg --- packages/e2e-test/src/commands/run.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/e2e-test/src/commands/run.ts b/packages/e2e-test/src/commands/run.ts index c055bcd21e..ebf4e6c835 100644 --- a/packages/e2e-test/src/commands/run.ts +++ b/packages/e2e-test/src/commands/run.ts @@ -335,7 +335,7 @@ async function testAppServe(pluginName: string, appDir: string) { try { const browser = new Browser(); - await waitForPageWithText(browser, '/', 'My Company Service Catalog'); + await waitForPageWithText(browser, '/', 'My Company Catalog'); await waitForPageWithText( browser, `/${pluginName}`, From 73f3f5d78d2388576c25b462a181fb3ddf2767c7 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 27 Apr 2021 12:29:53 +0200 Subject: [PATCH 5/5] create-app: update app template to check for new catalog index page title Signed-off-by: Patrik Oldsberg --- .changeset/little-trees-fold.md | 5 +++++ .../default-app/packages/app/cypress/integration/app.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/little-trees-fold.md diff --git a/.changeset/little-trees-fold.md b/.changeset/little-trees-fold.md new file mode 100644 index 0000000000..4963dd5aa1 --- /dev/null +++ b/.changeset/little-trees-fold.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': patch +--- + +Updates the end to end test in the app to match the new catalog index page title. To apply this change to an existing app, update `packages/app/cypress/integration/app.js` to search for `"My Company Catalog"` instead of `"My Company Service Catalog"`. diff --git a/packages/create-app/templates/default-app/packages/app/cypress/integration/app.js b/packages/create-app/templates/default-app/packages/app/cypress/integration/app.js index efcd5b8d93..43fb2e32de 100644 --- a/packages/create-app/templates/default-app/packages/app/cypress/integration/app.js +++ b/packages/create-app/templates/default-app/packages/app/cypress/integration/app.js @@ -1,6 +1,6 @@ describe('App', () => { it('should render the catalog', () => { cy.visit('/'); - cy.contains('My Company Service Catalog'); + cy.contains('My Company Catalog'); }); });