diff --git a/.changeset/perfect-rice-flash.md b/.changeset/perfect-rice-flash.md new file mode 100644 index 00000000000..d3b770b1044 --- /dev/null +++ b/.changeset/perfect-rice-flash.md @@ -0,0 +1,9 @@ +--- +"@wso2is/admin.server-configurations.v1": patch +"@wso2is/admin.applications.v1": patch +"@wso2is/admin.extensions.v1": patch +"@wso2is/admin.core.v1": patch +"@wso2is/console": patch +--- + +Fix issues with feature labels for features introduced with new authz runtime diff --git a/features/admin.applications.v1/data/application-templates/templates/m2m-application/m2m-application.json b/features/admin.applications.v1/data/application-templates/templates/m2m-application/m2m-application.json index 8532058000b..263b8837394 100644 --- a/features/admin.applications.v1/data/application-templates/templates/m2m-application/m2m-application.json +++ b/features/admin.applications.v1/data/application-templates/templates/m2m-application/m2m-application.json @@ -4,6 +4,7 @@ "name": "M2M Application", "description": "Applications tailored for Machine to Machine communication", "image": "m2m", + "status": "NEW", "authenticationProtocol": "", "category": "DEFAULT", "displayOrder": -1, diff --git a/features/admin.core.v1/configs/routes.tsx b/features/admin.core.v1/configs/routes.tsx index 5c9a08125ed..9aee51b216e 100644 --- a/features/admin.core.v1/configs/routes.tsx +++ b/features/admin.core.v1/configs/routes.tsx @@ -33,6 +33,7 @@ import { import { APIResourcesConstants } from "@wso2is/admin.api-resources.v1/constants"; import { commonConfig, identityProviderConfig } from "@wso2is/admin.extensions.v1"; import { FeatureGateConstants } from "@wso2is/admin.extensions.v1/components/feature-gate/constants/feature-gate"; +import FeatureStatusLabel from "@wso2is/admin.extensions.v1/components/feature-gate/models/feature-gate"; import { AppLayout, AuthLayout, DefaultLayout, ErrorLayout } from "@wso2is/admin.layouts.v1"; import { ServerConfigurationsConstants } from "@wso2is/admin.server-configurations.v1"; import { AppView, FullScreenView } from "@wso2is/admin.views.v1"; @@ -43,7 +44,7 @@ import merge from "lodash-es/merge"; import values from "lodash-es/values"; import React, { FunctionComponent, lazy } from "react"; import { getSidePanelIcons } from "./ui"; -import { AppConstants } from "../constants"; +import { AppConstants, OrganizationType } from "../constants"; import { store } from "../store"; /** @@ -72,6 +73,7 @@ export const getAppViewRoutes = (): RouteInterface[] => { = store.getState()?.config?.ui?.features?.applicationRoles; const showStatusLabelForNewAuthzRuntimeFeatures: boolean = window["AppUtils"]?.getConfig()?.ui?.showStatusLabelForNewAuthzRuntimeFeatures; + const orgType: OrganizationType = store.getState().organization.organizationType; const defaultRoutes: RouteInterface[] = [ { @@ -275,6 +277,14 @@ export const getAppViewRoutes = (): RouteInterface[] => { ], component: lazy(() => import("@wso2is/admin.users.v1/pages/users")), exact: true, + featureStatus: + showStatusLabelForNewAuthzRuntimeFeatures && orgType === OrganizationType.SUBORGANIZATION + ? "NEW" + : "", + featureStatusLabel: + showStatusLabelForNewAuthzRuntimeFeatures && orgType === OrganizationType.SUBORGANIZATION + ? FeatureStatusLabel.NEW + : null, icon: { icon: getSidePanelIcons().users }, diff --git a/features/admin.extensions.v1/components/feature-gate/models/feature-gate.ts b/features/admin.extensions.v1/components/feature-gate/models/feature-gate.ts index ca7dc4f41d7..4c2b42634d0 100644 --- a/features/admin.extensions.v1/components/feature-gate/models/feature-gate.ts +++ b/features/admin.extensions.v1/components/feature-gate/models/feature-gate.ts @@ -20,7 +20,7 @@ * Enum that lists the currently defined feature status label types and their corresponding i18n keys. */ enum FeatureStatusLabel { - NEW = "comon:new", + NEW = "common:new", BETA = "common:beta", EXPERIMENTAL = "common:experimental", PREMIUM = "common:premium", diff --git a/features/admin.server-configurations.v1/components/governance-connector-grid.scss b/features/admin.server-configurations.v1/components/governance-connector-grid.scss index f34ae9b5d12..ed3c23dadce 100644 --- a/features/admin.server-configurations.v1/components/governance-connector-grid.scss +++ b/features/admin.server-configurations.v1/components/governance-connector-grid.scss @@ -38,7 +38,6 @@ right: 0; height: 24px; min-width: 75px; - background: #3fb81f; display: flex; margin-left: auto; margin-right: -25px; diff --git a/features/admin.server-configurations.v1/components/governance-connector-grid.tsx b/features/admin.server-configurations.v1/components/governance-connector-grid.tsx index 5296da98845..5079039ec10 100644 --- a/features/admin.server-configurations.v1/components/governance-connector-grid.tsx +++ b/features/admin.server-configurations.v1/components/governance-connector-grid.tsx @@ -38,13 +38,13 @@ import { UserGearIcon, UserPlusIcon } from "@oxygen-ui/react-icons"; -import { AppConstants, AppState, history } from "@wso2is/admin.core.v1"; +import { AppConstants, history } from "@wso2is/admin.core.v1"; import { serverConfigurationConfig } from "@wso2is/admin.extensions.v1"; +import FeatureStatusLabel from "@wso2is/admin.extensions.v1/components/feature-gate/models/feature-gate"; import { IdentifiableComponentInterface, LoadableComponentInterface } from "@wso2is/core/models"; import { ContentLoader } from "@wso2is/react-components"; import React, { FunctionComponent, ReactElement, useMemo } from "react"; import { useTranslation } from "react-i18next"; -import { useSelector } from "react-redux"; import "./governance-connector-grid.scss"; import { ServerConfigurationsConstants } from "../constants/server-configurations-constants"; import { GovernanceConnectorCategoryInterface, GovernanceConnectorInterface } from "../models/governance-connectors"; @@ -82,8 +82,6 @@ const GovernanceConnectorCategoriesGrid: FunctionComponent state?.config?.ui?.showStatusLabelForNewAuthzRuntimeFeatures); /** * Combine the connectors and dynamic connectors and group them by category. @@ -211,6 +209,15 @@ const GovernanceConnectorCategoriesGrid: FunctionComponent { + switch (featureStatus) { + case FeatureStatusLabel.BETA: + return "oxygen-chip-beta"; + case FeatureStatusLabel.NEW: + return "oxygen-chip-new"; + } + }; + return (
{ combinedConnectors?.map((category: GovernanceConnectorCategoryInterface, index: number) => { @@ -236,10 +243,17 @@ const GovernanceConnectorCategoriesGrid: FunctionComponent { - showStatusLabelForNewAuthzRuntimeFeatures - && connector.status + connector.status && ( -
{ t(connector.status) }
+
+ { t(connector.status).toUpperCase() } +
) } diff --git a/features/admin.server-configurations.v1/utils/governance-connector-utils.ts b/features/admin.server-configurations.v1/utils/governance-connector-utils.ts index 33efe2252e8..d0e2a8d27a6 100644 --- a/features/admin.server-configurations.v1/utils/governance-connector-utils.ts +++ b/features/admin.server-configurations.v1/utils/governance-connector-utils.ts @@ -176,6 +176,9 @@ export class GovernanceConnectorUtils { } public static getPredefinedConnectorCategories(): Array { + const showStatusLabelForNewAuthzRuntimeFeatures: boolean = + store.getState()?.ui?.showStatusLabelForNewAuthzRuntimeFeatures; + return [ { connectors: [ @@ -197,7 +200,7 @@ export class GovernanceConnectorUtils { id: ServerConfigurationsConstants.ALTERNATIVE_LOGIN_IDENTIFIER, route: AppConstants.getPaths() .get("ALTERNATIVE_LOGIN_IDENTIFIER_EDIT"), - status: "beta", + status: FeatureStatusLabel.BETA, testId: "alternative-login-identifier-card" }, { @@ -376,7 +379,7 @@ export class GovernanceConnectorUtils { header: I18n.instance.t("pages:emailDomainDiscovery.title"), id: ServerConfigurationsConstants.EMAIL_DOMAIN_DISCOVERY, route: AppConstants.getPaths().get("ORGANIZATION_DISCOVERY_DOMAINS"), - status: FeatureStatusLabel.NEW, + status: showStatusLabelForNewAuthzRuntimeFeatures ? FeatureStatusLabel.NEW : null, testId: "email-domain-discovery-card" } ],