Skip to content

Commit a8cb2dd

Browse files
committed
Add secureHandlerToggleVisible to screen properties and update related logic
1 parent 90bfc32 commit a8cb2dd

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

src/bootstrap.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ const cacheEnabled = document.head.querySelector(
5050
const cacheTimeout = document.head.querySelector(
5151
"meta[name='screen-cache-timeout']"
5252
);
53+
const secureHandlerToggleVisibleMeta = document.head.querySelector(
54+
"meta[name='screen-secure-handler-toggle-visible']"
55+
);
5356

5457
// Get the current protocol, hostname, and port
5558
const { protocol, hostname, port } = window.location;
@@ -73,7 +76,10 @@ window.ProcessMaker = {
7376
alert(message, variant) {},
7477
screen: {
7578
cacheEnabled: cacheEnabled ? cacheEnabled.content === "true" : false,
76-
cacheTimeout: cacheTimeout ? Number(cacheTimeout.content) : 0
79+
cacheTimeout: cacheTimeout ? Number(cacheTimeout.content) : 0,
80+
secureHandlerToggleVisible: !!Number(
81+
secureHandlerToggleVisibleMeta?.content
82+
)
7783
}
7884
};
7985
window.Echo = {

src/components/vue-form-builder.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,13 @@ export default {
810810
},
811811
showToolbar() {
812812
return this.screenType === formTypes.form;
813+
},
814+
secureHandlerToggleVisible() {
815+
return _.get(
816+
globalObject,
817+
"ProcessMaker.screen.secureHandlerToggleVisible",
818+
false
819+
);
813820
}
814821
},
815822
watch: {
@@ -1220,6 +1227,13 @@ export default {
12201227
(control) => control.component === this.inspection.component
12211228
) || { inspector: [] };
12221229
return control.inspector.filter((input) => {
1230+
if (
1231+
!this.secureHandlerToggleVisible &&
1232+
typeof input === "object" &&
1233+
input.field === "handlerSecurityEnabled"
1234+
) {
1235+
return false;
1236+
}
12231237
if (accordionFields.includes(input.field)) {
12241238
return true;
12251239
}

src/main.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ const cacheEnabled = document.head.querySelector(
152152
const cacheTimeout = document.head.querySelector(
153153
"meta[name='screen-cache-timeout']"
154154
);
155+
const secureHandlerToggleVisibleMeta = document.head.querySelector(
156+
"meta[name='screen-secure-handler-toggle-visible']"
157+
);
158+
155159
// Get the current protocol, hostname, and port
156160
const { protocol, hostname, port } = window.location;
157161
window.ProcessMaker = {
@@ -302,7 +306,10 @@ window.ProcessMaker = {
302306
},
303307
screen: {
304308
cacheEnabled: cacheEnabled ? cacheEnabled.content === "true" : false,
305-
cacheTimeout: cacheTimeout ? Number(cacheTimeout.content) : 0
309+
cacheTimeout: cacheTimeout ? Number(cacheTimeout.content) : 0,
310+
secureHandlerToggleVisible: !!Number(
311+
secureHandlerToggleVisibleMeta?.content
312+
)
306313
}
307314
};
308315
window.Echo = {

0 commit comments

Comments
 (0)