@reltio/components 1.4.2227 → 1.4.2228

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.
Files changed (71) hide show
  1. package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.d.ts +9 -1
  2. package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.js +3 -3
  3. package/SimpleAttribute/SimpleAttribute.d.ts +5 -2
  4. package/SimpleAttribute/SimpleAttribute.js +15 -7
  5. package/SimpleAttribute/SimpleAttribute.module.css.js +9 -0
  6. package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.d.ts +9 -1
  7. package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.js +3 -3
  8. package/cjs/SimpleAttribute/SimpleAttribute.d.ts +5 -2
  9. package/cjs/SimpleAttribute/SimpleAttribute.js +19 -11
  10. package/cjs/SimpleAttribute/SimpleAttribute.module.css.js +9 -0
  11. package/cjs/features/crosswalks/AttributesTable/AttributesTable.js +3 -1
  12. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +4 -1
  13. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.js +51 -21
  14. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +56 -0
  15. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.d.ts +7 -0
  16. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.js +31 -0
  17. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.module.css.js +9 -0
  18. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/index.d.ts +1 -0
  19. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/index.js +5 -0
  20. package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +3 -1
  21. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.js +1 -1
  22. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
  23. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +65 -11
  24. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +9 -0
  25. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.d.ts +7 -0
  26. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +15 -0
  27. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.d.ts +7 -0
  28. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.js +53 -0
  29. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.d.ts +2 -0
  30. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.js +7 -0
  31. package/cjs/features/crosswalks/AttributesTable/helpers.d.ts +4 -2
  32. package/cjs/features/crosswalks/AttributesTable/helpers.js +96 -17
  33. package/cjs/features/crosswalks/AttributesTable/helpers.test.js +499 -50
  34. package/cjs/features/crosswalks/AttributesTable/types.d.ts +17 -3
  35. package/cjs/features/crosswalks/contexts/SyncedValueHeightsContext.d.ts +11 -0
  36. package/cjs/features/crosswalks/contexts/SyncedValueHeightsContext.js +66 -0
  37. package/features/crosswalks/AttributesTable/AttributesTable.js +3 -1
  38. package/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +4 -1
  39. package/features/crosswalks/AttributesTable/AttributesTable.test-data.js +49 -20
  40. package/features/crosswalks/AttributesTable/AttributesTable.test.js +58 -2
  41. package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.d.ts +7 -0
  42. package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.js +24 -0
  43. package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.module.css.js +9 -0
  44. package/features/crosswalks/AttributesTable/components/FallbackIndicator/index.d.ts +1 -0
  45. package/features/crosswalks/AttributesTable/components/FallbackIndicator/index.js +1 -0
  46. package/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +3 -1
  47. package/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.js +1 -1
  48. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
  49. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +65 -11
  50. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +9 -0
  51. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.d.ts +7 -0
  52. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +8 -0
  53. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.d.ts +7 -0
  54. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.js +23 -0
  55. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.d.ts +2 -0
  56. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.js +2 -0
  57. package/features/crosswalks/AttributesTable/helpers.d.ts +4 -2
  58. package/features/crosswalks/AttributesTable/helpers.js +95 -18
  59. package/features/crosswalks/AttributesTable/helpers.test.js +501 -52
  60. package/features/crosswalks/AttributesTable/types.d.ts +17 -3
  61. package/features/crosswalks/contexts/SyncedValueHeightsContext.d.ts +11 -0
  62. package/features/crosswalks/contexts/SyncedValueHeightsContext.js +38 -0
  63. package/package.json +2 -2
  64. package/SimpleAttribute/styles.d.ts +0 -1
  65. package/SimpleAttribute/styles.js +0 -42
  66. package/cjs/SimpleAttribute/styles.d.ts +0 -1
  67. package/cjs/SimpleAttribute/styles.js +0 -45
  68. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.d.ts +0 -1
  69. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.js +0 -13
  70. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.d.ts +0 -1
  71. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.js +0 -10
@@ -270,13 +270,21 @@ describe('helpers tests', function () {
270
270
  crosswalks: [crosswalks[0]]
271
271
  },
272
272
  ruleType: {
273
- ruleType: {
274
- uri: 'configuration/survivorshipStrategies/LUD',
275
- label: 'Recency'
276
- },
277
- comparisonAttributeUri: undefined,
278
- primaryAttributeUri: undefined,
279
- sourcesUriOrder: undefined
273
+ ruleTypes: [
274
+ {
275
+ data: {
276
+ strategy: {
277
+ uri: 'configuration/survivorshipStrategies/LUD',
278
+ label: 'Recency'
279
+ },
280
+ comparisonAttributeUri: undefined,
281
+ primaryAttributeUri: undefined,
282
+ sourcesUriOrder: undefined
283
+ },
284
+ type: 'rule',
285
+ valueUri: 'entities/1/attributes/CountryCode/1'
286
+ }
287
+ ]
280
288
  },
281
289
  count: 2,
282
290
  values: {
@@ -295,13 +303,21 @@ describe('helpers tests', function () {
295
303
  crosswalks: []
296
304
  },
297
305
  ruleType: {
298
- ruleType: {
299
- uri: 'configuration/survivorshipStrategies/Frequency',
300
- label: 'Frequency'
301
- },
302
- comparisonAttributeUri: undefined,
303
- primaryAttributeUri: undefined,
304
- sourcesUriOrder: undefined
306
+ ruleTypes: [
307
+ {
308
+ data: {
309
+ strategy: {
310
+ uri: 'configuration/survivorshipStrategies/Frequency',
311
+ label: 'Frequency'
312
+ },
313
+ comparisonAttributeUri: undefined,
314
+ primaryAttributeUri: undefined,
315
+ sourcesUriOrder: undefined
316
+ },
317
+ type: 'rule',
318
+ valueUri: 'entities/1/attributes/Date/1'
319
+ }
320
+ ]
305
321
  },
306
322
  count: 2,
307
323
  values: {
@@ -320,10 +336,21 @@ describe('helpers tests', function () {
320
336
  crosswalks: attributes['Address'][0]['refRelation']['crosswalks']
321
337
  },
322
338
  ruleType: {
323
- ruleType: {
324
- uri: 'configuration/survivorshipStrategies/LUD',
325
- label: 'Recency'
326
- }
339
+ ruleTypes: [
340
+ {
341
+ data: {
342
+ strategy: {
343
+ uri: 'configuration/survivorshipStrategies/LUD',
344
+ label: 'Recency'
345
+ },
346
+ comparisonAttributeUri: undefined,
347
+ primaryAttributeUri: undefined,
348
+ sourcesUriOrder: undefined
349
+ },
350
+ type: 'rule',
351
+ valueUri: 'entities/1/attributes/Address/1'
352
+ }
353
+ ]
327
354
  },
328
355
  count: 1,
329
356
  values: {
@@ -406,6 +433,12 @@ describe('helpers tests', function () {
406
433
  name: 'CountryCode',
407
434
  type: 'String',
408
435
  uri: 'configuration/entityTypes/HCP/attributes/CountryCode'
436
+ },
437
+ {
438
+ label: 'Int',
439
+ name: 'Int',
440
+ type: 'Int',
441
+ uri: 'configuration/entityTypes/HCP/attributes/Int'
409
442
  }
410
443
  ],
411
444
  survivorshipGroups: [
@@ -460,13 +493,17 @@ describe('helpers tests', function () {
460
493
  ],
461
494
  survivorshipStrategies: [
462
495
  {
463
- uri: 'configuration/survivorshipStrategies/Recency',
496
+ uri: 'configuration/survivorshipStrategies/LUD',
464
497
  label: 'Recency'
465
498
  },
466
499
  {
467
500
  uri: 'configuration/survivorshipStrategies/Aggregation',
468
501
  label: 'Aggregation'
469
502
  },
503
+ {
504
+ uri: 'configuration/survivorshipStrategies/Frequency',
505
+ label: 'Frequency'
506
+ },
470
507
  {
471
508
  uri: 'configuration/survivorshipStrategies/SRC_SYS',
472
509
  label: 'Source system'
@@ -497,11 +534,30 @@ describe('helpers tests', function () {
497
534
  name: 'Int',
498
535
  label: 'Int'
499
536
  };
500
- expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP')).toEqual({
501
- ruleType: {
502
- uri: 'configuration/survivorshipStrategies/Aggregation',
503
- label: 'Aggregation'
537
+ var attributeValues = [
538
+ {
539
+ uri: 'entities/1/attributes/Int/1',
540
+ type: 'configuration/entityTypes/HCP/attributes/Int',
541
+ value: '1005',
542
+ ov: true
504
543
  }
544
+ ];
545
+ expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP', attributeValues)).toEqual({
546
+ ruleTypes: [
547
+ {
548
+ data: {
549
+ strategy: {
550
+ uri: 'configuration/survivorshipStrategies/Aggregation',
551
+ label: 'Aggregation'
552
+ },
553
+ comparisonAttributeUri: undefined,
554
+ primaryAttributeUri: undefined,
555
+ sourcesUriOrder: undefined
556
+ },
557
+ type: 'rule',
558
+ valueUri: 'entities/1/attributes/Int/1'
559
+ }
560
+ ]
505
561
  });
506
562
  });
507
563
  it('should return correct rule type based on active strategy', function () {
@@ -511,11 +567,30 @@ describe('helpers tests', function () {
511
567
  name: 'Int',
512
568
  label: 'Int'
513
569
  };
514
- expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP', 'configuration/entityTypes/HCP/survivorshipGroups/allRecency')).toEqual({
515
- ruleType: {
516
- uri: 'configuration/survivorshipStrategies/Recency',
517
- label: 'Recency'
570
+ var attributeValues = [
571
+ {
572
+ uri: 'entities/1/attributes/Int/1',
573
+ type: 'configuration/entityTypes/HCP/attributes/Int',
574
+ value: '1005',
575
+ ov: true
518
576
  }
577
+ ];
578
+ expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP', attributeValues, 'configuration/entityTypes/HCP/survivorshipGroups/allRecency')).toEqual({
579
+ ruleTypes: [
580
+ {
581
+ data: {
582
+ strategy: {
583
+ uri: 'configuration/survivorshipStrategies/LUD',
584
+ label: 'Recency'
585
+ },
586
+ comparisonAttributeUri: undefined,
587
+ primaryAttributeUri: undefined,
588
+ sourcesUriOrder: undefined
589
+ },
590
+ type: 'rule',
591
+ valueUri: 'entities/1/attributes/Int/1'
592
+ }
593
+ ]
519
594
  });
520
595
  });
521
596
  it('should use default one if strategy url is incorrect', function () {
@@ -525,41 +600,96 @@ describe('helpers tests', function () {
525
600
  name: 'Int',
526
601
  label: 'Int'
527
602
  };
528
- expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP', 'configuration/entityTypes/HCP/survivorshipGroups/unexisting')).toEqual({
529
- ruleType: {
530
- uri: 'configuration/survivorshipStrategies/Aggregation',
531
- label: 'Aggregation'
603
+ var attributeValues = [
604
+ {
605
+ uri: 'entities/1/attributes/Int/1',
606
+ type: 'configuration/entityTypes/HCP/attributes/Int',
607
+ value: '1005',
608
+ ov: true
532
609
  }
610
+ ];
611
+ expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP', attributeValues, 'configuration/entityTypes/HCP/survivorshipGroups/unexisting')).toEqual({
612
+ ruleTypes: [
613
+ {
614
+ data: {
615
+ strategy: {
616
+ uri: 'configuration/survivorshipStrategies/Aggregation',
617
+ label: 'Aggregation'
618
+ },
619
+ comparisonAttributeUri: undefined,
620
+ primaryAttributeUri: undefined,
621
+ sourcesUriOrder: undefined
622
+ },
623
+ type: 'rule',
624
+ valueUri: 'entities/1/attributes/Int/1'
625
+ }
626
+ ]
533
627
  });
534
628
  });
535
629
  it('should return correct rule type with sourcesUriOrder', function () {
536
630
  var attributeType = {
537
631
  uri: 'configuration/entityTypes/HCP/attributes/Gender',
538
- type: 'Gender',
632
+ type: 'String',
539
633
  name: 'Gender',
540
634
  label: 'Gender'
541
635
  };
542
- expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP')).toEqual({
543
- ruleType: {
544
- uri: 'configuration/survivorshipStrategies/SRC_SYS',
545
- label: 'Source system'
546
- },
547
- sourcesUriOrder: ['configuration/sources/TEST', 'configuration/sources/Reltio']
636
+ var attributeValues = [
637
+ {
638
+ uri: 'entities/1/attributes/Gender/1',
639
+ type: 'configuration/entityTypes/HCP/attributes/Gender',
640
+ value: 'F',
641
+ ov: true
642
+ }
643
+ ];
644
+ expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP', attributeValues)).toEqual({
645
+ ruleTypes: [
646
+ {
647
+ data: {
648
+ strategy: {
649
+ uri: 'configuration/survivorshipStrategies/SRC_SYS',
650
+ label: 'Source system'
651
+ },
652
+ comparisonAttributeUri: undefined,
653
+ primaryAttributeUri: undefined,
654
+ sourcesUriOrder: ['configuration/sources/TEST', 'configuration/sources/Reltio']
655
+ },
656
+ type: 'rule',
657
+ valueUri: 'entities/1/attributes/Gender/1'
658
+ }
659
+ ]
548
660
  });
549
661
  });
550
662
  it('should return correct rule type with primaryAttributeUri', function () {
551
663
  var attributeType = {
552
664
  uri: 'configuration/entityTypes/HCP/attributes/ScheduledDrug',
553
- type: 'ScheduledDrug',
665
+ type: 'String',
554
666
  name: 'ScheduledDrug',
555
667
  label: 'ScheduledDrug'
556
668
  };
557
- expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP')).toEqual({
558
- ruleType: {
559
- uri: 'configuration/survivorshipStrategies/OtherAttributeWinnerCrosswalk',
560
- label: 'Other Attribute Winner Crosswalk'
561
- },
562
- primaryAttributeUri: 'configuration/entityTypes/HCP/attributes/CountryCode'
669
+ var attributeValues = [
670
+ {
671
+ uri: 'entities/1/attributes/ScheduledDrug/1',
672
+ type: 'configuration/entityTypes/HCP/attributes/ScheduledDrug',
673
+ value: 'Aspirin',
674
+ ov: true
675
+ }
676
+ ];
677
+ expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP', attributeValues)).toEqual({
678
+ ruleTypes: [
679
+ {
680
+ data: {
681
+ strategy: {
682
+ uri: 'configuration/survivorshipStrategies/OtherAttributeWinnerCrosswalk',
683
+ label: 'Other Attribute Winner Crosswalk'
684
+ },
685
+ comparisonAttributeUri: undefined,
686
+ primaryAttributeUri: 'configuration/entityTypes/HCP/attributes/CountryCode',
687
+ sourcesUriOrder: undefined
688
+ },
689
+ type: 'rule',
690
+ valueUri: 'entities/1/attributes/ScheduledDrug/1'
691
+ }
692
+ ]
563
693
  });
564
694
  });
565
695
  it('should return correct rule type with comparisonAttributeUri', function () {
@@ -570,12 +700,290 @@ describe('helpers tests', function () {
570
700
  label: 'Address',
571
701
  referencedAttributeURIs: ['configuration/relationTypes/HasAddress/attributes/Status']
572
702
  };
573
- expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP')).toEqual({
574
- ruleType: {
575
- uri: 'configuration/survivorshipStrategies/MinValue',
576
- label: 'Minimum value'
703
+ var attributeValues = [
704
+ {
705
+ uri: 'entities/1/attributes/Address/1',
706
+ type: 'configuration/entityTypes/HCP/attributes/Address',
707
+ value: {},
708
+ ov: true
709
+ }
710
+ ];
711
+ expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP', attributeValues)).toEqual({
712
+ ruleTypes: [
713
+ {
714
+ data: {
715
+ strategy: {
716
+ uri: 'configuration/survivorshipStrategies/MinValue',
717
+ label: 'Minimum value'
718
+ },
719
+ comparisonAttributeUri: 'configuration/relationTypes/HasAddress/attributes/Status',
720
+ primaryAttributeUri: undefined,
721
+ sourcesUriOrder: undefined
722
+ },
723
+ type: 'rule',
724
+ valueUri: 'entities/1/attributes/Address/1'
725
+ }
726
+ ]
727
+ });
728
+ });
729
+ it('should return rule type with fallback labels if last applied survivorship rules differ from default one', function () {
730
+ var attributeType = {
731
+ uri: 'configuration/entityTypes/HCP/attributes/Int',
732
+ type: 'Int',
733
+ name: 'Int',
734
+ label: 'Int'
735
+ };
736
+ var attributeValues = [
737
+ {
738
+ uri: 'entities/123abc/attributes/Int/345fgh',
739
+ type: 'configuration/entityTypes/HCP/attributes/Int',
740
+ value: '1005',
741
+ ov: true,
742
+ ovDetails: {
743
+ participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
744
+ appliedSurvivorshipRules: {
745
+ SRC_SYS: [{ SRC_SYS: ['SRC_SYS', 'Aggregation'] }, { SRC_SYS: ['LUD'] }, 'Frequency']
746
+ }
747
+ }
748
+ }
749
+ ];
750
+ expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP', attributeValues)).toEqual({
751
+ ruleTypes: [
752
+ {
753
+ data: {
754
+ strategy: {
755
+ uri: 'configuration/survivorshipStrategies/Frequency',
756
+ label: 'Frequency'
757
+ },
758
+ comparisonAttributeUri: undefined,
759
+ primaryAttributeUri: undefined,
760
+ sourcesUriOrder: undefined
761
+ },
762
+ type: 'rule',
763
+ valueUri: 'entities/123abc/attributes/Int/345fgh'
764
+ }
765
+ ]
766
+ });
767
+ });
768
+ it('should return rule types per OV value with duplicates and ignore non-OV values', function () {
769
+ var attributeType = {
770
+ uri: 'configuration/entityTypes/HCP/attributes/Int',
771
+ type: 'Int',
772
+ name: 'Int',
773
+ label: 'Int'
774
+ };
775
+ var attributeValues = [
776
+ {
777
+ uri: 'entities/123abc/attributes/Int/345fgh',
778
+ type: 'configuration/entityTypes/HCP/attributes/Int',
779
+ value: '1005',
780
+ ov: true,
781
+ ovDetails: {
782
+ participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
783
+ appliedSurvivorshipRules: {
784
+ SRC_SYS: [{ SRC_SYS: ['SRC_SYS', 'Aggregation'] }, 'Frequency']
785
+ }
786
+ }
787
+ },
788
+ {
789
+ uri: 'entities/123abc/attributes/Int/ghj565',
790
+ type: 'configuration/entityTypes/HCP/attributes/Int',
791
+ value: '1006',
792
+ ov: true,
793
+ ovDetails: {
794
+ participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
795
+ appliedSurvivorshipRules: {
796
+ SRC_SYS: [{ SRC_SYS: ['SRC_SYS', 'Aggregation'] }, 'Frequency']
797
+ }
798
+ }
577
799
  },
578
- comparisonAttributeUri: 'configuration/relationTypes/HasAddress/attributes/Status'
800
+ {
801
+ uri: 'entities/123abc/attributes/Int/nonOvValue',
802
+ type: 'configuration/entityTypes/HCP/attributes/Int',
803
+ value: '1006-non-ov',
804
+ ov: false,
805
+ ovDetails: {
806
+ participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
807
+ appliedSurvivorshipRules: {
808
+ SRC_SYS: [{ SRC_SYS: ['SRC_SYS', 'Aggregation'] }, 'Aggregation']
809
+ }
810
+ }
811
+ },
812
+ {
813
+ uri: 'entities/123abc/attributes/Int/xfjhy6',
814
+ type: 'configuration/entityTypes/HCP/attributes/Int',
815
+ value: '1007',
816
+ ov: true,
817
+ ovDetails: {
818
+ participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
819
+ appliedSurvivorshipRules: {
820
+ SRC_SYS: [{ SRC_SYS: ['SRC_SYS', 'Aggregation'] }, { SRC_SYS: ['LUD'] }]
821
+ }
822
+ }
823
+ }
824
+ ];
825
+ expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP', attributeValues)).toEqual({
826
+ ruleTypes: [
827
+ {
828
+ data: {
829
+ strategy: {
830
+ uri: 'configuration/survivorshipStrategies/Frequency',
831
+ label: 'Frequency'
832
+ },
833
+ comparisonAttributeUri: undefined,
834
+ primaryAttributeUri: undefined,
835
+ sourcesUriOrder: undefined
836
+ },
837
+ type: 'rule',
838
+ valueUri: 'entities/123abc/attributes/Int/345fgh'
839
+ },
840
+ {
841
+ data: {
842
+ strategy: {
843
+ uri: 'configuration/survivorshipStrategies/Frequency',
844
+ label: 'Frequency'
845
+ },
846
+ comparisonAttributeUri: undefined,
847
+ primaryAttributeUri: undefined,
848
+ sourcesUriOrder: undefined
849
+ },
850
+ type: 'rule',
851
+ valueUri: 'entities/123abc/attributes/Int/ghj565'
852
+ },
853
+ {
854
+ data: {
855
+ strategy: {
856
+ uri: 'configuration/survivorshipStrategies/LUD',
857
+ label: 'Recency'
858
+ },
859
+ comparisonAttributeUri: undefined,
860
+ primaryAttributeUri: undefined,
861
+ sourcesUriOrder: undefined
862
+ },
863
+ type: 'rule',
864
+ valueUri: 'entities/123abc/attributes/Int/xfjhy6'
865
+ }
866
+ ]
867
+ });
868
+ });
869
+ it('should return default rule type if applied survivorship rules are invalid', function () {
870
+ var attributeType = {
871
+ uri: 'configuration/entityTypes/HCP/attributes/Int',
872
+ type: 'Int',
873
+ name: 'Int',
874
+ label: 'Int'
875
+ };
876
+ var attributeValues = [
877
+ {
878
+ uri: 'entities/123abc/attributes/Int/345fgh',
879
+ type: 'configuration/entityTypes/HCP/attributes/Int',
880
+ value: '1005',
881
+ ov: true,
882
+ ovDetails: {
883
+ participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
884
+ appliedSurvivorshipRules: 'N/A'
885
+ }
886
+ }
887
+ ];
888
+ expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP', attributeValues)).toEqual({
889
+ ruleTypes: [
890
+ {
891
+ data: {
892
+ strategy: {
893
+ uri: 'configuration/survivorshipStrategies/Aggregation',
894
+ label: 'Aggregation'
895
+ },
896
+ comparisonAttributeUri: undefined,
897
+ primaryAttributeUri: undefined,
898
+ sourcesUriOrder: undefined
899
+ },
900
+ type: 'rule',
901
+ valueUri: 'entities/123abc/attributes/Int/345fgh'
902
+ }
903
+ ]
904
+ });
905
+ });
906
+ it('should return rule type with sourcesUriOrder from applied survivorship rules', function () {
907
+ var attributeType = {
908
+ uri: 'configuration/entityTypes/HCP/attributes/Int',
909
+ type: 'Int',
910
+ name: 'Int',
911
+ label: 'Int'
912
+ };
913
+ var attributeValues = [
914
+ {
915
+ uri: 'entities/123abc/attributes/Int/345fgh',
916
+ type: 'configuration/entityTypes/HCP/attributes/Int',
917
+ value: '1005',
918
+ ov: true,
919
+ ovDetails: {
920
+ participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
921
+ appliedSurvivorshipRules: 'SRC_SYS'
922
+ }
923
+ }
924
+ ];
925
+ expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP', attributeValues)).toEqual({
926
+ ruleTypes: [
927
+ {
928
+ data: {
929
+ strategy: {
930
+ uri: 'configuration/survivorshipStrategies/SRC_SYS',
931
+ label: 'Source system'
932
+ },
933
+ comparisonAttributeUri: undefined,
934
+ primaryAttributeUri: undefined,
935
+ sourcesUriOrder: ['configuration/sources/TEST', 'configuration/sources/Reltio']
936
+ },
937
+ type: 'rule',
938
+ valueUri: 'entities/123abc/attributes/Int/345fgh'
939
+ }
940
+ ]
941
+ });
942
+ });
943
+ it('should return default rule type for complex attribute even if there are different applied survivorship rules', function () {
944
+ var attributeType = {
945
+ uri: 'configuration/entityTypes/HCP/attributes/Address',
946
+ type: 'Reference',
947
+ name: 'Address',
948
+ label: 'Address',
949
+ referencedAttributeURIs: ['configuration/relationTypes/HasAddress/attributes/Status']
950
+ };
951
+ var attributeValues = [
952
+ {
953
+ uri: 'entities/123abc/attributes/Address/345fgh',
954
+ type: 'configuration/entityTypes/HCP/attributes/Address',
955
+ value: {
956
+ Status: [
957
+ {
958
+ uri: 'entities/123abc/attributes/Status/345fgh',
959
+ type: 'configuration/relationTypes/HasAddress/attributes/Status',
960
+ value: '1005'
961
+ }
962
+ ]
963
+ },
964
+ ov: true,
965
+ ovDetails: {
966
+ participationStatus: mdm_sdk_1.ParticipationStatus.Strategy,
967
+ appliedSurvivorshipRules: 'Aggregation'
968
+ }
969
+ }
970
+ ];
971
+ expect((0, helpers_1.getRuleTypeValues)(metadata, attributeType, 'configuration/entityTypes/HCP', attributeValues)).toEqual({
972
+ ruleTypes: [
973
+ {
974
+ data: {
975
+ strategy: {
976
+ uri: 'configuration/survivorshipStrategies/MinValue',
977
+ label: 'Minimum value'
978
+ },
979
+ comparisonAttributeUri: 'configuration/relationTypes/HasAddress/attributes/Status',
980
+ primaryAttributeUri: undefined,
981
+ sourcesUriOrder: undefined
982
+ },
983
+ type: 'rule',
984
+ valueUri: 'entities/123abc/attributes/Address/345fgh'
985
+ }
986
+ ]
579
987
  });
580
988
  });
