@01-edu/shared 1.1.6 → 1.1.8

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/attrs-defs.js CHANGED
@@ -209,6 +209,7 @@ const autoRejectWhereLabel = `Automatic reject if`
209
209
  const sharedAutoValidationOperator = action => ({
210
210
  type: 'string',
211
211
  restrictive: true,
212
+ editable: true,
212
213
  label: `${action} - number of conditions to fulfil`,
213
214
  ...Functions({ all: () => 'and', one: () => 'or' }),
214
215
  })
@@ -293,11 +294,6 @@ types.autoRejectWhereConditions = Object.fromEntries(
293
294
  description: `Condition relative to ${breath(
294
295
  parameter,
295
296
  )} of the candidate.`,
296
- check: condition => {
297
- if (isntObjectOrIsEmpty(condition)) {
298
- throw Error('expect to contain a comparison.')
299
- }
300
- },
301
297
  type: {
302
298
  '<': Literal(shouldFailUnder, {
303
299
  label: 'is lower than',
@@ -321,11 +317,6 @@ attrs.autoRejectWhere = {
321
317
  label: autoRejectWhereLabel,
322
318
  instruction: 'List of conditions to automatically reject an application',
323
319
  type: types.autoRejectWhereConditions,
324
- check: autoRejectWhere => {
325
- if (isntObjectOrIsEmpty(autoRejectWhere)) {
326
- throw Error('expect to contain at least one condition.')
327
- }
328
- },
329
320
  },
330
321
  }
331
322
 
@@ -350,11 +341,6 @@ types.autoValidateWhereConditions = Object.fromEntries(
350
341
  description: `Condition relative to ${breath(
351
342
  parameter,
352
343
  )} of the candidate.`,
353
- check: condition => {
354
- if (isntObjectOrIsEmpty(condition)) {
355
- throw Error('expect to contain at least one condition.')
356
- }
357
- },
358
344
  type: {
359
345
  '>': Literal(shouldSucceedFrom, {
360
346
  label: 'is bigger than',
@@ -378,11 +364,6 @@ attrs.autoValidateWhere = {
378
364
  label: autoValidateWhereLabel,
379
365
  instruction: 'List of conditions to automatically accept an application',
380
366
  type: types.autoValidateWhereConditions,
381
- check: autoValidateWhere => {
382
- if (isntObjectOrIsEmpty(autoValidateWhere)) {
383
- throw Error('expect to contain at least one condition.')
384
- }
385
- },
386
367
  },
387
368
  }
388
369
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@01-edu/shared",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "scripts": {
package/toolbox.js CHANGED
@@ -491,12 +491,12 @@ export const timePlusDelay = (time, delay) =>
491
491
  new Date(new Date(time).getTime() + delay).toISOString()
492
492
 
493
493
  export const getRecordStatus = record => {
494
- if (!isFinished(record.startAt)) return 'starting soon'
495
- if (record.endAt && isFinished(record.endAt)) {
494
+ if (!isFinished(record?.startAt)) return 'starting soon'
495
+ if (record?.endAt && isFinished(record?.endAt)) {
496
496
  return 'finished'
497
497
  }
498
- if (record.type.isPermanent) return 'permanent'
499
- return record.endAt ? 'in progress' : 'unblock required'
498
+ if (record?.type.isPermanent) return 'permanent'
499
+ return record?.endAt ? 'in progress' : 'unblock required'
500
500
  }
501
501
 
502
502
  export const createFrequencyMap = arr =>