Skip to content

Commit

Permalink
Merge pull request #6757 from DonOmalVindula/fix/learn-more-links
Browse files Browse the repository at this point in the history
Fix appearing of learn more links in IS
  • Loading branch information
DonOmalVindula authored Aug 12, 2024
2 parents cb9b0f2 + 1669568 commit 568151e
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 20 deletions.
11 changes: 11 additions & 0 deletions .changeset/lemon-forks-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@wso2is/admin.organizations.v1": patch
"@wso2is/admin.org-insights.v1": patch
"@wso2is/admin.extensions.v1": patch
"@wso2is/admin.claims.v1": patch
"@wso2is/admin.groups.v1": patch
"@wso2is/admin.roles.v2": patch
"@wso2is/admin.users.v1": patch
---

Fix appearance of learn more links in the console UI
7 changes: 4 additions & 3 deletions features/admin.claims.v1/pages/claim-dialects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ import {
GridLayout,
PageLayout,
Popup,
PrimaryButton
PrimaryButton,
useDocumentation
} from "@wso2is/react-components";
import React, { FunctionComponent, ReactElement, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
Expand Down Expand Up @@ -66,6 +67,7 @@ const ClaimDialectsPage: FunctionComponent<ClaimDialectsPageInterface> = (
const { [ "data-testid" ]: testId } = props;

const { t } = useTranslation();
const { getLink } = useDocumentation();

const featureConfig: FeatureConfigInterface = useSelector((state: AppState) => state.config.ui.features);

Expand Down Expand Up @@ -241,8 +243,7 @@ const ClaimDialectsPage: FunctionComponent<ClaimDialectsPageInterface> = (
<>
{ t("claims:dialects.pageLayout.list.description") }
<DocumentationLink
link="manage.userStores.attributeMappings.learnMore"
isLinkRef
link={ getLink("manage.userStores.attributeMappings.learnMore") }
>
{ t("extensions:common.learnMore") }
</DocumentationLink>
Expand Down
7 changes: 4 additions & 3 deletions features/admin.extensions.v1/components/logs/pages/logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import {
DocumentationLink,
PageLayout,
ResourceTab,
ResourceTabPaneInterface
ResourceTabPaneInterface,
useDocumentation
} from "@wso2is/react-components";
import React, {
FunctionComponent,
Expand Down Expand Up @@ -60,6 +61,7 @@ const LogsPage: FunctionComponent<LogsPageInterface> = (
const featureConfig: FeatureConfigInterface = useSelector((state: AppState) => state.config.ui.features);

const { t } = useTranslation();
const { getLink } = useDocumentation();

const handleTabChange = (e: SyntheticEvent, data: TabProps): void => {
setActiveTabIndex(data.activeIndex as number);
Expand Down Expand Up @@ -134,8 +136,7 @@ const LogsPage: FunctionComponent<LogsPageInterface> = (
<>
{ t("extensions:develop.monitor.pageHeader.description") }
<DocumentationLink
link="manage.logs.learnMore"
isLinkRef
link={ getLink("manage.logs.learnMore") }
>
{ t("extensions:common.learnMore") }
</DocumentationLink>
Expand Down
7 changes: 4 additions & 3 deletions features/admin.groups.v1/pages/groups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ import {
EmptyPlaceholder,
ListLayout,
PageLayout,
PrimaryButton
PrimaryButton,
useDocumentation
} from "@wso2is/react-components";
import { AxiosResponse } from "axios";
import find from "lodash-es/find";
Expand Down Expand Up @@ -80,6 +81,7 @@ const GROUPS_SORTING_OPTIONS: DropdownItemProps[] = [
const GroupsPage: FunctionComponent<any> = (): ReactElement => {
const dispatch: Dispatch = useDispatch();
const { t } = useTranslation();
const { getLink } = useDocumentation();

const featureConfig: FeatureConfigInterface = useSelector((state: AppState) => state.config.ui.features);

Expand Down Expand Up @@ -316,8 +318,7 @@ const GroupsPage: FunctionComponent<any> = (): ReactElement => {
<>
{ t("pages:groups.subTitle") }
<DocumentationLink
link="manage.groups.learnMore"
isLinkRef
link={ getLink("manage.groups.learnMore") }
>
{ t("extensions:common.learnMore") }
</DocumentationLink>
Expand Down
5 changes: 3 additions & 2 deletions features/admin.org-insights.v1/pages/org-insights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import { SelectChangeEvent } from "@mui/material";
import MenuItem from "@oxygen-ui/react/MenuItem";
import Select from "@oxygen-ui/react/Select";
import { DocumentationLink, Hint, PageLayout } from "@wso2is/react-components";
import { DocumentationLink, Hint, PageLayout, useDocumentation } from "@wso2is/react-components";
import moment from "moment";
import React, { FunctionComponent, useState } from "react";
import { useTranslation } from "react-i18next";
Expand All @@ -42,6 +42,7 @@ const OrgInsightsPage: FunctionComponent = () => {
const [ selectedActivityType, setSelectedActivityType ] = useState<ActivityType>(ActivityType.LOGIN);

const { t } = useTranslation();
const { getLink } = useDocumentation();

const handleDurationChange = (event: SelectChangeEvent) => {
setDuration(Number(event.target.value));
Expand Down Expand Up @@ -75,7 +76,7 @@ const OrgInsightsPage: FunctionComponent = () => {
<>
{ t("insights:description") }
<DocumentationLink
link="manage.insights.learnMore"
link={ getLink("manage.insights.learnMore") }
isLinkRef
>
{ t("extensions:common.learnMore") }
Expand Down
7 changes: 4 additions & 3 deletions features/admin.organizations.v1/pages/organizations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { isFeatureEnabled } from "@wso2is/core/helpers";
import { AlertLevels, IdentifiableComponentInterface } from "@wso2is/core/models";
import { addAlert } from "@wso2is/core/store";
import { I18n } from "@wso2is/i18n";
import { DocumentationLink, ListLayout, PageLayout, PrimaryButton } from "@wso2is/react-components";
import { DocumentationLink, ListLayout, PageLayout, PrimaryButton, useDocumentation } from "@wso2is/react-components";
import { AxiosError } from "axios";
import find from "lodash-es/find";
import isEmpty from "lodash-es/isEmpty";
Expand Down Expand Up @@ -94,6 +94,8 @@ const OrganizationsPage: FunctionComponent<OrganizationsPageInterface> = (

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

const hasOrganizationListViewPermissions: boolean = useRequiredScopes(
featureConfig?.organizations?.scopes?.read
);
Expand Down Expand Up @@ -523,8 +525,7 @@ const OrganizationsPage: FunctionComponent<OrganizationsPageInterface> = (
<>
{ t("pages:organizations.subTitle") }
<DocumentationLink
link="manage.organizations.learnMore"
isLinkRef
link={ getLink("manage.organizations.learnMore") }
>
{ t("extensions:common.learnMore") }
</DocumentationLink>
Expand Down
6 changes: 3 additions & 3 deletions features/admin.roles.v2/pages/role.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { history } from "@wso2is/admin.core.v1/helpers";
import { useGetCurrentOrganizationType } from "@wso2is/admin.organizations.v1/hooks/use-get-organization-type";
import { AlertInterface, AlertLevels, IdentifiableComponentInterface, RolesInterface } from "@wso2is/core/models";
import { addAlert } from "@wso2is/core/store";
import { DocumentationLink, ListLayout, PageLayout, PrimaryButton } from "@wso2is/react-components";
import { DocumentationLink, ListLayout, PageLayout, PrimaryButton, useDocumentation } from "@wso2is/react-components";
import { AxiosError } from "axios";
import React, { FunctionComponent, ReactElement, useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
Expand Down Expand Up @@ -59,6 +59,7 @@ const RolesPage: FunctionComponent<RolesPagePropsInterface> = (

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

const { organizationType } = useGetCurrentOrganizationType();
const featureConfig : FeatureConfigInterface = useSelector((state: AppState) => state.config.ui.features);
Expand Down Expand Up @@ -243,8 +244,7 @@ const RolesPage: FunctionComponent<RolesPagePropsInterface> = (
<>
{ t("pages:roles.subTitle") }
<DocumentationLink
link="develop.applications.roles.learnMore"
isLinkRef
link={ getLink("develop.applications.roles.learnMore") }
>
{ t("extensions:common.learnMore") }
</DocumentationLink>
Expand Down
7 changes: 4 additions & 3 deletions features/admin.users.v1/pages/users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ import {
PageLayout,
PrimaryButton,
ResourceTab,
ResourceTabPaneInterface
ResourceTabPaneInterface,
useDocumentation
} from "@wso2is/react-components";
import { AxiosError } from "axios";
import cloneDeep from "lodash-es/cloneDeep";
Expand Down Expand Up @@ -127,6 +128,7 @@ const UsersPage: FunctionComponent<UsersPageInterface> = (
} = props;

const { t } = useTranslation();
const { getLink } = useDocumentation();

const dispatch: Dispatch<any> = useDispatch();

Expand Down Expand Up @@ -1000,8 +1002,7 @@ const UsersPage: FunctionComponent<UsersPageInterface> = (
<>
{ t("extensions:manage.users.usersSubTitle") }
<DocumentationLink
link="manage.users.learnMore"
isLinkRef
link={ getLink("manage.users.learnMore") }
>
{ t("extensions:common.learnMore") }
</DocumentationLink>
Expand Down

0 comments on commit 568151e

Please sign in to comment.