@steedos-labs/content-compliance 0.7.19 → 0.7.21
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/dist/index.js +1 -0
- package/lib/actions/addBulkMaterials.d.ts +15 -0
- package/lib/actions/addBulkMaterials.js +69 -0
- package/lib/actions/addBulkMaterials.js.map +1 -0
- package/lib/actions/briefFlows.d.ts +14 -0
- package/lib/actions/briefFlows.js +46 -0
- package/lib/actions/briefFlows.js.map +1 -0
- package/lib/actions/bypassApproval.d.ts +10 -0
- package/lib/actions/bypassApproval.js +269 -0
- package/lib/actions/bypassApproval.js.map +1 -0
- package/lib/actions/bypassMaterial.d.ts +10 -0
- package/lib/actions/bypassMaterial.js +190 -0
- package/lib/actions/bypassMaterial.js.map +1 -0
- package/lib/actions/calculateSpotCheckRates.d.ts +13 -0
- package/lib/actions/calculateSpotCheckRates.js +94 -0
- package/lib/actions/calculateSpotCheckRates.js.map +1 -0
- package/lib/actions/confirmDeployment.d.ts +7 -0
- package/lib/actions/confirmDeployment.js +31 -0
- package/lib/actions/confirmDeployment.js.map +1 -0
- package/lib/actions/dashboard_sync_data.d.ts +7 -0
- package/lib/actions/dashboard_sync_data.js +30 -0
- package/lib/actions/dashboard_sync_data.js.map +1 -0
- package/lib/actions/fixStuckPersonnelReview.d.ts +20 -0
- package/lib/actions/fixStuckPersonnelReview.js +145 -0
- package/lib/actions/fixStuckPersonnelReview.js.map +1 -0
- package/lib/actions/hasDuplicateMaterials.d.ts +9 -0
- package/lib/actions/hasDuplicateMaterials.js +30 -0
- package/lib/actions/hasDuplicateMaterials.js.map +1 -0
- package/lib/actions/imageComparison.d.ts +34 -0
- package/lib/actions/imageComparison.js +95 -0
- package/lib/actions/imageComparison.js.map +1 -0
- package/lib/actions/index.d.ts +27 -0
- package/lib/actions/index.js +31 -0
- package/lib/actions/index.js.map +1 -0
- package/lib/actions/initCollaborator.d.ts +13 -0
- package/lib/actions/initCollaborator.js +87 -0
- package/lib/actions/initCollaborator.js.map +1 -0
- package/lib/actions/initUrgentQuota.d.ts +17 -0
- package/lib/actions/initUrgentQuota.js +99 -0
- package/lib/actions/initUrgentQuota.js.map +1 -0
- package/lib/actions/migrateReviewCompletedDate.d.ts +21 -0
- package/lib/actions/migrateReviewCompletedDate.js +150 -0
- package/lib/actions/migrateReviewCompletedDate.js.map +1 -0
- package/lib/actions/migrateSpotCheckData.d.ts +23 -0
- package/lib/actions/migrateSpotCheckData.js +143 -0
- package/lib/actions/migrateSpotCheckData.js.map +1 -0
- package/lib/actions/migrateSpotCheckDepartments.d.ts +25 -0
- package/lib/actions/migrateSpotCheckDepartments.js +142 -0
- package/lib/actions/migrateSpotCheckDepartments.js.map +1 -0
- package/lib/actions/postponeDeployment.d.ts +7 -0
- package/lib/actions/postponeDeployment.js +30 -0
- package/lib/actions/postponeDeployment.js.map +1 -0
- package/lib/actions/postponeReview.d.ts +7 -0
- package/lib/actions/postponeReview.js +30 -0
- package/lib/actions/postponeReview.js.map +1 -0
- package/lib/actions/progress.d.ts +18 -0
- package/lib/actions/progress.js +71 -0
- package/lib/actions/progress.js.map +1 -0
- package/lib/actions/rule.d.ts +7 -0
- package/lib/actions/rule.js +27 -0
- package/lib/actions/rule.js.map +1 -0
- package/lib/actions/sendToContentHub.d.ts +7 -0
- package/lib/actions/sendToContentHub.js +37 -0
- package/lib/actions/sendToContentHub.js.map +1 -0
- package/lib/actions/spotCheckMaterial.d.ts +46 -0
- package/lib/actions/spotCheckMaterial.js +591 -0
- package/lib/actions/spotCheckMaterial.js.map +1 -0
- package/lib/actions/submit.d.ts +7 -0
- package/lib/actions/submit.js +48 -0
- package/lib/actions/submit.js.map +1 -0
- package/lib/actions/submitKids.d.ts +7 -0
- package/lib/actions/submitKids.js +30 -0
- package/lib/actions/submitKids.js.map +1 -0
- package/lib/actions/submitMaterial.d.ts +7 -0
- package/lib/actions/submitMaterial.js +30 -0
- package/lib/actions/submitMaterial.js.map +1 -0
- package/lib/actions/submitPreReview.d.ts +7 -0
- package/lib/actions/submitPreReview.js +34 -0
- package/lib/actions/submitPreReview.js.map +1 -0
- package/lib/actions/terminate.d.ts +7 -0
- package/lib/actions/terminate.js +30 -0
- package/lib/actions/terminate.js.map +1 -0
- package/lib/actions/urgentApproval.d.ts +14 -0
- package/lib/actions/urgentApproval.js +51 -0
- package/lib/actions/urgentApproval.js.map +1 -0
- package/lib/const.d.ts +1 -0
- package/lib/const.js +6 -0
- package/lib/const.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1238 -0
- package/lib/index.js.map +1 -0
- package/lib/methods/AI.d.ts +1 -0
- package/lib/methods/AI.js +45 -0
- package/lib/methods/AI.js.map +1 -0
- package/lib/methods/__tests__/__mocks__/empty.d.ts +2 -0
- package/lib/methods/__tests__/__mocks__/empty.js +4 -0
- package/lib/methods/__tests__/__mocks__/empty.js.map +1 -0
- package/lib/methods/__tests__/postponeReview.test.d.ts +1 -0
- package/lib/methods/__tests__/postponeReview.test.js +102 -0
- package/lib/methods/__tests__/postponeReview.test.js.map +1 -0
- package/lib/methods/__tests__/urgent.test.d.ts +1 -0
- package/lib/methods/__tests__/urgent.test.js +121 -0
- package/lib/methods/__tests__/urgent.test.js.map +1 -0
- package/lib/methods/agent.d.ts +4 -0
- package/lib/methods/agent.js +86 -0
- package/lib/methods/agent.js.map +1 -0
- package/lib/methods/approval_engine.d.ts +40 -0
- package/lib/methods/approval_engine.js +2302 -0
- package/lib/methods/approval_engine.js.map +1 -0
- package/lib/methods/consts.d.ts +209 -0
- package/lib/methods/consts.js +46 -0
- package/lib/methods/consts.js.map +1 -0
- package/lib/methods/content_hub.d.ts +2 -0
- package/lib/methods/content_hub.js +228 -0
- package/lib/methods/content_hub.js.map +1 -0
- package/lib/methods/dashboard_sync_data.d.ts +4 -0
- package/lib/methods/dashboard_sync_data.js +346 -0
- package/lib/methods/dashboard_sync_data.js.map +1 -0
- package/lib/methods/docx.d.ts +3 -0
- package/lib/methods/docx.js +12 -0
- package/lib/methods/docx.js.map +1 -0
- package/lib/methods/image_comparison.d.ts +39 -0
- package/lib/methods/image_comparison.js +454 -0
- package/lib/methods/image_comparison.js.map +1 -0
- package/lib/methods/index.d.ts +7 -0
- package/lib/methods/index.js +11 -0
- package/lib/methods/index.js.map +1 -0
- package/lib/methods/material.d.ts +15 -0
- package/lib/methods/material.js +756 -0
- package/lib/methods/material.js.map +1 -0
- package/lib/methods/notification.d.ts +4 -0
- package/lib/methods/notification.js +270 -0
- package/lib/methods/notification.js.map +1 -0
- package/lib/methods/password_expiry.d.ts +1 -0
- package/lib/methods/password_expiry.js +151 -0
- package/lib/methods/password_expiry.js.map +1 -0
- package/lib/methods/pls.d.ts +1 -0
- package/lib/methods/pls.js +217 -0
- package/lib/methods/pls.js.map +1 -0
- package/lib/methods/urgent.d.ts +20 -0
- package/lib/methods/urgent.js +259 -0
- package/lib/methods/urgent.js.map +1 -0
- package/main/default/objects/pepsico_material_approval/listviews/all.listview.yml +3 -2
- package/main/default/objects/pepsico_material_approval/listviews/collaboration.listview.yml +3 -2
- package/main/default/objects/pepsico_material_approval/listviews/handle.listview.yml +3 -2
- package/main/default/objects/pepsico_material_approval/listviews/handle_postpone.listview.yml +3 -2
- package/package.json +1 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scanPLSFiles = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var _ = require('lodash');
|
|
6
|
+
var getProductName = function (ctx, productId) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
7
|
+
var products, pLists, pRecords_1, pNames_1;
|
|
8
|
+
return tslib_1.__generator(this, function (_a) {
|
|
9
|
+
switch (_a.label) {
|
|
10
|
+
case 0:
|
|
11
|
+
products = _.split(productId, '-');
|
|
12
|
+
return [4, ctx.getObject('picklists').directFind({ filters: ["code", "=",
|
|
13
|
+
"223321001114213"] })];
|
|
14
|
+
case 1:
|
|
15
|
+
pLists = _a.sent();
|
|
16
|
+
if (!(products.length > 0 && pLists.length > 0)) return [3, 3];
|
|
17
|
+
return [4, ctx.getObject('picklist_options').directFind({
|
|
18
|
+
filters: [
|
|
19
|
+
["picklist", "=", pLists[0]._id],
|
|
20
|
+
["value", "in", products]
|
|
21
|
+
]
|
|
22
|
+
})];
|
|
23
|
+
case 2:
|
|
24
|
+
pRecords_1 = _a.sent();
|
|
25
|
+
pNames_1 = [];
|
|
26
|
+
_.each(products, function (pId) {
|
|
27
|
+
var pRecord = _.find(pRecords_1, { value: pId });
|
|
28
|
+
if (pRecord) {
|
|
29
|
+
pNames_1.push(pRecord.name);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return [2, _.join(pNames_1, '-')];
|
|
33
|
+
case 3: return [2, ''];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}); };
|
|
37
|
+
var scanPLSFiles = function (ctx) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
38
|
+
var approvalId, approvals, addPLSCount, approvals_1, approvals_1_1, approval, productId, productName, materials, materials_1, materials_1_1, material, filters, files, files_1, files_1_1, file, e_1_1, e_2_1, _a, _b, fileId, e_3_1, error_1, e_4_1;
|
|
39
|
+
var e_4, _c, e_2, _d, e_1, _e, e_3, _f;
|
|
40
|
+
return tslib_1.__generator(this, function (_g) {
|
|
41
|
+
switch (_g.label) {
|
|
42
|
+
case 0:
|
|
43
|
+
approvalId = "";
|
|
44
|
+
console.error("[scan pls files]: start ", new Date());
|
|
45
|
+
return [4, ctx.getObject('pepsico_material_approval').directFind({ filters: [['current_step', 'in', ['awaiting_deployment', 'conclusion']], ['scanned_pls', '!=', true]] })];
|
|
46
|
+
case 1:
|
|
47
|
+
approvals = _g.sent();
|
|
48
|
+
console.error("[scan pls files]: approvals.length", approvals.length);
|
|
49
|
+
addPLSCount = 0;
|
|
50
|
+
_g.label = 2;
|
|
51
|
+
case 2:
|
|
52
|
+
_g.trys.push([2, 35, 36, 37]);
|
|
53
|
+
approvals_1 = tslib_1.__values(approvals), approvals_1_1 = approvals_1.next();
|
|
54
|
+
_g.label = 3;
|
|
55
|
+
case 3:
|
|
56
|
+
if (!!approvals_1_1.done) return [3, 34];
|
|
57
|
+
approval = approvals_1_1.value;
|
|
58
|
+
_g.label = 4;
|
|
59
|
+
case 4:
|
|
60
|
+
_g.trys.push([4, 31, , 33]);
|
|
61
|
+
approvalId = approval._id;
|
|
62
|
+
productId = approval.product;
|
|
63
|
+
return [4, getProductName(ctx, productId)];
|
|
64
|
+
case 5:
|
|
65
|
+
productName = _g.sent();
|
|
66
|
+
return [4, ctx.getObject('pepsico_material').directFind({
|
|
67
|
+
filters: [
|
|
68
|
+
['pepsico_material_approval', '=', approvalId]
|
|
69
|
+
]
|
|
70
|
+
})];
|
|
71
|
+
case 6:
|
|
72
|
+
materials = _g.sent();
|
|
73
|
+
console.error("[scan pls files]: approvalId", approvalId);
|
|
74
|
+
_g.label = 7;
|
|
75
|
+
case 7:
|
|
76
|
+
_g.trys.push([7, 19, 20, 21]);
|
|
77
|
+
materials_1 = (e_2 = void 0, tslib_1.__values(materials)), materials_1_1 = materials_1.next();
|
|
78
|
+
_g.label = 8;
|
|
79
|
+
case 8:
|
|
80
|
+
if (!!materials_1_1.done) return [3, 18];
|
|
81
|
+
material = materials_1_1.value;
|
|
82
|
+
filters = [
|
|
83
|
+
['metadata/record_id', '=', "objects:pepsico_material:".concat(material._id)],
|
|
84
|
+
['metadata/object_name', '=', 'b6_rooms'],
|
|
85
|
+
['original/type', '=', 'application/pdf'],
|
|
86
|
+
['original/name', 'contains', 'PLS']
|
|
87
|
+
];
|
|
88
|
+
console.error("[scan pls files]: approvalId", approvalId, "material-".concat(material._id), 'filters: ', JSON.stringify(filters));
|
|
89
|
+
return [4, ctx.getObject('cfs_files_filerecord').directFind({
|
|
90
|
+
filters: filters
|
|
91
|
+
})];
|
|
92
|
+
case 9:
|
|
93
|
+
files = _g.sent();
|
|
94
|
+
console.error("[scan pls files]: approvalId", approvalId, "material-".concat(material._id), 'files.length: ', files.length);
|
|
95
|
+
_g.label = 10;
|
|
96
|
+
case 10:
|
|
97
|
+
_g.trys.push([10, 15, 16, 17]);
|
|
98
|
+
files_1 = (e_1 = void 0, tslib_1.__values(files)), files_1_1 = files_1.next();
|
|
99
|
+
_g.label = 11;
|
|
100
|
+
case 11:
|
|
101
|
+
if (!!files_1_1.done) return [3, 14];
|
|
102
|
+
file = files_1_1.value;
|
|
103
|
+
return [4, ctx.getObject('pepsico_km_pls_file').directInsert({
|
|
104
|
+
name: productName,
|
|
105
|
+
ai_extract: false,
|
|
106
|
+
pls_file: file._id,
|
|
107
|
+
pepsico_material: material._id,
|
|
108
|
+
product: productId,
|
|
109
|
+
pepsico_material_approval: approvalId,
|
|
110
|
+
space: approval.space,
|
|
111
|
+
created: new Date(),
|
|
112
|
+
modified: new Date()
|
|
113
|
+
})];
|
|
114
|
+
case 12:
|
|
115
|
+
_g.sent();
|
|
116
|
+
addPLSCount++;
|
|
117
|
+
_g.label = 13;
|
|
118
|
+
case 13:
|
|
119
|
+
files_1_1 = files_1.next();
|
|
120
|
+
return [3, 11];
|
|
121
|
+
case 14: return [3, 17];
|
|
122
|
+
case 15:
|
|
123
|
+
e_1_1 = _g.sent();
|
|
124
|
+
e_1 = { error: e_1_1 };
|
|
125
|
+
return [3, 17];
|
|
126
|
+
case 16:
|
|
127
|
+
try {
|
|
128
|
+
if (files_1_1 && !files_1_1.done && (_e = files_1.return)) _e.call(files_1);
|
|
129
|
+
}
|
|
130
|
+
finally { if (e_1) throw e_1.error; }
|
|
131
|
+
return [7];
|
|
132
|
+
case 17:
|
|
133
|
+
materials_1_1 = materials_1.next();
|
|
134
|
+
return [3, 8];
|
|
135
|
+
case 18: return [3, 21];
|
|
136
|
+
case 19:
|
|
137
|
+
e_2_1 = _g.sent();
|
|
138
|
+
e_2 = { error: e_2_1 };
|
|
139
|
+
return [3, 21];
|
|
140
|
+
case 20:
|
|
141
|
+
try {
|
|
142
|
+
if (materials_1_1 && !materials_1_1.done && (_d = materials_1.return)) _d.call(materials_1);
|
|
143
|
+
}
|
|
144
|
+
finally { if (e_2) throw e_2.error; }
|
|
145
|
+
return [7];
|
|
146
|
+
case 21:
|
|
147
|
+
if (!(approval.pls_file && approval.pls_file.length > 0)) return [3, 29];
|
|
148
|
+
_g.label = 22;
|
|
149
|
+
case 22:
|
|
150
|
+
_g.trys.push([22, 27, 28, 29]);
|
|
151
|
+
_a = (e_3 = void 0, tslib_1.__values(approval.pls_file)), _b = _a.next();
|
|
152
|
+
_g.label = 23;
|
|
153
|
+
case 23:
|
|
154
|
+
if (!!_b.done) return [3, 26];
|
|
155
|
+
fileId = _b.value;
|
|
156
|
+
return [4, ctx.getObject('pepsico_km_pls_file').directInsert({
|
|
157
|
+
name: productName,
|
|
158
|
+
ai_extract: false,
|
|
159
|
+
pls_file: fileId,
|
|
160
|
+
product: productId,
|
|
161
|
+
pepsico_material_approval: approvalId,
|
|
162
|
+
space: approval.space,
|
|
163
|
+
created_by: approval.created_by,
|
|
164
|
+
created: new Date(),
|
|
165
|
+
modified: new Date()
|
|
166
|
+
})];
|
|
167
|
+
case 24:
|
|
168
|
+
_g.sent();
|
|
169
|
+
_g.label = 25;
|
|
170
|
+
case 25:
|
|
171
|
+
_b = _a.next();
|
|
172
|
+
return [3, 23];
|
|
173
|
+
case 26: return [3, 29];
|
|
174
|
+
case 27:
|
|
175
|
+
e_3_1 = _g.sent();
|
|
176
|
+
e_3 = { error: e_3_1 };
|
|
177
|
+
return [3, 29];
|
|
178
|
+
case 28:
|
|
179
|
+
try {
|
|
180
|
+
if (_b && !_b.done && (_f = _a.return)) _f.call(_a);
|
|
181
|
+
}
|
|
182
|
+
finally { if (e_3) throw e_3.error; }
|
|
183
|
+
return [7];
|
|
184
|
+
case 29: return [4, ctx.getObject('pepsico_material_approval').directUpdate(approvalId, {
|
|
185
|
+
scanned_pls: true,
|
|
186
|
+
scanned_pls_date: new Date()
|
|
187
|
+
})];
|
|
188
|
+
case 30:
|
|
189
|
+
_g.sent();
|
|
190
|
+
return [3, 33];
|
|
191
|
+
case 31:
|
|
192
|
+
error_1 = _g.sent();
|
|
193
|
+
console.error("[scan pls files]-".concat(approvalId), error_1, new Date());
|
|
194
|
+
return [4, ctx.logger.error("[scan pls files]-".concat(approvalId), error_1.message)];
|
|
195
|
+
case 32:
|
|
196
|
+
_g.sent();
|
|
197
|
+
return [3, 33];
|
|
198
|
+
case 33:
|
|
199
|
+
approvals_1_1 = approvals_1.next();
|
|
200
|
+
return [3, 3];
|
|
201
|
+
case 34: return [3, 37];
|
|
202
|
+
case 35:
|
|
203
|
+
e_4_1 = _g.sent();
|
|
204
|
+
e_4 = { error: e_4_1 };
|
|
205
|
+
return [3, 37];
|
|
206
|
+
case 36:
|
|
207
|
+
try {
|
|
208
|
+
if (approvals_1_1 && !approvals_1_1.done && (_c = approvals_1.return)) _c.call(approvals_1);
|
|
209
|
+
}
|
|
210
|
+
finally { if (e_4) throw e_4.error; }
|
|
211
|
+
return [7];
|
|
212
|
+
case 37: return [2, addPLSCount];
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}); };
|
|
216
|
+
exports.scanPLSFiles = scanPLSFiles;
|
|
217
|
+
//# sourceMappingURL=pls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pls.js","sourceRoot":"","sources":["../../src/methods/pls.ts"],"names":[],"mappings":";;;;AAAA,IAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE5B,IAAM,cAAc,GAAG,UAAO,GAAG,EAAE,SAAiB;;;;;gBAC1C,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;gBAE1B,WAAM,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG;4BAClF,iBAAiB,C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;;;;;;;;;qBAIX,WAAM,GAAG,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC,YAAY,CAAC,UAAU,EAAE;oBACtE,WAAW,EAAE,IAAI;oBACjB,gBAAgB,EAAE,IAAI,IAAI,EAAE;iBAC/B,CAAC,EAAA;;gBAHF,SAGE,CAAC;;;;gBAEH,OAAO,CAAC,KAAK,CAAC,2BAAoB,UAAU,CAAE,EAAE,OAAK,EAAE,IAAI,IAAI,EAAE,CAAC,CAAA;gBAClE,WAAM,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,2BAAoB,UAAU,CAAE,EAAE,OAAK,CAAC,OAAO,CAAC,EAAA;;gBAAvE,SAAuE,CAAA;;;;;;;;;;;;;;;;qBAG/E,WAAO,WAAW,EAAC;;;KAEtB,CAAA;AAxEY,QAAA,YAAY,gBAwExB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type UrgentQuotaInfo = {
|
|
2
|
+
available: number;
|
|
3
|
+
used: number;
|
|
4
|
+
total: number;
|
|
5
|
+
year: number;
|
|
6
|
+
half: number;
|
|
7
|
+
configured: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const getUrgentQuota: (ctx: any, userId: string, space: string) => Promise<UrgentQuotaInfo>;
|
|
10
|
+
export declare const canUrgent: (ctx: any, approvalId: string, userId: string) => Promise<{
|
|
11
|
+
canUrgent: boolean;
|
|
12
|
+
reason?: string;
|
|
13
|
+
quota?: UrgentQuotaInfo;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const doUrgent: (ctx: any, approvalId: string, userId: string) => Promise<{
|
|
16
|
+
message: string;
|
|
17
|
+
used: number;
|
|
18
|
+
available: number;
|
|
19
|
+
total: number;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.doUrgent = exports.canUrgent = exports.getUrgentQuota = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var consts_1 = require("./consts");
|
|
6
|
+
var HALF_YEAR_QUOTA = 6;
|
|
7
|
+
var getUrgentQuota = function (ctx, userId, space) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
8
|
+
var now, year, half, quota, h1_used, h2_used, available, used, total, h1_remaining;
|
|
9
|
+
return tslib_1.__generator(this, function (_a) {
|
|
10
|
+
switch (_a.label) {
|
|
11
|
+
case 0:
|
|
12
|
+
now = new Date();
|
|
13
|
+
year = now.getFullYear();
|
|
14
|
+
half = now.getMonth() < 6 ? 1 : 2;
|
|
15
|
+
return [4, ctx.getObject('pepsico_urgent_quota').findOne({
|
|
16
|
+
filters: [['user', '=', userId], ['space', '=', space], ['year', '=', year]]
|
|
17
|
+
})];
|
|
18
|
+
case 1:
|
|
19
|
+
quota = _a.sent();
|
|
20
|
+
if (!quota) {
|
|
21
|
+
return [2, { available: 0, used: 0, total: 0, year: year, half: half, configured: false }];
|
|
22
|
+
}
|
|
23
|
+
h1_used = (quota === null || quota === void 0 ? void 0 : quota.h1_used) || 0;
|
|
24
|
+
h2_used = (quota === null || quota === void 0 ? void 0 : quota.h2_used) || 0;
|
|
25
|
+
if (half === 1) {
|
|
26
|
+
used = h1_used;
|
|
27
|
+
total = HALF_YEAR_QUOTA;
|
|
28
|
+
available = Math.max(0, HALF_YEAR_QUOTA - h1_used);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
h1_remaining = Math.max(0, HALF_YEAR_QUOTA - h1_used);
|
|
32
|
+
total = HALF_YEAR_QUOTA + h1_remaining;
|
|
33
|
+
used = h2_used;
|
|
34
|
+
available = Math.max(0, total - h2_used);
|
|
35
|
+
}
|
|
36
|
+
return [2, { available: available, used: used, total: total, year: year, half: half, configured: true }];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}); };
|
|
40
|
+
exports.getUrgentQuota = getUrgentQuota;
|
|
41
|
+
var canUrgent = function (ctx, approvalId, userId) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
42
|
+
var approval, spaceUser, reviewSteps, postponedUsers, quota;
|
|
43
|
+
return tslib_1.__generator(this, function (_a) {
|
|
44
|
+
switch (_a.label) {
|
|
45
|
+
case 0: return [4, ctx.getObject('pepsico_material_approval').findOne(approvalId)];
|
|
46
|
+
case 1:
|
|
47
|
+
approval = _a.sent();
|
|
48
|
+
if (!approval) {
|
|
49
|
+
return [2, { canUrgent: false, reason: '审批单不存在' }];
|
|
50
|
+
}
|
|
51
|
+
if (approval.is_urgent) {
|
|
52
|
+
return [2, { canUrgent: false, reason: '该审批单已处于加急状态' }];
|
|
53
|
+
}
|
|
54
|
+
if (approval.owner !== userId) {
|
|
55
|
+
return [2, { canUrgent: false, reason: '只有发起人可以加急' }];
|
|
56
|
+
}
|
|
57
|
+
return [4, ctx.getObject('space_users').findOne({
|
|
58
|
+
filters: [['user', '=', userId], ['space', '=', approval.space]],
|
|
59
|
+
fields: ['is_collaborator']
|
|
60
|
+
})];
|
|
61
|
+
case 2:
|
|
62
|
+
spaceUser = _a.sent();
|
|
63
|
+
if ((spaceUser === null || spaceUser === void 0 ? void 0 : spaceUser.is_collaborator) === true) {
|
|
64
|
+
return [2, { canUrgent: false, reason: '只有内部用户可以加急' }];
|
|
65
|
+
}
|
|
66
|
+
reviewSteps = [consts_1.Step.departmental_review, consts_1.Step.personnel_review];
|
|
67
|
+
if (!reviewSteps.includes(approval.current_step)) {
|
|
68
|
+
return [2, { canUrgent: false, reason: '当前步骤不支持加急' }];
|
|
69
|
+
}
|
|
70
|
+
postponedUsers = approval.review_postponed_users || [];
|
|
71
|
+
if (postponedUsers.length > 0) {
|
|
72
|
+
return [2, { canUrgent: false, reason: '存在延后审核人,无法加急' }];
|
|
73
|
+
}
|
|
74
|
+
return [4, (0, exports.getUrgentQuota)(ctx, userId, approval.space)];
|
|
75
|
+
case 3:
|
|
76
|
+
quota = _a.sent();
|
|
77
|
+
if (!quota.configured) {
|
|
78
|
+
return [2, { canUrgent: false, reason: '未配置加急次数', quota: quota }];
|
|
79
|
+
}
|
|
80
|
+
if (quota.available <= 0) {
|
|
81
|
+
return [2, { canUrgent: false, reason: '暂无加急次数', quota: quota }];
|
|
82
|
+
}
|
|
83
|
+
return [2, { canUrgent: true, quota: quota }];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}); };
|
|
87
|
+
exports.canUrgent = canUrgent;
|
|
88
|
+
var sendUrgentNotification = function (ctx, space, approvalId, approvalName, fromUserId, toUserId) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
89
|
+
var error_1, spaceUsers, spaceUsers_1, spaceUsers_1_1, spaceUser, error_2, e_1_1, error_3;
|
|
90
|
+
var e_1, _a;
|
|
91
|
+
return tslib_1.__generator(this, function (_b) {
|
|
92
|
+
switch (_b.label) {
|
|
93
|
+
case 0:
|
|
94
|
+
_b.trys.push([0, 2, , 3]);
|
|
95
|
+
return [4, ctx.broker.call('notifications.add', {
|
|
96
|
+
message: {
|
|
97
|
+
name: "\u52A0\u6025\u5BA1\u6279\uFF1A ".concat(approvalName),
|
|
98
|
+
body: '发起人已标记为加急审核,请优先处理',
|
|
99
|
+
related_to: {
|
|
100
|
+
o: 'pepsico_material_approval',
|
|
101
|
+
ids: [approvalId]
|
|
102
|
+
},
|
|
103
|
+
related_name: approvalName,
|
|
104
|
+
from: fromUserId,
|
|
105
|
+
space: space
|
|
106
|
+
},
|
|
107
|
+
from: fromUserId,
|
|
108
|
+
to: toUserId
|
|
109
|
+
})];
|
|
110
|
+
case 1:
|
|
111
|
+
_b.sent();
|
|
112
|
+
return [3, 3];
|
|
113
|
+
case 2:
|
|
114
|
+
error_1 = _b.sent();
|
|
115
|
+
console.log('[urgent] sendUrgentNotification notification error', error_1);
|
|
116
|
+
return [3, 3];
|
|
117
|
+
case 3:
|
|
118
|
+
_b.trys.push([3, 15, , 16]);
|
|
119
|
+
return [4, ctx.getObject('space_users').find({
|
|
120
|
+
filters: [['user', '=', toUserId], ['space', '=', space]]
|
|
121
|
+
})];
|
|
122
|
+
case 4:
|
|
123
|
+
spaceUsers = _b.sent();
|
|
124
|
+
_b.label = 5;
|
|
125
|
+
case 5:
|
|
126
|
+
_b.trys.push([5, 12, 13, 14]);
|
|
127
|
+
spaceUsers_1 = tslib_1.__values(spaceUsers), spaceUsers_1_1 = spaceUsers_1.next();
|
|
128
|
+
_b.label = 6;
|
|
129
|
+
case 6:
|
|
130
|
+
if (!!spaceUsers_1_1.done) return [3, 11];
|
|
131
|
+
spaceUser = spaceUsers_1_1.value;
|
|
132
|
+
if (!spaceUser.email) return [3, 10];
|
|
133
|
+
_b.label = 7;
|
|
134
|
+
case 7:
|
|
135
|
+
_b.trys.push([7, 9, , 10]);
|
|
136
|
+
return [4, ctx.broker.call('@builder6/email.send', {
|
|
137
|
+
to: spaceUser.email,
|
|
138
|
+
subject: "[\u52A0\u6025\u5BA1\u6838] ".concat(approvalName),
|
|
139
|
+
html: "\n <p>\u60A8\u6709\u4E00\u4EFD\u5BA1\u6279\u5355\u88AB\u6807\u8BB0\u4E3A<strong>\u52A0\u6025\u5BA1\u6838</strong>\uFF0C\u8BF7\u4F18\u5148\u5904\u7406\u3002</p>\n <a href=\"".concat(process.env.ROOT_URL, "/app/pepsico_content_review/pepsico_material_approval/view/").concat(approvalId, "?side_object=pepsico_material_approval&side_listview_id=pending\">").concat(approvalName, "</a>\n ")
|
|
140
|
+
})];
|
|
141
|
+
case 8:
|
|
142
|
+
_b.sent();
|
|
143
|
+
return [3, 10];
|
|
144
|
+
case 9:
|
|
145
|
+
error_2 = _b.sent();
|
|
146
|
+
console.log('[urgent] sendUrgentNotification email error', error_2);
|
|
147
|
+
return [3, 10];
|
|
148
|
+
case 10:
|
|
149
|
+
spaceUsers_1_1 = spaceUsers_1.next();
|
|
150
|
+
return [3, 6];
|
|
151
|
+
case 11: return [3, 14];
|
|
152
|
+
case 12:
|
|
153
|
+
e_1_1 = _b.sent();
|
|
154
|
+
e_1 = { error: e_1_1 };
|
|
155
|
+
return [3, 14];
|
|
156
|
+
case 13:
|
|
157
|
+
try {
|
|
158
|
+
if (spaceUsers_1_1 && !spaceUsers_1_1.done && (_a = spaceUsers_1.return)) _a.call(spaceUsers_1);
|
|
159
|
+
}
|
|
160
|
+
finally { if (e_1) throw e_1.error; }
|
|
161
|
+
return [7];
|
|
162
|
+
case 14: return [3, 16];
|
|
163
|
+
case 15:
|
|
164
|
+
error_3 = _b.sent();
|
|
165
|
+
console.log('[urgent] sendUrgentNotification spaceUsers error', error_3);
|
|
166
|
+
return [3, 16];
|
|
167
|
+
case 16: return [2];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}); };
|
|
171
|
+
var doUrgent = function (ctx, approvalId, userId) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
172
|
+
var check, approval, _a, year, half, used, total, existingQuota, updateField, pendingApprovers, pendingApprovers_1, pendingApprovers_1_1, approverId, e_2_1, newUsed, newAvailable;
|
|
173
|
+
var _b, e_2, _c;
|
|
174
|
+
return tslib_1.__generator(this, function (_d) {
|
|
175
|
+
switch (_d.label) {
|
|
176
|
+
case 0: return [4, (0, exports.canUrgent)(ctx, approvalId, userId)];
|
|
177
|
+
case 1:
|
|
178
|
+
check = _d.sent();
|
|
179
|
+
if (!check.canUrgent) {
|
|
180
|
+
throw new Error(check.reason);
|
|
181
|
+
}
|
|
182
|
+
return [4, ctx.getObject('pepsico_material_approval').findOne(approvalId)];
|
|
183
|
+
case 2:
|
|
184
|
+
approval = _d.sent();
|
|
185
|
+
_a = check.quota, year = _a.year, half = _a.half, used = _a.used, total = _a.total;
|
|
186
|
+
return [4, ctx.getObject('pepsico_urgent_quota').findOne({
|
|
187
|
+
filters: [['user', '=', userId], ['space', '=', approval.space], ['year', '=', year]]
|
|
188
|
+
})];
|
|
189
|
+
case 3:
|
|
190
|
+
existingQuota = _d.sent();
|
|
191
|
+
if (!existingQuota) {
|
|
192
|
+
throw new Error('未配置加急次数');
|
|
193
|
+
}
|
|
194
|
+
updateField = half === 1 ? 'h1_used' : 'h2_used';
|
|
195
|
+
return [4, ctx.getObject('pepsico_urgent_quota').directUpdate(existingQuota._id, (_b = {},
|
|
196
|
+
_b[updateField] = (existingQuota[updateField] || 0) + 1,
|
|
197
|
+
_b))];
|
|
198
|
+
case 4:
|
|
199
|
+
_d.sent();
|
|
200
|
+
return [4, ctx.getObject('pepsico_material_approval').directUpdate(approvalId, {
|
|
201
|
+
is_urgent: true,
|
|
202
|
+
urgent_times: (approval.urgent_times || 0) + 1,
|
|
203
|
+
urgent_at: new Date()
|
|
204
|
+
})];
|
|
205
|
+
case 5:
|
|
206
|
+
_d.sent();
|
|
207
|
+
return [4, ctx.getObject('pepsico_urgent_log').insert({
|
|
208
|
+
approval: approvalId,
|
|
209
|
+
approval_name: approval.name,
|
|
210
|
+
operator: userId,
|
|
211
|
+
space: approval.space,
|
|
212
|
+
year: year,
|
|
213
|
+
half: half
|
|
214
|
+
})];
|
|
215
|
+
case 6:
|
|
216
|
+
_d.sent();
|
|
217
|
+
pendingApprovers = Array.isArray(approval.person_pending_approve)
|
|
218
|
+
? approval.person_pending_approve
|
|
219
|
+
: [];
|
|
220
|
+
_d.label = 7;
|
|
221
|
+
case 7:
|
|
222
|
+
_d.trys.push([7, 12, 13, 14]);
|
|
223
|
+
pendingApprovers_1 = tslib_1.__values(pendingApprovers), pendingApprovers_1_1 = pendingApprovers_1.next();
|
|
224
|
+
_d.label = 8;
|
|
225
|
+
case 8:
|
|
226
|
+
if (!!pendingApprovers_1_1.done) return [3, 11];
|
|
227
|
+
approverId = pendingApprovers_1_1.value;
|
|
228
|
+
return [4, sendUrgentNotification(ctx, approval.space, approvalId, approval.name, userId, approverId)];
|
|
229
|
+
case 9:
|
|
230
|
+
_d.sent();
|
|
231
|
+
_d.label = 10;
|
|
232
|
+
case 10:
|
|
233
|
+
pendingApprovers_1_1 = pendingApprovers_1.next();
|
|
234
|
+
return [3, 8];
|
|
235
|
+
case 11: return [3, 14];
|
|
236
|
+
case 12:
|
|
237
|
+
e_2_1 = _d.sent();
|
|
238
|
+
e_2 = { error: e_2_1 };
|
|
239
|
+
return [3, 14];
|
|
240
|
+
case 13:
|
|
241
|
+
try {
|
|
242
|
+
if (pendingApprovers_1_1 && !pendingApprovers_1_1.done && (_c = pendingApprovers_1.return)) _c.call(pendingApprovers_1);
|
|
243
|
+
}
|
|
244
|
+
finally { if (e_2) throw e_2.error; }
|
|
245
|
+
return [7];
|
|
246
|
+
case 14:
|
|
247
|
+
newUsed = used + 1;
|
|
248
|
+
newAvailable = Math.max(0, total - newUsed);
|
|
249
|
+
return [2, {
|
|
250
|
+
message: "\u52A0\u6025\u6210\u529F\uFF01\u5DF2\u4F7F\u7528 ".concat(newUsed, " \u6B21\uFF0C\u5269\u4F59 ").concat(newAvailable, " \u6B21"),
|
|
251
|
+
used: newUsed,
|
|
252
|
+
available: newAvailable,
|
|
253
|
+
total: total
|
|
254
|
+
}];
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
}); };
|
|
258
|
+
exports.doUrgent = doUrgent;
|
|
259
|
+
//# sourceMappingURL=urgent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urgent.js","sourceRoot":"","sources":["../../src/methods/urgent.ts"],"names":[],"mappings":";;;;AAMA,mCAAkD;AAElD,IAAM,eAAe,GAAG,CAAC,CAAC;AAcnB,IAAM,cAAc,GAAG,UAAO,GAAG,EAAE,MAAc,EAAE,KAAa;;;;;gBAC7D,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;gBACjB,IAAI,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;gBACzB,IAAI,GAAG,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAE1B,WAAM,GAAG,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC;wBAC9D,OAAO,EAAE,CAAC,CAAC,MAAM,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AAC,KAAK;wBACrB,IAAI,MAAA;wBACJ,IAAI,MAAA;qBACP,CAAC,EAAA;;gBAPF,SAOE,CAAC;gBAGG,gBAAgB,GAAa,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC;oBAC7E,CAAC,CAAC,QAAQ,CAAC,sBAAsB;oBACjC,CAAC,CAAC,EAAE,CAAC;;;;gBAEgB,qBAAA,iBAAA,gBAAgB,CAAA;;;;gBAA9B,UAAU;gBACjB,WAAM,sBAAsB,CAAC,GAAG,EAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAA;;gBAAhG,SAAgG,CAAC;;;;;;;;;;;;;;;;;gBAI/F,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC;gBACnB,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,CAAC;gBAElD,WAAO;wBACH,OAAO,EAAE,2DAAY,OAAO,uCAAS,YAAY,YAAI;wBACrD,IAAI,EAAE,OAAO;wBACb,SAAS,EAAE,YAAY;wBACvB,KAAK,OAAA;qBACR,EAAC;;;KACL,CAAC;AA/DW,QAAA,QAAQ,YA+DnB"}
|
|
@@ -4,7 +4,7 @@ columns:
|
|
|
4
4
|
width: '400'
|
|
5
5
|
wrap: true
|
|
6
6
|
amis:
|
|
7
|
-
classNameExpr: "${is_urgent ? 'color-priority-danger' : ((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) ? 'color-priority-postponed' : '')}"
|
|
7
|
+
classNameExpr: "${is_urgent ? 'color-priority-danger' : (((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) || (postpone_marker_users && postpone_marker_users.length > 0 && (ARRAYINCLUDES(postpone_marker_users, context.userId) || owner == context.userId || context.user.profile == 'admin'))) ? 'color-priority-postponed' : '')}"
|
|
8
8
|
- field: owner
|
|
9
9
|
wrap: false
|
|
10
10
|
- field: owner_department
|
|
@@ -61,6 +61,7 @@ type: grid
|
|
|
61
61
|
extra_columns:
|
|
62
62
|
- is_urgent
|
|
63
63
|
- review_postponed_users
|
|
64
|
+
- postpone_marker_users
|
|
64
65
|
crudDataFilter: |
|
|
65
|
-
crud.rowClassNameExpr = "${is_urgent ? 'color-priority-danger' : ((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) ? 'color-priority-postponed' : '')}";
|
|
66
|
+
crud.rowClassNameExpr = "${is_urgent ? 'color-priority-danger' : (((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) || (postpone_marker_users && postpone_marker_users.length > 0 && (ARRAYINCLUDES(postpone_marker_users, context.userId) || owner == context.userId || context.user.profile == 'admin'))) ? 'color-priority-postponed' : '')}";
|
|
66
67
|
return crud;
|
|
@@ -4,7 +4,7 @@ columns:
|
|
|
4
4
|
wrap: true
|
|
5
5
|
width: '400'
|
|
6
6
|
amis:
|
|
7
|
-
classNameExpr: "${is_urgent ? 'color-priority-danger' : ((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) ? 'color-priority-postponed' : '')}"
|
|
7
|
+
classNameExpr: "${is_urgent ? 'color-priority-danger' : (((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) || (postpone_marker_users && postpone_marker_users.length > 0 && (ARRAYINCLUDES(postpone_marker_users, context.userId) || owner == context.userId || context.user.profile == 'admin'))) ? 'color-priority-postponed' : '')}"
|
|
8
8
|
- field: current_step
|
|
9
9
|
- field: person_pending_approve
|
|
10
10
|
- field: draft_submitted
|
|
@@ -76,6 +76,7 @@ type: grid
|
|
|
76
76
|
extra_columns:
|
|
77
77
|
- is_urgent
|
|
78
78
|
- review_postponed_users
|
|
79
|
+
- postpone_marker_users
|
|
79
80
|
crudDataFilter: |
|
|
80
|
-
crud.rowClassNameExpr = "${is_urgent ? 'color-priority-danger' : ((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) ? 'color-priority-postponed' : '')}";
|
|
81
|
+
crud.rowClassNameExpr = "${is_urgent ? 'color-priority-danger' : (((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) || (postpone_marker_users && postpone_marker_users.length > 0 && (ARRAYINCLUDES(postpone_marker_users, context.userId) || owner == context.userId || context.user.profile == 'admin'))) ? 'color-priority-postponed' : '')}";
|
|
81
82
|
return crud;
|
|
@@ -4,7 +4,7 @@ columns:
|
|
|
4
4
|
wrap: true
|
|
5
5
|
width: '400'
|
|
6
6
|
amis:
|
|
7
|
-
classNameExpr: "${is_urgent ? 'color-priority-danger' : ((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) ? 'color-priority-postponed' : '')}"
|
|
7
|
+
classNameExpr: "${is_urgent ? 'color-priority-danger' : (((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) || (postpone_marker_users && postpone_marker_users.length > 0 && (ARRAYINCLUDES(postpone_marker_users, context.userId) || owner == context.userId || context.user.profile == 'admin'))) ? 'color-priority-postponed' : '')}"
|
|
8
8
|
- field: current_step
|
|
9
9
|
- field: person_pending_approve
|
|
10
10
|
- field: draft_submitted
|
|
@@ -89,6 +89,7 @@ extra_columns:
|
|
|
89
89
|
- is_urgent
|
|
90
90
|
- owner
|
|
91
91
|
- review_postponed_users
|
|
92
|
+
- postpone_marker_users
|
|
92
93
|
crudDataFilter: |
|
|
93
|
-
crud.rowClassNameExpr = "${is_urgent ? 'color-priority-danger' : ((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) ? 'color-priority-postponed' : '')}";
|
|
94
|
+
crud.rowClassNameExpr = "${is_urgent ? 'color-priority-danger' : (((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) || (postpone_marker_users && postpone_marker_users.length > 0 && (ARRAYINCLUDES(postpone_marker_users, context.userId) || owner == context.userId || context.user.profile == 'admin'))) ? 'color-priority-postponed' : '')}";
|
|
94
95
|
return crud;
|
package/main/default/objects/pepsico_material_approval/listviews/handle_postpone.listview.yml
CHANGED
|
@@ -4,7 +4,7 @@ columns:
|
|
|
4
4
|
wrap: true
|
|
5
5
|
width: '400'
|
|
6
6
|
amis:
|
|
7
|
-
classNameExpr: "${is_urgent ? 'color-priority-danger' : ((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) ? 'color-priority-postponed' : '')}"
|
|
7
|
+
classNameExpr: "${is_urgent ? 'color-priority-danger' : (((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) || (postpone_marker_users && postpone_marker_users.length > 0 && (ARRAYINCLUDES(postpone_marker_users, context.userId) || owner == context.userId || context.user.profile == 'admin'))) ? 'color-priority-postponed' : '')}"
|
|
8
8
|
- field: current_step
|
|
9
9
|
- field: person_pending_approve
|
|
10
10
|
- field: draft_submitted
|
|
@@ -89,6 +89,7 @@ extra_columns:
|
|
|
89
89
|
- is_urgent
|
|
90
90
|
- owner
|
|
91
91
|
- review_postponed_users
|
|
92
|
+
- postpone_marker_users
|
|
92
93
|
crudDataFilter: |
|
|
93
|
-
crud.rowClassNameExpr = "${is_urgent ? 'color-priority-danger' : ((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) ? 'color-priority-postponed' : '')}";
|
|
94
|
+
crud.rowClassNameExpr = "${is_urgent ? 'color-priority-danger' : (((review_postponed_users && review_postponed_users.length > 0 && (ARRAYINCLUDES(review_postponed_users, context.userId) || owner == context.userId || context.user.profile == 'admin')) || (postpone_marker_users && postpone_marker_users.length > 0 && (ARRAYINCLUDES(postpone_marker_users, context.userId) || owner == context.userId || context.user.profile == 'admin'))) ? 'color-priority-postponed' : '')}";
|
|
94
95
|
return crud;
|