tango-app-api-trax 3.8.15 → 3.8.16
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/package.json
CHANGED
|
@@ -3412,7 +3412,16 @@ export async function getStoreTaskDetails( req, res ) {
|
|
|
3412
3412
|
|
|
3413
3413
|
export async function runAIFlag( req, res ) {
|
|
3414
3414
|
try {
|
|
3415
|
-
let checklistDetails = await CLconfig.find( {
|
|
3415
|
+
let checklistDetails = await CLconfig.find( {
|
|
3416
|
+
publish: true,
|
|
3417
|
+
runAIQuestionCount: { $ne: 0 },
|
|
3418
|
+
$expr: {
|
|
3419
|
+
$gt: [
|
|
3420
|
+
{ $size: { $cond: [ { $isArray: '$notifyFlags.notifyType' }, '$notifyFlags.notifyType', [] ] } },
|
|
3421
|
+
0,
|
|
3422
|
+
],
|
|
3423
|
+
},
|
|
3424
|
+
}, { _id: 1, notifyFlags: 1, approver: 1 } );
|
|
3416
3425
|
let date = dayjs().subtract( 1, 'day' ).format( 'YYYY-MM-DD' );
|
|
3417
3426
|
if ( checklistDetails.length ) {
|
|
3418
3427
|
await Promise.all( checklistDetails.map( async ( ele ) => {
|
|
@@ -3422,7 +3431,7 @@ export async function runAIFlag( req, res ) {
|
|
|
3422
3431
|
let runAIFlag = 0;
|
|
3423
3432
|
store.questionAnswers.forEach( ( section ) => {
|
|
3424
3433
|
section.questions.forEach( ( question ) => {
|
|
3425
|
-
if ( question.answerType == 'image' && ( question?.userAnswer?.[0]?.runAIData
|
|
3434
|
+
if ( question.answerType == 'image' && ( question?.userAnswer?.[0]?.runAIData?.value == 'False' || !question?.userAnswer?.[0]?.runAIData?.value ) ) {
|
|
3426
3435
|
runAIFlag++;
|
|
3427
3436
|
}
|
|
3428
3437
|
} );
|
|
@@ -196,8 +196,8 @@
|
|
|
196
196
|
{{!-- <span class="q-ans {{#if this.isYes}}ans-yes{{else}}{{#if this.isNo}}ans-no{{/if}}{{/if}}">{{#if this.isYes}}✓ Yes{{else}}{{#if this.isNo}}✗ No{{else}}{{this.answerDisplay}}{{/if}}{{/if}}</span> --}}
|
|
197
197
|
{{#if this.userAnswer.length}}
|
|
198
198
|
<div class="q-answer-list">
|
|
199
|
+
{{!-- text/video answers render per userAnswer above the table --}}
|
|
199
200
|
{{#each this.userAnswer}}
|
|
200
|
-
<div class="q-answer-item">
|
|
201
201
|
{{#eq this.answerType 'text'}}
|
|
202
202
|
{{#if this.answer}}
|
|
203
203
|
<div class="q-answer-text {{#if this.sopFlag}}flagged{{/if}}">{{this.answer}}</div>
|
|
@@ -211,62 +211,64 @@
|
|
|
211
211
|
</div>
|
|
212
212
|
{{/if}}
|
|
213
213
|
{{/eq}}
|
|
214
|
+
{{/each}}
|
|
214
215
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
{{/
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
216
|
+
{{!-- Single 50/50 table per question: references rendered once on the left,
|
|
217
|
+
all uploaded/validation images stacked on the right --}}
|
|
218
|
+
<table style="width:100%;margin-top:8px"><tr>
|
|
219
|
+
{{#if this.userAnswer.[0].multiReferenceImage.length}}
|
|
220
|
+
<td style="width:50%;vertical-align:top;padding-right:8px">
|
|
221
|
+
<div class="q-answer-caption">Reference Image</div>
|
|
222
|
+
{{#each this.userAnswer.[0].multiReferenceImage}}
|
|
223
|
+
<img src="{{this}}" alt="Reference Image" />
|
|
224
|
+
{{/each}}
|
|
225
|
+
</td>
|
|
226
|
+
{{else}}
|
|
227
|
+
{{#if this.userAnswer.[0].referenceImage}}
|
|
228
|
+
<td style="width:50%;vertical-align:top;padding-right:8px">
|
|
229
|
+
<div class="q-answer-caption">Reference Image</div>
|
|
230
|
+
<img src="{{this.userAnswer.[0].referenceImage}}" alt="Reference Image" />
|
|
231
|
+
</td>
|
|
232
|
+
{{/if}}
|
|
233
|
+
{{/if}}
|
|
234
|
+
<td style="vertical-align:top">
|
|
235
|
+
{{#each this.userAnswer}}
|
|
236
|
+
{{#eq this.answerType 'image'}}
|
|
237
|
+
{{#if this.answer}}
|
|
238
|
+
<div class="q-answer-caption">Uploaded Image</div>
|
|
239
|
+
<img src="{{this.answer}}" alt="Uploaded Image" />
|
|
240
|
+
{{/if}}
|
|
241
|
+
{{/eq}}
|
|
242
|
+
{{#if this.validation}}
|
|
243
|
+
{{#eq this.validationDisplayType 'image'}}
|
|
244
|
+
{{#if this.validationAnswer}}
|
|
245
|
+
<div class="q-answer-caption">Validation Image</div>
|
|
246
|
+
<img src="{{this.validationAnswer}}" alt="Validation Image" />
|
|
237
247
|
{{/if}}
|
|
238
248
|
{{/eq}}
|
|
239
|
-
{{#
|
|
240
|
-
{{#
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
{{#
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
{{
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
{{/
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
{{/each}}
|
|
263
|
-
{{/if}}
|
|
264
|
-
{{/eq}}
|
|
265
|
-
{{/if}}
|
|
266
|
-
</td>
|
|
267
|
-
</tr></table>
|
|
268
|
-
</div>
|
|
269
|
-
{{/each}}
|
|
249
|
+
{{#eq this.validationDisplayType 'video'}}
|
|
250
|
+
{{#if this.validationAnswer}}
|
|
251
|
+
<div class="q-answer-caption">Validation Video</div>
|
|
252
|
+
<a class="q-answer-link" href="{{this.validationAnswer}}" target="_blank">{{this.validationAnswer}}</a>
|
|
253
|
+
{{/if}}
|
|
254
|
+
{{/eq}}
|
|
255
|
+
{{#eq this.validationDisplayType 'text'}}
|
|
256
|
+
{{#if this.validationAnswer}}
|
|
257
|
+
<div class="q-answer-text">{{this.validationAnswer}}</div>
|
|
258
|
+
{{/if}}
|
|
259
|
+
{{/eq}}
|
|
260
|
+
{{#eq this.validationDisplayType 'multiImage'}}
|
|
261
|
+
{{#if this.validationImage.length}}
|
|
262
|
+
<div class="q-answer-caption">Validation Image</div>
|
|
263
|
+
{{#each this.validationImage}}
|
|
264
|
+
<img src="{{this}}" alt="Validation Image" />
|
|
265
|
+
{{/each}}
|
|
266
|
+
{{/if}}
|
|
267
|
+
{{/eq}}
|
|
268
|
+
{{/if}}
|
|
269
|
+
{{/each}}
|
|
270
|
+
</td>
|
|
271
|
+
</tr></table>
|
|
270
272
|
</div>
|
|
271
273
|
{{/if}}
|
|
272
274
|
{{#if this.remarks}}
|