Skip to content

Commit

Permalink
Fix PR comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpmadhavig committed Aug 26, 2024
1 parent 33b932c commit 025df58
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 61 deletions.
6 changes: 6 additions & 0 deletions features/admin.applications.v1/pages/application-edit.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
border-top-left-radius: 0;
border-top-right-radius: 0;
background: #fffaf3;
padding: 5px;
padding-left: 35px;
}

.application-outdated-alert-expanded-view {
Expand All @@ -39,3 +41,7 @@
.spaced-list li {
margin-bottom: 10px;
}

.banner-wrapper {
margin-bottom: 20px;
}
102 changes: 45 additions & 57 deletions features/admin.applications.v1/pages/application-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
* under the License.
*/

import { Typography } from "@mui/material";
import Alert from "@oxygen-ui/react/Alert";
import AlertTitle from "@oxygen-ui/react/AlertTitle";
import Button from "@oxygen-ui/react/Button";
import Card from "@oxygen-ui/react/Card";
import CardContent from "@oxygen-ui/react/CardContent";
import Divider from "@oxygen-ui/react/Divider";
import Grid from "@oxygen-ui/react/Grid";
import Typography from "@oxygen-ui/react/Typography";
import { useRequiredScopes } from "@wso2is/access-control";
import ApplicationTemplateMetadataProvider from
"@wso2is/admin.application-templates.v1/provider/application-template-metadata-provider";
Expand Down Expand Up @@ -569,59 +569,53 @@ const ApplicationEditPage: FunctionComponent<ApplicationEditPageInterface> = (
* @returns Alert banner.
*/
const resolveAlertBanner = (): ReactElement => {

const classes: any = classNames( { "application-outdated-alert-expanded-view": viewBannerDetails } );

return (
!isBannerDataLoading && displayBanner &&
(
<>
{
<>
<Alert
className={ classes }
severity="warning"
action={
(
<>
<Button
onClick={ () => setViewBannerDetails(!viewBannerDetails) }>
{ t("applications:forms.inboundOIDC.sections"
<div className="banner-wrapper">
<Alert
className={ classes }
severity="warning"
action={
(
<>
<Button
onClick={ () => setViewBannerDetails(!viewBannerDetails) }>
{ t("applications:forms.inboundOIDC.sections"
+ ".legacyApplicationTokens.alert.viewButton") }
</Button>
<Button
className="ignore-once-button"
onClick={ () => setDisplayBanner(false) }>
{ t("applications:forms.inboundOIDC.sections"
</Button>
<Button
className="ignore-once-button"
onClick={ () => setDisplayBanner(false) }>
{ t("applications:forms.inboundOIDC.sections"
+ ".legacyApplicationTokens.alert.cancelButton") }
</Button>
</>
)
}
>
<AlertTitle className="alert-title">
<Trans components={ { strong: <strong/> } } >
{ t("applications:forms.inboundOIDC.sections.legacyApplicationTokens"
</Button>
</>
)
}
>
<AlertTitle className="alert-title">
<Trans components={ { strong: <strong/> } } >
{ t("applications:forms.inboundOIDC.sections.legacyApplicationTokens"
+ ".alert.title") }
</Trans>
</AlertTitle>
<Trans>
{ t("applications:forms.inboundOIDC.sections.legacyApplicationTokens"
</Trans>
</AlertTitle>
<Trans>
{ t("applications:forms.inboundOIDC.sections.legacyApplicationTokens"
+ ".alert.content") }
</Trans>
</Alert>
<Card
className="banner-detail-card"
hidden={ !viewBannerDetails }
>
<CardContent>
{ resolveBannerViewDetails() }
</CardContent>
</Card>
</>
}
<Divider hidden />
</>
</Trans>
</Alert>
<Card
className="banner-detail-card"
hidden={ !viewBannerDetails }
>
<CardContent>
{ resolveBannerViewDetails() }
</CardContent>
</Card>
</div>
)
);
};
Expand All @@ -632,7 +626,6 @@ const ApplicationEditPage: FunctionComponent<ApplicationEditPageInterface> = (
* @returns Alert banner details.
*/
const resolveBannerViewDetails = (): ReactElement => {

return (
<Forms onSubmit={ handleBannerCheckBoxUpdate }>
<Grid>
Expand All @@ -655,9 +648,9 @@ const ApplicationEditPage: FunctionComponent<ApplicationEditPageInterface> = (
i18nKey={
t("applications:forms.inboundOIDC.sections"
+ ".legacyApplicationTokens.fields."
+ "useClientIdAsSubClaimForAppTokens.label")
}>
</Trans>
+ "useClientIdAsSubClaimForAppTokens.instruction")
}
/>
<Field
ref={ useClientIdAsSubClaimForAppTokensElement }
name="useClientIdAsSubClaimForAppTokens"
Expand Down Expand Up @@ -719,11 +712,9 @@ const ApplicationEditPage: FunctionComponent<ApplicationEditPageInterface> = (
i18nKey={
t("applications:forms.inboundOIDC.sections"
+ ".legacyApplicationTokens.fields."
+ "omitUsernameInIntrospectionRespForAppTokens.label")
}>
Application access token, Introspection response will not include
the <code>username</code> attribute.
</Trans>
+ "omitUsernameInIntrospectionRespForAppTokens.instruction")
}
/>
<Field
ref={ omitUsernameInIntrospectionRespForAppTokensElement }
name="omitUsernameInIntrospectionRespForAppTokens"
Expand Down Expand Up @@ -789,7 +780,6 @@ const ApplicationEditPage: FunctionComponent<ApplicationEditPageInterface> = (
* @returns Confirmation modal.
*/
const confirmationModal = () => {

return (
<ConfirmationModal
primaryActionLoading={ bannerUpdateLoading }
Expand Down Expand Up @@ -854,7 +844,6 @@ const ApplicationEditPage: FunctionComponent<ApplicationEditPageInterface> = (
* Handles banner content update action which prepares data.
*/
const handleBannerCheckBoxUpdate = (formDataValues: any) => {

mutateApplicationInboundConfigs().then((response: any) => {

let values: any = response.data;
Expand Down Expand Up @@ -894,7 +883,6 @@ const ApplicationEditPage: FunctionComponent<ApplicationEditPageInterface> = (
* Handles the banner data update action.
*/
const handleBannerCheckBoxUpdateConfirmation = async (): Promise<void> => {

setBannerUpdateLoading(true);

return updateAuthProtocolConfig<OIDCDataInterface>(application?.id, formData, SupportedAuthProtocolTypes.OIDC)
Expand Down
6 changes: 2 additions & 4 deletions modules/i18n/src/translations/en-US/portals/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1660,16 +1660,14 @@ export const applications: ApplicationsNS = {
fields: {
commonInstruction: "Change the customer-end applications accordingly to recieve the below updates.",
useClientIdAsSubClaimForAppTokens: {
instruction: "Application access token <code>sub</code> attribute will be"
+ "<code>client_id</code> generated for an application.",
instruction: "Application access token sub attribute will be client_id generated for an application.",
label: "Set client_id as the sub attribute value for Application tokens",
hint: "For application tokens, the sub attribute was previosuly set to the "
+ "application owner's user_id. However, to support a more industry standard "
+ "solution, this value will be changed to the client ID for application tokens."
},
omitUsernameInIntrospectionRespForAppTokens: {
instruction: "Application access token, Introspection response will not include"
+ "the <code>username</code> attribute.",
instruction: "Introspection response for application access token will not include the username attribute.",
label: "Omit sending username attribute in the Introspection response for Application tokens",
hint: "For access tokens, the previous behavior includes sending the username attribute"
+ " in the introspection response. However, to support a more industry standard"
Expand Down

0 comments on commit 025df58

Please sign in to comment.