diff --git a/features/admin.identity-verification-providers.v1/components/identity-verification-provider-edit.tsx b/features/admin.identity-verification-providers.v1/components/identity-verification-provider-edit.tsx index 4bd591f225d..401c4dc0634 100644 --- a/features/admin.identity-verification-providers.v1/components/identity-verification-provider-edit.tsx +++ b/features/admin.identity-verification-providers.v1/components/identity-verification-provider-edit.tsx @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved. + * Copyright (c) 2023-2024, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except diff --git a/features/admin.identity-verification-providers.v1/models/ui-metadata.ts b/features/admin.identity-verification-providers.v1/models/ui-metadata.ts index 84a388d5696..f891339a9cd 100644 --- a/features/admin.identity-verification-providers.v1/models/ui-metadata.ts +++ b/features/admin.identity-verification-providers.v1/models/ui-metadata.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). All Rights Reserved. + * Copyright (c) 2023-2024, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -15,6 +15,7 @@ * specific language governing permissions and limitations * under the License. */ + import { FormFieldMessage } from "@wso2is/form"; /** @@ -53,8 +54,8 @@ export interface UIMetaDataForIDVP { * Model that represents a dropdown option */ export interface DropdownOptionsInterface { - label: string; - value: string + label: string; + value: string } /** diff --git a/features/admin.identity-verification-providers.v1/pages/identity-verification-provider-edit.tsx b/features/admin.identity-verification-providers.v1/pages/identity-verification-provider-edit.tsx index 7c44f5ec82b..2447b6f5a63 100644 --- a/features/admin.identity-verification-providers.v1/pages/identity-verification-provider-edit.tsx +++ b/features/admin.identity-verification-providers.v1/pages/identity-verification-provider-edit.tsx @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). + * Copyright (c) 2023-2024, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -16,8 +16,8 @@ * under the License. */ +import { useRequiredScopes } from "@wso2is/access-control"; import { AppConstants, AppState, FeatureConfigInterface, history } from "@wso2is/admin.core.v1"; -import { hasRequiredScopes } from "@wso2is/core/helpers"; import { IdentifiableComponentInterface } from "@wso2is/core/models"; import { AnimatedAvatar, @@ -28,7 +28,6 @@ import React, { FunctionComponent, ReactElement, useEffect, - useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; @@ -95,22 +94,11 @@ const IdentityVerificationProviderEditPage: FunctionComponent state.config.ui.features); - const allowedScopes: string = useSelector((state: AppState) => state?.auth?.allowedScopes); - const isReadOnly: boolean = useMemo(() => { - return !hasRequiredScopes( - featureConfig?.identityVerificationProviders, - featureConfig?.identityVerificationProviders?.scopes?.update, - allowedScopes - ); - }, [ featureConfig, allowedScopes ]); - const isDeletePermitted: boolean = useMemo(() => { - return hasRequiredScopes( - featureConfig?.identityVerificationProviders, - featureConfig?.identityVerificationProviders?.scopes?.delete, - allowedScopes - ); - }, [ featureConfig, allowedScopes ]); + const hasIdVPUpdatePermissions: boolean = useRequiredScopes( + featureConfig?.identityVerificationProviders?.scopes?.update); + const hasIdVPDeletePermissions: boolean = useRequiredScopes( + featureConfig?.identityVerificationProviders?.scopes?.delete); /** * Checks if the user needs to go to a specific tab index. @@ -254,8 +242,8 @@ const IdentityVerificationProviderEditPage: FunctionComponent