some migrations have empty name (#34288)

fixes: #33309

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
Erik Jan de Wit 2024-10-29 12:13:48 +01:00 committed by GitHub
parent 65f4ea9c8c
commit b47a8b3f05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,7 +20,7 @@ type DataType = RequiredActionProviderRepresentation &
}; };
type Row = { type Row = {
name: string; name?: string;
enabled: boolean; enabled: boolean;
defaultAction: boolean; defaultAction: boolean;
data: DataType; data: DataType;
@ -173,14 +173,14 @@ export const RequiredActions = () => {
displayKey: "enabled", displayKey: "enabled",
cellRenderer: (row) => ( cellRenderer: (row) => (
<Switch <Switch
id={`enable-${toKey(row.name)}`} id={`enable-${toKey(row.name || "")}`}
label={t("on")} label={t("on")}
labelOff={t("off")} labelOff={t("off")}
isChecked={row.enabled} isChecked={row.enabled}
onChange={() => { onChange={() => {
updateAction(row.data, "enabled"); updateAction(row.data, "enabled");
}} }}
aria-label={toKey(row.name)} aria-label={row.name}
/> />
), ),
width: 20, width: 20,
@ -191,7 +191,7 @@ export const RequiredActions = () => {
thTooltipText: "authDefaultActionTooltip", thTooltipText: "authDefaultActionTooltip",
cellRenderer: (row) => ( cellRenderer: (row) => (
<Switch <Switch
id={`default-${toKey(row.name)}`} id={`default-${toKey(row.name || "")}`}
label={t("on")} label={t("on")}
isDisabled={!row.enabled} isDisabled={!row.enabled}
labelOff={!row.enabled ? t("disabledOff") : t("off")} labelOff={!row.enabled ? t("disabledOff") : t("off")}
@ -199,7 +199,7 @@ export const RequiredActions = () => {
onChange={() => { onChange={() => {
updateAction(row.data, "defaultAction"); updateAction(row.data, "defaultAction");
}} }}
aria-label={toKey(row.name)} aria-label={row.name}
/> />
), ),
width: 20, width: 20,