modal fixes for predefined mappers (#1701)
* modal fixes for predefined mappers * remove log stmt * Update src/client-scopes/add/MapperDialog.tsx Co-authored-by: Jon Koops <jonkoops@gmail.com> Co-authored-by: Jon Koops <jonkoops@gmail.com>
This commit is contained in:
parent
f0a2494d2c
commit
64ee1957c8
2 changed files with 18 additions and 8 deletions
|
@ -92,11 +92,11 @@ export const AddMapperDialog = (props: AddMapperDialogProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
aria-labelledby={t("chooseAMapperType")}
|
aria-labelledby={t("addPredefinedMappers")}
|
||||||
variant={ModalVariant.medium}
|
variant={ModalVariant.medium}
|
||||||
header={
|
header={
|
||||||
<TextContent>
|
<TextContent>
|
||||||
<Text component={TextVariants.h1}>{t("chooseAMapperType")}</Text>
|
<Text component={TextVariants.h1}>{t("addPredefinedMappers")}</Text>
|
||||||
<Text>{t("predefinedMappingDescription")}</Text>
|
<Text>{t("predefinedMappingDescription")}</Text>
|
||||||
</TextContent>
|
</TextContent>
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ export const AddMapperDialog = (props: AddMapperDialogProps) => {
|
||||||
props.onConfirm(mapper!);
|
props.onConfirm(mapper!);
|
||||||
props.toggleDialog();
|
props.toggleDialog();
|
||||||
}}
|
}}
|
||||||
aria-label={t("chooseAMapperType")}
|
aria-label={t("addPredefinedMappers")}
|
||||||
isCompact
|
isCompact
|
||||||
>
|
>
|
||||||
<DataListItem aria-labelledby="headerName" id="header">
|
<DataListItem aria-labelledby="headerName" id="header">
|
||||||
|
@ -179,12 +179,21 @@ export const AddMapperDialog = (props: AddMapperDialogProps) => {
|
||||||
variant={TableVariant.compact}
|
variant={TableVariant.compact}
|
||||||
cells={header}
|
cells={header}
|
||||||
onSelect={(_, isSelected, rowIndex) => {
|
onSelect={(_, isSelected, rowIndex) => {
|
||||||
|
if (rowIndex === -1) {
|
||||||
|
setRows(
|
||||||
|
rows.map((row) => ({
|
||||||
|
...row,
|
||||||
|
selected: isSelected,
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
} else {
|
||||||
rows[rowIndex].selected = isSelected;
|
rows[rowIndex].selected = isSelected;
|
||||||
setRows([...rows]);
|
setRows([...rows]);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
canSelectAll={false}
|
canSelectAll
|
||||||
rows={rows}
|
rows={rows}
|
||||||
aria-label={t("chooseAMapperType")}
|
aria-label={t("addPredefinedMappers")}
|
||||||
>
|
>
|
||||||
<TableHeader />
|
<TableHeader />
|
||||||
<TableBody />
|
<TableBody />
|
||||||
|
|
|
@ -45,8 +45,9 @@ export default {
|
||||||
guiOrder: "Display Order",
|
guiOrder: "Display Order",
|
||||||
shouldBeANumber: "Should be a number",
|
shouldBeANumber: "Should be a number",
|
||||||
chooseAMapperType: "Choose a mapper type",
|
chooseAMapperType: "Choose a mapper type",
|
||||||
|
addPredefinedMappers: "Add predefined mappers",
|
||||||
predefinedMappingDescription:
|
predefinedMappingDescription:
|
||||||
"Choose one of the predefined mappings from this table",
|
"Choose any of the predefined mappings from this table",
|
||||||
mappingTable: "Table with predefined mapping",
|
mappingTable: "Table with predefined mapping",
|
||||||
scope: "Scope",
|
scope: "Scope",
|
||||||
roleMappingUpdatedSuccess: "Role mapping updated",
|
roleMappingUpdatedSuccess: "Role mapping updated",
|
||||||
|
|
Loading…
Reference in a new issue