diff --git a/apps/console/src/features/applications/components/wizard/minimal-application-create-wizard.tsx b/apps/console/src/features/applications/components/wizard/minimal-application-create-wizard.tsx index 6399e5694d7..955b84ed324 100644 --- a/apps/console/src/features/applications/components/wizard/minimal-application-create-wizard.tsx +++ b/apps/console/src/features/applications/components/wizard/minimal-application-create-wizard.tsx @@ -15,6 +15,7 @@ * specific language governing permissions and limitations * under the License. */ + import { Show } from "@wso2is/access-control"; import { IdentityAppsApiException } from "@wso2is/core/exceptions"; import { AlertLevels, TestableComponentInterface } from "@wso2is/core/models"; @@ -53,6 +54,7 @@ import { useDispatch, useSelector } from "react-redux"; import { Dispatch } from "redux"; import { Card, Checkbox, CheckboxProps, Dimmer, Divider, Grid } from "semantic-ui-react"; import { OauthProtocolSettingsWizardForm } from "./oauth-protocol-settings-wizard-form"; +import { PassiveStsProtocolSettingsWizardForm } from "./passive-sts-protocol-settings-wizard-form"; import { SAMLProtocolAllSettingsWizardForm } from "./saml-protocol-settings-all-option-wizard-form"; import { applicationConfig } from "../../../../extensions"; import { AccessControlConstants } from "../../../access-control/constants/access-control"; @@ -259,6 +261,11 @@ export const MinimalAppCreateWizard: FunctionComponent { + if (!protocolFormValues) { + return; + } + const application: MainApplicationInterface = cloneDeep({ + ...templateSettings?.application, + ...protocolFormValues, + name: generalFormValues.get("name").toString(), + templateId: ApplicationManagementConstants.CUSTOM_APPLICATION_PASSIVE_STS + }); + + if (customApplicationProtocol === SupportedAuthProtocolTypes.WS_FEDERATION && protocolFormValues) { + createApp(application); + } + + }, [ protocolFormValues ]); + + const createApp = (application: MainApplicationInterface): void => { createApplication(application) .then((response: AxiosResponse) => { eventPublisher.compute(() => { @@ -410,8 +436,8 @@ export const MinimalAppCreateWizard: FunctionComponent { if (error?.response?.status === 403 && - error?.response?.data?.code === - ApplicationManagementConstants.ERROR_CREATE_LIMIT_REACHED.getErrorCode()) { + error?.response?.data?.code === + ApplicationManagementConstants.ERROR_CREATE_LIMIT_REACHED.getErrorCode()) { setOpenLimitReachedModal(true); return; @@ -481,7 +507,7 @@ export const MinimalAppCreateWizard: FunctionComponent { // The created resource's id is sent as a location header. @@ -715,6 +741,16 @@ export const MinimalAppCreateWizard: FunctionComponent ); + } else if (selectedProtocol === SupportedAuthProtocolTypes.WS_FEDERATION) { + return ( + ): void => setProtocolFormValues(values) } + data-testid={ `${ testId }-passive-sts-protocol-settings-form` } + /> + ); } }; @@ -728,7 +764,7 @@ export const MinimalAppCreateWizard: FunctionComponent { - document.getElementById("notification-div").scrollIntoView({ behavior: "smooth" }); + document.getElementById("notification-div")?.scrollIntoView({ behavior: "smooth" }); }; /**