Skip to content

Commit

Permalink
fix(sql): update function IDs for gw_fct_featurechanges and gw_fct_ge…
Browse files Browse the repository at this point in the history
…twidgets_checkproject to maintain consistency in the database schema
  • Loading branch information
danimarinBG committed Jan 24, 2025
1 parent 53b5b96 commit dafa08b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions updates/40/40000/utils/dml.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ INSERT INTO config_form_fields (formname, formtype, tabname, columnname, layoutn
}'::json, NULL, false, 0);

-- 23/01/2025
-- INSERT INTO sys_function (id, function_name, project_type, function_type, input_params, return_type, descript, sys_role, sample_query, "source") VALUES(3372, 'gw_fct_featurechanges', 'utils', 'function', 'json', 'json', 'Upsert assets in gis', 'role_basic', NULL, 'core');
INSERT INTO sys_function (id, function_name, project_type, function_type, input_params, return_type, descript, sys_role, sample_query, "source") VALUES(3374, 'gw_fct_featurechanges', 'utils', 'function', 'json', 'json', 'Upsert assets in gis', 'role_basic', NULL, 'core');


UPDATE config_form_fields
Expand Down Expand Up @@ -1125,4 +1125,4 @@ UPDATE config_form_fields
SET widgetcontrols='{"saveValue":false, "onContextMenu":"Delete dscenario"}'::json
WHERE formtype='form_feature' AND tabname='tab_epa' AND columnname='remove_from_dscenario';

INSERT INTO sys_function (id, function_name, project_type, function_type, input_params, return_type, descript, sys_role, sample_query, "source") VALUES(3372, 'gw_fct_getwidgets_checkproject', 'utils', 'function', 'json', 'json', 'Set widgets to show in check project button according to user''s role.', 'role_basic', NULL, 'core');
INSERT INTO sys_function (id, function_name, project_type, function_type, input_params, return_type, descript, sys_role, sample_query, "source") VALUES(3376, 'gw_fct_getwidgets_checkproject', 'utils', 'function', 'json', 'json', 'Set widgets to show in check project button according to user''s role.', 'role_basic', NULL, 'core');
2 changes: 1 addition & 1 deletion utils/fct/gw_fct_featurechanges.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The program is free software: you can redistribute it and/or modify it under the
This version of Giswater is provided by Giswater Association
*/

--FUNCTION CODE: 3372
--FUNCTION CODE: 3374

CREATE OR REPLACE FUNCTION SCHEMA_NAME.gw_fct_featurechanges(p_data json)
RETURNS json
Expand Down
22 changes: 11 additions & 11 deletions utils/fct/gw_fct_getwidgets_checkproject.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The program is free software: you can redistribute it and/or modify it under the
This version of Giswater is provided by Giswater Association
*/

-- FUNCTION CODE: 3372
-- FUNCTION CODE: 3376

CREATE OR REPLACE FUNCTION SCHEMA_NAME.gw_fct_getwidgets_checkproject(p_data json)
RETURNS json
Expand All @@ -17,7 +17,7 @@ SELECT SCHEMA_NAME.gw_fct_getrolewidgets($${"client":{"device":4, "infoType":1,
*/

DECLARE
DECLARE
v_version TEXT;
v_role TEXT;
v_widget_verified TEXT;
Expand Down Expand Up @@ -52,23 +52,23 @@ BEGIN
v_widget_epa = '{"widgetname":"epaCheck", "label":"Check EPA data:", "widgettype":"check","datatype":"boolean","layoutname":"grl_option_parameters","layoutorder":"3", "value":""}';
v_widget_plan = '{"widgetname":"planCheck", "label":"Check plan data:", "widgettype":"check","datatype":"boolean","layoutname":"grl_option_parameters","layoutorder":"4", "value":""}';
v_widget_admin = '{"widgetname":"adminCheck", "label":"Check admin data:", "widgettype":"check","datatype":"boolean","layoutname":"grl_option_parameters","layoutorder":"5", "value":""}';

IF v_role in ('role_basic', 'role_edit', 'role_om') THEN

v_return_widgets = concat(v_widget_om);

ELSIF v_role = 'role_epa' THEN

v_return_widgets = concat(v_widget_om, ',', v_widget_epa);

ELSIF v_role = 'role_plan' THEN

v_return_widgets = concat(v_widget_om, ',', v_widget_epa, ',', v_widget_plan);

ELSIF v_role = 'role_admin' THEN

v_return_widgets = concat(v_widget_om, ',', v_widget_epa, ',', v_widget_plan, ',', v_widget_admin);

END IF;

-- Return
Expand Down

0 comments on commit dafa08b

Please sign in to comment.