Skip to content

Commit

Permalink
Merge pull request #7758 from DonOmalVindula/fix/29339
Browse files Browse the repository at this point in the history
Add documentation link to account disable connector and fix loading states
  • Loading branch information
DonOmalVindula authored Feb 28, 2025
2 parents 1f32f65 + 94f0ac3 commit 9b605e1
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 25 deletions.
6 changes: 6 additions & 0 deletions .changeset/calm-humans-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@wso2is/admin.server-configurations.v1": patch
"@wso2is/admin.extensions.v1": patch
---

Add documentation link to account disable connector
3 changes: 3 additions & 0 deletions features/admin.extensions.v1/configs/documentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ export const getDocumentationLinksExtension = () : DocumentationLinksExtensionIn
}
},
manage: {
accountDisable: {
learnMore: undefined
},
accountRecovery: {
passwordRecovery: {
learnMore: undefined
Expand Down
11 changes: 11 additions & 0 deletions features/admin.extensions.v1/configs/models/documentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,13 @@ interface MultiTenancyDocumentationLinksInterface {
};
}

/**
* Interface for the account disable section documentation structure.
*/
interface AccountDisableDocumentationLinksInterface {
learnMore: string;
}

/**
* Interface for the console documentation structure.
*/
Expand Down Expand Up @@ -622,6 +629,10 @@ export interface DocumentationLinksExtensionInterface {
* Documentation links for manage section elements.
*/
manage: {
/**
* Documentation links for account disable elements.
*/
accountDisable: AccountDisableDocumentationLinksInterface;
/**
* Documentation links for account recovery elements.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ import { AppConstants } from "@wso2is/admin.core.v1/constants/app-constants";
import { history } from "@wso2is/admin.core.v1/helpers/history";
import { AlertLevels, IdentifiableComponentInterface } from "@wso2is/core/models";
import { addAlert } from "@wso2is/core/store";
import { EmphasizedSegment, Hint, PageLayout } from "@wso2is/react-components";
import {
ContentLoader,
DocumentationLink,
EmphasizedSegment,
Hint,
PageLayout,
useDocumentation
} from "@wso2is/react-components";
import { AxiosError } from "axios";
import React, { FC, FormEvent, ReactElement, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
Expand Down Expand Up @@ -53,6 +60,7 @@ export const AccountDisablePage: FC<AccountDisablePageInterface> = (

const { t } = useTranslation();
const dispatch: Dispatch = useDispatch();
const { getLink } = useDocumentation();

const {
data: accountDisableConnectorData,
Expand Down Expand Up @@ -189,8 +197,17 @@ export const AccountDisablePage: FC<AccountDisablePageInterface> = (
"accountDisableHandler.friendlyName") }
pageTitle={ t("governanceConnectors:connectorCategories.accountManagement.connectors." +
"accountDisableHandler.friendlyName") }
description={ t("governanceConnectors:connectorCategories.accountManagement.connectors." +
"accountDisableHandler.description") }
description={
(<>
{ t("governanceConnectors:connectorCategories.accountManagement.connectors." +
"accountDisableHandler.description") }
<DocumentationLink
link={ getLink("manage.accountDisable.learnMore") }
>
{ t("common:learnMore") }
</DocumentationLink>
</>)
}
data-componentid={ `${ componentId }-page-layout` }
backButton={ {
"data-testid": `${ componentId }-page-back-button`,
Expand All @@ -204,28 +221,36 @@ export const AccountDisablePage: FC<AccountDisablePageInterface> = (
>
<Grid className={ "mt-5" }>
<EmphasizedSegment className="form-wrapper" padded={ "very" }>
<Checkbox
ariaLabel={ t("governanceConnectors:connectorCategories." +
"accountManagement.connectors.accountDisableHandler.properties." +
"accountDisableHandlerEnable.label") }
name="accountDisable"
label={ t("governanceConnectors:connectorCategories." +
"accountManagement.connectors.accountDisableHandler.properties." +
"accountDisableHandlerEnable.label") }
width={ 16 }
data-componentid={
`${componentId}-toggle` }
toggle
onChange={ (event: FormEvent<HTMLInputElement>, data: CheckboxProps) => {
handleCheckboxToggle(data);
} }
checked={ isAccountDisableEnabled }
/>
<Hint>
{ t("governanceConnectors:connectorCategories." +
"accountManagement.connectors.accountDisableHandler.properties." +
"accountDisableHandlerEnable.hint") }
</Hint>
{
accountDisableFetchRequestLoading
? <ContentLoader />
: (
<>
<Checkbox
ariaLabel={ t("governanceConnectors:connectorCategories." +
"accountManagement.connectors.accountDisableHandler.properties." +
"accountDisableHandlerEnable.label") }
name="accountDisable"
label={ t("governanceConnectors:connectorCategories." +
"accountManagement.connectors.accountDisableHandler.properties." +
"accountDisableHandlerEnable.label") }
width={ 16 }
data-componentid={
`${componentId}-toggle` }
toggle
onChange={ (event: FormEvent<HTMLInputElement>, data: CheckboxProps) => {
handleCheckboxToggle(data);
} }
checked={ isAccountDisableEnabled }
/>
<Hint>
{ t("governanceConnectors:connectorCategories." +
"accountManagement.connectors.accountDisableHandler.properties." +
"accountDisableHandlerEnable.hint") }
</Hint>
</>
)
}
</EmphasizedSegment>
</Grid>
</PageLayout>
Expand Down

0 comments on commit 9b605e1

Please sign in to comment.