Provide danger-highlighted combo box items in add/edit view for configured locations that are no longer on the manifest. (#140223)

This commit is contained in:
Justin Kambic 2022-09-14 12:14:17 -04:00 committed by GitHub
parent 40b1a67ae5
commit 0fbe9e9837
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -390,11 +390,14 @@ export const FIELD: Record<string, FieldMeta> = {
options: Object.values(locations).map((location) => ({
label: locations?.find((loc) => location.id === loc.id)?.label,
id: location.id,
key: location.id,
isServiceManaged: location.isServiceManaged,
})),
selectedOptions: Object.values(field?.value as ServiceLocations).map((location) => ({
label: locations?.find((loc) => location.id === loc.id)?.label,
color: locations.some((s) => s.id === location.id) ? 'default' : 'danger',
label: locations?.find((loc) => location.id === loc.id)?.label ?? location.id,
id: location.id,
key: location.id,
isServiceManaged: location.isServiceManaged,
})),
'data-test-subj': 'syntheticsMonitorConfigLocations',