@reltio/components 1.4.2190 → 1.4.2192
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/AttributeCellRenderers/BlobRenderer.d.ts +5 -0
- package/AttributeCellRenderers/BlobRenderer.js +23 -0
- package/AttributeCellRenderers/EntityIdRenderer.d.ts +11 -0
- package/AttributeCellRenderers/EntityIdRenderer.js +19 -0
- package/AttributeCellRenderers/EntityProfileRenderer.d.ts +5 -0
- package/AttributeCellRenderers/EntityProfileRenderer.js +17 -0
- package/AttributeCellRenderers/ImageRenderer.d.ts +10 -0
- package/AttributeCellRenderers/ImageRenderer.js +10 -0
- package/AttributeCellRenderers/ReferenceRenderer.d.ts +5 -0
- package/AttributeCellRenderers/ReferenceRenderer.js +24 -0
- package/AttributeCellRenderers/SimpleAttributeRenderer.d.ts +5 -0
- package/AttributeCellRenderers/SimpleAttributeRenderer.js +22 -0
- package/AttributeCellRenderers/getAttributeValueRenderer.d.ts +15 -0
- package/AttributeCellRenderers/getAttributeValueRenderer.js +24 -0
- package/AttributeCellRenderers/index.d.ts +1 -0
- package/AttributeCellRenderers/index.js +1 -0
- package/AttributeCellRenderers/styles.module.css.js +9 -0
- package/AttributeRowCellRenderer/AttributeRowCellRenderer.d.ts +21 -0
- package/AttributeRowCellRenderer/AttributeRowCellRenderer.js +42 -0
- package/AttributeRowCellRenderer/index.d.ts +1 -0
- package/AttributeRowCellRenderer/index.js +1 -0
- package/DefaultHeadCellRendererWithTooltip/DefaultHeadCellRendererWithTooltip.d.ts +4 -1
- package/DefaultHeadCellRendererWithTooltip/DefaultHeadCellRendererWithTooltip.js +7 -4
- package/DefaultHeadCellRendererWithTooltip/DefaultHeadCellRendererWithTooltip.module.css.js +2 -2
- package/ProfileBand/ProfileBand.d.ts +5 -4
- package/ProfileBand/ProfileBand.js +4 -5
- package/ProfileBand/ProfileBand.module.css.js +9 -0
- package/RCTree/styles.d.ts +1 -1
- package/RowCellChipWithTooltip/RowCellChipWithTooltip.d.ts +9 -0
- package/RowCellChipWithTooltip/RowCellChipWithTooltip.js +18 -0
- package/RowCellChipWithTooltip/RowCellChipWithTooltip.module.css.js +9 -0
- package/RowCellChipWithTooltip/index.d.ts +1 -0
- package/RowCellChipWithTooltip/index.js +1 -0
- package/RowCellChips/RowCellChips.d.ts +11 -0
- package/RowCellChips/RowCellChips.js +9 -0
- package/RowCellChips/RowCellChips.module.css.js +9 -0
- package/RowCellChips/index.d.ts +1 -0
- package/RowCellChips/index.js +1 -0
- package/TableWithBars/TableWithBars.test.js +3 -3
- package/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.js +1 -1
- package/cjs/AttributeCellRenderers/BlobRenderer.d.ts +5 -0
- package/cjs/AttributeCellRenderers/BlobRenderer.js +28 -0
- package/cjs/AttributeCellRenderers/EntityIdRenderer.d.ts +11 -0
- package/cjs/AttributeCellRenderers/EntityIdRenderer.js +26 -0
- package/cjs/AttributeCellRenderers/EntityProfileRenderer.d.ts +5 -0
- package/cjs/AttributeCellRenderers/EntityProfileRenderer.js +22 -0
- package/cjs/AttributeCellRenderers/ImageRenderer.d.ts +10 -0
- package/cjs/AttributeCellRenderers/ImageRenderer.js +17 -0
- package/cjs/AttributeCellRenderers/ReferenceRenderer.d.ts +5 -0
- package/cjs/AttributeCellRenderers/ReferenceRenderer.js +29 -0
- package/cjs/AttributeCellRenderers/SimpleAttributeRenderer.d.ts +5 -0
- package/cjs/AttributeCellRenderers/SimpleAttributeRenderer.js +27 -0
- package/cjs/AttributeCellRenderers/getAttributeValueRenderer.d.ts +15 -0
- package/cjs/AttributeCellRenderers/getAttributeValueRenderer.js +31 -0
- package/cjs/AttributeCellRenderers/index.d.ts +1 -0
- package/cjs/AttributeCellRenderers/index.js +5 -0
- package/cjs/AttributeCellRenderers/styles.module.css.js +9 -0
- package/cjs/AttributeRowCellRenderer/AttributeRowCellRenderer.d.ts +21 -0
- package/cjs/AttributeRowCellRenderer/AttributeRowCellRenderer.js +47 -0
- package/cjs/AttributeRowCellRenderer/index.d.ts +1 -0
- package/cjs/AttributeRowCellRenderer/index.js +8 -0
- package/cjs/DefaultHeadCellRendererWithTooltip/DefaultHeadCellRendererWithTooltip.d.ts +4 -1
- package/cjs/DefaultHeadCellRendererWithTooltip/DefaultHeadCellRendererWithTooltip.js +7 -4
- package/cjs/DefaultHeadCellRendererWithTooltip/DefaultHeadCellRendererWithTooltip.module.css.js +2 -2
- package/cjs/ProfileBand/ProfileBand.d.ts +5 -4
- package/cjs/ProfileBand/ProfileBand.js +14 -15
- package/cjs/ProfileBand/ProfileBand.module.css.js +9 -0
- package/cjs/RCTree/styles.d.ts +1 -1
- package/cjs/RowCellChipWithTooltip/RowCellChipWithTooltip.d.ts +9 -0
- package/cjs/RowCellChipWithTooltip/RowCellChipWithTooltip.js +48 -0
- package/cjs/RowCellChipWithTooltip/RowCellChipWithTooltip.module.css.js +9 -0
- package/cjs/RowCellChipWithTooltip/index.d.ts +1 -0
- package/cjs/RowCellChipWithTooltip/index.js +5 -0
- package/cjs/RowCellChips/RowCellChips.d.ts +11 -0
- package/cjs/RowCellChips/RowCellChips.js +16 -0
- package/cjs/RowCellChips/RowCellChips.module.css.js +9 -0
- package/cjs/RowCellChips/index.d.ts +1 -0
- package/cjs/RowCellChips/index.js +5 -0
- package/cjs/TableWithBars/TableWithBars.test.js +3 -3
- package/cjs/TableWithBars/components/HeadCellRenderer/HeadCellRenderer.js +1 -1
- package/cjs/contexts/BasicTableContext/index.d.ts +1 -1
- package/cjs/contexts/MdmModuleContext/context.d.ts +4 -0
- package/cjs/contexts/MdmModuleContext/hooks.d.ts +2 -0
- package/cjs/contexts/MdmModuleContext/hooks.js +6 -2
- package/cjs/contexts/MdmModuleContext/index.d.ts +1 -1
- package/cjs/contexts/MdmModuleContext/index.js +3 -1
- package/cjs/features/history/HistoryRow/styles.d.ts +1 -1
- package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.d.ts +8 -0
- package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +18 -0
- package/cjs/features/workflow/ChangeRequestEditor/ChangeRequestEditor.module.css.js +9 -0
- package/cjs/features/workflow/ChangeRequestEditor/index.d.ts +1 -0
- package/cjs/features/workflow/ChangeRequestEditor/index.js +5 -0
- package/cjs/features/workflow/ReviewDCRButton/ReviewDCRButton.d.ts +6 -0
- package/cjs/features/workflow/ReviewDCRButton/ReviewDCRButton.js +19 -0
- package/cjs/features/workflow/ReviewDCRButton/ReviewDCRButton.module.css.js +9 -0
- package/cjs/features/workflow/ReviewDCRButton/index.d.ts +1 -0
- package/cjs/features/workflow/ReviewDCRButton/index.js +5 -0
- package/cjs/features/workflow/ReviewDCRDialog/ReviewDCRDialog.d.ts +11 -0
- package/cjs/features/workflow/ReviewDCRDialog/ReviewDCRDialog.js +63 -0
- package/cjs/features/workflow/ReviewDCRDialog/ReviewDCRDialog.module.css.js +9 -0
- package/cjs/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.d.ts +8 -0
- package/cjs/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.js +73 -0
- package/cjs/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.module.css.js +9 -0
- package/cjs/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/index.d.ts +1 -0
- package/cjs/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/index.js +5 -0
- package/cjs/features/workflow/ReviewDCRDialog/components/DCRSummaryInfo/DCRSummaryInfo.d.ts +9 -0
- package/cjs/features/workflow/ReviewDCRDialog/components/DCRSummaryInfo/DCRSummaryInfo.js +40 -0
- package/cjs/features/workflow/ReviewDCRDialog/components/DCRSummaryInfo/DCRSummaryInfo.module.css.js +9 -0
- package/cjs/features/workflow/ReviewDCRDialog/helpers/calculateDCRChanges.d.ts +3 -0
- package/cjs/features/workflow/ReviewDCRDialog/helpers/calculateDCRChanges.js +19 -0
- package/cjs/features/workflow/ReviewDCRDialog/helpers/calculateDCRChanges.test.d.ts +1 -0
- package/cjs/features/workflow/ReviewDCRDialog/helpers/calculateDCRChanges.test.js +124 -0
- package/cjs/features/workflow/ReviewDCRDialog/helpers/index.d.ts +1 -0
- package/cjs/features/workflow/ReviewDCRDialog/helpers/index.js +5 -0
- package/cjs/features/workflow/ReviewDCRDialog/index.d.ts +1 -0
- package/cjs/features/workflow/ReviewDCRDialog/index.js +5 -0
- package/cjs/features/workflow/WorkflowActionButtons/WorkflowActionButtons.d.ts +12 -0
- package/cjs/features/workflow/WorkflowActionButtons/WorkflowActionButtons.js +57 -0
- package/cjs/features/workflow/WorkflowActionButtons/index.d.ts +1 -0
- package/cjs/features/workflow/WorkflowActionButtons/index.js +5 -0
- package/cjs/features/workflow/WorkflowComments/WorkflowComments.d.ts +7 -1
- package/cjs/features/workflow/WorkflowComments/WorkflowComments.js +15 -31
- package/cjs/features/workflow/WorkflowComments/WorkflowComments.module.css.js +9 -0
- package/cjs/features/workflow/WorkflowTaskCard/components/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +46 -6
- package/cjs/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/GenericWorkflowTaskCard.d.ts +2 -1
- package/cjs/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/GenericWorkflowTaskCard.js +30 -29
- package/cjs/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/GenericWorkflowTaskCard.module.css.js +9 -0
- package/cjs/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/GenericWorkflowTaskCard.spec.js +20 -2
- package/cjs/features/workflow/index.d.ts +2 -0
- package/cjs/features/workflow/index.js +5 -1
- package/cjs/icons/RequestSummary.d.ts +3 -0
- package/cjs/icons/RequestSummary.js +24 -0
- package/cjs/icons/ReviewDCR.d.ts +3 -0
- package/cjs/icons/ReviewDCR.js +22 -0
- package/cjs/index.d.ts +3 -0
- package/cjs/index.js +14 -8
- package/cjs/types/basicTable.d.ts +12 -0
- package/cjs/types/basicTable.js +11 -0
- package/contexts/BasicTableContext/index.d.ts +1 -1
- package/contexts/MdmModuleContext/context.d.ts +4 -0
- package/contexts/MdmModuleContext/hooks.d.ts +2 -0
- package/contexts/MdmModuleContext/hooks.js +2 -0
- package/contexts/MdmModuleContext/index.d.ts +1 -1
- package/contexts/MdmModuleContext/index.js +1 -1
- package/features/history/HistoryRow/styles.d.ts +1 -1
- package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.d.ts +8 -0
- package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.js +11 -0
- package/features/workflow/ChangeRequestEditor/ChangeRequestEditor.module.css.js +9 -0
- package/features/workflow/ChangeRequestEditor/index.d.ts +1 -0
- package/features/workflow/ChangeRequestEditor/index.js +1 -0
- package/features/workflow/ReviewDCRButton/ReviewDCRButton.d.ts +6 -0
- package/features/workflow/ReviewDCRButton/ReviewDCRButton.js +12 -0
- package/features/workflow/ReviewDCRButton/ReviewDCRButton.module.css.js +9 -0
- package/features/workflow/ReviewDCRButton/index.d.ts +1 -0
- package/features/workflow/ReviewDCRButton/index.js +1 -0
- package/features/workflow/ReviewDCRDialog/ReviewDCRDialog.d.ts +11 -0
- package/features/workflow/ReviewDCRDialog/ReviewDCRDialog.js +56 -0
- package/features/workflow/ReviewDCRDialog/ReviewDCRDialog.module.css.js +9 -0
- package/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.d.ts +8 -0
- package/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.js +43 -0
- package/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/DCRChangesSummary.module.css.js +9 -0
- package/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/index.d.ts +1 -0
- package/features/workflow/ReviewDCRDialog/components/DCRChangesSummary/index.js +1 -0
- package/features/workflow/ReviewDCRDialog/components/DCRSummaryInfo/DCRSummaryInfo.d.ts +9 -0
- package/features/workflow/ReviewDCRDialog/components/DCRSummaryInfo/DCRSummaryInfo.js +33 -0
- package/features/workflow/ReviewDCRDialog/components/DCRSummaryInfo/DCRSummaryInfo.module.css.js +9 -0
- package/features/workflow/ReviewDCRDialog/helpers/calculateDCRChanges.d.ts +3 -0
- package/features/workflow/ReviewDCRDialog/helpers/calculateDCRChanges.js +15 -0
- package/features/workflow/ReviewDCRDialog/helpers/calculateDCRChanges.test.d.ts +1 -0
- package/features/workflow/ReviewDCRDialog/helpers/calculateDCRChanges.test.js +122 -0
- package/features/workflow/ReviewDCRDialog/helpers/index.d.ts +1 -0
- package/features/workflow/ReviewDCRDialog/helpers/index.js +1 -0
- package/features/workflow/ReviewDCRDialog/index.d.ts +1 -0
- package/features/workflow/ReviewDCRDialog/index.js +1 -0
- package/features/workflow/WorkflowActionButtons/WorkflowActionButtons.d.ts +12 -0
- package/features/workflow/WorkflowActionButtons/WorkflowActionButtons.js +27 -0
- package/features/workflow/WorkflowActionButtons/index.d.ts +1 -0
- package/features/workflow/WorkflowActionButtons/index.js +1 -0
- package/features/workflow/WorkflowComments/WorkflowComments.d.ts +7 -1
- package/features/workflow/WorkflowComments/WorkflowComments.js +13 -29
- package/features/workflow/WorkflowComments/WorkflowComments.module.css.js +9 -0
- package/features/workflow/WorkflowTaskCard/components/DataChangeRequestTaskCard/DataChangeRequestTaskCard.js +23 -6
- package/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/GenericWorkflowTaskCard.d.ts +2 -1
- package/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/GenericWorkflowTaskCard.js +8 -7
- package/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/GenericWorkflowTaskCard.module.css.js +9 -0
- package/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/GenericWorkflowTaskCard.spec.js +20 -2
- package/features/workflow/index.d.ts +2 -0
- package/features/workflow/index.js +2 -0
- package/icons/RequestSummary.d.ts +3 -0
- package/icons/RequestSummary.js +19 -0
- package/icons/ReviewDCR.d.ts +3 -0
- package/icons/ReviewDCR.js +17 -0
- package/index.d.ts +3 -0
- package/index.js +3 -0
- package/package.json +2 -2
- package/types/basicTable.d.ts +12 -0
- package/types/basicTable.js +10 -1
- package/ProfileBand/styles.d.ts +0 -1
- package/ProfileBand/styles.js +0 -87
- package/cjs/ProfileBand/styles.d.ts +0 -1
- package/cjs/ProfileBand/styles.js +0 -90
- package/cjs/features/workflow/WorkflowComments/styles.d.ts +0 -1
- package/cjs/features/workflow/WorkflowComments/styles.js +0 -42
- package/cjs/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/styles.d.ts +0 -3
- package/cjs/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/styles.js +0 -113
- package/features/workflow/WorkflowComments/styles.d.ts +0 -1
- package/features/workflow/WorkflowComments/styles.js +0 -39
- package/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/styles.d.ts +0 -3
- package/features/workflow/WorkflowTaskCard/components/GenericWorkflowTaskCard/styles.js +0 -110
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { mergeChanges } from '../../AttributesChanges/helpers/merge';
|
|
2
|
+
export var calculateDCRChanges = function (metadata, changes, groupedObjects) {
|
|
3
|
+
var mergedChanges = groupedObjects.reduce(function (mergedChanges, object) {
|
|
4
|
+
var _a = mergeChanges(metadata, changes, object.entity, object.relations), mergedEntityChanges = _a[0], mergedRelationsChanges = _a[1];
|
|
5
|
+
return mergedChanges.concat(mergedEntityChanges).concat(mergedRelationsChanges);
|
|
6
|
+
}, []);
|
|
7
|
+
var changesCounts = mergedChanges.reduce(function (changesCounts, _a) {
|
|
8
|
+
var operation = _a.operation;
|
|
9
|
+
if (operation) {
|
|
10
|
+
changesCounts[operation] = (changesCounts[operation] || 0) + 1;
|
|
11
|
+
}
|
|
12
|
+
return changesCounts;
|
|
13
|
+
}, {});
|
|
14
|
+
return changesCounts;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { calculateDCRChanges } from './calculateDCRChanges';
|
|
2
|
+
import { DCRTypes } from '@reltio/mdm-sdk';
|
|
3
|
+
describe('calculateDCRChanges', function () {
|
|
4
|
+
var metadata = {
|
|
5
|
+
entityTypes: [
|
|
6
|
+
{
|
|
7
|
+
uri: 'configuration/entityTypes/HCP',
|
|
8
|
+
label: 'HCP',
|
|
9
|
+
attributes: [
|
|
10
|
+
{
|
|
11
|
+
label: 'Name',
|
|
12
|
+
name: 'Name',
|
|
13
|
+
type: 'String',
|
|
14
|
+
uri: 'configuration/entityTypes/HCP/attributes/Name'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: 'City',
|
|
18
|
+
name: 'City',
|
|
19
|
+
type: 'String',
|
|
20
|
+
uri: 'configuration/entityTypes/HCP/attributes/City'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: 'Tags',
|
|
24
|
+
name: 'Tags',
|
|
25
|
+
type: 'String',
|
|
26
|
+
uri: 'configuration/entityTypes/HCP/attributes/Tags'
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
};
|
|
32
|
+
var groupedObjects = [
|
|
33
|
+
{
|
|
34
|
+
entity: {
|
|
35
|
+
uri: 'entities/123',
|
|
36
|
+
label: 'Entity 123',
|
|
37
|
+
type: 'configuration/entityTypes/HCP',
|
|
38
|
+
isExist: true,
|
|
39
|
+
secondaryLabel: 'Test Secondary Label'
|
|
40
|
+
},
|
|
41
|
+
relations: []
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
it('should count "added" changes correctly', function () {
|
|
45
|
+
var changes = {
|
|
46
|
+
'entities/123': [
|
|
47
|
+
{
|
|
48
|
+
id: 'change1',
|
|
49
|
+
type: DCRTypes.UPDATE_TAGS,
|
|
50
|
+
oldValue: ['tag1', 'tag2'],
|
|
51
|
+
newValue: ['tag1', 'tag2', 'tag3']
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'change2',
|
|
55
|
+
type: DCRTypes.UPDATE_ROLES,
|
|
56
|
+
oldValue: ['role1'],
|
|
57
|
+
newValue: ['role1', 'role2']
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'change3',
|
|
61
|
+
attributePath: 'Name',
|
|
62
|
+
type: DCRTypes.INSERT_ATTRIBUTE,
|
|
63
|
+
objectType: 'configuration/entityTypes/HCP',
|
|
64
|
+
newValue: {
|
|
65
|
+
value: {
|
|
66
|
+
Name: [{ value: 'John' }]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
};
|
|
72
|
+
var result = calculateDCRChanges(metadata, changes, groupedObjects);
|
|
73
|
+
expect(result).toEqual({
|
|
74
|
+
added: 3
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
it('should count multiple change types correctly', function () {
|
|
78
|
+
var changes = {
|
|
79
|
+
'entities/123': [
|
|
80
|
+
{
|
|
81
|
+
id: 'change1',
|
|
82
|
+
type: DCRTypes.UPDATE_TAGS,
|
|
83
|
+
oldValue: ['tag1'],
|
|
84
|
+
newValue: ['tag1', 'tag2', 'tag3']
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 'change2',
|
|
88
|
+
type: DCRTypes.UPDATE_ROLES,
|
|
89
|
+
oldValue: ['role1', 'role2'],
|
|
90
|
+
newValue: ['role1']
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'change3',
|
|
94
|
+
attributePath: 'City',
|
|
95
|
+
type: DCRTypes.INSERT_ATTRIBUTE,
|
|
96
|
+
objectType: 'configuration/entityTypes/HCP',
|
|
97
|
+
newValue: { value: { City: [{ value: 'New York' }] } }
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: 'change4',
|
|
101
|
+
attributePath: 'Name/21vmKank',
|
|
102
|
+
attributeType: 'configuration/entityTypes/HCP/attributes/Name',
|
|
103
|
+
type: DCRTypes.UPDATE_ATTRIBUTE,
|
|
104
|
+
objectType: 'configuration/entityTypes/HCP',
|
|
105
|
+
oldValue: { value: 'John' },
|
|
106
|
+
newValue: { value: 'Mike' }
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
};
|
|
110
|
+
var result = calculateDCRChanges(metadata, changes, groupedObjects);
|
|
111
|
+
expect(result).toEqual({
|
|
112
|
+
added: 2,
|
|
113
|
+
deleted: 1,
|
|
114
|
+
edited: 1
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
it('should handle empty changes', function () {
|
|
118
|
+
var changes = {};
|
|
119
|
+
var result = calculateDCRChanges(metadata, changes, groupedObjects);
|
|
120
|
+
expect(result).toEqual({});
|
|
121
|
+
});
|
|
122
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { calculateDCRChanges, type DCRChangeCounts } from './calculateDCRChanges';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { calculateDCRChanges } from './calculateDCRChanges';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReviewDCRDialog } from './ReviewDCRDialog';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReviewDCRDialog } from './ReviewDCRDialog';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TaskAction } from '../types';
|
|
3
|
+
type Props = {
|
|
4
|
+
workflowActions: TaskAction[];
|
|
5
|
+
actionRequestIsInProgress?: boolean;
|
|
6
|
+
preferredAction?: {
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
comment?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const WorkflowActionButtons: ({ workflowActions: actions, actionRequestIsInProgress, preferredAction, comment }: Props) => React.JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
|
+
import Button from '@mui/material/Button';
|
|
3
|
+
import { ModeSwitcherSelect } from '../../../ModeSwitcherSelect';
|
|
4
|
+
export var WorkflowActionButtons = function (_a) {
|
|
5
|
+
var actions = _a.workflowActions, actionRequestIsInProgress = _a.actionRequestIsInProgress, preferredAction = _a.preferredAction, _b = _a.comment, comment = _b === void 0 ? '' : _b;
|
|
6
|
+
var _c = useState(function () { var _a; return (preferredAction === null || preferredAction === void 0 ? void 0 : preferredAction.label) || ((_a = actions[0]) === null || _a === void 0 ? void 0 : _a.text); }), currentAction = _c[0], setCurrentAction = _c[1];
|
|
7
|
+
var buttonsGroup = useMemo(function () {
|
|
8
|
+
return actions.map(function (_a) {
|
|
9
|
+
var text = _a.text, onClick = _a.onClick;
|
|
10
|
+
return ({
|
|
11
|
+
label: text,
|
|
12
|
+
onClick: function () {
|
|
13
|
+
setCurrentAction(text);
|
|
14
|
+
onClick(comment);
|
|
15
|
+
},
|
|
16
|
+
value: text
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}, [actions, comment]);
|
|
20
|
+
if (buttonsGroup.length === 0) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
if (buttonsGroup.length === 1) {
|
|
24
|
+
return (React.createElement(Button, { variant: "outlined", onClick: buttonsGroup[0].onClick, disabled: actionRequestIsInProgress, size: "small" }, buttonsGroup[0].label));
|
|
25
|
+
}
|
|
26
|
+
return (React.createElement(ModeSwitcherSelect, { buttonsGroup: buttonsGroup, value: currentAction, loading: actionRequestIsInProgress, disabled: actionRequestIsInProgress }));
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WorkflowActionButtons } from './WorkflowActionButtons';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WorkflowActionButtons } from './WorkflowActionButtons';
|
|
@@ -8,6 +8,12 @@ type Props = {
|
|
|
8
8
|
taskId: string;
|
|
9
9
|
isTaskOpen: boolean;
|
|
10
10
|
preferredAction?: WorkflowAction;
|
|
11
|
+
showActionButtons?: boolean;
|
|
12
|
+
alwaysExpanded?: boolean;
|
|
13
|
+
classes?: {
|
|
14
|
+
container?: string;
|
|
15
|
+
commentsContainer?: string;
|
|
16
|
+
};
|
|
11
17
|
};
|
|
12
|
-
export declare const WorkflowComments: ({ workflowActions: actions, actionRequestIsInProgress, processInstanceComments, taskId, isTaskOpen, preferredAction }: Props) => React.JSX.Element;
|
|
18
|
+
export declare const WorkflowComments: ({ workflowActions: actions, actionRequestIsInProgress, processInstanceComments, taskId, isTaskOpen, preferredAction, showActionButtons, alwaysExpanded, classes }: Props) => React.JSX.Element;
|
|
13
19
|
export {};
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import React, { useCallback, useState
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
2
3
|
import i18n from 'ui-i18n';
|
|
3
4
|
import Input from '@mui/material/Input';
|
|
4
5
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
5
6
|
import SendIcon from '@mui/icons-material/Send';
|
|
6
|
-
import Button from '@mui/material/Button';
|
|
7
7
|
import { CollapsedComments } from './components/CollapsedComments';
|
|
8
8
|
import { ExpandedComments } from './components/ExpandedComments';
|
|
9
9
|
import { useWorkflowComments } from '../hooks/useWorkflowComments';
|
|
10
10
|
import { SmallIconButton } from '../../../SmallIconButton';
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
11
|
+
import { WorkflowActionButtons } from '../WorkflowActionButtons';
|
|
12
|
+
import styles from './WorkflowComments.module.css';
|
|
13
13
|
export var WorkflowComments = function (_a) {
|
|
14
|
-
var actions = _a.workflowActions, actionRequestIsInProgress = _a.actionRequestIsInProgress, processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isTaskOpen = _a.isTaskOpen, preferredAction = _a.preferredAction;
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var _d = useState(function () { var _a; return (preferredAction === null || preferredAction === void 0 ? void 0 : preferredAction.label) || ((_a = actions[0]) === null || _a === void 0 ? void 0 : _a.text); }), currentAction = _d[0], setCurrentAction = _d[1];
|
|
19
|
-
var _e = useWorkflowComments({
|
|
14
|
+
var actions = _a.workflowActions, actionRequestIsInProgress = _a.actionRequestIsInProgress, processInstanceComments = _a.processInstanceComments, taskId = _a.taskId, isTaskOpen = _a.isTaskOpen, preferredAction = _a.preferredAction, _b = _a.showActionButtons, showActionButtons = _b === void 0 ? true : _b, _c = _a.alwaysExpanded, alwaysExpanded = _c === void 0 ? false : _c, classes = _a.classes;
|
|
15
|
+
var _d = useState(false), expanded = _d[0], setExpanded = _d[1];
|
|
16
|
+
var _e = useState(''), comment = _e[0], setComment = _e[1];
|
|
17
|
+
var _f = useWorkflowComments({
|
|
20
18
|
processInstanceComments: processInstanceComments,
|
|
21
19
|
taskId: taskId,
|
|
22
20
|
isOpen: isTaskOpen
|
|
23
|
-
}), comments =
|
|
21
|
+
}), comments = _f.comments, writeComment = _f.writeComment, readOnly = _f.readOnly;
|
|
24
22
|
var sendComment = useCallback(function () {
|
|
25
23
|
writeComment(comment);
|
|
26
24
|
setComment('');
|
|
@@ -40,28 +38,14 @@ export var WorkflowComments = function (_a) {
|
|
|
40
38
|
e.preventDefault();
|
|
41
39
|
}
|
|
42
40
|
}, [comment, sendComment]);
|
|
43
|
-
|
|
44
|
-
return actions.map(function (_a) {
|
|
45
|
-
var text = _a.text, onClick = _a.onClick;
|
|
46
|
-
return ({
|
|
47
|
-
label: text,
|
|
48
|
-
onClick: function () {
|
|
49
|
-
setCurrentAction(text);
|
|
50
|
-
onClick(comment);
|
|
51
|
-
},
|
|
52
|
-
value: text
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
}, [actions, comment]);
|
|
56
|
-
return (React.createElement("div", { className: styles.container },
|
|
41
|
+
return (React.createElement("div", { className: classnames(styles.container, classes === null || classes === void 0 ? void 0 : classes.container) },
|
|
57
42
|
React.createElement("div", { className: styles.title },
|
|
58
43
|
" ",
|
|
59
44
|
i18n.text('Comments'),
|
|
60
45
|
" "),
|
|
61
|
-
React.createElement("div", { className: styles.commentsContainer }, expanded || comments.length < 3 ? (React.createElement(ExpandedComments, { comments: comments })) : (React.createElement(CollapsedComments, { onClick: function () { return setExpanded(true); }, comments: comments }))),
|
|
46
|
+
React.createElement("div", { className: classnames(styles.commentsContainer, classes === null || classes === void 0 ? void 0 : classes.commentsContainer) }, expanded || alwaysExpanded || comments.length < 3 ? (React.createElement(ExpandedComments, { comments: comments })) : (React.createElement(CollapsedComments, { onClick: function () { return setExpanded(true); }, comments: comments }))),
|
|
62
47
|
!readOnly && (React.createElement(Input, { endAdornment: React.createElement(InputAdornment, { position: "end", className: styles.sendButton },
|
|
63
48
|
React.createElement(SmallIconButton, { icon: SendIcon, disabled: comment.length === 0, onClick: sendComment, "data-reltio-id": "send-button" })), classes: { root: styles.filledInputRoot }, placeholder: i18n.text('Write a comment'), value: comment, onKeyPress: handleKeyPress, onChange: handleChange, disableUnderline: true, multiline: true })),
|
|
64
|
-
React.createElement("div", { className: styles.modeSwitcherWrapper },
|
|
65
|
-
|
|
66
|
-
buttonsGroup.length > 1 && (React.createElement(ModeSwitcherSelect, { buttonsGroup: buttonsGroup, value: currentAction, loading: actionRequestIsInProgress, disabled: actionRequestIsInProgress })))));
|
|
49
|
+
showActionButtons && (React.createElement("div", { className: styles.modeSwitcherWrapper },
|
|
50
|
+
React.createElement(WorkflowActionButtons, { workflowActions: actions, actionRequestIsInProgress: actionRequestIsInProgress, preferredAction: preferredAction, comment: comment })))));
|
|
67
51
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"container":"WorkflowComments-container--zu4Un","commentsContainer":"WorkflowComments-commentsContainer--CHV0q","title":"WorkflowComments-title--a0FTZ","filledInputRoot":"WorkflowComments-filledInputRoot--q5WAu","focused":"WorkflowComments-focused--s-NQa","modeSwitcherWrapper":"WorkflowComments-modeSwitcherWrapper--b585U","sendButton":"WorkflowComments-sendButton--NjNcl"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.WorkflowComments-container--zu4Un{display:flex;flex-direction:column;padding:5px 0}.WorkflowComments-commentsContainer--CHV0q{max-height:300px;overflow-y:auto}.WorkflowComments-title--a0FTZ{color:rgba(0,0,0,.87);font-size:14px;margin:0 0 8px 5px}.WorkflowComments-filledInputRoot--q5WAu{background-color:rgba(0,0,0,.03);font-size:14px;margin:10px 17px 0 6px;min-height:40px;padding:10px 6px}.WorkflowComments-filledInputRoot--q5WAu.WorkflowComments-focused--s-NQa,.WorkflowComments-filledInputRoot--q5WAu:hover{background-color:rgba(0,0,0,.03)}.WorkflowComments-modeSwitcherWrapper--b585U{margin-left:auto;margin-right:16px;margin-top:8px}.WorkflowComments-sendButton--NjNcl{align-self:end;margin-bottom:10px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -1,16 +1,33 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
2
2
|
import DcrTaskIcon from '../../../../../icons/DcrTaskIcon';
|
|
3
|
+
import { useMdmReviewDCREnabled, useMdmUsername } from '../../../../../contexts/MdmModuleContext';
|
|
3
4
|
import { GenericWorkflowTaskCard } from '../GenericWorkflowTaskCard';
|
|
4
5
|
import { AttributesChanges } from '../../../AttributesChanges';
|
|
5
6
|
import { LineDecorator } from '../../../LineDecorator';
|
|
6
7
|
import { useChangeRequest } from '../../../hooks/useChangeRequest';
|
|
7
8
|
import { getDCRUri } from '../../../helpers/common';
|
|
9
|
+
import { ReviewDCRDialog } from '../../../ReviewDCRDialog';
|
|
10
|
+
import { ReviewDCRButton } from '../../../ReviewDCRButton';
|
|
8
11
|
export var DataChangeRequestTaskCard = function (_a) {
|
|
9
12
|
var task = _a.task;
|
|
10
|
-
var
|
|
13
|
+
var reviewDCREnabled = useMdmReviewDCREnabled();
|
|
14
|
+
var username = useMdmUsername();
|
|
15
|
+
var _b = useState(false), isReviewDCRDialogOpen = _b[0], setIsReviewDCRDialogOpen = _b[1];
|
|
16
|
+
var objectURIs = task.objectURIs, assignee = task.assignee;
|
|
11
17
|
var dcrUri = getDCRUri(objectURIs);
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
var _c = useChangeRequest(dcrUri), dcr = _c.dcr, groupedObjects = _c.groupedObjects;
|
|
19
|
+
var handleReviewDCR = useCallback(function () {
|
|
20
|
+
setIsReviewDCRDialogOpen(true);
|
|
21
|
+
}, []);
|
|
22
|
+
var handleCloseReviewDCRDialog = useCallback(function () {
|
|
23
|
+
setIsReviewDCRDialogOpen(false);
|
|
24
|
+
}, []);
|
|
25
|
+
var showReviewDCRButton = reviewDCREnabled && assignee == username;
|
|
26
|
+
var showReviewDialog = isReviewDCRDialogOpen && (showReviewDCRButton || reviewDCREnabled);
|
|
27
|
+
var customActionsSlot = useMemo(function () { return showReviewDCRButton && React.createElement(ReviewDCRButton, { onClick: handleReviewDCR }); }, [showReviewDCRButton, handleReviewDCR]);
|
|
28
|
+
return (React.createElement(React.Fragment, null,
|
|
29
|
+
React.createElement(GenericWorkflowTaskCard, { task: task, Icon: DcrTaskIcon, customActionsSlot: customActionsSlot }, dcr &&
|
|
30
|
+
groupedObjects.map(function (object, index) { return (React.createElement(LineDecorator, { key: index, last: index === groupedObjects.length - 1, divider: true },
|
|
31
|
+
React.createElement(AttributesChanges, { entityInfo: object.entity, relationsInfo: object.relations, changes: dcr.changes, objectsInfo: dcr.objectsInfo, dcrUri: dcrUri }))); })),
|
|
32
|
+
showReviewDialog && (React.createElement(ReviewDCRDialog, { open: isReviewDCRDialogOpen, onClose: handleCloseReviewDCRDialog, dcr: dcr, groupedObjects: groupedObjects, task: task }))));
|
|
16
33
|
};
|
|
@@ -5,6 +5,7 @@ type Props = {
|
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
actions?: React.ReactNode;
|
|
7
7
|
Icon?: React.ElementType;
|
|
8
|
+
customActionsSlot?: React.ReactNode;
|
|
8
9
|
};
|
|
9
|
-
export declare const GenericWorkflowTaskCard: ({ task, children, actions, Icon }: Props) => React.JSX.Element;
|
|
10
|
+
export declare const GenericWorkflowTaskCard: ({ task, children, actions, Icon, customActionsSlot }: Props) => React.JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -15,14 +15,13 @@ import { useWorkflowCheckPermission } from '../../../hooks/useWorkflowCheckPermi
|
|
|
15
15
|
import CollaborationIcon from '../../../../../icons/CollaborationIcon';
|
|
16
16
|
import { useWorkflowActions } from '../../../hooks/useWorkflowActions';
|
|
17
17
|
import { getDCRId } from '../../../helpers/common';
|
|
18
|
-
import
|
|
18
|
+
import styles from './GenericWorkflowTaskCard.module.css';
|
|
19
19
|
export var GenericWorkflowTaskCard = function (_a) {
|
|
20
20
|
var _b;
|
|
21
|
-
var task = _a.task, children = _a.children, actions = _a.actions, Icon = _a.Icon;
|
|
21
|
+
var task = _a.task, children = _a.children, actions = _a.actions, Icon = _a.Icon, customActionsSlot = _a.customActionsSlot;
|
|
22
22
|
var taskId = task.taskId, dueDate = task.dueDate, priority = task.priority, assignee = task.assignee, createdBy = task.createdBy, createTime = task.createTime, step = task.displayName, processDefinitionDisplayName = task.processDefinitionDisplayName, objectURIs = task.objectURIs, processInstanceComments = task.processInstanceComments, possibleActions = task.possibleActions, isTaskOpen = task.isOpen, preferredAction = task.preferredAction;
|
|
23
23
|
var dcrId = getDCRId(objectURIs);
|
|
24
24
|
var color = useWorkflowColor({ processDefinitionDisplayName: processDefinitionDisplayName });
|
|
25
|
-
var styles = useStyles({ color: color });
|
|
26
25
|
var _c = useState(false), isExpanded = _c[0], setExpanded = _c[1];
|
|
27
26
|
var checkWorkflowPermission = useWorkflowCheckPermission();
|
|
28
27
|
var canViewComments = checkWorkflowPermission('VIEW_PROCESS_INSTANCE_COMMENTS');
|
|
@@ -34,7 +33,7 @@ export var GenericWorkflowTaskCard = function (_a) {
|
|
|
34
33
|
}), workflowActions = _d.actions, actionRequestIsInProgress = _d.actionRequestIsInProgress;
|
|
35
34
|
return (React.createElement("div", { className: styles.card },
|
|
36
35
|
React.createElement("div", { className: classnames((_b = {}, _b[styles.withBackground] = isExpanded, _b)) },
|
|
37
|
-
React.createElement("div", { className: styles.lineWrapper },
|
|
36
|
+
React.createElement("div", { className: styles.lineWrapper, style: { '--workflow-color': color } },
|
|
38
37
|
React.createElement("div", { className: styles.line }),
|
|
39
38
|
Icon && React.createElement(Icon, { className: styles.icon }),
|
|
40
39
|
React.createElement(LineDecorator, { plain: true, first: true, transparent: !isExpanded },
|
|
@@ -65,9 +64,11 @@ export var GenericWorkflowTaskCard = function (_a) {
|
|
|
65
64
|
i18n.text('Step'),
|
|
66
65
|
': ',
|
|
67
66
|
React.createElement("span", { className: styles.infoValue }, step)),
|
|
68
|
-
|
|
69
|
-
React.createElement(
|
|
70
|
-
|
|
67
|
+
React.createElement("div", { className: styles.bottomInfo },
|
|
68
|
+
canViewComments && (processInstanceComments === null || processInstanceComments === void 0 ? void 0 : processInstanceComments.length) > 0 && (React.createElement("div", { className: styles.commentsInfo },
|
|
69
|
+
React.createElement(CollaborationIcon, { className: styles.commentsIcon }),
|
|
70
|
+
React.createElement("div", { className: styles.infoValue }, processInstanceComments.length))),
|
|
71
|
+
customActionsSlot && (React.createElement("div", { className: styles.customActionsSlot }, customActionsSlot)))),
|
|
71
72
|
actions || (React.createElement(TaskActions, { actions: workflowActions, isInProgress: actionRequestIsInProgress })))))),
|
|
72
73
|
isExpanded && (React.createElement(LineDecorator, { plain: true },
|
|
73
74
|
React.createElement("div", { className: styles.controlsBox },
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"card":"GenericWorkflowTaskCard-card--EMo-i","withBackground":"GenericWorkflowTaskCard-withBackground--Y--db","lineWrapper":"GenericWorkflowTaskCard-lineWrapper--15MN6","icon":"GenericWorkflowTaskCard-icon--eoHOp","line":"GenericWorkflowTaskCard-line--Z1Emv","info":"GenericWorkflowTaskCard-info--2OyKu","bottomInfo":"GenericWorkflowTaskCard-bottomInfo--4bsc4","commentsInfo":"GenericWorkflowTaskCard-commentsInfo--Q6M07","commentsIcon":"GenericWorkflowTaskCard-commentsIcon--crUiN","infoValue":"GenericWorkflowTaskCard-infoValue---gkaX","infoBlock":"GenericWorkflowTaskCard-infoBlock--VyI2O","header":"GenericWorkflowTaskCard-header--bN0nh","flex":"GenericWorkflowTaskCard-flex--5oWde","caption":"GenericWorkflowTaskCard-caption--vxnNJ","title":"GenericWorkflowTaskCard-title--zyCft","flag":"GenericWorkflowTaskCard-flag--dfydb","date":"GenericWorkflowTaskCard-date--MHd-G","mainInfo":"GenericWorkflowTaskCard-mainInfo--l5b9R","controlsBox":"GenericWorkflowTaskCard-controlsBox--ZHDhQ","controlsInRow":"GenericWorkflowTaskCard-controlsInRow--c48Nv","priority":"GenericWorkflowTaskCard-priority--xnnl9","comments":"GenericWorkflowTaskCard-comments--OG-db","customActionsSlot":"GenericWorkflowTaskCard-customActionsSlot--J-mXk"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.GenericWorkflowTaskCard-card--EMo-i{border-bottom:1px solid rgba(0,0,0,.06)}.GenericWorkflowTaskCard-withBackground--Y--db{background-color:rgba(0,0,0,.03)}.GenericWorkflowTaskCard-lineWrapper--15MN6{position:relative}.GenericWorkflowTaskCard-icon--eoHOp{height:32px;left:16px;position:absolute;top:8px;width:32px;z-index:1}.GenericWorkflowTaskCard-line--Z1Emv{border-left:3px solid var(--workflow-color);bottom:0;left:0;position:absolute;top:0}.GenericWorkflowTaskCard-info--2OyKu{color:rgba(0,0,0,.54);font-size:13px;word-wrap:break-word;line-height:15px}.GenericWorkflowTaskCard-bottomInfo--4bsc4{align-items:flex-start;display:flex}.GenericWorkflowTaskCard-commentsInfo--Q6M07{align-items:center;display:flex;margin-bottom:-4px;margin-top:7px}.GenericWorkflowTaskCard-commentsIcon--crUiN{height:11px;margin-left:2px;margin-right:6px;margin-top:-2px;width:11px}.GenericWorkflowTaskCard-infoValue---gkaX{color:rgba(0,0,0,.87)}.GenericWorkflowTaskCard-infoBlock--VyI2O{display:flex;flex-direction:row;margin-bottom:5px}.GenericWorkflowTaskCard-header--bN0nh{display:flex;flex-direction:row;padding-bottom:12px}.GenericWorkflowTaskCard-flex--5oWde{flex:1}.GenericWorkflowTaskCard-caption--vxnNJ{color:rgba(0,0,0,.87);font-size:16px}.GenericWorkflowTaskCard-title--zyCft{align-items:center;display:flex;flex-direction:row;margin-bottom:-4px}.GenericWorkflowTaskCard-flag--dfydb{height:13px;width:13px;stroke:#000;fill:none;margin:2px 5px 0}.GenericWorkflowTaskCard-date--MHd-G{color:rgba(0,0,0,.87);font-size:13px}.GenericWorkflowTaskCard-mainInfo--l5b9R{display:flex;flex:1;flex-direction:column}.GenericWorkflowTaskCard-controlsBox--ZHDhQ{margin-bottom:12px;margin-right:16px;margin-top:13px}.GenericWorkflowTaskCard-controlsInRow--c48Nv{align-items:center;display:flex;flex-direction:row;justify-content:space-between;margin-bottom:20px}.GenericWorkflowTaskCard-priority--xnnl9{width:162px}.GenericWorkflowTaskCard-comments--OG-db{margin-left:11px}.GenericWorkflowTaskCard-customActionsSlot--J-mXk{display:flex;flex-grow:1;justify-content:flex-end;margin-right:-30px}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -71,6 +71,7 @@ import { CommentDialogProvider } from '../../../../../contexts/CommentDialogCont
|
|
|
71
71
|
import { ErrorPopup } from '../../../../../ErrorPopup';
|
|
72
72
|
import { getDefaultTask } from './task.test-data';
|
|
73
73
|
import { GenericWorkflowTaskCard } from './GenericWorkflowTaskCard';
|
|
74
|
+
import { ReviewDCRButton } from '../../../ReviewDCRButton';
|
|
74
75
|
jest.mock('@reltio/mdm-sdk', function () { return (__assign(__assign({}, jest.requireActual('@reltio/mdm-sdk')), { runTaskAction: jest.fn().mockReturnValue(Promise.resolve()), getAssigneeForTask: jest.fn().mockResolvedValue({ data: ['assignee1', 'assignee2'] }), addCommentForTask: jest.fn().mockResolvedValue({ status: 'success' }), getTaskById: jest.fn() })); });
|
|
75
76
|
var onActionSuccess = jest.fn();
|
|
76
77
|
var workflowTaskContextValue = { onActionSuccess: onActionSuccess };
|
|
@@ -102,14 +103,14 @@ var defaultMdmValues = {
|
|
|
102
103
|
var errorSet = jest.fn();
|
|
103
104
|
var defaultTask = getDefaultTask();
|
|
104
105
|
var setUp = function (_a) {
|
|
105
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.mdmValues, mdmValues = _c === void 0 ? defaultMdmValues : _c, _d = _b.task, task = _d === void 0 ? defaultTask : _d;
|
|
106
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.mdmValues, mdmValues = _c === void 0 ? defaultMdmValues : _c, _d = _b.task, task = _d === void 0 ? defaultTask : _d, customActionsSlot = _b.customActionsSlot;
|
|
106
107
|
var user = userEvent.setup();
|
|
107
108
|
return __assign(__assign({}, render(React.createElement(MdmModuleProvider, { values: mdmValues, actions: { errorSet: errorSet } },
|
|
108
109
|
React.createElement(ThemeProvider, { theme: createTheme(theme) },
|
|
109
110
|
React.createElement(LocalizationProvider, { dateAdapter: AdapterMoment },
|
|
110
111
|
React.createElement(CommentDialogProvider, null,
|
|
111
112
|
React.createElement(WorkflowTasksContext.Provider, { value: workflowTaskContextValue },
|
|
112
|
-
React.createElement(GenericWorkflowTaskCard, { task: task },
|
|
113
|
+
React.createElement(GenericWorkflowTaskCard, { task: task, customActionsSlot: customActionsSlot },
|
|
113
114
|
React.createElement("div", { className: "someChildren" }, "some children")),
|
|
114
115
|
React.createElement(ErrorPopup, { showErrorFromStore: true })))))))), { user: user });
|
|
115
116
|
};
|
|
@@ -451,6 +452,23 @@ describe('GenericWorkflowTaskCard tests', function () {
|
|
|
451
452
|
}
|
|
452
453
|
});
|
|
453
454
|
}); });
|
|
455
|
+
it('should render custom actions slot if it is provided', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
456
|
+
var openReviewDialog, user, reviewDCRButton;
|
|
457
|
+
return __generator(this, function (_a) {
|
|
458
|
+
switch (_a.label) {
|
|
459
|
+
case 0:
|
|
460
|
+
openReviewDialog = jest.fn();
|
|
461
|
+
user = setUp({ customActionsSlot: React.createElement(ReviewDCRButton, { onClick: openReviewDialog }) }).user;
|
|
462
|
+
reviewDCRButton = screen.getByRole('button', { name: 'Review DCR' });
|
|
463
|
+
expect(reviewDCRButton).toBeInTheDocument();
|
|
464
|
+
return [4 /*yield*/, user.click(reviewDCRButton)];
|
|
465
|
+
case 1:
|
|
466
|
+
_a.sent();
|
|
467
|
+
expect(openReviewDialog).toHaveBeenCalled();
|
|
468
|
+
return [2 /*return*/];
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
}); });
|
|
454
472
|
describe('Required comments', function () {
|
|
455
473
|
it('should show comment dialog when user runs action and comment is required', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
456
474
|
var task, user, dialog, comment, commentInput;
|
|
@@ -5,6 +5,8 @@ export { AssigneeSelector } from './AssigneeSelector';
|
|
|
5
5
|
export { ReassignButton } from './ReassignButton';
|
|
6
6
|
export { WorkflowComments } from './WorkflowComments';
|
|
7
7
|
export { TaskActionButtons } from './TaskActionButtons';
|
|
8
|
+
export { ReviewDCRButton } from './ReviewDCRButton';
|
|
9
|
+
export { ReviewDCRDialog } from './ReviewDCRDialog';
|
|
8
10
|
export { useWorkflowAssignee } from './hooks/useWorkflowAssignee';
|
|
9
11
|
export { useWorkflowComments } from './hooks/useWorkflowComments';
|
|
10
12
|
export { useWorkflowActions } from './hooks/useWorkflowActions';
|
|
@@ -6,6 +6,8 @@ export { AssigneeSelector } from './AssigneeSelector';
|
|
|
6
6
|
export { ReassignButton } from './ReassignButton';
|
|
7
7
|
export { WorkflowComments } from './WorkflowComments';
|
|
8
8
|
export { TaskActionButtons } from './TaskActionButtons';
|
|
9
|
+
export { ReviewDCRButton } from './ReviewDCRButton';
|
|
10
|
+
export { ReviewDCRDialog } from './ReviewDCRDialog';
|
|
9
11
|
// hooks
|
|
10
12
|
export { useWorkflowAssignee } from './hooks/useWorkflowAssignee';
|
|
11
13
|
export { useWorkflowComments } from './hooks/useWorkflowComments';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
var SvgRequestSummary = function (props) {
|
|
14
|
+
return (React.createElement("svg", __assign({ width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", "data-reltio-id": "SvgRequestSummary" }, props),
|
|
15
|
+
React.createElement("ellipse", { cx: "15.972", cy: "16", rx: "15.972", ry: "16", fill: "#1D4E99" }),
|
|
16
|
+
React.createElement("path", { opacity: "0.54", d: "M24.4771 14.7002C23.972 14.3772 23.4183 14.1244 22.8286 13.9561V8.42871H8.50342V19.415H14.8589C14.8411 19.6077 14.8316 19.8027 14.8315 20C14.8315 20.3358 14.8581 20.6657 14.9087 20.9873H6.84521V6.85742H24.4771V14.7002ZM11.8091 17.8428H10.1519V16.2803H11.8091V17.8428ZM16.0483 16.2803C15.7 16.7547 15.4168 17.2799 15.2114 17.8428H13.4575V16.2803H16.0483ZM11.8091 14.708H10.1519V13.1357H11.8091V14.708ZM21.1714 13.7158C21.1496 13.7156 21.1278 13.7148 21.106 13.7148C19.8597 13.7148 18.6995 14.0804 17.7231 14.708H13.4575V13.1357H21.1714V13.7158ZM11.8091 11.5645H10.1519V10.001H11.8091V11.5645ZM21.1714 11.5645H13.4575V10.001H21.1714V11.5645Z", fill: "white" }),
|
|
17
|
+
React.createElement("path", { opacity: "0.87", d: "M21.106 14.8574C22.2479 14.8575 23.3031 15.2315 24.1558 15.8633L23.2349 16.7861C22.6252 16.3801 21.8929 16.1426 21.106 16.1426C18.9797 16.1428 17.2565 17.87 17.2563 20C17.2563 22.1301 18.9796 23.8572 21.106 23.8574C23.0435 23.8572 24.6461 22.4229 24.9155 20.5566L26.189 19.2822C26.2217 19.5168 26.2407 19.7564 26.2407 20C26.2407 22.8402 23.9412 25.1424 21.106 25.1426C18.2708 25.1423 15.9722 22.8402 15.9722 20C15.9723 17.16 18.2709 14.8577 21.106 14.8574ZM26.7075 17.208L21.2622 22.6631L20.354 21.7539V21.7529L18.5396 19.9355L19.4468 19.0264L21.2612 20.8438L25.7993 16.2988L26.7075 17.208Z", fill: "white" })));
|
|
18
|
+
};
|
|
19
|
+
export default SvgRequestSummary;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
var SvgReviewDCR = function (props) {
|
|
14
|
+
return (React.createElement("svg", __assign({ width: "16", height: "15", viewBox: "0 0 16 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
15
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2.5 9H5.51415C5.53356 8.74392 5.57268 8.49341 5.63 8.25H2.5V6.75H6.26449C6.43659 6.48075 6.63444 6.2296 6.85458 6H2.5V4.5H10V4.51415C10.1238 4.50477 10.2488 4.5 10.375 4.5C11.0397 4.5 11.673 4.63248 12.25 4.87252V1.5C12.25 0.675 11.575 0 10.75 0H1.75C0.925 0 0.25 0.675 0.25 1.5V11.25C0.25 12.075 0.925 12.75 1.75 12.75H6.85373C6.26293 12.1331 5.8327 11.3608 5.63001 10.5H2.5V9ZM10 3.75H2.5V2.25H10V3.75ZM13.225 11.1675L15.565 13.5L14.5 14.565L12.16 12.225C11.6425 12.555 11.0275 12.75 10.3675 12.75C8.5075 12.75 7 11.2425 7 9.375C7 7.5075 8.5075 6 10.375 6C12.2425 6 13.75 7.5075 13.75 9.375C13.75 10.035 13.555 10.6425 13.225 11.1675ZM10.375 11.25C11.41 11.25 12.25 10.41 12.25 9.375C12.25 8.34 11.41 7.5 10.375 7.5C9.34 7.5 8.5 8.34 8.5 9.375C8.5 10.41 9.34 11.25 10.375 11.25Z", fill: "#0072CE" })));
|
|
16
|
+
};
|
|
17
|
+
export default SvgReviewDCR;
|
package/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { AttributesErrorsPanel } from './AttributesErrorsPanel';
|
|
|
7
7
|
export { AttributesFilterSelector } from './AttributesFilterSelector';
|
|
8
8
|
export { AttributesFiltersBuilder } from './AttributesFiltersBuilder';
|
|
9
9
|
export { AttributesFiltersButton } from './AttributesFiltersButton';
|
|
10
|
+
export { AttributeRowCellRenderer } from './AttributeRowCellRenderer';
|
|
10
11
|
export { AttributesValuesEditor } from './AttributesValuesEditor';
|
|
11
12
|
export { AttributesView } from './AttributesView';
|
|
12
13
|
export { AutoSizeList } from './AutoSizeList';
|
|
@@ -56,6 +57,8 @@ export { ReferenceAttribute } from './ReferenceAttribute';
|
|
|
56
57
|
export { ReferenceAttributeEditor } from './ReferenceAttributeEditor';
|
|
57
58
|
export { RelationTypeSelector } from './RelationTypeSelector';
|
|
58
59
|
export { RowCellAutoSizer } from './RowCellAutoSizer';
|
|
60
|
+
export { RowCellChipWithTooltip } from './RowCellChipWithTooltip';
|
|
61
|
+
export { RowCellChips } from './RowCellChips';
|
|
59
62
|
export { SimpleAttribute } from './SimpleAttribute';
|
|
60
63
|
export { SimpleAttributeEditor } from './SimpleAttributeEditor';
|
|
61
64
|
export { SmallIconButton, SmallIconButtonWithTooltip } from './SmallIconButton';
|
package/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export { AttributesErrorsPanel } from './AttributesErrorsPanel';
|
|
|
8
8
|
export { AttributesFilterSelector } from './AttributesFilterSelector';
|
|
9
9
|
export { AttributesFiltersBuilder } from './AttributesFiltersBuilder';
|
|
10
10
|
export { AttributesFiltersButton } from './AttributesFiltersButton';
|
|
11
|
+
export { AttributeRowCellRenderer } from './AttributeRowCellRenderer';
|
|
11
12
|
export { AttributesValuesEditor } from './AttributesValuesEditor';
|
|
12
13
|
export { AttributesView } from './AttributesView';
|
|
13
14
|
export { AutoSizeList } from './AutoSizeList';
|
|
@@ -57,6 +58,8 @@ export { ReferenceAttribute } from './ReferenceAttribute';
|
|
|
57
58
|
export { ReferenceAttributeEditor } from './ReferenceAttributeEditor';
|
|
58
59
|
export { RelationTypeSelector } from './RelationTypeSelector';
|
|
59
60
|
export { RowCellAutoSizer } from './RowCellAutoSizer';
|
|
61
|
+
export { RowCellChipWithTooltip } from './RowCellChipWithTooltip';
|
|
62
|
+
export { RowCellChips } from './RowCellChips';
|
|
60
63
|
export { SimpleAttribute } from './SimpleAttribute';
|
|
61
64
|
export { SimpleAttributeEditor } from './SimpleAttributeEditor';
|
|
62
65
|
export { SmallIconButton, SmallIconButtonWithTooltip } from './SmallIconButton';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2192",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
12
12
|
"@googlemaps/markerclusterer": "^2.5.3",
|
|
13
13
|
"@react-sigma/core": "3.4.0",
|
|
14
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
14
|
+
"@reltio/mdm-sdk": "^1.4.1997",
|
|
15
15
|
"@vis.gl/react-google-maps": "^1.3.0",
|
|
16
16
|
"d3-cloud": "^1.2.5",
|
|
17
17
|
"d3-geo": "^2.0.1",
|
package/types/basicTable.d.ts
CHANGED
|
@@ -89,4 +89,16 @@ export type OnFilter = (event: {
|
|
|
89
89
|
export type DraggableProps = DraggableAttributes & {
|
|
90
90
|
ref: (element: HTMLElement | null) => void;
|
|
91
91
|
};
|
|
92
|
+
export type CellValue = {
|
|
93
|
+
uri: string;
|
|
94
|
+
value: unknown;
|
|
95
|
+
};
|
|
96
|
+
export declare enum TableVariant {
|
|
97
|
+
Narrow = "narrow",
|
|
98
|
+
Wide = "wide"
|
|
99
|
+
}
|
|
100
|
+
export declare enum HeadColorVariant {
|
|
101
|
+
Grey = "grey",
|
|
102
|
+
White = "white"
|
|
103
|
+
}
|
|
92
104
|
export {};
|
package/types/basicTable.js
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var TableVariant;
|
|
2
|
+
(function (TableVariant) {
|
|
3
|
+
TableVariant["Narrow"] = "narrow";
|
|
4
|
+
TableVariant["Wide"] = "wide";
|
|
5
|
+
})(TableVariant || (TableVariant = {}));
|
|
6
|
+
export var HeadColorVariant;
|
|
7
|
+
(function (HeadColorVariant) {
|
|
8
|
+
HeadColorVariant["Grey"] = "grey";
|
|
9
|
+
HeadColorVariant["White"] = "white";
|
|
10
|
+
})(HeadColorVariant || (HeadColorVariant = {}));
|
package/ProfileBand/styles.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"inactive" | "label" | "secondaryLabel" | "profileBand" | "entityType" | "entityId" | "profileIcon" | "profileBandWrapper" | "imageProfileIcon" | "profileInfo" | "badge" | "businessCard" | "specialInfo">;
|