Skip to content

Commit

Permalink
Merge pull request #7385 from Thumimku/reverthyb
Browse files Browse the repository at this point in the history
Revert "Add checkbox for hybrid flow"
  • Loading branch information
Thumimku authored Jan 24, 2025
2 parents 27c735f + 021fdf5 commit 69db419
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 34 deletions.
5 changes: 5 additions & 0 deletions .changeset/itchy-carrots-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/admin.applications.v1": patch
---

revert checkbox of hybrid flow config
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ export const InboundOIDCForm: FunctionComponent<InboundOIDCFormPropsInterface> =
const [ showCallbackURLField, setShowCallbackURLField ] = useState<boolean>(undefined);
const [ hideRefreshTokenGrantType, setHideRefreshTokenGrantType ] = useState<boolean>(false);
const [ selectedGrantTypes, setSelectedGrantTypes ] = useState<string[]>(undefined);
const [ selectedHybridFlowResponseTypes, setSelectedHybridFlowResponseTypes ] = useState<string[]>(undefined);
const [ isJWTAccessTokenTypeSelected, setJWTAccessTokenTypeSelected ] = useState<boolean>(false);
const [ isGrantChanged, setGrantChanged ] = useState<boolean>(false);
const [ showRegenerateConfirmationModal, setShowRegenerateConfirmationModal ] = useState<boolean>(false);
Expand Down Expand Up @@ -686,20 +685,6 @@ export const InboundOIDCForm: FunctionComponent<InboundOIDCFormPropsInterface> =
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 ]);


Expand Down Expand Up @@ -815,18 +800,6 @@ export const InboundOIDCForm: FunctionComponent<InboundOIDCFormPropsInterface> =
setGrantChanged(!isGrantChanged);
};

/**
* Handle hybrid flow response type change.
*
* @param values - Form values.
*/
const handleHybridFlowResponseTypeChange = (values: Map<string, FormValue>) => {
const hybridFlowResponseTypes: string[] =
values.get(ApplicationManagementConstants.HYBRID_FLOW_RESPONSE_TYPE) as string[];

setSelectedHybridFlowResponseTypes(hybridFlowResponseTypes);
};

const getMetadataHints = (element: string) => {
switch (element.toLowerCase()) {
case "none":
Expand Down Expand Up @@ -1422,7 +1395,7 @@ export const InboundOIDCForm: FunctionComponent<InboundOIDCFormPropsInterface> =
...inboundConfigFormValues,
hybridFlow: {
enable: values.get("enable-hybrid-flow")?.length > 0,
responseType: selectedHybridFlowResponseTypes?.join(",") ?? null
responseType: values.get(ApplicationManagementConstants.HYBRID_FLOW_RESPONSE_TYPE)
}
};
} else {
Expand Down Expand Up @@ -1616,7 +1589,7 @@ export const InboundOIDCForm: FunctionComponent<InboundOIDCFormPropsInterface> =
...inboundConfigFormValues,
hybridFlow: {
enable: values.get("enable-hybrid-flow")?.length > 0,
responseType: selectedHybridFlowResponseTypes?.join(",") ?? null
responseType: values.get(ApplicationManagementConstants.HYBRID_FLOW_RESPONSE_TYPE)
}
};
} else {
Expand Down Expand Up @@ -2256,7 +2229,7 @@ export const InboundOIDCForm: FunctionComponent<InboundOIDCFormPropsInterface> =
}
{
showHybridFlowEnableConfig
&& enableHybridFlowResponseTypeField
&& ( enableHybridFlowResponseTypeField || initialValues?.hybridFlow?.enable )
&& (
<Grid.Row columns={ 2 }>
<Grid.Column mobile={ 16 } tablet={ 16 } computer={ 16 }>
Expand All @@ -2269,14 +2242,13 @@ export const InboundOIDCForm: FunctionComponent<InboundOIDCFormPropsInterface> =
".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<string, FormValue>) =>
handleHybridFlowResponseTypeChange(values) }
data-testid={ `${ testId }--hybridflow-responsetype-checkbox` }
/>
<Hint>
Expand Down

0 comments on commit 69db419

Please sign in to comment.