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:
Jenny 2021-12-15 13:37:04 -05:00 committed by GitHub
parent f0a2494d2c
commit 64ee1957c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 8 deletions

View file

@ -92,11 +92,11 @@ export const AddMapperDialog = (props: AddMapperDialogProps) => {
return (
<Modal
aria-labelledby={t("chooseAMapperType")}
aria-labelledby={t("addPredefinedMappers")}
variant={ModalVariant.medium}
header={
<TextContent>
<Text component={TextVariants.h1}>{t("chooseAMapperType")}</Text>
<Text component={TextVariants.h1}>{t("addPredefinedMappers")}</Text>
<Text>{t("predefinedMappingDescription")}</Text>
</TextContent>
}
@ -138,7 +138,7 @@ export const AddMapperDialog = (props: AddMapperDialogProps) => {
props.onConfirm(mapper!);
props.toggleDialog();
}}
aria-label={t("chooseAMapperType")}
aria-label={t("addPredefinedMappers")}
isCompact
>
<DataListItem aria-labelledby="headerName" id="header">
@ -179,12 +179,21 @@ export const AddMapperDialog = (props: AddMapperDialogProps) => {
variant={TableVariant.compact}
cells={header}
onSelect={(_, isSelected, rowIndex) => {
rows[rowIndex].selected = isSelected;
setRows([...rows]);
if (rowIndex === -1) {
setRows(
rows.map((row) => ({
...row,
selected: isSelected,
}))
);
} else {
rows[rowIndex].selected = isSelected;
setRows([...rows]);
}
}}
canSelectAll={false}
canSelectAll
rows={rows}
aria-label={t("chooseAMapperType")}
aria-label={t("addPredefinedMappers")}
>
<TableHeader />
<TableBody />

View file

@ -45,8 +45,9 @@ export default {
guiOrder: "Display Order",
shouldBeANumber: "Should be a number",
chooseAMapperType: "Choose a mapper type",
addPredefinedMappers: "Add predefined mappers",
predefinedMappingDescription:
"Choose one of the predefined mappings from this table",
"Choose any of the predefined mappings from this table",
mappingTable: "Table with predefined mapping",
scope: "Scope",
roleMappingUpdatedSuccess: "Role mapping updated",