Skip to content

Commit 2ca937c

Browse files
committed
Display provider-specific logo for Azure data-planes
1 parent db3b52b commit 2ca937c

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

Diff for: src/components/shared/Entity/DataPlaneIcon.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Avatar, Box, PaletteMode, useTheme } from '@mui/material';
22
import { DataPlaneIconProps } from 'components/shared/Entity/types';
33
import { semiTransparentBackground_oneLayerElevated } from 'context/Theme';
44
import { Lock, QuestionMark } from 'iconoir-react';
5+
import azureLogo from 'images/data-plane-providers/10018-icon-service-Azure-A.svg';
56
import awsLogo from 'images/data-plane-providers/aws.png';
67
import awsLogoWhite from 'images/data-plane-providers/aws_logo-white.png';
78
import gcpLogo from 'images/data-plane-providers/google_cloud.png';
@@ -16,6 +17,10 @@ const getProviderIconPath = (
1617
return colorMode === 'light' ? awsLogo : awsLogoWhite;
1718
}
1819

20+
if (provider === 'az') {
21+
return azureLogo;
22+
}
23+
1924
if (provider === 'gcp') {
2025
return gcpLogo;
2126
}
Loading

Diff for: src/utils/__tests__/dataPlane-utils.test.ts

+20
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ describe('formatDataPlaneName', () => {
3737
whole: 'ops/dp/private/melk/aws-eu-west-1-c2',
3838
})
3939
).toBe('aws: eu-west-1 c2');
40+
41+
expect(
42+
formatDataPlaneName({
43+
cluster: 'c1',
44+
prefix: '',
45+
provider: 'az',
46+
region: 'westus',
47+
whole: 'ops/dp/public/az-westus-c1',
48+
})
49+
).toBe('az: westus c1');
4050
});
4151

4252
test('returns unformatted name when data plane name does not include a provider', () => {
@@ -157,6 +167,16 @@ describe('parseDataPlaneName', () => {
157167
region: 'cluster',
158168
whole: 'ops/dp/private/melk/local-cluster',
159169
});
170+
171+
expect(
172+
parseDataPlaneName('ops/dp/private/melk/az-eastus-c8', 'private')
173+
).toStrictEqual({
174+
cluster: 'c8',
175+
prefix: 'melk/',
176+
provider: 'az',
177+
region: 'eastus',
178+
whole: 'ops/dp/private/melk/az-eastus-c8',
179+
});
160180
});
161181

162182
test('returns a cluster when the truncated data plane name suffix contains at least two hyphens', () => {

0 commit comments

Comments
 (0)