cpee-worklist 1.0.9 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5107cbb0d04bd9f6c9e594848eb1c31753764f94bbe4ca3b98d1be239061a138
4
- data.tar.gz: 060e527f606c626231b42ee5e5f43c8c06e6b5f9dcad787b27a52d662b9cf2a7
3
+ metadata.gz: 803b1b014fedfd15a18792b7d8bd8ae44b8ca3f0f9c9e73ee3bce147c079fe66
4
+ data.tar.gz: 0a5faa9d0a7a044a450b17dcf2d30b98774800b5e3cf5d5c1e4e8dc535512d9f
5
5
  SHA512:
6
- metadata.gz: 3b64c541cc55f92c99c700462387236d1a7bb29b1b0b71cc82397bdd08626b1908ab8dfa354ef1beba3a806759f29b039e1f535321ced4041635c3f9bb45f99e
7
- data.tar.gz: acbaf61bdd25be56ff03fdd804b97a99de4c8dc1ef4a516dd73b0f3d1fc2d64fb9ee5ae4d327ac1f0fc6728c89c1b18184017c9ef31f2b0648e837d5b1f950ea
6
+ metadata.gz: 5cd26a575083104789de654796f57ef5f403e7ee03fc4c0f79b16c0f0ee7225ef904c992eb71760e571c2d536e29bbcec46336baae02375c2e1ff4adf315212f
7
+ data.tar.gz: 60353fd3d43a1419b4633c26dd17aa5da78b350e907a684f3a64618df3055d177ae32cc0a63fc97a6fe8b20db67ac251a04df345e6248d5be82d4642907ca28c
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-worklist"
3
- s.version = "1.0.9"
3
+ s.version = "1.0.11"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0-or-later"
6
6
  s.summary = "Worklist for the cloud process execution engine (cpee.org)"
data/ui/container.html ADDED
@@ -0,0 +1,40 @@
1
+ <!--
2
+ This file is part of CPEE.
3
+
4
+ CPEE is free software: you can redistribute it and/or modify it under the terms
5
+ of the GNU General Public License as published by the Free Software Foundation,
6
+ either version 3 of the License, or (at your option) any later version.
7
+
8
+ CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
9
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10
+ PARTICULAR PURPOSE. See the GNU General Public License for more details.
11
+
12
+ You should have received a copy of the GNU General Public License along with
13
+ CPEE (file COPYING in the main directory). If not, see
14
+ <http://www.gnu.org/licenses/>.
15
+ -->
16
+
17
+ <!DOCTYPE html>
18
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
19
+ <head>
20
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
21
+ <title>Container</title>
22
+
23
+ <!-- libs, do not modify. When local than load local libs. -->
24
+ <script type="text/javascript" src="/js_libs/jquery.min.js"></script>
25
+ <script type="text/javascript" src="/js_libs/jquery.browser.js"></script>
26
+ <script type="text/javascript" src="/js_libs/jquery.svg.min.js"></script>
27
+ <script type="text/javascript" src="/js_libs/jquery.svgdom.min.js"></script>
28
+ <script type="text/javascript" src="/js_libs/vkbeautify.js"></script>
29
+ <script type="text/javascript" src="/js_libs/util.js"></script>
30
+ <script type="text/javascript" src="/js_libs/printf.js"></script>
31
+ <script type="text/javascript" src="/js_libs/strftime.min.js"></script>
32
+ <script type="text/javascript" src="/js_libs/parsequery.js"></script>
33
+ <script type="text/javascript" src="/js_libs/underscore.min.js"></script>
34
+ <script type="text/javascript" src="/js_libs/jquery.caret.min.js"></script>
35
+ <script type="text/javascript" src="/js_libs/jquery.cookie.js"></script>
36
+ <script type="text/javascript" src="/js_libs/marked.min.js"></script>
37
+ </head>
38
+ <body>
39
+ </body>
40
+ </html>
data/ui/css/ui.css CHANGED
@@ -136,8 +136,14 @@ ui-area > form {
136
136
  padding-left: 1em;
137
137
  }
138
138
 
