fixed JS bugs
This commit is contained in:
parent
a60d6e2e41
commit
037a06cbb1
|
@ -8,7 +8,7 @@ workflows:
|
||||||
# - invitation-accepted
|
# - invitation-accepted
|
||||||
# - user-group_deleted
|
# - user-group_deleted
|
||||||
# - user-group-role_deleted
|
# - user-group-role_deleted
|
||||||
- delete-user-account
|
# - delete-user-account
|
||||||
# - role_deleted
|
# - role_deleted
|
||||||
# - role_created
|
# - role_created
|
||||||
# - add_role_policy_permission
|
# - add_role_policy_permission
|
||||||
|
@ -18,7 +18,7 @@ workflows:
|
||||||
# - add_all_system_services_to_vre
|
# - add_all_system_services_to_vre
|
||||||
# - create_workspace_client
|
# - create_workspace_client
|
||||||
# - add_workspace_client_to_context
|
# - add_workspace_client_to_context
|
||||||
# - enable_workspace_clients_for_context
|
- enable_workspace_clients_for_context
|
||||||
# - add_workspace_client_to_contexts
|
# - add_workspace_client_to_contexts
|
||||||
# - ghn_client_add_to_context
|
# - ghn_client_add_to_context
|
||||||
# - ghn_client_add_to_contexts
|
# - ghn_client_add_to_contexts
|
||||||
|
@ -26,7 +26,7 @@ workflows:
|
||||||
# - ghn_client_delete
|
# - ghn_client_delete
|
||||||
# - ghn_client_remove_from_contexts
|
# - ghn_client_remove_from_contexts
|
||||||
# - ghn_client_remove_from_context
|
# - ghn_client_remove_from_context
|
||||||
# - jupyterhub_add_serveroptions_to_context
|
- jupyterhub_add_serveroptions_to_context
|
||||||
# - record_context_to_is
|
# - record_context_to_is
|
||||||
# - create_vre_folder_for_context
|
# - create_vre_folder_for_context
|
||||||
# - create_vre
|
# - create_vre
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
"evaluatorType" : "javascript",
|
"evaluatorType" : "javascript",
|
||||||
"names" : "${extract_workspace_client_names.output.result}",
|
"names" : "${extract_workspace_client_names.output.result}",
|
||||||
"filter" : "${init.output.result.filter}",
|
"filter" : "${init.output.result.filter}",
|
||||||
"expression": "names=Java.from($.names); f=Java.from($.filter); function f(){if(f.length === 0) output=names; else { output=[]; for(i=0;i<names.length;i++){ if(f.indexOf(names[i]) !== -1) output.push(names[i])}} return { 'names' : Java.to(output, 'java.lang.String[]')}} f()"
|
"expression": "names=Java.from($.names); filt=Java.from($.filter); function f(){if(filt.length === 0) output=names; else { output=[]; for(i=0;i<names.length;i++){ if(filt.indexOf(names[i]) !== -1) output.push(names[i])}} return { 'names' : Java.to(output, 'java.lang.String[]')}} f()"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
"context" : "${workflow.input.context}",
|
"context" : "${workflow.input.context}",
|
||||||
"names" : "${filtered_workspace_client_names.output.result.names}",
|
"names" : "${filtered_workspace_client_names.output.result.names}",
|
||||||
"evaluatorType" : "javascript",
|
"evaluatorType" : "javascript",
|
||||||
"scriptExpression": "inputs={};tasks=[];function f(){for(var i=0;i<$.names.length;i++){tasks.push({name:'sub_workflow_task',type:'SUB_WORKFLOW',taskReferenceName:'call_add_ws_client_to_context_'+i, subWorkflowParam:{ name:'add_workspace_client_to_context'}});inputs['call_add_ws_client_to_context_'+i]={client_id:$.names[i], context:$.context}} return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs};} f()"
|
"expression": "inputs={};tasks=[];function f(){for(var i=0;i<$.names.length;i++){tasks.push({name:'sub_workflow_task',type:'SUB_WORKFLOW',taskReferenceName:'call_add_ws_client_to_context_'+i, subWorkflowParam:{ name:'add_workspace_client_to_context'}});inputs['call_add_ws_client_to_context_'+i]={client_id:$.names[i], context:$.context}} return {tasks:Java.to(tasks,'java.util.Map[]'),inputs:inputs};} f()"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"keycloak": "{{ keycloak }}/{{ keycloak_realm }}",
|
"keycloak": "{{ keycloak }}/{{ keycloak_realm }}",
|
||||||
"keycloak_admin": "{{ keycloak_admin }}/{{ keycloak_realm }}",
|
"keycloak_admin": "{{ keycloak_admin }}/{{ keycloak_realm }}",
|
||||||
"ctx": "${workflow.input.context}",
|
"ctx": "${workflow.input.context}",
|
||||||
"jupyterhub_clientid" : "jupyterhub-prod",
|
"jupyterhub_clientid" : "jupyterhub1",
|
||||||
"evaluatorType" : "javascript",
|
"evaluatorType" : "javascript",
|
||||||
"expression": "function e(v){ return (v == null || (v.trim && v.trim() === ''))}; function f(){if(e($.ctx)) throw('Context must not be empty'); else return { encoded_context : $.ctx.replaceAll('/', '%2F')}} f()"
|
"expression": "function e(v){ return (v == null || (v.trim && v.trim() === ''))}; function f(){if(e($.ctx)) throw('Context must not be empty'); else return { encoded_context : $.ctx.replaceAll('/', '%2F')}} f()"
|
||||||
},
|
},
|
||||||
|
@ -253,7 +253,7 @@
|
||||||
"inputParameters": {
|
"inputParameters": {
|
||||||
"evaluatorType" : "javascript",
|
"evaluatorType" : "javascript",
|
||||||
"param": "ok",
|
"param": "ok",
|
||||||
"expression": "function e(v){ return (v == null || (v.trim && v.trim() === ''))}; function(){if(e($.param)) throw('Param must not be empty'); else return $.param} f()"
|
"expression": "function e(v){ return (v == null || (v.trim && v.trim() === ''))}; function f(){if(e($.param)) throw('Param must not be empty'); else return $.param} f()"
|
||||||
},
|
},
|
||||||
"type": "INLINE",
|
"type": "INLINE",
|
||||||
"decisionCases": {},
|
"decisionCases": {},
|
||||||
|
@ -274,7 +274,7 @@
|
||||||
"allowed": "${extract_authids.output.result}",
|
"allowed": "${extract_authids.output.result}",
|
||||||
"res": "${lookup_jupyterhub_resources.output.body}",
|
"res": "${lookup_jupyterhub_resources.output.body}",
|
||||||
"ctx": "${init.output.result.encoded_context}",
|
"ctx": "${init.output.result.encoded_context}",
|
||||||
"expression": "var ret = []; function() f(){for(var r=0; r < $.res.length; r++){ if($.allowed.indexOf($.res[r].name) !== -1){ $.res[r].attributes[$.ctx] = Java.to(['true'], 'java.lang.String[]'); ret.push($.res[r]) } } return Java.to(ret, 'java.util.Map[]')} f()"
|
"expression": "var ret = []; function f(){for(var r=0; r < $.res.length; r++){ if($.allowed.indexOf($.res[r].name) !== -1){ $.res[r].attributes[$.ctx] = Java.to(['true'], 'java.lang.String[]'); ret.push($.res[r]) } } return Java.to(ret, 'java.util.Map[]')} f()"
|
||||||
},
|
},
|
||||||
"type": "INLINE",
|
"type": "INLINE",
|
||||||
"decisionCases": {},
|
"decisionCases": {},
|
||||||
|
@ -294,7 +294,7 @@
|
||||||
"evaluatorType" : "javascript",
|
"evaluatorType" : "javascript",
|
||||||
"res": "${filter_and_update.output.result}",
|
"res": "${filter_and_update.output.result}",
|
||||||
"url": "${init.input.keycloak_admin}/clients/${lookup_jupyterhub.output.body[0].id}/authz/resource-server/resource/",
|
"url": "${init.input.keycloak_admin}/clients/${lookup_jupyterhub.output.body[0].id}/authz/resource-server/resource/",
|
||||||
"expression": "inputs = {}, tasks = [];function(){for (var i = 0; i < $.res.length; i++){s = $.res[i];tasks.push({name: 'pyrest',type: 'SIMPLE',taskReferenceName: 't' + i});inputs['t' + i] = {url: $.url + $.res[i]._id,method: 'PUT', body: $.res[i], headers: {Authorization: 'Bearer ${authorize.output.body.access_token}', 'Content-Type': 'application/json'}}};return {tasks: Java.to(tasks, 'java.util.Map[]'),inputs: inputs};} f()"
|
"expression": "inputs = {}, tasks = [];function f(){for (var i = 0; i < $.res.length; i++){s = $.res[i];tasks.push({name: 'pyrest',type: 'SIMPLE',taskReferenceName: 't' + i});inputs['t' + i] = {url: $.url + $.res[i]._id,method: 'PUT', body: $.res[i], headers: {Authorization: 'Bearer ${authorize.output.body.access_token}', 'Content-Type': 'application/json'}}};return {tasks: Java.to(tasks, 'java.util.Map[]'),inputs: inputs};} f()"
|
||||||
},
|
},
|
||||||
"type": "INLINE",
|
"type": "INLINE",
|
||||||
"decisionCases": {},
|
"decisionCases": {},
|
||||||
|
|
Loading…
Reference in New Issue