Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
JayaShakthi97 committed Aug 6, 2024
1 parent 9a39d43 commit c975381
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -15,6 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/

import { FormFieldMessage } from "@wso2is/form";

/**
Expand Down Expand Up @@ -53,8 +54,8 @@ export interface UIMetaDataForIDVP {
* Model that represents a dropdown option
*/
export interface DropdownOptionsInterface {
label: string;
value: string
label: string;
value: string
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand All @@ -28,7 +28,6 @@ import React, {
FunctionComponent,
ReactElement,
useEffect,
useMemo,
useState
} from "react";
import { useTranslation } from "react-i18next";
Expand Down Expand Up @@ -95,22 +94,11 @@ const IdentityVerificationProviderEditPage: FunctionComponent<IDVPEditPagePropsI
} = useIDVPTemplateTypeMetadata(idvp?.Type);

const featureConfig: FeatureConfigInterface = useSelector((state: AppState) => 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.
Expand Down Expand Up @@ -254,8 +242,8 @@ const IdentityVerificationProviderEditPage: FunctionComponent<IDVPEditPagePropsI
onDelete={ onIdentityVerificationProviderDelete }
onUpdate={ onIdentityVerificationProviderUpdate }
data-testid={ componentId }
isReadOnly={ isReadOnly }
isDeletePermitted={ isDeletePermitted }
isReadOnly={ !hasIdVPUpdatePermissions }
isDeletePermitted={ hasIdVPDeletePermissions }
isAutomaticTabRedirectionEnabled={ isAutomaticTabRedirectionEnabled }
tabIdentifier={ tabIdentifier }
uiMetaData={ uiMetaData }
Expand Down

0 comments on commit c975381

Please sign in to comment.