Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation link to account disable connector and fix loading states #7758

Merged
merged 2 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading