diff --git a/.changeset/itchy-carrots-exercise.md b/.changeset/itchy-carrots-exercise.md new file mode 100644 index 00000000000..90c67094ed6 --- /dev/null +++ b/.changeset/itchy-carrots-exercise.md @@ -0,0 +1,5 @@ +--- +"@wso2is/admin.applications.v1": patch +--- + +revert checkbox of hybrid flow config diff --git a/features/admin.applications.v1/components/forms/inbound-oidc-form.tsx b/features/admin.applications.v1/components/forms/inbound-oidc-form.tsx index 554389e232d..4341618e316 100644 --- a/features/admin.applications.v1/components/forms/inbound-oidc-form.tsx +++ b/features/admin.applications.v1/components/forms/inbound-oidc-form.tsx @@ -240,7 +240,6 @@ export const InboundOIDCForm: FunctionComponent = const [ showCallbackURLField, setShowCallbackURLField ] = useState(undefined); const [ hideRefreshTokenGrantType, setHideRefreshTokenGrantType ] = useState(false); const [ selectedGrantTypes, setSelectedGrantTypes ] = useState(undefined); - const [ selectedHybridFlowResponseTypes, setSelectedHybridFlowResponseTypes ] = useState(undefined); const [ isJWTAccessTokenTypeSelected, setJWTAccessTokenTypeSelected ] = useState(false); const [ isGrantChanged, setGrantChanged ] = useState(false); const [ showRegenerateConfirmationModal, setShowRegenerateConfirmationModal ] = useState(false); @@ -686,20 +685,6 @@ export const InboundOIDCForm: FunctionComponent = setAllowedOrigins(initialValues.allowedOrigins.toString()); } - if (initialValues?.hybridFlow?.enable) { - setEnableHybridFlowResponseTypeField(initialValues?.hybridFlow?.enable); - } - - if (initialValues?.hybridFlow?.responseType) { - // Split the string by commas and trim any whitespace (if needed) - const responseTypes: string[] = initialValues.hybridFlow.responseType - .split(",") - .map((type: string) => type.trim()); - - // Update the state with the resulting array - setSelectedHybridFlowResponseTypes(responseTypes); - } - }, [ initialValues ]); @@ -815,18 +800,6 @@ export const InboundOIDCForm: FunctionComponent = setGrantChanged(!isGrantChanged); }; - /** - * Handle hybrid flow response type change. - * - * @param values - Form values. - */ - const handleHybridFlowResponseTypeChange = (values: Map) => { - const hybridFlowResponseTypes: string[] = - values.get(ApplicationManagementConstants.HYBRID_FLOW_RESPONSE_TYPE) as string[]; - - setSelectedHybridFlowResponseTypes(hybridFlowResponseTypes); - }; - const getMetadataHints = (element: string) => { switch (element.toLowerCase()) { case "none": @@ -1422,7 +1395,7 @@ export const InboundOIDCForm: FunctionComponent = ...inboundConfigFormValues, hybridFlow: { enable: values.get("enable-hybrid-flow")?.length > 0, - responseType: selectedHybridFlowResponseTypes?.join(",") ?? null + responseType: values.get(ApplicationManagementConstants.HYBRID_FLOW_RESPONSE_TYPE) } }; } else { @@ -1616,7 +1589,7 @@ export const InboundOIDCForm: FunctionComponent = ...inboundConfigFormValues, hybridFlow: { enable: values.get("enable-hybrid-flow")?.length > 0, - responseType: selectedHybridFlowResponseTypes?.join(",") ?? null + responseType: values.get(ApplicationManagementConstants.HYBRID_FLOW_RESPONSE_TYPE) } }; } else { @@ -2256,7 +2229,7 @@ export const InboundOIDCForm: FunctionComponent = } { showHybridFlowEnableConfig - && enableHybridFlowResponseTypeField + && ( enableHybridFlowResponseTypeField || initialValues?.hybridFlow?.enable ) && ( @@ -2269,14 +2242,13 @@ export const InboundOIDCForm: FunctionComponent = ".hybridFlow.hybridFlowResponseType.label") } name = { ApplicationManagementConstants.HYBRID_FLOW_RESPONSE_TYPE } - type="checkbox" + type="radio" required={ true } children={ getHybridFlowResponseTypes() } readOnly={ readOnly } - value={ selectedHybridFlowResponseTypes ?? ApplicationManagementConstants.CODE_IDTOKEN } + default= { initialValues?.hybridFlow?.responseType? + initialValues.hybridFlow.responseType :ApplicationManagementConstants.CODE_IDTOKEN } enableReinitialize={ true } - listen={ (values: Map) => - handleHybridFlowResponseTypeChange(values) } data-testid={ `${ testId }--hybridflow-responsetype-checkbox` } />