From 59a879115887bc9f9d79f941572ce6668911c63d Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 9 Dec 2020 15:51:16 -0500 Subject: [PATCH 1/6] Fix comment typos --- .../catalog/src/components/EntityPageLayout/Tabbed/Tabbed.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/catalog/src/components/EntityPageLayout/Tabbed/Tabbed.tsx b/plugins/catalog/src/components/EntityPageLayout/Tabbed/Tabbed.tsx index 096b2fa708..9a4e872d8f 100644 --- a/plugins/catalog/src/components/EntityPageLayout/Tabbed/Tabbed.tsx +++ b/plugins/catalog/src/components/EntityPageLayout/Tabbed/Tabbed.tsx @@ -39,8 +39,8 @@ const getSelectedIndexOrDefault = ( /** * Compound component, which allows you to define layout - * for EntityPage using Tabs as a subnavigation mechanism - * Constists of 2 parts: Tabbed.Layout and Tabbed.Content. + * for EntityPage using Tabs as a sub-navigation mechanism + * Consists of 2 parts: Tabbed.Layout and Tabbed.Content. * Takes care of: tabs, routes, document titles, spacing around content * * @example From 6fde301a993c0342581b98878a4f9129ba59a927 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 9 Dec 2020 15:56:27 -0500 Subject: [PATCH 2/6] FIx unneeded defensive code --- packages/config/src/reader.ts | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/packages/config/src/reader.ts b/packages/config/src/reader.ts index eb8c91e366..cd0a6f3221 100644 --- a/packages/config/src/reader.ts +++ b/packages/config/src/reader.ts @@ -272,23 +272,17 @@ export class ConfigReader implements Config { if (value === undefined) { return this.fallback?.readConfigValue(key, validate); } - if (value !== undefined) { - const result = validate(value); - if (result !== true) { - const { - key: keyName = key, - value: theValue = value, + const result = validate(value); + if (result !== true) { + const { key: keyName = key, value: theValue = value, expected } = result; + throw new TypeError( + errors.type( + this.fullKey(keyName), + this.context, + typeOf(theValue), expected, - } = result; - throw new TypeError( - errors.type( - this.fullKey(keyName), - this.context, - typeOf(theValue), - expected, - ), - ); - } + ), + ); } return value as T; From a6b8d6163d742767ed398286e4fa3d00b7d76a63 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 9 Dec 2020 16:02:52 -0500 Subject: [PATCH 3/6] Fix useless conditional --- plugins/catalog/src/components/Router.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/catalog/src/components/Router.tsx b/plugins/catalog/src/components/Router.tsx index fe1ba3a593..298aa28d52 100644 --- a/plugins/catalog/src/components/Router.tsx +++ b/plugins/catalog/src/components/Router.tsx @@ -50,7 +50,7 @@ const EntityPageSwitch = ({ EntityPage }: { EntityPage: ComponentType }) => { const { entity, loading, error } = useEntity(); // Loading and error states if (loading) return ; - if (error || (!loading && !entity)) return ; + if (error || !entity) return ; // Otherwise EntityPage provided from the App // Note that EntityPage will include EntityPageLayout already From e3bd9fc2f480b2bfc8326c9598d5b6c87638cf6a Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 9 Dec 2020 16:12:43 -0500 Subject: [PATCH 4/6] Add changesets --- .changeset/poor-spies-grin.md | 5 +++++ .changeset/violet-windows-run.md | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/poor-spies-grin.md create mode 100644 .changeset/violet-windows-run.md diff --git a/.changeset/poor-spies-grin.md b/.changeset/poor-spies-grin.md new file mode 100644 index 0000000000..cab5df9029 --- /dev/null +++ b/.changeset/poor-spies-grin.md @@ -0,0 +1,5 @@ +--- +'@backstage/config': patch +--- + +Fix unneeded defensive code diff --git a/.changeset/violet-windows-run.md b/.changeset/violet-windows-run.md new file mode 100644 index 0000000000..5f385d4dfe --- /dev/null +++ b/.changeset/violet-windows-run.md @@ -0,0 +1,5 @@ +--- +'@backstage/config': patch +--- + +Fix useless conditional From a48f2704c91670713e9fe80abea19c54234fdde1 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 9 Dec 2020 16:17:48 -0500 Subject: [PATCH 5/6] Fix string template literal --- .../src/ingestion/processors/microsoftGraph/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/catalog-backend/src/ingestion/processors/microsoftGraph/client.ts b/plugins/catalog-backend/src/ingestion/processors/microsoftGraph/client.ts index 6dded56aa1..9db76542f4 100644 --- a/plugins/catalog-backend/src/ingestion/processors/microsoftGraph/client.ts +++ b/plugins/catalog-backend/src/ingestion/processors/microsoftGraph/client.ts @@ -184,7 +184,7 @@ export class MicrosoftGraphClient { const response = await this.requestApi(`organization/${tenantId}`); if (response.status !== 200) { - await this.handleError('organization/${tenantId}', response); + await this.handleError(`organization/${tenantId}`, response); } return await response.json(); From 38d63fbe1cc04cf8cc7e272865e179e72128cf73 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 9 Dec 2020 16:18:43 -0500 Subject: [PATCH 6/6] Add catalog-backend changeset --- .changeset/seven-tigers-mate.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/seven-tigers-mate.md diff --git a/.changeset/seven-tigers-mate.md b/.changeset/seven-tigers-mate.md new file mode 100644 index 0000000000..c48bcf649a --- /dev/null +++ b/.changeset/seven-tigers-mate.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Fix string template literal