Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add new probes metadata #1044

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/components/CheckEditor/CheckProbes/CheckProbes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ export function CheckProbes({ probes, availableProbes, onChange, error }: CheckP
<div>
<ProbesFilter probes={availableProbes} onSearch={setFilteredProbes} />
<Stack wrap="wrap">
<Stack wrap="nowrap">
{Object.entries(groupedByRegion).map(([region, allProbes]) => (
<ProbesList
key={region}
title={region}
probes={allProbes}
selectedProbes={probes}
onSelectionChange={onChange}
/>
))}
</Stack>

{privateProbes.length > 0 && (
<ProbesList
title="Private probes"
Expand All @@ -57,16 +69,6 @@ export function CheckProbes({ probes, availableProbes, onChange, error }: CheckP
onSelectionChange={onChange}
/>
)}

{Object.entries(groupedByRegion).map(([region, allProbes]) => (
<ProbesList
key={region}
title={region}
probes={allProbes}
selectedProbes={probes}
onSelectionChange={onChange}
/>
))}
</Stack>
</div>
</Field>
Expand Down
46 changes: 24 additions & 22 deletions src/components/CheckEditor/CheckProbes/ProbesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,29 @@ export const ProbesList = ({
onClick={() => handleToggleProbe(probe)}
checked={selectedProbes.includes(probe.id!)}
/>
<Label htmlFor={`probe-${probe.id}`} className={styles.columnLabel}>
<ProbeStatus probe={probe} />{' '}
{`${probe.name}${probe.countryCode ? `, ${probe.countryCode}` : ''} ${
probe.provider ? `(${probe.provider})` : ''
}`}
{probe.deprecated && (
<DeprecationNotice
tooltipContent={
<div>
This probe is deprecated and will be removed soon. For more information{' '}
<TextLink
variant={'bodySmall'}
href="https://grafana.com/docs/grafana-cloud/whats-new/2025-01-14-launch-and-shutdown-dates-for-synthetics-probes-in-february-2025/"
external
>
click here.
</TextLink>
</div>
}
/>
)}
<Label htmlFor={`probe-${probe.id}`}>
<div className={styles.columnLabel}>
<ProbeStatus probe={probe} />{' '}
{`${probe.name}${probe.countryCode ? `, ${probe.countryCode}` : ''} ${
probe.provider ? `(${probe.provider})` : ''
}`}
{probe.deprecated && (
<DeprecationNotice
tooltipContent={
<div>
This probe is deprecated and will be removed soon. For more information{' '}
<TextLink
variant={'bodySmall'}
href="https://grafana.com/docs/grafana-cloud/whats-new/2025-01-14-launch-and-shutdown-dates-for-synthetics-probes-in-february-2025/"
external
>
click here.
</TextLink>
</div>
}
/>
)}
</div>
</Label>
</div>
))}
Expand Down Expand Up @@ -135,7 +137,7 @@ const getStyles = (theme: GrafanaTheme2) => ({
flexDirection: 'column',
minWidth: '250px',
maxWidth: '350px',
maxHeight: '230px',
maxHeight: '400px',
overflowY: 'auto',
}),

Expand Down
69 changes: 69 additions & 0 deletions src/components/CheckEditor/ProbesMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ const COUNTRY_ZA = { code: 'ZA', long: 'South Africa' };
const COUNTRY_DE = { code: 'DE', long: 'Germany' };
const COUNTRY_UK = { code: 'UK', long: 'United Kingdom' };
const COUNTRY_FR = { code: 'FR', long: 'France' };
const COUNTRY_CH = { code: 'CH', long: 'Switzerland' };
const COUNTRY_SE = { code: 'SE', long: 'Sweden' };
const COUNTRY_AE = { code: 'AE', long: 'United Arab Emirates' };
const COUNTRY_ES = { code: 'ES', long: 'Spain' };
const COUNTRY_ID = { code: 'ID', long: 'Indonesia' };

export const PROBES_METADATA = [
{
Expand Down Expand Up @@ -197,4 +202,68 @@ export const PROBES_METADATA = [
countryCode: COUNTRY_FR.code,
country: COUNTRY_FR.long,
},
{
name: 'Zurich',
region: REGION_EMEA.code,
longRegion: REGION_EMEA.long,
provider: ProbeProvider.AWS,
countryCode: COUNTRY_CH.code,
country: COUNTRY_CH.long,
},
{
name: 'Stockholm',
region: REGION_EMEA.code,
longRegion: REGION_EMEA.long,
provider: ProbeProvider.AWS,
countryCode: COUNTRY_SE.code,
country: COUNTRY_SE.long,
},
{
name: 'Montreal',
region: REGION_AMER.code,
longRegion: REGION_AMER.long,
provider: ProbeProvider.AWS,
countryCode: COUNTRY_CA.code,
country: COUNTRY_CA.long,
},
{
name: 'Calgary',
region: REGION_AMER.code,
longRegion: REGION_AMER.long,
provider: ProbeProvider.AWS,
countryCode: COUNTRY_CA.code,
country: COUNTRY_CA.long,
},
{
name: 'UAE',
region: REGION_EMEA.code,
longRegion: REGION_EMEA.long,
provider: ProbeProvider.AWS,
countryCode: COUNTRY_AE.code,
country: COUNTRY_AE.long,
},
{
name: 'Hyderabad',
region: REGION_APAC.code,
longRegion: REGION_APAC.long,
provider: ProbeProvider.AWS,
countryCode: COUNTRY_IN.code,
country: COUNTRY_IN.long,
},
{
name: 'Spain',
region: REGION_EMEA.code,
longRegion: REGION_EMEA.long,
provider: ProbeProvider.AWS,
countryCode: COUNTRY_ES.code,
country: COUNTRY_ES.long,
},
{
name: 'Jakarta',
region: REGION_APAC.code,
longRegion: REGION_APAC.long,
provider: ProbeProvider.AWS,
countryCode: COUNTRY_ID.code,
country: COUNTRY_ID.long,
},
];
Loading