581
989
  });
@@ -746,5 +1154,46 @@ describe('helpers tests', function () {
746
1154
  expect((0, helpers_1.getWinnerCrosswalks)(undefined, crosswalksMap)).toEqual([]);
747
1155
  });
748
1156
  });
1157
+ describe('collectRuleNames', function () {
1158
+ it('should return single rule when input is a string', function () {
1159
+ expect((0, helpers_1.collectRuleNames)('LUD')).toEqual(['LUD']);
1160
+ });
1161
+ it('should return empty array for empty object', function () {
1162
+ expect((0, helpers_1.collectRuleNames)({})).toEqual([]);
1163
+ });
1164
+ it('should flatten nested applied survivorship rules', function () {
1165
+ var rules = {
1166
+ SRC_SYS: [{ SRC_SYS: ['SRC_SYS', 'Aggregation'] }, { SRC_SYS: ['LUD'] }, 'Frequency']
1167
+ };
1168
+ expect((0, helpers_1.collectRuleNames)(rules)).toEqual([
1169
+ 'SRC_SYS',
1170
+ 'SRC_SYS',
1171
+ 'SRC_SYS',
1172
+ 'Aggregation',
1173
+ 'SRC_SYS',
1174
+ 'LUD',
1175
+ 'Frequency'
1176
+ ]);
1177
+ });
1178
+ it('should handle rules with multiple top-level keys', function () {
1179
+ var rules = {
1180
+ SRC_SYS: ['LUD', { SRC_SYS: ['SRC_SYS', 'Aggregation'] }],
1181
+ SRC_SYS2: ['Aggregation']
1182
+ };
1183
+ expect((0, helpers_1.collectRuleNames)(rules)).toEqual([
1184
+ 'SRC_SYS',
1185
+ 'LUD',
1186
+ 'SRC_SYS',
1187
+ 'SRC_SYS',
1188
+ 'Aggregation',
1189
+ 'SRC_SYS2',
1190
+ 'Aggregation'
1191
+ ]);
1192
+ });
1193
+ it('should handle rules with empty nested arrays', function () {
1194
+ var rules = { SRC_SYS: ['LUD', { SRC_SYS: [] }] };
1195
+ expect((0, helpers_1.collectRuleNames)(rules)).toEqual(['SRC_SYS', 'LUD', 'SRC_SYS']);
1196
+ });
1197
+ });
749
1198
  });
750
1199
  });