Skip to content

Commit

Permalink
Remove skip logout consent configuration for SAML apps
Browse files Browse the repository at this point in the history
  • Loading branch information
sumedhe committed Jul 30, 2021
1 parent 62debf1 commit 64ab1b5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ export const EditApplication: FunctionComponent<EditApplicationPropsInterface> =
onUpdate={ handleApplicationUpdate }
featureConfig={ featureConfig }
readOnly={ readOnly }
template={ template }
data-testid={ `${ testId }-advanced-settings` }
/>
</ResourceTab.Pane>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import { Field, Form } from "@wso2is/form";
import React, { FunctionComponent, ReactElement } from "react";
import { useTranslation } from "react-i18next";
import { applicationConfig } from "../../../../extensions";
import { AdvancedConfigurationsInterface } from "../../models";
import {AdvancedConfigurationsInterface, ApplicationTemplateListItemInterface} from "../../models";
import SAMLWebApplicationTemplate
from "../../data/application-templates/templates/saml-web-application/saml-web-application.json";

/**
* Advanced Configurations for the Application.
Expand All @@ -33,6 +35,10 @@ interface AdvancedConfigurationsFormPropsInterface extends TestableComponentInte
* Make the form read only.
*/
readOnly?: boolean;
/**
* Application template.
*/
template?: ApplicationTemplateListItemInterface;
}

/**
Expand All @@ -50,6 +56,7 @@ export const AdvancedConfigurationsForm: FunctionComponent<AdvancedConfiguration
config,
onSubmit,
readOnly,
template,
[ "data-testid" ]: testId
} = props;

Expand Down Expand Up @@ -109,20 +116,25 @@ export const AdvancedConfigurationsForm: FunctionComponent<AdvancedConfiguration
data-testid={ `${testId}-skip-login-consent-checkbox` }
hint={ t("console:develop.features.applications.forms.advancedConfig.fields.skipConsentLogin.hint") }
/>
<Field.CheckboxLegacy
ariaLabel="Skip consent logout"
name="skipConsentLogout"
label={ t("console:develop.features.applications.forms.advancedConfig.fields.skipConsentLogout" +
".label"
) }
required={ false }
value={ config?.skipLogoutConsent ? ["skipLogoutConsent"] : [] }
readOnly={ readOnly }
data-testid={ `${testId}-skip-logout-consent-checkbox` }
hint={ t("console:develop.features.applications.forms.advancedConfig.fields.skipConsentLogout" +
".hint"
) }
/>
{
SAMLWebApplicationTemplate?.id !== template?.id &&
(
<Field.CheckboxLegacy
ariaLabel="Skip consent logout"
name="skipConsentLogout"
label={ t("console:develop.features.applications.forms.advancedConfig.fields.skipConsentLogout" +
".label"
) }
required={ false }
value={ config?.skipLogoutConsent ? ["skipLogoutConsent"] : [] }
readOnly={ readOnly }
data-testid={ `${testId}-skip-logout-consent-checkbox` }
hint={ t("console:develop.features.applications.forms.advancedConfig.fields.skipConsentLogout" +
".hint"
) }
/>
)
}
<Field.CheckboxLegacy
ariaLabel="Return authenticated IDP list"
name="returnAuthenticatedIdpList"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { useTranslation } from "react-i18next";
import { useDispatch, useSelector } from "react-redux";
import { AppState, FeatureConfigInterface } from "../../../core";
import { updateApplicationConfigurations } from "../../api";
import { AdvancedConfigurationsInterface } from "../../models";
import {AdvancedConfigurationsInterface, ApplicationTemplateListItemInterface} from "../../models";
import { AdvancedConfigurationsForm } from "../forms";

/**
Expand All @@ -48,6 +48,10 @@ interface AdvancedSettingsPropsInterface extends SBACInterface<FeatureConfigInte
* Make the form read only.
*/
readOnly?: boolean;
/**
* Application template.
*/
template?: ApplicationTemplateListItemInterface;
}

/**
Expand All @@ -67,6 +71,7 @@ export const AdvancedSettings: FunctionComponent<AdvancedSettingsPropsInterface>
featureConfig,
onUpdate,
readOnly,
template,
[ "data-testid" ]: testId
} = props;

Expand Down Expand Up @@ -126,6 +131,7 @@ export const AdvancedSettings: FunctionComponent<AdvancedSettingsPropsInterface>
featureConfig?.applications?.scopes?.update,
allowedScopes)
}
template={ template }
data-testid={ `${ testId }-form` }
/>
</EmphasizedSegment>
Expand Down

0 comments on commit 64ab1b5

Please sign in to comment.