@opencrvs/toolkit 2.0.0-rc.b2f052c → 2.0.0-rc.b3014dd
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/application-config/index.js +8 -1
- package/dist/cli.js +1 -1
- package/dist/commons/api/router.d.ts +13 -2
- package/dist/commons/events/ActionConfig.d.ts +227 -2
- package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
- package/dist/commons/events/EventIndex.d.ts +14 -0
- package/dist/commons/events/FieldConfig.d.ts +1 -0
- package/dist/commons/events/FieldType.d.ts +1 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +1 -1
- package/dist/commons/events/WorkqueueConfig.d.ts +39 -0
- package/dist/events/index.js +228 -62
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +1 -1
- package/dist/migrations/v2.0/index.js +1 -1
- package/dist/notification/index.js +171 -3
- package/opencrvs-toolkit-2.0.0-rc.b3014dd.tgz +0 -0
- package/package.json +1 -1
- package/opencrvs-toolkit-2.0.0-rc.b2f052c.tgz +0 -0
package/dist/events/index.js
CHANGED
|
@@ -151,6 +151,7 @@ __export(events_exports, {
|
|
|
151
151
|
FormPageConfig: () => FormPageConfig,
|
|
152
152
|
Fuzzy: () => Fuzzy,
|
|
153
153
|
GeographicalArea: () => GeographicalArea,
|
|
154
|
+
HiddenFieldTypes: () => HiddenFieldTypes,
|
|
154
155
|
HiddenFieldValue: () => HiddenFieldValue,
|
|
155
156
|
HttpFieldUpdateValue: () => HttpFieldUpdateValue,
|
|
156
157
|
HttpFieldValue: () => HttpFieldValue,
|
|
@@ -1219,6 +1220,11 @@ var FieldTypesToHideInReview = [
|
|
|
1219
1220
|
FieldType.ALPHA_PRINT_BUTTON,
|
|
1220
1221
|
FieldType.ALPHA_HIDDEN
|
|
1221
1222
|
];
|
|
1223
|
+
var HiddenFieldTypes = [
|
|
1224
|
+
FieldType.HTTP,
|
|
1225
|
+
FieldType.QUERY_PARAM_READER,
|
|
1226
|
+
FieldType.ALPHA_HIDDEN
|
|
1227
|
+
];
|
|
1222
1228
|
|
|
1223
1229
|
// ../commons/src/events/FieldValue.ts
|
|
1224
1230
|
var z12 = __toESM(require("zod/v4"));
|
|
@@ -2017,7 +2023,8 @@ var Range = import_v4.z.object({
|
|
|
2017
2023
|
});
|
|
2018
2024
|
var ContainsFlags = import_v4.z.object({
|
|
2019
2025
|
anyOf: import_v4.z.array(Flag).optional(),
|
|
2020
|
-
noneOf: import_v4.z.array(Flag).optional()
|
|
2026
|
+
noneOf: import_v4.z.array(Flag).optional(),
|
|
2027
|
+
allOf: import_v4.z.array(Flag).optional()
|
|
2021
2028
|
}).meta({
|
|
2022
2029
|
id: "ContainsFlags"
|
|
2023
2030
|
});
|
|
@@ -2292,6 +2299,7 @@ var NumberField = BaseField.extend({
|
|
|
2292
2299
|
configuration: import_v43.default.object({
|
|
2293
2300
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
2294
2301
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
2302
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
2295
2303
|
prefix: TranslationConfig.optional(),
|
|
2296
2304
|
postfix: TranslationConfig.optional()
|
|
2297
2305
|
}).optional()
|
|
@@ -3215,6 +3223,43 @@ var ReadActionConfig = ActionConfigBase.extend(
|
|
|
3215
3223
|
conditionals: z24.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
|
|
3216
3224
|
}).shape
|
|
3217
3225
|
);
|
|
3226
|
+
var NotifyConfig = ActionConfigBase.extend(
|
|
3227
|
+
z24.object({
|
|
3228
|
+
type: z24.literal(ActionType.NOTIFY)
|
|
3229
|
+
}).shape
|
|
3230
|
+
);
|
|
3231
|
+
var DuplicateDetectedConfig = z24.object({
|
|
3232
|
+
type: z24.literal(ActionType.DUPLICATE_DETECTED),
|
|
3233
|
+
flags: ActionConfigBase.shape.flags,
|
|
3234
|
+
conditionals: z24.never().optional().describe(
|
|
3235
|
+
"DUPLICATE_DETECTED is system-generated and never shown as a button, so it cannot be disabled or hidden with conditionals."
|
|
3236
|
+
)
|
|
3237
|
+
});
|
|
3238
|
+
var MarkAsDuplicateConfig = ActionConfigBase.extend(
|
|
3239
|
+
z24.object({
|
|
3240
|
+
type: z24.literal(ActionType.MARK_AS_DUPLICATE)
|
|
3241
|
+
}).shape
|
|
3242
|
+
);
|
|
3243
|
+
var MarkAsNotDuplicateConfig = ActionConfigBase.extend(
|
|
3244
|
+
z24.object({
|
|
3245
|
+
type: z24.literal(ActionType.MARK_AS_NOT_DUPLICATE)
|
|
3246
|
+
}).shape
|
|
3247
|
+
);
|
|
3248
|
+
var AssignConfig = ActionConfigBase.extend(
|
|
3249
|
+
z24.object({
|
|
3250
|
+
type: z24.literal(ActionType.ASSIGN)
|
|
3251
|
+
}).shape
|
|
3252
|
+
);
|
|
3253
|
+
var UnassignConfig = ActionConfigBase.extend(
|
|
3254
|
+
z24.object({
|
|
3255
|
+
type: z24.literal(ActionType.UNASSIGN)
|
|
3256
|
+
}).shape
|
|
3257
|
+
);
|
|
3258
|
+
var DeleteConfig = ActionConfigBase.extend(
|
|
3259
|
+
z24.object({
|
|
3260
|
+
type: z24.literal(ActionType.DELETE)
|
|
3261
|
+
}).shape
|
|
3262
|
+
);
|
|
3218
3263
|
var DeclareConfig = DeclarationActionBase.extend(
|
|
3219
3264
|
z24.object({
|
|
3220
3265
|
type: z24.literal(ActionType.DECLARE),
|
|
@@ -3277,6 +3322,16 @@ var RequestCorrectionConfig = ActionConfigBase.extend(
|
|
|
3277
3322
|
correctionForm: ActionFormConfig
|
|
3278
3323
|
}).shape
|
|
3279
3324
|
);
|
|
3325
|
+
var ApproveCorrectionConfig = ActionConfigBase.extend(
|
|
3326
|
+
z24.object({
|
|
3327
|
+
type: z24.literal(ActionType.APPROVE_CORRECTION)
|
|
3328
|
+
}).shape
|
|
3329
|
+
);
|
|
3330
|
+
var RejectCorrectionConfig = ActionConfigBase.extend(
|
|
3331
|
+
z24.object({
|
|
3332
|
+
type: z24.literal(ActionType.REJECT_CORRECTION)
|
|
3333
|
+
}).shape
|
|
3334
|
+
);
|
|
3280
3335
|
var CustomActionConfig = ActionConfigBase.merge(
|
|
3281
3336
|
z24.object({
|
|
3282
3337
|
type: z24.literal(ActionType.CUSTOM),
|
|
@@ -3299,9 +3354,37 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
3299
3354
|
id: "ReadActionConfig",
|
|
3300
3355
|
description: "Configuration for the read action \u2014 defines the record-tab content displayed on the event overview page."
|
|
3301
3356
|
}),
|
|
3357
|
+
AssignConfig.meta({
|
|
3358
|
+
id: "AssignActionConfig",
|
|
3359
|
+
description: "Configuration for assigning a record to the current user."
|
|
3360
|
+
}),
|
|
3361
|
+
UnassignConfig.meta({
|
|
3362
|
+
id: "UnassignActionConfig",
|
|
3363
|
+
description: "Configuration for unassigning a record from its current assignee."
|
|
3364
|
+
}),
|
|
3365
|
+
DeleteConfig.meta({
|
|
3366
|
+
id: "DeleteActionConfig",
|
|
3367
|
+
description: "Configuration for deleting a draft record."
|
|
3368
|
+
}),
|
|
3369
|
+
NotifyConfig.meta({
|
|
3370
|
+
id: "NotifyActionConfig",
|
|
3371
|
+
description: "Configuration for the notify action. When present, NOTIFY uses this config independently from DECLARE. When absent, NOTIFY falls back to the DeclareActionConfig."
|
|
3372
|
+
}),
|
|
3302
3373
|
DeclareConfig.meta({
|
|
3303
3374
|
id: "DeclareActionConfig",
|
|
3304
|
-
description: "Configuration for the declare action. Includes review-page fields.
|
|
3375
|
+
description: "Configuration for the declare action. Includes review-page fields. NOTIFY falls back to this config when no dedicated NotifyActionConfig is provided."
|
|
3376
|
+
}),
|
|
3377
|
+
DuplicateDetectedConfig.meta({
|
|
3378
|
+
id: "DuplicateDetectedActionConfig",
|
|
3379
|
+
description: "Configuration for the system-generated duplicate-detection action. Never shown as a button, so it only supports flags \u2014 not label, icon, or conditionals."
|
|
3380
|
+
}),
|
|
3381
|
+
MarkAsDuplicateConfig.meta({
|
|
3382
|
+
id: "MarkAsDuplicateActionConfig",
|
|
3383
|
+
description: "Configuration for marking a record as a duplicate."
|
|
3384
|
+
}),
|
|
3385
|
+
MarkAsNotDuplicateConfig.meta({
|
|
3386
|
+
id: "MarkAsNotDuplicateActionConfig",
|
|
3387
|
+
description: "Configuration for marking a record as not a duplicate, after it was previously flagged as one."
|
|
3305
3388
|
}),
|
|
3306
3389
|
RejectConfig.meta({
|
|
3307
3390
|
id: "RejectActionConfig",
|
|
@@ -3319,6 +3402,14 @@ var ActionConfig = z24.discriminatedUnion("type", [
|
|
|
3319
3402
|
id: "RequestCorrectionActionConfig",
|
|
3320
3403
|
description: "Configuration for requesting a correction on a registered record."
|
|
3321
3404
|
}),
|
|
3405
|
+
ApproveCorrectionConfig.meta({
|
|
3406
|
+
id: "ApproveCorrectionActionConfig",
|
|
3407
|
+
description: "Configuration for approving a requested correction."
|
|
3408
|
+
}),
|
|
3409
|
+
RejectCorrectionConfig.meta({
|
|
3410
|
+
id: "RejectCorrectionActionConfig",
|
|
3411
|
+
description: "Configuration for rejecting a requested correction."
|
|
3412
|
+
}),
|
|
3322
3413
|
EditActionConfig.meta({
|
|
3323
3414
|
id: "EditActionConfig",
|
|
3324
3415
|
description: "Configuration for editing a record before registration."
|
|
@@ -3908,7 +3999,7 @@ var isHiddenFieldType = (field3) => {
|
|
|
3908
3999
|
return field3.config.type === FieldType.ALPHA_HIDDEN;
|
|
3909
4000
|
};
|
|
3910
4001
|
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.
|
|
4002
|
+
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
4003
|
};
|
|
3913
4004
|
|
|
3914
4005
|
// ../commons/src/conditionals/validate.ts
|
|
@@ -4470,13 +4561,13 @@ function getActionConfig({
|
|
|
4470
4561
|
actionType,
|
|
4471
4562
|
customActionType
|
|
4472
4563
|
}) {
|
|
4564
|
+
if (actionType === ActionType.NOTIFY) {
|
|
4565
|
+
return eventConfiguration.actions.find((a) => a.type === ActionType.NOTIFY) ?? eventConfiguration.actions.find((a) => a.type === ActionType.DECLARE);
|
|
4566
|
+
}
|
|
4473
4567
|
return eventConfiguration.actions.find((a) => {
|
|
4474
4568
|
if (a.type === ActionType.CUSTOM && customActionType) {
|
|
4475
4569
|
return a.customActionType === customActionType;
|
|
4476
4570
|
}
|
|
4477
|
-
if (actionType === ActionType.NOTIFY) {
|
|
4478
|
-
return a.type === ActionType.DECLARE;
|
|
4479
|
-
}
|
|
4480
4571
|
if (actionType === ActionType.APPROVE_CORRECTION || actionType === ActionType.REJECT_CORRECTION) {
|
|
4481
4572
|
return a.type === ActionType.REQUEST_CORRECTION;
|
|
4482
4573
|
}
|
|
@@ -4513,7 +4604,7 @@ var getActionAnnotationFields = (actionConfig) => {
|
|
|
4513
4604
|
if (actionConfig.type === ActionType.CUSTOM) {
|
|
4514
4605
|
return actionConfig.form;
|
|
4515
4606
|
}
|
|
4516
|
-
if ("review" in actionConfig) {
|
|
4607
|
+
if ("review" in actionConfig && actionConfig.review != null) {
|
|
4517
4608
|
return actionConfig.review.fields;
|
|
4518
4609
|
}
|
|
4519
4610
|
return [];
|
|
@@ -6485,6 +6576,8 @@ var updateActions = ActionTypes.extract([
|
|
|
6485
6576
|
ActionType.ARCHIVE,
|
|
6486
6577
|
ActionType.PRINT_CERTIFICATE,
|
|
6487
6578
|
ActionType.REQUEST_CORRECTION,
|
|
6579
|
+
ActionType.APPROVE_CORRECTION,
|
|
6580
|
+
ActionType.REJECT_CORRECTION,
|
|
6488
6581
|
ActionType.CUSTOM
|
|
6489
6582
|
]);
|
|
6490
6583
|
function getActionUpdateMetadata(actions) {
|
|
@@ -6526,9 +6619,6 @@ function getLegalStatuses(actions) {
|
|
|
6526
6619
|
// ../commons/src/events/state/flags.ts
|
|
6527
6620
|
var import_lodash3 = require("lodash");
|
|
6528
6621
|
var import_date_fns3 = require("date-fns");
|
|
6529
|
-
function isEditInProgress(actions) {
|
|
6530
|
-
return actions.at(-1)?.type === ActionType.EDIT;
|
|
6531
|
-
}
|
|
6532
6622
|
function findPendingCorrectionAction(writeActions2) {
|
|
6533
6623
|
let correctionRequestAction;
|
|
6534
6624
|
for (let i = writeActions2.length - 1; i >= 0; i--) {
|
|
@@ -6543,29 +6633,6 @@ function findPendingCorrectionAction(writeActions2) {
|
|
|
6543
6633
|
}
|
|
6544
6634
|
return correctionRequestAction;
|
|
6545
6635
|
}
|
|
6546
|
-
function isCorrectionRequested(actions) {
|
|
6547
|
-
return findPendingCorrectionAction(actions) !== void 0;
|
|
6548
|
-
}
|
|
6549
|
-
function isDeclarationIncomplete(actions) {
|
|
6550
|
-
return getStatusFromActions(actions) === EventStatus.enum.NOTIFIED;
|
|
6551
|
-
}
|
|
6552
|
-
function isRejected(actions) {
|
|
6553
|
-
const resettingActionTypes = [
|
|
6554
|
-
ActionType.NOTIFY,
|
|
6555
|
-
ActionType.DECLARE,
|
|
6556
|
-
ActionType.EDIT,
|
|
6557
|
-
ActionType.REGISTER
|
|
6558
|
-
];
|
|
6559
|
-
return actions.reduce((prev, { type }) => {
|
|
6560
|
-
if (type === ActionType.REJECT) {
|
|
6561
|
-
return true;
|
|
6562
|
-
}
|
|
6563
|
-
if (resettingActionTypes.includes(type)) {
|
|
6564
|
-
return false;
|
|
6565
|
-
}
|
|
6566
|
-
return prev;
|
|
6567
|
-
}, false);
|
|
6568
|
-
}
|
|
6569
6636
|
function isPotentialDuplicate(actions) {
|
|
6570
6637
|
return actions.reduce((prev, { type }) => {
|
|
6571
6638
|
if (type === ActionType.DUPLICATE_DETECTED) {
|
|
@@ -6593,6 +6660,88 @@ function isFlagConditionMet(conditional, form, action) {
|
|
|
6593
6660
|
}
|
|
6594
6661
|
});
|
|
6595
6662
|
}
|
|
6663
|
+
function actionConfigRemovesFlag(action, flagId, actionsUpToAndIncluding, event2, eventConfiguration) {
|
|
6664
|
+
if (!isActionConfigType(action.type)) {
|
|
6665
|
+
return false;
|
|
6666
|
+
}
|
|
6667
|
+
const actionConfig = getActionConfig({
|
|
6668
|
+
eventConfiguration,
|
|
6669
|
+
actionType: action.type,
|
|
6670
|
+
customActionType: "customActionType" in action ? action.customActionType : void 0
|
|
6671
|
+
});
|
|
6672
|
+
const removeOperations = (actionConfig?.flags ?? []).filter(
|
|
6673
|
+
({ id, operation }) => id === flagId && operation === "remove"
|
|
6674
|
+
);
|
|
6675
|
+
if (removeOperations.length === 0) {
|
|
6676
|
+
return false;
|
|
6677
|
+
}
|
|
6678
|
+
const eventUpToThisAction = { ...event2, actions: actionsUpToAndIncluding };
|
|
6679
|
+
const declaration = aggregateActionDeclarations(eventUpToThisAction);
|
|
6680
|
+
const annotation = aggregateActionAnnotations(eventUpToThisAction);
|
|
6681
|
+
const form = { ...declaration, ...annotation };
|
|
6682
|
+
return removeOperations.some(
|
|
6683
|
+
({ conditional }) => conditional ? isFlagConditionMet(conditional, form, action) : true
|
|
6684
|
+
);
|
|
6685
|
+
}
|
|
6686
|
+
var INHERENT_FLAG_RULES = [
|
|
6687
|
+
{
|
|
6688
|
+
flag: InherentFlags.CORRECTION_REQUESTED,
|
|
6689
|
+
setOn: [ActionType.REQUEST_CORRECTION],
|
|
6690
|
+
resetOn: [ActionType.APPROVE_CORRECTION, ActionType.REJECT_CORRECTION]
|
|
6691
|
+
},
|
|
6692
|
+
{
|
|
6693
|
+
// INCOMPLETE mirrors the NOTIFIED status: set by NOTIFY, cleared by any
|
|
6694
|
+
// other status-changing action (see getStatusFromActions).
|
|
6695
|
+
flag: InherentFlags.INCOMPLETE,
|
|
6696
|
+
setOn: [ActionType.NOTIFY],
|
|
6697
|
+
resetOn: [
|
|
6698
|
+
ActionType.CREATE,
|
|
6699
|
+
ActionType.DECLARE,
|
|
6700
|
+
ActionType.REGISTER,
|
|
6701
|
+
ActionType.ARCHIVE
|
|
6702
|
+
]
|
|
6703
|
+
},
|
|
6704
|
+
{
|
|
6705
|
+
flag: InherentFlags.REJECTED,
|
|
6706
|
+
setOn: [ActionType.REJECT],
|
|
6707
|
+
resetOn: [
|
|
6708
|
+
ActionType.NOTIFY,
|
|
6709
|
+
ActionType.DECLARE,
|
|
6710
|
+
ActionType.EDIT,
|
|
6711
|
+
ActionType.REGISTER
|
|
6712
|
+
]
|
|
6713
|
+
},
|
|
6714
|
+
{
|
|
6715
|
+
flag: InherentFlags.POTENTIAL_DUPLICATE,
|
|
6716
|
+
setOn: [ActionType.DUPLICATE_DETECTED],
|
|
6717
|
+
resetOn: [ActionType.MARK_AS_DUPLICATE, ActionType.MARK_AS_NOT_DUPLICATE]
|
|
6718
|
+
},
|
|
6719
|
+
{
|
|
6720
|
+
flag: InherentFlags.EDIT_IN_PROGRESS,
|
|
6721
|
+
setOn: [ActionType.EDIT],
|
|
6722
|
+
resetOnAnyOtherAction: true
|
|
6723
|
+
}
|
|
6724
|
+
];
|
|
6725
|
+
function resolveInherentFlag(rule, acceptedActions, event2, eventConfiguration) {
|
|
6726
|
+
return acceptedActions.reduce((present, action, idx) => {
|
|
6727
|
+
if (rule.setOn.includes(action.type)) {
|
|
6728
|
+
return true;
|
|
6729
|
+
}
|
|
6730
|
+
if (rule.resetOnAnyOtherAction || (rule.resetOn ?? []).includes(action.type)) {
|
|
6731
|
+
return false;
|
|
6732
|
+
}
|
|
6733
|
+
if (actionConfigRemovesFlag(
|
|
6734
|
+
action,
|
|
6735
|
+
rule.flag,
|
|
6736
|
+
acceptedActions.slice(0, idx + 1),
|
|
6737
|
+
event2,
|
|
6738
|
+
eventConfiguration
|
|
6739
|
+
)) {
|
|
6740
|
+
return false;
|
|
6741
|
+
}
|
|
6742
|
+
return present;
|
|
6743
|
+
}, false);
|
|
6744
|
+
}
|
|
6596
6745
|
function resolveEventCustomFlags(event2, eventConfiguration) {
|
|
6597
6746
|
const actions = getAcceptedActions(event2).filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
6598
6747
|
return actions.reduce((acc, action, idx) => {
|
|
@@ -6641,33 +6790,19 @@ function getActionStatusFlags(sortedActions) {
|
|
|
6641
6790
|
return flag2;
|
|
6642
6791
|
});
|
|
6643
6792
|
}
|
|
6644
|
-
function getInherentFlags(sortedActions) {
|
|
6793
|
+
function getInherentFlags(sortedActions, event2, eventConfiguration) {
|
|
6645
6794
|
const acceptedActions = sortedActions.filter(
|
|
6646
6795
|
({ status: status2 }) => status2 === ActionStatus.Accepted
|
|
6647
6796
|
);
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
}
|
|
6652
|
-
if (isDeclarationIncomplete(acceptedActions)) {
|
|
6653
|
-
inherentFlags.push(InherentFlags.INCOMPLETE);
|
|
6654
|
-
}
|
|
6655
|
-
if (isRejected(acceptedActions)) {
|
|
6656
|
-
inherentFlags.push(InherentFlags.REJECTED);
|
|
6657
|
-
}
|
|
6658
|
-
if (isPotentialDuplicate(acceptedActions)) {
|
|
6659
|
-
inherentFlags.push(InherentFlags.POTENTIAL_DUPLICATE);
|
|
6660
|
-
}
|
|
6661
|
-
if (isEditInProgress(acceptedActions)) {
|
|
6662
|
-
inherentFlags.push(InherentFlags.EDIT_IN_PROGRESS);
|
|
6663
|
-
}
|
|
6664
|
-
return inherentFlags;
|
|
6797
|
+
return INHERENT_FLAG_RULES.filter(
|
|
6798
|
+
(rule) => resolveInherentFlag(rule, acceptedActions, event2, eventConfiguration)
|
|
6799
|
+
).map(({ flag: flag2 }) => flag2);
|
|
6665
6800
|
}
|
|
6666
6801
|
function getEventFlags(event2, config) {
|
|
6667
6802
|
const sortedActions = event2.actions.filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
6668
6803
|
return [
|
|
6669
6804
|
...getActionStatusFlags(sortedActions),
|
|
6670
|
-
...getInherentFlags(sortedActions),
|
|
6805
|
+
...getInherentFlags(sortedActions, event2, config),
|
|
6671
6806
|
...resolveEventCustomFlags(event2, config)
|
|
6672
6807
|
];
|
|
6673
6808
|
}
|
|
@@ -7672,6 +7807,11 @@ var TENNIS_CLUB_DECLARATION_REVIEW = {
|
|
|
7672
7807
|
id: "signature.upload.modal.title",
|
|
7673
7808
|
defaultMessage: "Draw signature",
|
|
7674
7809
|
description: "Title for the modal to draw signature"
|
|
7810
|
+
},
|
|
7811
|
+
// Zod applies the schema default at parse time, but this fixture bypasses
|
|
7812
|
+
// parsing — GeneratedInputField accesses configuration.maxFileSize directly.
|
|
7813
|
+
configuration: {
|
|
7814
|
+
maxFileSize: 5 * 1024 * 1024
|
|
7675
7815
|
}
|
|
7676
7816
|
}
|
|
7677
7817
|
]
|
|
@@ -8228,6 +8368,20 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
8228
8368
|
},
|
|
8229
8369
|
review: TENNIS_CLUB_DECLARATION_REVIEW
|
|
8230
8370
|
},
|
|
8371
|
+
{
|
|
8372
|
+
type: ActionType.NOTIFY,
|
|
8373
|
+
label: {
|
|
8374
|
+
defaultMessage: "Notify health worker",
|
|
8375
|
+
description: "This is shown as the action name anywhere the user can trigger the action from",
|
|
8376
|
+
id: "event.tennis-club-membership.action.notify.label"
|
|
8377
|
+
},
|
|
8378
|
+
flags: [
|
|
8379
|
+
{
|
|
8380
|
+
id: "health-worker-notified",
|
|
8381
|
+
operation: "add"
|
|
8382
|
+
}
|
|
8383
|
+
]
|
|
8384
|
+
},
|
|
8231
8385
|
{
|
|
8232
8386
|
type: ActionType.REJECT,
|
|
8233
8387
|
label: {
|
|
@@ -8470,6 +8624,17 @@ var tennisClubMembershipEvent = defineConfig({
|
|
|
8470
8624
|
}
|
|
8471
8625
|
}
|
|
8472
8626
|
],
|
|
8627
|
+
flags: [
|
|
8628
|
+
{
|
|
8629
|
+
id: "health-worker-notified",
|
|
8630
|
+
requiresAction: false,
|
|
8631
|
+
label: {
|
|
8632
|
+
id: "event.tennis-club-membership.flag.health-worker-notified.label",
|
|
8633
|
+
defaultMessage: "Health worker notified",
|
|
8634
|
+
description: "Label for the health-worker-notified flag"
|
|
8635
|
+
}
|
|
8636
|
+
}
|
|
8637
|
+
],
|
|
8473
8638
|
advancedSearch: [
|
|
8474
8639
|
{
|
|
8475
8640
|
title: {
|
|
@@ -10228,7 +10393,7 @@ function matchesJurisdictionFilter(locationIds, filter, user2) {
|
|
|
10228
10393
|
return locationIds.some((id) => id === user2.primaryOfficeId);
|
|
10229
10394
|
}
|
|
10230
10395
|
if (filter === JurisdictionFilter.enum.administrativeArea) {
|
|
10231
|
-
return user2.administrativeAreaId
|
|
10396
|
+
return !user2.administrativeAreaId || locationIds.some((id) => id === user2.administrativeAreaId);
|
|
10232
10397
|
}
|
|
10233
10398
|
return true;
|
|
10234
10399
|
}
|
|
@@ -10317,7 +10482,7 @@ function canAccessUserWithScope({
|
|
|
10317
10482
|
}
|
|
10318
10483
|
const hasAdministrativeAreaInHierarchy = userToAccess.administrativeHierarchy.some(
|
|
10319
10484
|
(id) => user2.administrativeAreaId === id
|
|
10320
|
-
) || user2.administrativeAreaId
|
|
10485
|
+
) || !user2.administrativeAreaId;
|
|
10321
10486
|
if (opts?.accessLevel === JurisdictionFilter.enum.administrativeArea && !hasAdministrativeAreaInHierarchy) {
|
|
10322
10487
|
return false;
|
|
10323
10488
|
}
|
|
@@ -10623,18 +10788,19 @@ var ACTION_FILTERS = {
|
|
|
10623
10788
|
function filterActionsByFlags(actions, flags) {
|
|
10624
10789
|
return actions.filter((action) => ACTION_FILTERS[action]?.(flags) ?? true);
|
|
10625
10790
|
}
|
|
10791
|
+
var REJECTED_ACTIONS = [
|
|
10792
|
+
ActionType.READ,
|
|
10793
|
+
ActionType.NOTIFY,
|
|
10794
|
+
ActionType.CUSTOM,
|
|
10795
|
+
ActionType.EDIT,
|
|
10796
|
+
ActionType.ARCHIVE
|
|
10797
|
+
];
|
|
10626
10798
|
function getAvailableActionsWithoutFlagFilters(status2, flags) {
|
|
10627
10799
|
if (flags.includes(InherentFlags.EDIT_IN_PROGRESS)) {
|
|
10628
10800
|
return [ActionType.NOTIFY, ActionType.DECLARE, ActionType.REGISTER];
|
|
10629
10801
|
}
|
|
10630
|
-
if (flags.includes(InherentFlags.REJECTED)) {
|
|
10631
|
-
return
|
|
10632
|
-
ActionType.READ,
|
|
10633
|
-
ActionType.NOTIFY,
|
|
10634
|
-
ActionType.CUSTOM,
|
|
10635
|
-
ActionType.EDIT,
|
|
10636
|
-
ActionType.ARCHIVE
|
|
10637
|
-
];
|
|
10802
|
+
if (flags.includes(InherentFlags.REJECTED) && status2 !== EventStatus.enum.ARCHIVED) {
|
|
10803
|
+
return REJECTED_ACTIONS;
|
|
10638
10804
|
}
|
|
10639
10805
|
return AVAILABLE_ACTIONS_BY_EVENT_STATUS[status2];
|
|
10640
10806
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const UPSTREAM_URL = "https://github.com/opencrvs/opencrvs-countryconfig.git";
|
|
2
|
-
export declare const UPSTREAM_BRANCH = "release
|
|
2
|
+
export declare const UPSTREAM_BRANCH = "release/2.0.0";
|
|
3
3
|
/**
|
|
4
4
|
* Runs a git command in the country config working directory.
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-upstream-files.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/checkout-upstream-files.ts"],"names":[],"mappings":"AA8CA,eAAO,MAAM,YAAY,2DACiC,CAAA;AAE1D,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"checkout-upstream-files.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/checkout-upstream-files.ts"],"names":[],"mappings":"AA8CA,eAAO,MAAM,YAAY,2DACiC,CAAA;AAE1D,eAAO,MAAM,eAAe,kBAAkB,CAAA;AAc9C;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,MAAM,EAAE,EACd,EAAE,MAAc,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5C,MAAM,CAMR;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAO9C;AAED,wBAAgB,eAAe,IAAI,IAAI,CAMtC;AAID,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAuDnC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -59,7 +59,7 @@ exports.main = main;
|
|
|
59
59
|
*/
|
|
60
60
|
const child_process_1 = require("child_process");
|
|
61
61
|
exports.UPSTREAM_URL = 'https://github.com/opencrvs/opencrvs-countryconfig.git';
|
|
62
|
-
exports.UPSTREAM_BRANCH = 'release
|
|
62
|
+
exports.UPSTREAM_BRANCH = 'release/2.0.0';
|
|
63
63
|
// Remote name used only for the duration of this codemod. Prefixed to avoid
|
|
64
64
|
// clashing with remotes the user may have (origin, upstream, etc.).
|
|
65
65
|
const TEMP_REMOTE = 'opencrvs-upgrade-v19-v20-codemod';
|
|
@@ -4312,7 +4312,7 @@ Saved ${handlerRelPath}.`);
|
|
|
4312
4312
|
// src/migrations/v2.0/checkout-upstream-files.ts
|
|
4313
4313
|
var import_child_process = require("child_process");
|
|
4314
4314
|
var UPSTREAM_URL = "https://github.com/opencrvs/opencrvs-countryconfig.git";
|
|
4315
|
-
var UPSTREAM_BRANCH = "release
|
|
4315
|
+
var UPSTREAM_BRANCH = "release/2.0.0";
|
|
4316
4316
|
var TEMP_REMOTE = "opencrvs-upgrade-v19-v20-codemod";
|
|
4317
4317
|
var FILES_TO_CHECKOUT = [
|
|
4318
4318
|
"src/analytics/analytics.ts",
|