parent
776984188f
commit
67f401b029
5 changed files with 12 additions and 11 deletions
|
@ -145,38 +145,32 @@ describe("Realm settings events tab tests", () => {
|
|||
|
||||
cy.findByTestId("option-aes-generated").click();
|
||||
realmSettingsPage.enterUIDisplayName("test_aes-generated");
|
||||
realmSettingsPage.toggleSwitch("active", false);
|
||||
realmSettingsPage.toggleSwitch("enabled", false);
|
||||
realmSettingsPage.addProvider();
|
||||
|
||||
realmSettingsPage.toggleAddProviderDropdown();
|
||||
|
||||
cy.findByTestId("option-ecdsa-generated").click();
|
||||
realmSettingsPage.enterUIDisplayName("test_ecdsa-generated");
|
||||
realmSettingsPage.toggleSwitch("enabled", false);
|
||||
realmSettingsPage.toggleSwitch("active", false);
|
||||
realmSettingsPage.addProvider();
|
||||
|
||||
realmSettingsPage.toggleAddProviderDropdown();
|
||||
|
||||
cy.findByTestId("option-hmac-generated").click();
|
||||
realmSettingsPage.enterUIDisplayName("test_hmac-generated");
|
||||
realmSettingsPage.toggleSwitch("active", false);
|
||||
realmSettingsPage.toggleSwitch("enabled", false);
|
||||
realmSettingsPage.addProvider();
|
||||
|
||||
realmSettingsPage.toggleAddProviderDropdown();
|
||||
|
||||
cy.findByTestId("option-rsa-generated").click();
|
||||
realmSettingsPage.enterUIDisplayName("test_rsa-generated");
|
||||
realmSettingsPage.toggleSwitch("active", false);
|
||||
realmSettingsPage.toggleSwitch("enabled", false);
|
||||
realmSettingsPage.addProvider();
|
||||
|
||||
realmSettingsPage.toggleAddProviderDropdown();
|
||||
|
||||
cy.findByTestId("option-rsa-enc-generated").click();
|
||||
realmSettingsPage.enterUIDisplayName("test_rsa-enc-generated");
|
||||
realmSettingsPage.toggleSwitch("active", false);
|
||||
realmSettingsPage.toggleSwitch("enabled", false);
|
||||
realmSettingsPage.addProvider();
|
||||
});
|
||||
|
||||
|
|
|
@ -242,7 +242,10 @@ export default function MappingDetails() {
|
|||
/>
|
||||
</FormGroup>
|
||||
<FormProvider {...form}>
|
||||
<DynamicComponents properties={mapping?.properties || []} />
|
||||
<DynamicComponents
|
||||
properties={mapping?.properties || []}
|
||||
isNew={!isUpdating}
|
||||
/>
|
||||
</FormProvider>
|
||||
<ActionGroup>
|
||||
<Button variant="primary" type="submit">
|
||||
|
|
|
@ -11,6 +11,8 @@ export const BooleanComponent = ({
|
|||
label,
|
||||
helpText,
|
||||
isDisabled = false,
|
||||
defaultValue,
|
||||
isNew = true,
|
||||
}: ComponentProps) => {
|
||||
const { t } = useTranslation("dynamic");
|
||||
const { control } = useFormContext();
|
||||
|
@ -27,7 +29,7 @@ export const BooleanComponent = ({
|
|||
<Controller
|
||||
name={convertToName(name!)}
|
||||
data-testid={name}
|
||||
defaultValue={false}
|
||||
defaultValue={isNew ? defaultValue : false}
|
||||
control={control}
|
||||
render={({ field }) => (
|
||||
<Switch
|
||||
|
@ -38,7 +40,7 @@ export const BooleanComponent = ({
|
|||
isChecked={
|
||||
field.value === "true" ||
|
||||
field.value === true ||
|
||||
field.value[0] === "true"
|
||||
field.value?.[0] === "true"
|
||||
}
|
||||
onChange={(value) => field.onChange("" + value)}
|
||||
data-testid={name}
|
||||
|
|
|
@ -6,6 +6,7 @@ import { convertAttributeNameToForm } from "../../util";
|
|||
type DynamicComponentProps = {
|
||||
properties: ConfigPropertyRepresentation[];
|
||||
stringify?: boolean;
|
||||
isNew?: boolean;
|
||||
};
|
||||
|
||||
export const DynamicComponents = ({
|
||||
|
|
|
@ -16,6 +16,7 @@ import { TextComponent } from "./TextComponent";
|
|||
|
||||
export type ComponentProps = Omit<ConfigPropertyRepresentation, "type"> & {
|
||||
isDisabled?: boolean;
|
||||
isNew?: boolean;
|
||||
stringify?: boolean;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue