Merge pull request #23170 from graemechristie/fix-azure-refresh-jank

Fix azure refresh jank
This commit is contained in:
Fredrik Adelöw
2024-03-12 13:50:18 +01:00
committed by GitHub
2 changed files with 17 additions and 10 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@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
@@ -99,15 +99,17 @@ const Kind = ({ value }: { value: Kinds }) => {
};
const Tags = ({ tags }: { tags: any }) => {
return Object.keys(tags).map((key: any) => (
<Chip
key={key}
label={`${key}: ${tags[key]}`}
size="small"
variant="default"
style={{ marginBottom: '1px' }}
/>
));
return Object.keys(tags)
.sort()
.map((key: any) => (
<Chip
key={key}
label={`${key}: ${tags[key]}`}
size="small"
variant="default"
style={{ marginBottom: '1px' }}
/>
));
};
type TableProps = {
@@ -291,7 +293,7 @@ export const AzureSitesOverviewTable = ({ data, loading }: TableProps) => {
options={{ paging: true, search: false, pageSize: 10 }}
data={data}
emptyContent={<LinearProgress />}
isLoading={loading}
isLoading={loading && data.length === 0}
columns={columns}
/>
<Snackbar