@opencrvs/toolkit 2.0.0-rc.7bafd95 → 2.0.0-rc.7be4902

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.
@@ -324,7 +324,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
324
324
  // ../commons/src/events/FieldValue.ts
325
325
  var TextValue = z7.string();
326
326
  var HiddenFieldValue = z7.string();
327
- var NonEmptyTextValue = TextValue.min(1);
327
+ var NonEmptyTextValue = z7.string().trim().min(1);
328
328
  var DateValue = z7.iso.date().describe("Date in the format YYYY-MM-DD");
329
329
  var AgeValue = z7.object({
330
330
  age: z7.number(),
@@ -690,7 +690,7 @@ export declare const isHiddenFieldType: (field: {
690
690
  value: undefined;
691
691
  config: HiddenField;
692
692
  };
693
- export type NonInteractiveFieldType = Divider | PageHeader | ImageViewField | Paragraph | Heading | BulletList | DataField | AlphaPrintButton | HttpField | LinkButtonField | QueryParamReaderField | LoaderField | AutocompleteField;
693
+ export type NonInteractiveFieldType = Divider | PageHeader | ImageViewField | Paragraph | Heading | BulletList | DataField | AlphaPrintButton | LinkButtonField | LoaderField | AutocompleteField;
694
694
  export type InteractiveFieldType = Exclude<FieldConfig, NonInteractiveFieldType>;
695
695
  export declare const isNonInteractiveFieldType: (field: FieldConfig) => field is NonInteractiveFieldType;
696
696
  export {};
@@ -1345,7 +1345,7 @@ function plainDateToLocalDate(date) {
1345
1345
  // ../commons/src/events/FieldValue.ts
1346
1346
  var TextValue = z12.string();
1347
1347
  var HiddenFieldValue = z12.string();
1348
- var NonEmptyTextValue = TextValue.min(1);
1348
+ var NonEmptyTextValue = z12.string().trim().min(1);
1349
1349
  var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
1350
1350
  var AgeValue = z12.object({
1351
1351
  age: z12.number(),
@@ -3908,7 +3908,7 @@ var isHiddenFieldType = (field3) => {
3908
3908
  return field3.config.type === FieldType.ALPHA_HIDDEN;
3909
3909
  };
3910
3910
  var isNonInteractiveFieldType = (field3) => {
3911
- return field3.type === FieldType.DIVIDER || field3.type === FieldType.PAGE_HEADER || field3.type === FieldType.PARAGRAPH || field3.type === FieldType.HEADING || field3.type === FieldType.BULLET_LIST || field3.type === FieldType.DATA || field3.type === FieldType.ALPHA_PRINT_BUTTON || field3.type === FieldType.HTTP || field3.type === FieldType.LINK_BUTTON || field3.type === FieldType.QUERY_PARAM_READER || field3.type === FieldType.LOADER;
3911
+ return field3.type === FieldType.DIVIDER || field3.type === FieldType.PAGE_HEADER || field3.type === FieldType.PARAGRAPH || field3.type === FieldType.HEADING || field3.type === FieldType.BULLET_LIST || field3.type === FieldType.DATA || field3.type === FieldType.ALPHA_PRINT_BUTTON || field3.type === FieldType.LINK_BUTTON || field3.type === FieldType.LOADER;
3912
3912
  };
3913
3913
 
3914
3914
  // ../commons/src/conditionals/validate.ts
@@ -10623,18 +10623,19 @@ var ACTION_FILTERS = {
10623
10623
  function filterActionsByFlags(actions, flags) {
10624
10624
  return actions.filter((action) => ACTION_FILTERS[action]?.(flags) ?? true);
10625
10625
  }
10626
+ var REJECTED_ACTIONS = [
10627
+ ActionType.READ,
10628
+ ActionType.NOTIFY,
10629
+ ActionType.CUSTOM,
10630
+ ActionType.EDIT,
10631
+ ActionType.ARCHIVE
10632
+ ];
10626
10633
  function getAvailableActionsWithoutFlagFilters(status2, flags) {
10627
10634
  if (flags.includes(InherentFlags.EDIT_IN_PROGRESS)) {
10628
10635
  return [ActionType.NOTIFY, ActionType.DECLARE, ActionType.REGISTER];
10629
10636
  }
10630
- if (flags.includes(InherentFlags.REJECTED)) {
10631
- return [
10632
- ActionType.READ,
10633
- ActionType.NOTIFY,
10634
- ActionType.CUSTOM,
10635
- ActionType.EDIT,
10636
- ActionType.ARCHIVE
10637
- ];
10637
+ if (flags.includes(InherentFlags.REJECTED) && status2 !== EventStatus.enum.ARCHIVED) {
10638
+ return REJECTED_ACTIONS;
10638
10639
  }
10639
10640
  return AVAILABLE_ACTIONS_BY_EVENT_STATUS[status2];
10640
10641
  }
@@ -888,7 +888,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
888
888
  // ../commons/src/events/FieldValue.ts
889
889
  var TextValue = z12.string();
890
890
  var HiddenFieldValue = z12.string();
891
- var NonEmptyTextValue = TextValue.min(1);
891
+ var NonEmptyTextValue = z12.string().trim().min(1);
892
892
  var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
893
893
  var AgeValue = z12.object({
894
894
  age: z12.number(),
@@ -7241,6 +7241,13 @@ var ACTION_FILTERS = {
7241
7241
  [ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
7242
7242
  [ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
7243
7243
  };
7244
+ var REJECTED_ACTIONS = [
7245
+ ActionType.READ,
7246
+ ActionType.NOTIFY,
7247
+ ActionType.CUSTOM,
7248
+ ActionType.EDIT,
7249
+ ActionType.ARCHIVE
7250
+ ];
7244
7251
 
7245
7252
  // ../commons/src/events/FileUtils.ts
7246
7253
  var import_lodash7 = require("lodash");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "2.0.0-rc.7bafd95",
3
+ "version": "2.0.0-rc.7be4902",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "bin": {