From ee7ea7780163e87747c9bf31e5b57f7741eaa2a1 Mon Sep 17 00:00:00 2001 From: Graeme Christie Date: Thu, 22 Feb 2024 15:29:00 +0800 Subject: [PATCH 1/4] Modified azure table to only show loading UI on initial load Sorted tags in table is thier order from the api is indeterminate, and they would randomly shuffle on each load Signed-off-by: Graeme Christie --- .../AzureSitesOverviewTable.tsx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/plugins/azure-sites/src/components/AzureSitesOverviewTableComponent/AzureSitesOverviewTable.tsx b/plugins/azure-sites/src/components/AzureSitesOverviewTableComponent/AzureSitesOverviewTable.tsx index 2f891ec3d2..751a61a3e1 100644 --- a/plugins/azure-sites/src/components/AzureSitesOverviewTableComponent/AzureSitesOverviewTable.tsx +++ b/plugins/azure-sites/src/components/AzureSitesOverviewTableComponent/AzureSitesOverviewTable.tsx @@ -99,15 +99,17 @@ const Kind = ({ value }: { value: Kinds }) => { }; const Tags = ({ tags }: { tags: any }) => { - return Object.keys(tags).map((key: any) => ( - - )); + return Object.keys(tags) + .toSorted() + .map((key: any) => ( + + )); }; type TableProps = { @@ -291,7 +293,7 @@ export const AzureSitesOverviewTable = ({ data, loading }: TableProps) => { options={{ paging: true, search: false, pageSize: 10 }} data={data} emptyContent={} - isLoading={loading} + isLoading={loading && data.length === 0} columns={columns} /> Date: Thu, 22 Feb 2024 15:31:37 +0800 Subject: [PATCH 2/4] Added Changeset Signed-off-by: Graeme Christie --- .changeset/pretty-olives-travel.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/pretty-olives-travel.md diff --git a/.changeset/pretty-olives-travel.md b/.changeset/pretty-olives-travel.md new file mode 100644 index 0000000000..5b36f66879 --- /dev/null +++ b/.changeset/pretty-olives-travel.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-azure-sites': minor +--- + +Modified azure table to only show loading UI on initial load. Sorted tags in table is their order from the api is indeterminate, and they would randomly shuffle on each load From 80a4886561e3620328c28981e01730ddb11d63e9 Mon Sep 17 00:00:00 2001 From: Graeme Christie Date: Thu, 22 Feb 2024 16:11:44 +0800 Subject: [PATCH 3/4] Replaced toSorted reference with sort as backstage does not have ESNext array functionality enabed in tsconfig Signed-off-by: Graeme Christie --- .../AzureSitesOverviewTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/azure-sites/src/components/AzureSitesOverviewTableComponent/AzureSitesOverviewTable.tsx b/plugins/azure-sites/src/components/AzureSitesOverviewTableComponent/AzureSitesOverviewTable.tsx index 751a61a3e1..c8afb1c6aa 100644 --- a/plugins/azure-sites/src/components/AzureSitesOverviewTableComponent/AzureSitesOverviewTable.tsx +++ b/plugins/azure-sites/src/components/AzureSitesOverviewTableComponent/AzureSitesOverviewTable.tsx @@ -100,7 +100,7 @@ const Kind = ({ value }: { value: Kinds }) => { const Tags = ({ tags }: { tags: any }) => { return Object.keys(tags) - .toSorted() + .sort() .map((key: any) => ( Date: Wed, 28 Feb 2024 12:02:11 +0800 Subject: [PATCH 4/4] Update .changeset/pretty-olives-travel.md Co-authored-by: Philipp Hugenroth Signed-off-by: Graeme Christie --- .changeset/pretty-olives-travel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/pretty-olives-travel.md b/.changeset/pretty-olives-travel.md index 5b36f66879..371f6e8e95 100644 --- a/.changeset/pretty-olives-travel.md +++ b/.changeset/pretty-olives-travel.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-azure-sites': minor +'@backstage/plugin-azure-sites': patch --- Modified azure table to only show loading UI on initial load. Sorted tags in table is their order from the api is indeterminate, and they would randomly shuffle on each load