@saltcorn/server 0.9.4-beta.16 → 0.9.4-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/locales/en.json +4 -1
- package/package.json +8 -8
- package/public/tabulator_bootstrap5.min.css +1 -0
- package/routes/actions.js +106 -8
- package/routes/admin.js +1 -0
- package/routes/list.js +1 -1
- package/tests/admin.test.js +10 -10
package/locales/en.json
CHANGED
|
@@ -1376,5 +1376,8 @@
|
|
|
1376
1376
|
"Server logs": "Server logs",
|
|
1377
1377
|
"Timestamp": "Timestamp",
|
|
1378
1378
|
"Message": "Message",
|
|
1379
|
-
"Please enter the two-factor authetication code from your authenticator device": "Please enter the two-factor authetication code from your authenticator device"
|
|
1379
|
+
"Please enter the two-factor authetication code from your authenticator device": "Please enter the two-factor authetication code from your authenticator device",
|
|
1380
|
+
"Only if...": "Only if...",
|
|
1381
|
+
"Allow self signed": "Allow self signed",
|
|
1382
|
+
"Open a connection to TLS server with self-signed or invalid TLS certificate": "Open a connection to TLS server with self-signed or invalid TLS certificate"
|
|
1380
1383
|
}
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saltcorn/server",
|
|
3
|
-
"version": "0.9.4-beta.
|
|
3
|
+
"version": "0.9.4-beta.18",
|
|
4
4
|
"description": "Server app for Saltcorn, open-source no-code platform",
|
|
5
5
|
"homepage": "https://saltcorn.com",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@aws-sdk/client-s3": "^3.451.0",
|
|
10
|
-
"@saltcorn/base-plugin": "0.9.4-beta.
|
|
11
|
-
"@saltcorn/builder": "0.9.4-beta.
|
|
12
|
-
"@saltcorn/data": "0.9.4-beta.
|
|
13
|
-
"@saltcorn/admin-models": "0.9.4-beta.
|
|
14
|
-
"@saltcorn/filemanager": "0.9.4-beta.
|
|
15
|
-
"@saltcorn/markup": "0.9.4-beta.
|
|
16
|
-
"@saltcorn/sbadmin2": "0.9.4-beta.
|
|
10
|
+
"@saltcorn/base-plugin": "0.9.4-beta.18",
|
|
11
|
+
"@saltcorn/builder": "0.9.4-beta.18",
|
|
12
|
+
"@saltcorn/data": "0.9.4-beta.18",
|
|
13
|
+
"@saltcorn/admin-models": "0.9.4-beta.18",
|
|
14
|
+
"@saltcorn/filemanager": "0.9.4-beta.18",
|
|
15
|
+
"@saltcorn/markup": "0.9.4-beta.18",
|
|
16
|
+
"@saltcorn/sbadmin2": "0.9.4-beta.18",
|
|
17
17
|
"@socket.io/cluster-adapter": "^0.2.1",
|
|
18
18
|
"@socket.io/sticky": "^1.0.1",
|
|
19
19
|
"adm-zip": "0.5.10",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.tabulator{position:relative;border:1px solid #dee2e6;font-size:16px;text-align:left;overflow:hidden;-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);-o-transform:translateZ(0);transform:translateZ(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableholder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator.tabulator-block-select{user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:1px solid #dee2e6;background-color:#fff;color:#555;font-weight:700;white-space:nowrap;overflow:hidden;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-header-contents{position:relative;overflow:hidden}.tabulator .tabulator-header .tabulator-header-contents .tabulator-headers{display:inline-block}.tabulator .tabulator-header .tabulator-col{display:inline-flex;position:relative;box-sizing:border-box;flex-direction:column;justify-content:flex-start;border-right:1px solid #aaa;background:#fff;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #dee2e6;background:#e6e6e6;pointer-events:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;position:relative;padding:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder{position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title.tabulator-col-title-wrap{white-space:normal;text-overflow:clip}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{box-sizing:border-box;width:100%;border:1px solid #999;padding:1px;background:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button+.tabulator-title-editor{width:calc(100% - 22px)}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{display:flex;align-items:center;position:absolute;top:0;bottom:0;right:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{position:relative;display:flex;border-top:1px solid #aaa;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{position:relative;box-sizing:border-box;margin-top:2px;width:100%;text-align:center}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto!important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{width:0;height:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}.tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover{cursor:pointer;background-color:#e6e6e6}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter{color:#bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{cursor:pointer;border-bottom:6px solid #555}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter{color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{cursor:pointer;border-bottom:6px solid #555}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-top:none;border-bottom:6px solid #666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter{color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{cursor:pointer;border-top:6px solid #555}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:none;border-top:6px solid #666;color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{writing-mode:vertical-rl;text-orientation:mixed;display:flex;align-items:center;justify-content:center}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-right:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-right:0;padding-bottom:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter{justify-content:center;left:0;right:0;top:4px;bottom:auto}.tabulator .tabulator-header .tabulator-frozen{position:sticky;left:0;z-index:10}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #dee2e6}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #dee2e6}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;min-width:600%;background:#fff!important;border-top:1px solid #dee2e6;border-bottom:1px solid #aaa}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:#fff!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{min-width:600%}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableholder{position:relative;width:100%;white-space:nowrap;overflow:auto;-webkit-overflow-scrolling:touch}.tabulator .tabulator-tableholder:focus{outline:none}.tabulator .tabulator-tableholder .tabulator-placeholder{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%;min-width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents{display:inline-block;text-align:center;padding:10px;color:#ccc;font-weight:700;font-size:20px;white-space:normal}.tabulator .tabulator-tableholder .tabulator-table{position:relative;display:inline-block;background-color:#fff;white-space:nowrap;overflow:visible;color:#333}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs{font-weight:700;background:#dadfe4!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border-bottom:2px solid #dee2e6}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border-top:2px solid #dee2e6}.tabulator .tabulator-footer{border-top:1px solid #dee2e6;background-color:#e6e6e6;color:#555;font-weight:700;white-space:nowrap;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-footer .tabulator-footer-contents{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:5px 10px}.tabulator .tabulator-footer .tabulator-footer-contents:empty{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder{box-sizing:border-box;width:100%;text-align:left;background:#f3f3f3!important;border-bottom:1px solid #dee2e6;border-top:1px solid #dee2e6;overflow:hidden}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{display:inline-block;background:#f3f3f3!important}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{margin-bottom:-5px;border-bottom:none}.tabulator .tabulator-footer>*+.tabulator-page-counter{margin-left:10px}.tabulator .tabulator-footer .tabulator-page-counter{font-weight:400}.tabulator .tabulator-footer .tabulator-paginator{flex:1;text-align:right;color:#555;font-family:inherit;font-weight:inherit;font-size:inherit}.tabulator .tabulator-footer .tabulator-page-size{display:inline-block;margin:0 5px;padding:2px 5px;border:1px solid #dee2e6;border-radius:3px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{display:inline-block;margin:0 2px;padding:2px 5px;border:1px solid #dee2e6;border-radius:3px;background:hsla(0,0%,100%,.2)}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{cursor:pointer;background:rgba(0,0,0,.2);color:#fff}.tabulator .tabulator-col-resize-handle{position:relative;display:inline-block;width:6px;margin-left:-3px;margin-right:-3px;z-index:10;vertical-align:middle}.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}.tabulator .tabulator-col-resize-handle:last-of-type{width:3px;margin-right:0}.tabulator .tabulator-alert{position:absolute;display:flex;align-items:center;top:0;left:0;z-index:100;height:100%;width:100%;background:rgba(0,0,0,.4);text-align:center}.tabulator .tabulator-alert .tabulator-alert-msg{display:inline-block;margin:0 auto;padding:10px 20px;border-radius:10px;background:#fff;font-weight:700;font-size:16px}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg{border:4px solid #333;color:#000}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error{border:4px solid #d00;color:#590000}.tabulator-row{position:relative;box-sizing:border-box;min-height:24px;background-color:#fff}.tabulator-row.tabulator-row-even{background-color:#e9ecef}.tabulator-row.tabulator-selectable:hover{background-color:#ced4da;cursor:pointer}.tabulator-row.tabulator-selected{background-color:#9abcea}.tabulator-row.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}.tabulator-row.tabulator-row-moving{border:1px solid #000;background:#fff}.tabulator-row.tabulator-moving{position:absolute;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6;pointer-events:none;z-index:15}.tabulator-row .tabulator-row-resize-handle{position:absolute;right:0;bottom:0;left:0;height:5px}.tabulator-row .tabulator-row-resize-handle.prev{top:0;bottom:auto}.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}.tabulator-row .tabulator-responsive-collapse{box-sizing:border-box;padding:5px;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:16px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-right:10px}.tabulator-row .tabulator-cell{display:inline-block;position:relative;box-sizing:border-box;padding:4px;border-right:1px solid #dee2e6;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tabulator-row .tabulator-cell.tabulator-frozen{display:inline-block;position:sticky;left:0;background-color:inherit;z-index:10}.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left{border-right:2px solid #dee2e6}.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right{border-left:2px solid #dee2e6}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;outline:none;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{border:1px;background:transparent;outline:none}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #d00}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{border:1px;background:transparent;color:#d00}.tabulator-row .tabulator-cell.tabulator-row-handle{display:inline-flex;align-items:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{width:100%;height:3px;margin-top:2px;background:#666}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #dee2e6;border-bottom:2px solid #dee2e6}.tabulator-row .tabulator-cell .tabulator-data-tree-control{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{display:inline-flex;align-items:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;height:15px;width:15px;border-radius:20px;background:#666;color:#fff;font-weight:700;font-size:1.1em}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{opacity:.7;cursor:pointer}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open{display:none}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle svg{stroke:#fff}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{display:inline-block;height:14px;width:14px;border-radius:14px}.tabulator-row.tabulator-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #dee2e6;border-top:1px solid #999;padding:5px 5px 5px 10px;background:#ccc;font-weight:700;min-width:100%}.tabulator-row.tabulator-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-left:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-left:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-left:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-left:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-left:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-row.tabulator-group span{margin-left:10px;color:#d00}.tabulator-popup-container{position:absolute;display:inline-block;box-sizing:border-box;border:1px solid #dee2e6;box-shadow:0 0 5px 0 rgba(0,0,0,.2);font-size:16px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-popup{padding:5px;border-radius:3px}.tabulator-tooltip{max-width:Min(500px,100%);padding:3px 5px;border-radius:2px;box-shadow:none;font-size:12px;pointer-events:none}.tabulator-menu .tabulator-menu-item{position:relative;box-sizing:border-box;padding:5px 10px;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{cursor:pointer;background:#e9ecef}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu{padding-right:25px}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu:after{display:inline-block;position:absolute;top:calc(5px + .4em);right:10px;height:7px;width:7px;content:"";border-color:#dee2e6;border-style:solid;border-width:1px 1px 0 0;vertical-align:top;transform:rotate(45deg)}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #dee2e6}.tabulator-edit-list{max-height:200px;font-size:16px;overflow-y:auto;-webkit-overflow-scrolling:touch}.tabulator-edit-list .tabulator-edit-list-item{padding:4px;color:#333;outline:none}.tabulator-edit-list .tabulator-edit-list-item.active{background:#1d68cd}.tabulator-edit-list .tabulator-edit-list-item.focused{outline:1px solid #1d68cd}.tabulator-edit-list .tabulator-edit-list-item:hover{cursor:pointer;background:#1d68cd}.tabulator-edit-list .tabulator-edit-list-placeholder{padding:4px;color:#333;text-align:center}.tabulator-edit-list .tabulator-edit-list-group{border-bottom:1px solid #dee2e6;padding:6px 4px 4px;color:#333;font-weight:700}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2{padding-left:12px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3{padding-left:20px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4{padding-left:28px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5{padding-left:36px}.tabulator.tabulator-ltr{direction:ltr}.tabulator.tabulator-rtl{text-align:initial;direction:rtl}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{border-left:1px solid #aaa;border-right:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{margin-right:0;margin-left:-1px}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:0;padding-left:25px}.tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{left:8px;right:auto}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell{border-right:initial;border-left:1px solid #dee2e6}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch{margin-right:0;margin-left:5px;border-bottom-left-radius:0;border-bottom-right-radius:1px;border-left:initial;border-right:2px solid #dee2e6}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control{margin-right:0;margin-left:5px}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left{border-left:2px solid #dee2e6}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right{border-right:2px solid #dee2e6}.tabulator.tabulator-rtl .tabulator-row .tabulator-col-resize-handle:last-of-type{width:3px;margin-left:0;margin-right:-3px}.tabulator.tabulator-rtl .tabulator-footer .tabulator-calcs-holder{text-align:initial}.tabulator-print-fullscreen{position:absolute;top:0;bottom:0;left:0;right:0;z-index:10000}body.tabulator-print-fullscreen-hide>:not(.tabulator-print-fullscreen){display:none!important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #dee2e6;border-bottom:2px solid #dee2e6}.tabulator-print-table .tabulator-print-table-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #dee2e6;border-top:1px solid #999;padding:5px 5px 5px 10px;background:#ccc;font-weight:700;min-width:100%}.tabulator-print-table .tabulator-print-table-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-left:30px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-left:50px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-left:70px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-left:90px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-left:110px!important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-print-table .tabulator-print-table-group span{margin-left:10px;color:#d00}.tabulator-print-table .tabulator-data-tree-control{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-print-table .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator{background-color:#fff;border:none}.tabulator .tabulator-header{border-top:1px solid #dee2e6;border-bottom:2px solid #dee2e6;color:inherit}.tabulator .tabulator-header .tabulator-col{border-right:none;background-color:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:12px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{right:0}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{border-top:1px solid #dee2e6}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input{padding:.375rem .75rem;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;font-size:1rem;line-height:1.5;color:#495057}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input:focus{color:#495057;background-color:#fff;border:1px solid #1d68cd;outline:0}.tabulator .tabulator-header .tabulator-calcs-holder{width:100%;border-bottom:1px solid #dee2e6}.tabulator .tabulator-tableholder .tabulator-placeholder span{color:#000}.tabulator .tabulator-footer,.tabulator .tabulator-footer .tabulator-paginator,.tabulator .tabulator-tableholder .tabulator-table{color:inherit}.tabulator .tabulator-footer .tabulator-pages{margin:0}.tabulator .tabulator-footer .tabulator-page{margin:5px 0 0;padding:8px 12px}.tabulator .tabulator-footer .tabulator-page[data-page=first]{border-top-left-radius:4px;border-bottom-left-radius:4px}.tabulator .tabulator-footer .tabulator-page[data-page=last]{border:1px solid #dee2e6;border-top-right-radius:4px;border-bottom-right-radius:4px}.tabulator .tabulator-footer .tabulator-page.active{border-color:#0d6efd;background-color:#0d6efd;color:#fff}.tabulator .tabulator-footer .tabulator-page:disabled{border-color:#dee2e6;background:#fff;color:#6c757d}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{border-color:#dee2e6;background:#e9ecef;color:#0a58ca}.tabulator.thead-dark .tabulator-header,.tabulator.thead-dark .tabulator-header .tabulator-col{border-color:#dee2e6;background-color:#fff;color:#212529}.tabulator.table{background-color:#fff}.tabulator.table:not(.thead-light) .tabulator-header,.tabulator.table:not(.thead-light) .tabulator-header .tabulator-col{border-color:#dee2e6;background-color:#fff;color:#212529}.tabulator.table .tabulator-tableholder{color:#212529}.tabulator.table .tabulator-row{border-color:#dee2e6;background-color:#fff;color:#212529}.tabulator.table .tabulator-row:hover{background-color:#dee2e6}.tabulator.table .tabulator-row:hover .tabulator-cell{background-color:#ced4da}.tabulator.table .tabulator-row.tabulator-selected{background-color:#9abcea}.tabulator.table .tabulator-footer{border-color:#dee2e6!important}.tabulator.table .tabulator-footer .tabulator-calcs-holder{border-color:#dee2e6!important;background:#fff!important}.tabulator.table .tabulator-footer .tabulator-calcs-holder .tabulator-row{border-color:#dee2e6!important;background-color:#fff!important;color:#212529!important}.tabulator.table-striped:not(.table) .tabulator-row.tabulator-row-even{background-color:#e9ecef}.tabulator.table-striped:not(.table) .tabulator-row.tabulator-row-even.tabulator-selected{background-color:#9abcea}.tabulator.table-striped:not(.table) .tabulator-row.tabulator-row-even.tabulator-selectable:hover{background-color:#ced4da;cursor:pointer}.tabulator.table-striped:not(.table) .tabulator-row.tabulator-row-even.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}.tabulator.table-striped.table .tabulator-row:nth-child(2n) .tabulator-cell{background-color:transparent}.tabulator.table-bordered{border:1px solid #dee2e6}.tabulator.table-bordered .tabulator-header .tabulator-col,.tabulator.table-bordered .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{border-right:1px solid #dee2e6}.tabulator.table-borderless .tabulator-header,.tabulator.table-borderless .tabulator-row{border:none}.tabulator.table-sm .tabulator-header .tabulator-col .tabulator-col-content{padding:5px!important}.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row{min-height:26px}.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{padding:5px!important}.tabulator.table-sm .tabulator-row{padding-top:0;padding-bottom:0}.tabulator.table-sm .tabulator-col-resize-handle{padding:0}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-primary{background:#cfe2ff!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-secondary{background:#e2e3e5!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-success{background:#d1e7dd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-info{background:#cff4fc!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-warning{background:#fff3cd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-danger{background:#f8d7da!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-light{background:#f8f9fa!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table{background:#212529!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-active{background:#6c757d!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-primary{background:#cfe2ff!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-secondary{background:#e2e3e5!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-success{background:#d1e7dd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-info{background:#cff4fc!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-warning{background:#fff3cd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-danger{background:#f8d7da!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-light{background:#f8f9fa!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-dark{background:#212529!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-active{background:#6c757d!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-primary{background:#cfe2ff!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-secondary{background:#e2e3e5!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-success{background:#d1e7dd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-info{background:#cff4fc!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-warning{background:#fff3cd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-danger{background:#f8d7da!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-light{background:#f8f9fa!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table{background:#212529!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-active{background:#6c757d!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-primary{background:#cfe2ff!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-secondary{background:#e2e3e5!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-success{background:#d1e7dd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-info{background:#cff4fc!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-warning{background:#fff3cd!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-danger{background:#f8d7da!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-light{background:#f8f9fa!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-dark{background:#212529!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-active{background:#6c757d!important}.tabulator-row{min-height:40px;border-bottom:1px solid #dee2e6}.tabulator-row .tabulator-cell{padding:12px;border-right:none}.tabulator-row .tabulator-cell:last-of-type{border-right:none}.tabulator-row .tabulator-cell .tabulator-data-tree-control{border:1px solid #ccc}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after,.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand,.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#ccc}.tabulator-row.tabulator-group{background:#fafafa}.tabulator-row.tabulator-group span{color:#666}.tabulator-edit-select-list{background:#fff}.tabulator-edit-select-list .tabulator-edit-select-list-item.active{color:#fff}.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused{outline:1px solid hsla(0,0%,100%,.5)}.tabulator-edit-select-list .tabulator-edit-select-list-item:hover{color:#fff}.tabulator-edit-select-list .tabulator-edit-select-list-group,.tabulator-edit-select-list .tabulator-edit-select-list-notice{color:inherit}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{text-align:initial;border-left:initial}.tabulator-print-table .tabulator-print-table-group{background:#fafafa}.tabulator-print-table .tabulator-print-table-group span{color:#666}.tabulator-print-table .tabulator-data-tree-control{color:inherit}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after,.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand,.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#ccc}.tabulator-popup-container{background:#fff}.tabulator-edit-list .tabulator-edit-list-item.active{color:#fff}.tabulator-edit-list .tabulator-edit-list-item.active.focused{outline:1px solid hsla(0,0%,100%,.5)}.tabulator-edit-list .tabulator-edit-list-item:hover{color:#fff}
|
package/routes/actions.js
CHANGED
|
@@ -14,9 +14,11 @@ const {
|
|
|
14
14
|
const { ppVal } = require("@saltcorn/data/utils");
|
|
15
15
|
const { getState } = require("@saltcorn/data/db/state");
|
|
16
16
|
const Trigger = require("@saltcorn/data/models/trigger");
|
|
17
|
+
const FieldRepeat = require("@saltcorn/data/models/fieldrepeat");
|
|
17
18
|
const { getTriggerList } = require("./common_lists");
|
|
18
19
|
const TagEntry = require("@saltcorn/data/models/tag_entry");
|
|
19
20
|
const Tag = require("@saltcorn/data/models/tag");
|
|
21
|
+
const db = require("@saltcorn/data/db");
|
|
20
22
|
|
|
21
23
|
/**
|
|
22
24
|
* @type {object}
|
|
@@ -167,11 +169,14 @@ const triggerForm = async (req, trigger) => {
|
|
|
167
169
|
.filter(([k, v]) => v.hasChannel)
|
|
168
170
|
.map(([k, v]) => k);
|
|
169
171
|
const allActions = actions.map((t) => t.name);
|
|
172
|
+
allActions.push("Multi-step action");
|
|
170
173
|
const table_triggers = ["Insert", "Update", "Delete", "Validate"];
|
|
171
174
|
const action_options = {};
|
|
172
175
|
const actionsNotRequiringRow = actions
|
|
173
176
|
.filter((a) => !a.requireRow)
|
|
174
177
|
.map((t) => t.name);
|
|
178
|
+
actionsNotRequiringRow.push("Multi-step action");
|
|
179
|
+
|
|
175
180
|
Trigger.when_options.forEach((t) => {
|
|
176
181
|
if (table_triggers.includes(t)) action_options[t] = allActions;
|
|
177
182
|
else action_options[t] = actionsNotRequiringRow;
|
|
@@ -282,6 +287,17 @@ router.get(
|
|
|
282
287
|
send_events_page({
|
|
283
288
|
res,
|
|
284
289
|
req,
|
|
290
|
+
headers: [
|
|
291
|
+
// date flat picker external component
|
|
292
|
+
{
|
|
293
|
+
script: `/static_assets/${db.connectObj.version_tag}/flatpickr.min.js`,
|
|
294
|
+
},
|
|
295
|
+
|
|
296
|
+
// css for date flat picker external component
|
|
297
|
+
{
|
|
298
|
+
css: `/static_assets/${db.connectObj.version_tag}/flatpickr.min.css`,
|
|
299
|
+
},
|
|
300
|
+
],
|
|
285
301
|
active_sub: "Triggers",
|
|
286
302
|
sub2_page: "New",
|
|
287
303
|
contents: {
|
|
@@ -398,6 +414,66 @@ router.post(
|
|
|
398
414
|
})
|
|
399
415
|
);
|
|
400
416
|
|
|
417
|
+
const getMultiStepForm = async (req, id, table) => {
|
|
418
|
+
let stateActions = getState().actions;
|
|
419
|
+
const stateActionKeys = Object.entries(stateActions)
|
|
420
|
+
.filter(([k, v]) => !v.disableInList && (table || !v.requireRow))
|
|
421
|
+
.map(([k, v]) => k);
|
|
422
|
+
const actions = [...stateActionKeys];
|
|
423
|
+
const triggers = Trigger.find({
|
|
424
|
+
when_trigger: { or: ["API call", "Never"] },
|
|
425
|
+
});
|
|
426
|
+
triggers.forEach((tr) => {
|
|
427
|
+
actions.push(tr.name);
|
|
428
|
+
});
|
|
429
|
+
const actionConfigFields = [];
|
|
430
|
+
for (const [name, action] of Object.entries(stateActions)) {
|
|
431
|
+
if (!stateActionKeys.includes(name)) continue;
|
|
432
|
+
const cfgFields = await getActionConfigFields(action, table);
|
|
433
|
+
|
|
434
|
+
for (const field of cfgFields) {
|
|
435
|
+
const cfgFld = {
|
|
436
|
+
...field,
|
|
437
|
+
showIf: {
|
|
438
|
+
step_action_name: name,
|
|
439
|
+
...(field.showIf || {}),
|
|
440
|
+
},
|
|
441
|
+
};
|
|
442
|
+
if (cfgFld.input_type === "code") cfgFld.input_type = "textarea";
|
|
443
|
+
actionConfigFields.push(cfgFld);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
const form = new Form({
|
|
447
|
+
action: addOnDoneRedirect(`/actions/configure/${id}`, req),
|
|
448
|
+
onChange: "saveAndContinue(this)",
|
|
449
|
+
submitLabel: req.__("Done"),
|
|
450
|
+
fields: [
|
|
451
|
+
new FieldRepeat({
|
|
452
|
+
name: "steps",
|
|
453
|
+
fields: [
|
|
454
|
+
{
|
|
455
|
+
name: "step_action_name",
|
|
456
|
+
label: req.__("Action"),
|
|
457
|
+
type: "String",
|
|
458
|
+
required: true,
|
|
459
|
+
attributes: {
|
|
460
|
+
options: actions,
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
name: "step_only_if",
|
|
465
|
+
label: req.__("Only if..."),
|
|
466
|
+
type: "String",
|
|
467
|
+
class: "validate-expression",
|
|
468
|
+
},
|
|
469
|
+
...actionConfigFields,
|
|
470
|
+
],
|
|
471
|
+
}),
|
|
472
|
+
],
|
|
473
|
+
});
|
|
474
|
+
return form;
|
|
475
|
+
};
|
|
476
|
+
|
|
401
477
|
/**
|
|
402
478
|
* Edit Trigger configuration (GET)
|
|
403
479
|
*
|
|
@@ -440,7 +516,24 @@ router.get(
|
|
|
440
516
|
{ href: `/actions/testrun/${id}`, class: "ms-2" },
|
|
441
517
|
req.__("Test run") + " »"
|
|
442
518
|
);
|
|
443
|
-
if (
|
|
519
|
+
if (trigger.action === "Multi-step action") {
|
|
520
|
+
const form = await getMultiStepForm(req, id, table);
|
|
521
|
+
form.values = trigger.configuration;
|
|
522
|
+
send_events_page({
|
|
523
|
+
res,
|
|
524
|
+
req,
|
|
525
|
+
active_sub: "Triggers",
|
|
526
|
+
sub2_page: "Configure",
|
|
527
|
+
page_title: req.__(`%s configuration`, trigger.name),
|
|
528
|
+
contents: {
|
|
529
|
+
type: "card",
|
|
530
|
+
titleAjaxIndicator: true,
|
|
531
|
+
title: req.__("Configure trigger %s", trigger.name),
|
|
532
|
+
subtitle,
|
|
533
|
+
contents: renderForm(form, req.csrfToken()),
|
|
534
|
+
},
|
|
535
|
+
});
|
|
536
|
+
} else if (!action) {
|
|
444
537
|
req.flash("warning", req.__("Action not found"));
|
|
445
538
|
res.redirect(`/actions/`);
|
|
446
539
|
} else if (trigger.action === "blocks") {
|
|
@@ -564,13 +657,18 @@ router.post(
|
|
|
564
657
|
const table = trigger.table_id
|
|
565
658
|
? Table.findOne({ id: trigger.table_id })
|
|
566
659
|
: null;
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
action
|
|
572
|
-
|
|
573
|
-
|
|
660
|
+
let form;
|
|
661
|
+
if (trigger.action === "Multi-step action") {
|
|
662
|
+
form = await getMultiStepForm(req, id, table);
|
|
663
|
+
} else {
|
|
664
|
+
const cfgFields = await getActionConfigFields(action, table, {
|
|
665
|
+
mode: "trigger",
|
|
666
|
+
});
|
|
667
|
+
form = new Form({
|
|
668
|
+
action: `/actions/configure/${id}`,
|
|
669
|
+
fields: cfgFields,
|
|
670
|
+
});
|
|
671
|
+
}
|
|
574
672
|
form.validate(req.body);
|
|
575
673
|
if (form.hasErrors) {
|
|
576
674
|
if (req.xhr) {
|
package/routes/admin.js
CHANGED
package/routes/list.js
CHANGED
|
@@ -288,7 +288,7 @@ router.get(
|
|
|
288
288
|
},
|
|
289
289
|
//css for jsgrid - grid editor external component
|
|
290
290
|
{
|
|
291
|
-
css: `/static_assets/${db.connectObj.version_tag}/
|
|
291
|
+
css: `/static_assets/${db.connectObj.version_tag}/tabulator_bootstrap5.min.css`,
|
|
292
292
|
},
|
|
293
293
|
|
|
294
294
|
// css for date flat picker external component
|
package/tests/admin.test.js
CHANGED
|
@@ -382,13 +382,13 @@ describe("actions", () => {
|
|
|
382
382
|
.send("table_id=2")
|
|
383
383
|
.send("name=mynewaction")
|
|
384
384
|
.send("when_trigger=Insert")
|
|
385
|
-
.expect(toRedirect("/actions/configure/
|
|
385
|
+
.expect(toRedirect("/actions/configure/3"));
|
|
386
386
|
});
|
|
387
387
|
it("show edit", async () => {
|
|
388
388
|
const app = await getApp({ disableCsrf: true });
|
|
389
389
|
const loginCookie = await getAdminLoginCookie();
|
|
390
390
|
await request(app)
|
|
391
|
-
.get("/actions/edit/
|
|
391
|
+
.get("/actions/edit/3")
|
|
392
392
|
.set("Cookie", loginCookie)
|
|
393
393
|
.expect(toInclude("Edit trigger"))
|
|
394
394
|
.expect(toInclude("run_js_code"));
|
|
@@ -397,7 +397,7 @@ describe("actions", () => {
|
|
|
397
397
|
const app = await getApp({ disableCsrf: true });
|
|
398
398
|
const loginCookie = await getAdminLoginCookie();
|
|
399
399
|
await request(app)
|
|
400
|
-
.get("/actions/configure/
|
|
400
|
+
.get("/actions/configure/3")
|
|
401
401
|
.set("Cookie", loginCookie)
|
|
402
402
|
.expect(toInclude("Configure trigger"))
|
|
403
403
|
.expect(toInclude("Code"));
|
|
@@ -406,7 +406,7 @@ describe("actions", () => {
|
|
|
406
406
|
const app = await getApp({ disableCsrf: true });
|
|
407
407
|
const loginCookie = await getAdminLoginCookie();
|
|
408
408
|
await request(app)
|
|
409
|
-
.post("/actions/configure/
|
|
409
|
+
.post("/actions/configure/3")
|
|
410
410
|
.set("Cookie", loginCookie)
|
|
411
411
|
.send("code=console.log(12345678)")
|
|
412
412
|
.expect(toRedirect("/actions/"));
|
|
@@ -415,7 +415,7 @@ describe("actions", () => {
|
|
|
415
415
|
const app = await getApp({ disableCsrf: true });
|
|
416
416
|
const loginCookie = await getAdminLoginCookie();
|
|
417
417
|
await request(app)
|
|
418
|
-
.get("/actions/testrun/
|
|
418
|
+
.get("/actions/testrun/3")
|
|
419
419
|
.set("Cookie", loginCookie)
|
|
420
420
|
.expect(toInclude("12345678"));
|
|
421
421
|
});
|
|
@@ -423,7 +423,7 @@ describe("actions", () => {
|
|
|
423
423
|
const app = await getApp({ disableCsrf: true });
|
|
424
424
|
const loginCookie = await getAdminLoginCookie();
|
|
425
425
|
await request(app)
|
|
426
|
-
.post("/actions/configure/
|
|
426
|
+
.post("/actions/configure/3")
|
|
427
427
|
.set("Cookie", loginCookie)
|
|
428
428
|
.send("code=1")
|
|
429
429
|
.expect(toRedirect("/actions/"));
|
|
@@ -432,7 +432,7 @@ describe("actions", () => {
|
|
|
432
432
|
const app = await getApp({ disableCsrf: true });
|
|
433
433
|
const loginCookie = await getAdminLoginCookie();
|
|
434
434
|
await request(app)
|
|
435
|
-
.get("/actions/testrun/
|
|
435
|
+
.get("/actions/testrun/2")
|
|
436
436
|
.set("Cookie", loginCookie)
|
|
437
437
|
.expect(toRedirect("/actions/"));
|
|
438
438
|
});
|
|
@@ -446,9 +446,9 @@ describe("actions", () => {
|
|
|
446
446
|
.send("action=run_js_code")
|
|
447
447
|
.send("when_trigger=API+call")
|
|
448
448
|
.send("min_role=1")
|
|
449
|
-
.expect(toRedirect("/actions/configure/
|
|
449
|
+
.expect(toRedirect("/actions/configure/4"));
|
|
450
450
|
await request(app)
|
|
451
|
-
.post("/actions/configure/
|
|
451
|
+
.post("/actions/configure/4")
|
|
452
452
|
.set("Cookie", loginCookie)
|
|
453
453
|
.send("code=return 27")
|
|
454
454
|
.expect(toRedirect("/actions/"));
|
|
@@ -463,7 +463,7 @@ describe("actions", () => {
|
|
|
463
463
|
const app = await getApp({ disableCsrf: true });
|
|
464
464
|
const loginCookie = await getAdminLoginCookie();
|
|
465
465
|
await request(app)
|
|
466
|
-
.post("/actions/delete/
|
|
466
|
+
.post("/actions/delete/3")
|
|
467
467
|
.set("Cookie", loginCookie)
|
|
468
468
|
.expect(toRedirect("/actions/"));
|
|
469
469
|
});
|