message: Remove capabities step from wizard for SAML
diff: @@ -39,16 +39,17 @@ export default function NewClientForm() {
  implicitFlowEnabled: false,
  directAccessGrantsEnabled: true,
  standardFlowEnabled: true,
  + frontchannelLogout: true,
  });
  const { addAlert, addError } = useAlerts();
  const methods = useForm<ClientRepresentation>({ defaultValues: client });
  + const protocol = methods.watch("protocol");
  const save = async () => {
  try {
  const newClient = await adminClient.clients.create({
  - ...convertFormValuesToObject(client),
  + ...client,
  clientId: client.clientId?.trim(),
  - frontchannelLogout: true,
  });
  addAlert(t("createSuccess"), AlertVariant.success);
  history.push(
  @@ -65,17 +66,23 @@ export default function NewClientForm() {
  ...client,
  ...convertFormValuesToObject(methods.getValues()),
  });
  + if (!isFinalStep()) {
  setShowCapabilityConfig(true);
  + }
  onNext?.();
  }
  };
  + const isFinalStep = () =>
  + showCapabilityConfig || protocol !== "openid-connect";
  +
  const back = () => {
  setClient({ ...client, ...convertFormValuesToObject(methods.getValues()) });
  methods.reset({
  ...client,
  ...convertFormValuesToObject(methods.getValues()),
  });
  + setShowCapabilityConfig(false);
  };
  const onGoToStep = (newStep: { id?: string | number }) => {
  @@ -89,22 +96,17 @@ export default function NewClientForm() {
  const Footer = () => (
  <WizardFooter>
  <WizardContextConsumer>
  - {({ activeStep, onNext, onBack, onClose }) => {
  - return (
  + {({ activeStep, onNext, onBack, onClose }) => (
  <>
  <Button
  variant="primary"
  - data-testid={
  - activeStep.name === t("capabilityConfig") ? "save" : "next"
  - }
  + data-testid={isFinalStep() ? "save" : "next"}
  type="submit"
  onClick={() => {
  forward(onNext);
  }}
  >
  - {activeStep.name === t("capabilityConfig")
  - ? t("common:save")
  - : t("common:next")}
  + {isFinalStep() ? t("common:save") : t("common:next")}
  </Button>
  <Button
  variant="secondary"
  @@ -121,8 +123,7 @@ export default function NewClientForm() {
  {t("common:cancel")}
  </Button>
  </>
  - );
  - }}
  + )}
  </WizardContextConsumer>
  </WizardFooter>
  );
  