diff --git a/services/service-workflow/main/default/pages/instance_tasks_list.page.amis.json b/services/service-workflow/main/default/pages/instance_tasks_list.page.amis.json index 82c149bcaf..1123fb2a3f 100644 --- a/services/service-workflow/main/default/pages/instance_tasks_list.page.amis.json +++ b/services/service-workflow/main/default/pages/instance_tasks_list.page.amis.json @@ -42,20 +42,7 @@ "listName": "inbox", "rowClassNameExpr": "<%=(data.is_read === false && (!data.clientIds || data.clientIds.length == 0 || !data.clientIds.includes(data._id))) ? 'unread-instance' : '' %>", "rebuildOn": "\\${flowId || categoryId}", - "crudDataFilter": "if (data && data.flowId && (data.listName == 'inbox' || 'monitor') && window.innerWidth > 768) {\r\n var api = {\r\n url: \"${context.rootUrl}/graphql\",\r\n method: \"post\",\r\n dataType: \"json\",\r\n data: {\r\n \"query\": '{flow: flows__findOne(id:\"' + data.flowId + '\"){form__expand{current}}}'\r\n },\r\n headers: {\r\n Authorization:\r\n \"Bearer ${context.tenantId},${context.authToken}\",\r\n },\r\n };\r\n return env.fetcher(api).then((result) => {\r\n if (result.data && result.data.flow && result.data.flow.form__expand.current.fields && result.data.flow.form__expand.current.fields.length > 0) {\r\n let fields = result.data.flow.form__expand.current.fields;\r\n fields.forEach(function (field) {\r\n if (field.is_list_display) {\r\n crud.columns.push({\r\n \"name\": \"instance__expand.values.\" + field.code,\r\n \"label\": field.name || field.code,\r\n \"width\": \"unset\",\r\n \"type\": \"text\",\r\n \"className\": \" whitespace-nowrap\",\r\n \"static\": true,\r\n \"options\": null\r\n });\r\n }\r\n })\r\n let schemaApiService = SteedosUI.getRef('steedosPageObjectControl').parent.getComponentById(\"instance_tasks_list_service\");\r\n schemaApiService && schemaApiService.setData({ form_fields: fields, isFlowDataDone: true });\r\n crud.api.sendOn = \"this.isFlowDataDone\";\r\n }\r\n return crud;\r\n });\r\n} else {\r\n let schemaApiService = SteedosUI.getRef('steedosPageObjectControl').parent.getComponentById(\"instance_tasks_list_service\");\r\n schemaApiService && schemaApiService.setData({ isFlowDataDone: true });\r\n crud.api.sendOn = \"this.isFlowDataDone\";\r\n return crud;\r\n}\r\n", - "crud": { - "onEvent": { - "rowClick": { - "actions": [ - { - "actionType": "custom", - "script": "const clientIds = event.data.clientIds || []; clientIds.push(event.data.item._id);doAction({actionType: 'setValue', componentId: 'service_listview_instance_tasks', args: {value: {clientIds: clientIds}}})" - } - ] - } - }, - "id": "u:af8bd61b2b28" - } + "crudDataFilter": "if (data && data.flowId && (data.listName == 'inbox' || 'monitor') && window.innerWidth > 768) {\r\n var api = {\r\n url: \"${context.rootUrl}/graphql\",\r\n method: \"post\",\r\n dataType: \"json\",\r\n data: {\r\n \"query\": '{flow: flows__findOne(id:\"' + data.flowId + '\"){form__expand{current}}}'\r\n },\r\n headers: {\r\n Authorization:\r\n \"Bearer ${context.tenantId},${context.authToken}\",\r\n },\r\n };\r\n return env.fetcher(api).then((result) => {\r\n if (result.data && result.data.flow && result.data.flow.form__expand.current.fields && result.data.flow.form__expand.current.fields.length > 0) {\r\n let fields = result.data.flow.form__expand.current.fields;\r\n fields.forEach(function (field) {\r\n if (field.is_list_display) {\r\n crud.columns.push({\r\n \"name\": \"instance__expand.values.\" + field.code,\r\n \"label\": field.name || field.code,\r\n \"width\": \"unset\",\r\n \"type\": \"text\",\r\n \"className\": \" whitespace-nowrap\",\r\n \"static\": true,\r\n \"options\": null\r\n });\r\n }\r\n })\r\n let schemaApiService = SteedosUI.getRef('steedosPageObjectControl').parent.getComponentById(\"instance_tasks_list_service\");\r\n schemaApiService && schemaApiService.setData({ form_fields: fields, isFlowDataDone: true });\r\n crud.api.sendOn = \"this.isFlowDataDone\";\r\n }\r\n return crud;\r\n });\r\n} else {\r\n let schemaApiService = SteedosUI.getRef('steedosPageObjectControl').parent.getComponentById(\"instance_tasks_list_service\");\r\n schemaApiService && schemaApiService.setData({ isFlowDataDone: true });\r\n crud.api.sendOn = \"this.isFlowDataDone\"; if(data.display == 'split'){Object.assign(crud, {\"onEvent\":{\"rowClick\":{\"actions\":[{\"actionType\":\"custom\",\"script\":\"const clientIds = event.data.clientIds || []; clientIds.push(event.data.item._id);doAction({actionType: 'setValue', componentId: 'service_listview_instance_tasks', args: {value: {clientIds: clientIds}}})\"}]}},\"id\":\"u:af8bd61b2b28\"});} ; \r\n return crud;\r\n}\r\n" }, { "type": "action",