139
- div.task {
140
- padding: 1em;
139
+ .areataskitem iframe {
140
+ width: 100%;
141
+ border:0 none;
142
+ height: 100%;
143
+ margin: 0;
144
+ padding: 0;
145
+ box-sizing: border-box;
146
+ display: block;
141
147
  }
142
148
 
143
149
  #dat_tasks tr.priority_1:nth-child(even) { background-color: #dc8add30; color: ButtonText; }
@@ -164,3 +170,5 @@ div.task {
164
170
  75% { background-color: red; }
165
171
  100% { background-color: #ebdef0; }
166
172
  }
173
+
174
+
data/ui/js/worklist.js CHANGED
@@ -159,19 +159,27 @@ function do_work(taskid,taskidurl) { //{{{
159
159
  url: res.form,
160
160
  dataType: 'text',
161
161
  success: async (iform) => {
162
- let end = false;
162
+ let end = false;;
163
163
  let evaltext = '';
164
+ let rel = res.form.match(/.*\//)[0];
165
+
164
166
  while (!end) {
165
167
  let matches = iform.match(/<worklist-form-load>(.*?)<\/worklist-form-load>/ms);
166
168
  if (matches && matches.length > 0) {
167
169
  evaltext += matches[1];
168
170
  iform = iform.replace(matches[0],'');
169
171
  } else {
170
- let includes = iform.match(/<\/?worklist-include\s+href=(("([^"]*)")|('([^']*)'))\s*\/?\s*>/ms);
172
+ let includes = iform.match(/<\/?worklist-(relative-)?include\s+href=(("([^"]*)")|('([^']*)'))\s*\/?\s*>/ms);
171
173
  if (includes && includes.length > 0) {
174
+ let inc;
175
+ if (includes[1]) {
176
+ inc = rel + includes[4];
177
+ } else {
178
+ inc = includes[4];
179
+ }
172
180
  await $.ajax({
173
181
  type: "GET",
174
- url: includes[3],
182
+ url: inc,
175
183
  dataType: 'text',
176
184
  success: function(inctext) {
177
185
  iform = iform.replace(includes[0],inctext);
@@ -182,105 +190,101 @@ function do_work(taskid,taskidurl) { //{{{
182
190
  }
183
191
  }
184
192
  }
185
- {
186
- let replaces = iform.match(/form="worklist-form"/ms);
187
- if (replaces && replaces.length > 0) {
188
- iform = iform.replaceAll(replaces[0],'form="form_' + taskid + '"');
189
- }
190
- }
191
- {
192
- let replaces = iform.match(/div.task.current/ms);
193
- if (replaces && replaces.length > 0) {
194
- iform = iform.replaceAll(replaces[0],'div.task.task_' + taskid);
195
- }
196
- }
197
193
  {
198
194
  let replaces = iform.match(/worklist-item/ms);
199
195
  if (replaces && replaces.length > 0) {
200
- iform = iform.replaceAll(replaces[0],'div.task.task_' + taskid);
196
+ iform = iform.replaceAll(replaces[0],'body');
201
197
  }
202
198
  }
203
199
  {
204
200
  let replaces = evaltext.match(/worklist-item/ms);
205
201
  if (replaces && replaces.length > 0) {
206
- evaltext = evaltext.replaceAll(replaces[0],'div.task.task_' + taskid);
202
+ evaltext = evaltext.replaceAll(replaces[0],'body');
207
203
  }
208
204
  }
209
205
 
210
- let container = $("<div class='task task_" + taskid + "'><form id='form_" + taskid + "'></form></div>");
211
- container.append(iform);
206
+ let worklist_form = $("<form id='worklist-form'></form></div>");
212
207
 
213
- let form = $("ui-area[data-belongs-to-tab="+taskid+"]");
214
- form.addClass('areataskitem');
215
208
  let data;
216
209
  try { data = res.parameters; } catch (e) { data = {}; }
217
- form.append(container);
218
210
 
219
- eval(evaltext); // investigate indirect eval and strict
211
+ let iframe= $('<iframe src="container.html"></iframe>')[0];
212
+ iframe.onload = () => {
213
+ $(iframe.contentDocument.body).append(worklist_form);
214
+ $(iframe.contentDocument.body).append(iform);
215
+ iframe.contentWindow.data = data;
216
+ iframe.contentWindow.form = $(iframe.contentDocument.body);
217
+ iframe.contentWindow.eval(evaltext); // investigate indirect eval and strict
218
+ $("#worklist-form",iframe.contentWindow.form).on('submit',function(e){
220
219
 
221
- uidash_activate_tab($('ui-tabbar ui-tab[data-tab=' + taskid + ']'));
222
- $("#form_"+taskid).on('submit',function(e){
223
- let scount = 0;
224
- $('select[required][form="form_' + taskid + '"]').each((_,e) => {
225
- if ($(e).val() == null) { scount += 1; }
226
- if (scount == 1) {
227
- $(e).focus();
228
- $(e).removeClass('pulseit');
220
+ let scount = 0;
221
+ $('select[required][form="worklist-form"]',iframe.contentWindow.form).each((_,e) => {
222
+ if ($(e).val() == null) { scount += 1; }
223
+ if (scount == 1) {
224
+ $(e).focus();
225
+ $(e).removeClass('pulseit');
229
226
 
230
- setTimeout(()=>{$(e).addClass('pulseit')},100);;
231
- }
232
- });
233
- if (scount > 0) {
234
- e.preventDefault();
235
- return false;
236
- }
237
- var form_data = $(this).serializeArray();
238
- var send_data = {};
239
- var headers = {};
240
- if (res.collect) { headers['CPEE-UPDATE'] = 'true'; }
241
- send_data['user'] = $("input[name=user-name]").val();
242
- send_data['raw'] = form_data;
243
- send_data['data'] = {};
244
- $.map(send_data['raw'], function(n, i){
245
- send_data['data'][n['name']] = n['value'];
246
- });
247
- $.ajax({
248
- type: "PUT",
249
- url: res.url,
250
- headers: headers,
251
- contentType: "application/json",
252
- data: JSON.stringify(send_data),
253
- success: function(something){
254
- $.ajax({
255
- type: "DELETE",
256
- url: taskidurl,
257
- success: function(del){
258
- uidash_close_tab('ui-tab[data-tab='+taskid+'] ui-close');
259
- get_worklist();
260
- },
261
- error: function(a,b,c){
262
- console.log("Delete failed");
263
- }
264
- });
265
- },
266
- error: function(a,b,c){
267
- $.ajax({
268
- type: "DELETE",
269
- url: taskidurl,
270
- success: function(del){
271
- uidash_close_tab('ui-tab[data-tab='+taskid+'] ui-close');
272
- get_worklist();
273
- },
274
- error: function(a,b,c){
275
- console.log("Delete failed");
227
+ setTimeout(()=>{$(e).addClass('pulseit')},100);;
228
+ }
229
+ });
230
+ if (scount > 0) {
231
+ e.preventDefault();
232
+ return false;
276
233
  }
234
+ var form_data = $(this).serializeArray();
235
+ var send_data = {};
236
+ var headers = {};
237
+ if (res.collect) { headers['CPEE-UPDATE'] = 'true'; }
238
+ send_data['user'] = $("input[name=user-name]").val();
239
+ send_data['raw'] = form_data;
240
+ send_data['data'] = {};
241
+ $.map(send_data['raw'], function(n, i){
242
+ send_data['data'][n['name']] = n['value'];
243
+ });
244
+ $.ajax({
245
+ type: "PUT",
246
+ url: res.url,
247
+ headers: headers,
248
+ contentType: "application/json",
249
+ data: JSON.stringify(send_data),
250
+ success: function(something){
251
+ $.ajax({
252
+ type: "DELETE",
253
+ url: taskidurl,
254
+ success: function(del){
255
+ uidash_close_tab('ui-tab[data-tab='+taskid+'] ui-close');
256
+ get_worklist();
257
+ },
258
+ error: function(a,b,c){
259
+ console.log("Delete failed");
260
+ }
261
+ });
262
+ },
263
+ error: function(a,b,c){
264
+ $.ajax({
265
+ type: "DELETE",
266
+ url: taskidurl,
267
+ success: function(del){
268
+ uidash_close_tab('ui-tab[data-tab='+taskid+'] ui-close');
269
+ get_worklist();
270
+ },
271
+ error: function(a,b,c){
272
+ console.log("Delete failed");
273
+ }
274
+ });
275
+ // TODO
276
+ console.log("Put didnt work");
277
+ }
278
+ });
279
+ e.preventDefault();
277
280
  });
278
- // TODO
279
- console.log("Put didnt work");
280
281
  }
281
- });
282
- e.preventDefault();
283
- });
282
+
283
+ let taskitem = $("ui-area[data-belongs-to-tab="+taskid+"]");
284
+ taskitem.addClass('areataskitem');
285
+ taskitem.append(iframe);
286
+
287
+ uidash_activate_tab($('ui-tabbar ui-tab[data-tab=' + taskid + ']'));
284
288
  },
285
289
  error: function(a,b,c){
286
290
  $.ajax({
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee-worklist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: tools
12
12
  cert_chain: []
13
- date: 2024-07-12 00:00:00.000000000 Z
13
+ date: 2024-07-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: riddl
@@ -109,6 +109,7 @@ files:
109
109
  - server/worklist
110
110
  - server/worklist.conf
111
111
  - tools/cpee-worklist
112
+ - ui/container.html
112
113
  - ui/css/ui.css
113
114
  - ui/direct.html
114
115
  - ui/index.html