From d468c16ca2980f554447cdc4074ff760d9ac8c51 Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Wed, 23 Apr 2025 15:47:51 +0530 Subject: [PATCH] Fixed more issues found while testing role permissions feature. #7310 --- web/pgadmin/static/js/Theme/dark.js | 3 ++- web/pgadmin/static/js/Theme/high_contrast.js | 3 ++- web/pgadmin/static/js/Theme/light.js | 3 ++- .../static/js/components/SchemaDiffButtonComponent.jsx | 9 +++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/web/pgadmin/static/js/Theme/dark.js b/web/pgadmin/static/js/Theme/dark.js index 975ed6e4b..5013403b8 100644 --- a/web/pgadmin/static/js/Theme/dark.js +++ b/web/pgadmin/static/js/Theme/dark.js @@ -60,6 +60,7 @@ export default function(basicSettings) { '400': '#333333', '600': '#282828', '800': '#1e1e1e', + '900': '#8A8A8A', }, text: { primary: '#d4d4d4', @@ -72,7 +73,7 @@ export default function(basicSettings) { }, custom: { checkbox: { - borderColor: '#4a4a4a', + borderColor: '#8A8A8A', disabled: '#6b6b6b' }, icon: { diff --git a/web/pgadmin/static/js/Theme/high_contrast.js b/web/pgadmin/static/js/Theme/high_contrast.js index b5d53855a..aa62e3a6d 100644 --- a/web/pgadmin/static/js/Theme/high_contrast.js +++ b/web/pgadmin/static/js/Theme/high_contrast.js @@ -58,6 +58,7 @@ export default function(basicSettings) { '400': '#2D3A48', '600': '#1F2932', '800': '#010B15', + '900': '#8b9cac' }, text: { primary: '#fff', @@ -70,7 +71,7 @@ export default function(basicSettings) { }, custom: { checkbox: { - borderColor: '#A6B7C8', + borderColor: '#8b9cac', disabled: '#6b6b6b' }, icon: { diff --git a/web/pgadmin/static/js/Theme/light.js b/web/pgadmin/static/js/Theme/light.js index 875793ea8..d99b8231a 100644 --- a/web/pgadmin/static/js/Theme/light.js +++ b/web/pgadmin/static/js/Theme/light.js @@ -58,6 +58,7 @@ export default function(basicSettings) { '400': '#ebeef3', '600': '#bac1cd', '800': '#848ea0', + '900': '#646B82', }, text: { primary: '#222', @@ -70,7 +71,7 @@ export default function(basicSettings) { }, custom: { checkbox: { - borderColor: '#bac1cd', + borderColor: '#646B82', disabled: '#ebeef3' }, icon: { diff --git a/web/pgadmin/tools/schema_diff/static/js/components/SchemaDiffButtonComponent.jsx b/web/pgadmin/tools/schema_diff/static/js/components/SchemaDiffButtonComponent.jsx index 95ddfb820..dd9fc3c25 100644 --- a/web/pgadmin/tools/schema_diff/static/js/components/SchemaDiffButtonComponent.jsx +++ b/web/pgadmin/tools/schema_diff/static/js/components/SchemaDiffButtonComponent.jsx @@ -24,6 +24,8 @@ import { FilterIcon } from '../../../../../static/js/components/ExternalIcon'; import { PgMenu, PgMenuItem, usePgMenuGroup } from '../../../../../static/js/components/Menu'; import { FILTER_NAME, MENUS, MENUS_COMPARE_CONSTANT, SCHEMA_DIFF_EVENT, IGNORE_OPTION } from '../SchemaDiffConstants'; import { SchemaDiffContext, SchemaDiffEventsContext } from './SchemaDiffComponent'; +import withCheckPermission from '../../../../../browser/static/js/withCheckPermission'; +import { AllPermissionTypes } from '../../../../../browser/static/js/constants'; const Root = styled('div')(({theme}) => ({ @@ -152,9 +154,12 @@ export function SchemaDiffButtonComponent({ sourceData, targetData, selectedRowI onServerSchemaChange(); }; - const generateScript = () => { + // Check permission and call. + const generateScript = withCheckPermission({ + permission: AllPermissionTypes.TOOLS_QUERY_TOOL + }, () => { eventBus.fireEvent(SCHEMA_DIFF_EVENT.TRIGGER_GENERATE_SCRIPT, { sid: targetData.sid, did: targetData.did, selectedIds: selectedRowIds, rows: rows, selectedFilters: selectedFilters }); - }; + }); return ( (