@zohodesk/library-platform 1.1.12-exp.1 → 1.1.12-exp.2
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/es/bc/index.js +0 -1
- package/es/bc/zlist/Constants.js +0 -1
- package/es/bc/zlist/Types.js +10 -0
- package/es/bc/zrecord/Constants.js +1 -0
- package/es/bc/zrecord/Schemas.js +29 -0
- package/es/bc/zrecord/Types.js +45 -0
- package/es/cc/checkbox/Properties.js +1 -2
- package/es/cc/email/Properties.js +0 -8
- package/es/cc/fields/field/Types.js +23 -31
- package/es/cc/fields/lookup/Properties.js +10 -26
- package/es/cc/highlighted-value/Properties.js +0 -18
- package/es/cc/link/Properties.js +3 -13
- package/es/cc/switch/Properties.js +2 -2
- package/es/cc/table-connected/SdkContract.js +21 -0
- package/es/cc/table-connected/constants/Events.js +2 -0
- package/es/cc/table-list/Actions.js +0 -2
- package/es/cc/table-list/Constants.js +0 -1
- package/es/cc/table-list/Events.js +0 -2
- package/es/cc/table-list/Properties.js +35 -4
- package/es/cc/tags/Data.js +6 -0
- package/es/cc/tags/model/TagModel.js +26 -0
- package/es/cc/tags/model/index.js +1 -1
- package/es/library/custom-component/frameworks/ui/CustomComponentFactory.js +56 -0
- package/es/library/dot/components/table-list/adapters/controllers/index.js +0 -2
- package/es/library/dot/components/table-list/frameworks/ui/EventHandlersFactory.js +1 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +1 -3
- package/es/library/dot/legacy-to-new-arch/email/frameworks/ui/EmailView.js +2 -4
- package/es/library/dot/legacy-to-new-arch/highlighted-value/frameworks/ui/HighlightedValueView.js +1 -6
- package/es/library/dot/legacy-to-new-arch/index.js +0 -1
- package/es/library/dot/legacy-to-new-arch/link/frameworks/ui/LinkView.js +2 -4
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/CheckboxField.js +2 -12
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/CheckboxFieldView.js +5 -8
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/EventHandlersFactory.js +3 -3
- package/es/library/dot/legacy-to-new-arch/table-field-components/email-field/frameworks/ui/EmailField.js +3 -3
- package/es/library/dot/legacy-to-new-arch/table-field-components/email-field/frameworks/ui/EmailFieldView.js +6 -8
- package/es/library/dot/legacy-to-new-arch/table-field-components/index.js +5 -22
- package/es/library/dot/legacy-to-new-arch/table-field-components/lookup-field/frameworks/ui/LookupFieldView.js +1 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/phone-field/frameworks/ui/PhoneFieldView.js +1 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/EventHandlersFactory.js +3 -3
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/SwitchField.js +4 -14
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/SwitchFieldView.js +4 -8
- package/es/library/dot/legacy-to-new-arch/table-field-components/url-field/frameworks/ui/UrlFieldView.js +1 -1
- package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +169 -8
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +11 -2
- package/es/platform/data-source/http-template/fetchLookupFields.js +0 -6
- package/es/platform/data-source/http-template/getRecords.js +1 -0
- package/es/platform/data-source/index.js +1 -3
- package/es/platform/zfield/applications/usecases/FetchSuccessUseCase.js +0 -33
- package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +0 -5
- package/es/platform/zform/adapters/gateway/FormRepository.js +3 -1
- package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +12 -11
- package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +9 -10
- package/es/platform/zform/domain/ZForm.js +2 -0
- package/es/platform/zlist/adapters/controllers/RefreshRecordsRequestedController.js +21 -0
- package/es/platform/zlist/adapters/controllers/SortController.js +2 -2
- package/es/platform/zlist/adapters/gateways/Repository.js +6 -11
- package/es/platform/zlist/adapters/gateways/Service.js +2 -0
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +11 -21
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +52 -48
- package/es/platform/zlist/adapters/presenters/translators/Header.js +29 -21
- package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +3 -3
- package/es/platform/zlist/adapters/presenters/translators/Row.js +2 -3
- package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +1 -3
- package/es/platform/zlist/adapters/presenters/translators/fields/BooleanFieldTranslator.js +12 -87
- package/es/platform/zlist/adapters/presenters/translators/fields/CurrencyFieldTranslator.js +11 -66
- package/es/platform/zlist/adapters/presenters/translators/fields/DateFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/DateTimeFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/DecimalFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/EmailFieldTranslator.js +9 -29
- package/es/platform/zlist/adapters/presenters/translators/fields/FormulaFieldTranslator.js +27 -23
- package/es/platform/zlist/adapters/presenters/translators/fields/LookUpFieldTranslator.js +17 -106
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiLineFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiSelectFieldTranslator.js +26 -100
- package/es/platform/zlist/adapters/presenters/translators/fields/NumberFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/PercentageFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/PhoneFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/PickListFieldTranslator.js +26 -167
- package/es/platform/zlist/adapters/presenters/translators/fields/SingleLineFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/URLFieldTranslator.js +9 -32
- package/es/platform/zlist/adapters/presenters/utils/DefaultClientActions.js +7 -4
- package/es/platform/zlist/applications/entities-factory/ListFactory.js +2 -2
- package/es/platform/zlist/applications/interfaces/input/GetSortConfigUseCaseInputModel.js +1 -0
- package/es/platform/zlist/applications/interfaces/input/RefreshRecordsRequestedUseCaseInputModel.js +1 -0
- package/es/platform/zlist/applications/interfaces/input/SetSortConfigUseCaseInputModel.js +1 -0
- package/es/platform/zlist/applications/usecases/GetSortConfigUseCase.js +17 -0
- package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +1 -1
- package/es/platform/zlist/applications/usecases/RefreshRecordsRequestedUseCase.js +17 -0
- package/es/platform/zlist/applications/usecases/SetSortConfigUseCase.js +26 -0
- package/es/platform/zlist/applications/usecases/SortUseCase.js +6 -6
- package/es/platform/zlist/domain/entities/List.js +27 -15
- package/es/platform/zlist/domain/entities/interfaces/Properties.js +5 -5
- package/es/platform/zlist/frameworks/EventHandlersFactory.js +3 -4
- package/es/platform/zlist/frameworks/ZListBehaviourFactory.js +2 -5
- package/es/platform/zrecord/adapters/gateways/Repository.js +5 -2
- package/es/platform/zrecord/applications/entities-factory/RecordsManagerFactory.js +2 -2
- package/es/platform/zrecord/applications/interfaces/input/ClearAllFiltersUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/GetFilterConditionUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/GetFilterConfigUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/RefreshRecordsUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/SetFilterUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/usecases/ClearAllFiltersUseCase.js +24 -0
- package/es/platform/zrecord/applications/usecases/GetFilterConditionUseCase.js +15 -0
- package/es/platform/zrecord/applications/usecases/GetFilterConfigUseCase.js +15 -0
- package/es/platform/zrecord/applications/usecases/RefreshRecordsUseCase.js +14 -0
- package/es/platform/zrecord/applications/usecases/SetFilterUseCase.js +24 -0
- package/es/platform/zrecord/domain/entities/Filter.js +247 -0
- package/es/platform/zrecord/domain/entities/RecordsManager.js +19 -1
- package/es/platform/zrecord/domain/entities/interfaces/IFilter.js +1 -0
- package/es/platform/zrecord/frameworks/RecordBehaviourFactory.js +11 -1
- package/package.json +7 -7
package/es/platform/zlist/adapters/presenters/translators/fields/MultiSelectFieldTranslator.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
2
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
3
|
+
import MultiListFieldModel from "../../../../../../cc/fields/multi-select/Model";
|
|
4
|
+
import ColouredMultiListFieldModel from "../../../../../../cc/fields/coloured-multi-select/Model";
|
|
3
5
|
|
|
4
6
|
const MultiSelectFieldTranslator = _ref => {
|
|
5
7
|
let {
|
|
@@ -10,7 +12,10 @@ const MultiSelectFieldTranslator = _ref => {
|
|
|
10
12
|
isRead
|
|
11
13
|
} = _ref;
|
|
12
14
|
const {
|
|
13
|
-
|
|
15
|
+
uiType,
|
|
16
|
+
name,
|
|
17
|
+
subType,
|
|
18
|
+
pickListValues
|
|
14
19
|
} = field;
|
|
15
20
|
const updatedValue = value.split(';').map(item => item === '' ? '-None-' : item);
|
|
16
21
|
|
|
@@ -18,113 +23,34 @@ const MultiSelectFieldTranslator = _ref => {
|
|
|
18
23
|
return ColouredMultiSelectFieldTranslator(field, updatedValue, appendToActionPayload, textOverflowMode, isRead);
|
|
19
24
|
}
|
|
20
25
|
|
|
21
|
-
return
|
|
26
|
+
return MultiListFieldModel({
|
|
27
|
+
uiType: uiType || FieldTypes.MultiSelectField,
|
|
28
|
+
appendToActionPayload,
|
|
29
|
+
name,
|
|
30
|
+
options: pickListValues,
|
|
31
|
+
isRead,
|
|
32
|
+
value: updatedValue,
|
|
33
|
+
textOverflowMode
|
|
34
|
+
});
|
|
22
35
|
};
|
|
23
36
|
|
|
24
37
|
export default MultiSelectFieldTranslator;
|
|
25
38
|
|
|
26
|
-
const StandardMultiSelectFieldTranslator = (field, value, appendToActionPayload, textOverflowMode, isRead) => {
|
|
27
|
-
const {
|
|
28
|
-
uiType,
|
|
29
|
-
name,
|
|
30
|
-
displayLabel
|
|
31
|
-
} = field;
|
|
32
|
-
const selectedOptions = value.map(item => ({
|
|
33
|
-
id: item,
|
|
34
|
-
label: item
|
|
35
|
-
}));
|
|
36
|
-
|
|
37
|
-
switch (uiType) {
|
|
38
|
-
case FieldTypes.TextField:
|
|
39
|
-
{
|
|
40
|
-
let valueText = value.join(', ');
|
|
41
|
-
return {
|
|
42
|
-
type: FieldTypes.TextField,
|
|
43
|
-
fieldName: name,
|
|
44
|
-
text: valueText,
|
|
45
|
-
isDotted: textOverflowMode === 'clip',
|
|
46
|
-
weight: isRead ? undefined : 'bold',
|
|
47
|
-
tooltip: valueText,
|
|
48
|
-
appendToActionPayload,
|
|
49
|
-
isRead,
|
|
50
|
-
textOverflowMode
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
case FieldTypes.TagsListDropdownField:
|
|
55
|
-
return {
|
|
56
|
-
type: FieldTypes.TagsListDropdownField,
|
|
57
|
-
// fieldName: name,
|
|
58
|
-
text: `${selectedOptions.length} ${displayLabel}`,
|
|
59
|
-
tags: selectedOptions,
|
|
60
|
-
hasSearch: selectedOptions.length > 5,
|
|
61
|
-
searchPlaceholder: 'Search',
|
|
62
|
-
dropdownHeading: displayLabel,
|
|
63
|
-
emptyMessage: 'No items found',
|
|
64
|
-
appendToActionPayload,
|
|
65
|
-
isRead,
|
|
66
|
-
textOverflowMode
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
case FieldTypes.TagsField:
|
|
70
|
-
default:
|
|
71
|
-
return {
|
|
72
|
-
type: FieldTypes.TagsField,
|
|
73
|
-
fieldName: name,
|
|
74
|
-
title: displayLabel,
|
|
75
|
-
isWrapped: textOverflowMode !== 'clip',
|
|
76
|
-
tags: selectedOptions,
|
|
77
|
-
appendToActionPayload,
|
|
78
|
-
isRead,
|
|
79
|
-
textOverflowMode
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
39
|
const ColouredMultiSelectFieldTranslator = (field, value, appendToActionPayload, textOverflowMode, isRead) => {
|
|
85
40
|
const {
|
|
86
41
|
uiType,
|
|
87
42
|
name,
|
|
88
|
-
pickListValues
|
|
89
|
-
displayLabel
|
|
43
|
+
pickListValues
|
|
90
44
|
} = field;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
45
|
+
return ColouredMultiListFieldModel({
|
|
46
|
+
uiType: uiType || FieldTypes.ColouredMultiSelectField,
|
|
47
|
+
appendToActionPayload,
|
|
48
|
+
name,
|
|
49
|
+
options: pickListValues.map(option => ({ ...option,
|
|
50
|
+
colorCode: option.colorCode || ''
|
|
51
|
+
})),
|
|
52
|
+
isRead,
|
|
53
|
+
value,
|
|
54
|
+
textOverflowMode
|
|
98
55
|
});
|
|
99
|
-
|
|
100
|
-
switch (uiType) {
|
|
101
|
-
case FieldTypes.TextField:
|
|
102
|
-
{
|
|
103
|
-
let valueText = value.join(', ');
|
|
104
|
-
return {
|
|
105
|
-
type: FieldTypes.TextField,
|
|
106
|
-
fieldName: name,
|
|
107
|
-
text: valueText,
|
|
108
|
-
isDotted: textOverflowMode === 'clip',
|
|
109
|
-
weight: isRead ? undefined : 'bold',
|
|
110
|
-
tooltip: valueText,
|
|
111
|
-
appendToActionPayload,
|
|
112
|
-
isRead,
|
|
113
|
-
textOverflowMode
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
case FieldTypes.TagsField:
|
|
118
|
-
default:
|
|
119
|
-
return {
|
|
120
|
-
type: FieldTypes.TagsField,
|
|
121
|
-
fieldName: name,
|
|
122
|
-
title: displayLabel,
|
|
123
|
-
isWrapped: textOverflowMode !== 'clip',
|
|
124
|
-
tags: selectedOptions,
|
|
125
|
-
appendToActionPayload,
|
|
126
|
-
isRead,
|
|
127
|
-
textOverflowMode
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
56
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
2
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
3
|
+
import NumberFieldModel from "../../../../../../cc/fields/number/Model";
|
|
3
4
|
|
|
4
5
|
const NumberLineFieldTranslator = _ref => {
|
|
5
6
|
let {
|
|
@@ -13,22 +14,14 @@ const NumberLineFieldTranslator = _ref => {
|
|
|
13
14
|
uiType,
|
|
14
15
|
name
|
|
15
16
|
} = field;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
isDotted: textOverflowMode === 'clip',
|
|
25
|
-
weight: isRead ? undefined : 'bold',
|
|
26
|
-
tooltip: value,
|
|
27
|
-
appendToActionPayload,
|
|
28
|
-
isRead,
|
|
29
|
-
textOverflowMode
|
|
30
|
-
};
|
|
31
|
-
}
|
|
17
|
+
return NumberFieldModel({
|
|
18
|
+
uiType: uiType || FieldTypes.NumberField,
|
|
19
|
+
appendToActionPayload,
|
|
20
|
+
name,
|
|
21
|
+
isRead,
|
|
22
|
+
value,
|
|
23
|
+
textOverflowMode
|
|
24
|
+
});
|
|
32
25
|
};
|
|
33
26
|
|
|
34
27
|
export default NumberLineFieldTranslator;
|
package/es/platform/zlist/adapters/presenters/translators/fields/PercentageFieldTranslator.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
2
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
3
|
+
import PercentFieldModel from "../../../../../../cc/fields/percent/Model";
|
|
3
4
|
|
|
4
5
|
const PercentageFieldTranslator = _ref => {
|
|
5
6
|
let {
|
|
@@ -13,22 +14,14 @@ const PercentageFieldTranslator = _ref => {
|
|
|
13
14
|
uiType,
|
|
14
15
|
name
|
|
15
16
|
} = field;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
isDotted: textOverflowMode === 'clip',
|
|
25
|
-
weight: isRead ? undefined : 'bold',
|
|
26
|
-
tooltip: value,
|
|
27
|
-
appendToActionPayload,
|
|
28
|
-
isRead,
|
|
29
|
-
textOverflowMode
|
|
30
|
-
};
|
|
31
|
-
}
|
|
17
|
+
return PercentFieldModel({
|
|
18
|
+
uiType: uiType || FieldTypes.PercentageField,
|
|
19
|
+
appendToActionPayload,
|
|
20
|
+
name,
|
|
21
|
+
isRead,
|
|
22
|
+
value,
|
|
23
|
+
textOverflowMode
|
|
24
|
+
});
|
|
32
25
|
};
|
|
33
26
|
|
|
34
27
|
export default PercentageFieldTranslator;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
2
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
3
|
+
import PhoneFieldModel from "../../../../../../cc/fields/phone/Model";
|
|
3
4
|
|
|
4
5
|
const PhoneFieldTranslator = _ref => {
|
|
5
6
|
let {
|
|
@@ -13,22 +14,14 @@ const PhoneFieldTranslator = _ref => {
|
|
|
13
14
|
uiType,
|
|
14
15
|
name
|
|
15
16
|
} = field;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
isDotted: textOverflowMode === 'clip',
|
|
25
|
-
weight: isRead ? undefined : 'bold',
|
|
26
|
-
tooltip: value,
|
|
27
|
-
appendToActionPayload,
|
|
28
|
-
isRead,
|
|
29
|
-
textOverflowMode
|
|
30
|
-
};
|
|
31
|
-
}
|
|
17
|
+
return PhoneFieldModel({
|
|
18
|
+
uiType: uiType || FieldTypes.PhoneField,
|
|
19
|
+
appendToActionPayload,
|
|
20
|
+
name,
|
|
21
|
+
isRead,
|
|
22
|
+
value,
|
|
23
|
+
textOverflowMode
|
|
24
|
+
});
|
|
32
25
|
};
|
|
33
26
|
|
|
34
27
|
export default PhoneFieldTranslator;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
2
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
3
|
-
|
|
3
|
+
import PickListFieldModel from "../../../../../../cc/fields/pick-list/Model";
|
|
4
|
+
import ColouredPickListFieldModel from "../../../../../../cc/fields/coloured-pick-list/Model";
|
|
4
5
|
|
|
5
6
|
const PickListFieldTranslator = _ref => {
|
|
6
7
|
let {
|
|
@@ -11,6 +12,9 @@ const PickListFieldTranslator = _ref => {
|
|
|
11
12
|
isRead
|
|
12
13
|
} = _ref;
|
|
13
14
|
const {
|
|
15
|
+
uiType,
|
|
16
|
+
name,
|
|
17
|
+
pickListValues,
|
|
14
18
|
subType
|
|
15
19
|
} = field;
|
|
16
20
|
|
|
@@ -18,179 +22,34 @@ const PickListFieldTranslator = _ref => {
|
|
|
18
22
|
return ColouredPickListFieldTranslator(field, value, appendToActionPayload, textOverflowMode, isRead);
|
|
19
23
|
}
|
|
20
24
|
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const StandardPickListFieldTranslator = (field, value, appendToActionPayload, textOverflowMode, isRead) => {
|
|
27
|
-
const {
|
|
28
|
-
uiType,
|
|
25
|
+
return PickListFieldModel({
|
|
26
|
+
uiType: uiType || FieldTypes.PickListField,
|
|
27
|
+
appendToActionPayload,
|
|
28
|
+
options: pickListValues,
|
|
29
29
|
name,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
switch (uiType) {
|
|
35
|
-
case FieldTypes.HighlightedValueField:
|
|
36
|
-
return {
|
|
37
|
-
type: FieldTypes.HighlightedValueField,
|
|
38
|
-
fieldName: name,
|
|
39
|
-
text: value,
|
|
40
|
-
color: 'grey',
|
|
41
|
-
tooltip: value,
|
|
42
|
-
cursor: 'default',
|
|
43
|
-
appendToActionPayload,
|
|
44
|
-
isRead,
|
|
45
|
-
textOverflowMode
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
case FieldTypes.TagField:
|
|
49
|
-
return {
|
|
50
|
-
type: FieldTypes.TagField,
|
|
51
|
-
fieldName: name,
|
|
52
|
-
label: value,
|
|
53
|
-
tooltip: value,
|
|
54
|
-
cursor: 'default',
|
|
55
|
-
appendToActionPayload,
|
|
56
|
-
isRead,
|
|
57
|
-
textOverflowMode
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
case FieldTypes.RadioDropdownField:
|
|
61
|
-
{
|
|
62
|
-
const options = pickListValues.map(option => ({
|
|
63
|
-
id: option.value,
|
|
64
|
-
value: option.value,
|
|
65
|
-
secondaryValue: ''
|
|
66
|
-
}));
|
|
67
|
-
return {
|
|
68
|
-
type: FieldTypes.RadioDropdownField,
|
|
69
|
-
fieldName: name,
|
|
70
|
-
options,
|
|
71
|
-
selectedId: value,
|
|
72
|
-
selectedValue: value,
|
|
73
|
-
dropdownHeading: displayLabel,
|
|
74
|
-
hasSearch: pickListValues.length > 4,
|
|
75
|
-
isDotted: textOverflowMode === 'clip',
|
|
76
|
-
weight: isRead ? undefined : 'bold',
|
|
77
|
-
searchPlaceholder: 'Search',
|
|
78
|
-
emptyStateTitle: 'No results found',
|
|
79
|
-
isDisabled: false,
|
|
80
|
-
isReadOnly: false,
|
|
81
|
-
appendToActionPayload,
|
|
82
|
-
isRead,
|
|
83
|
-
textOverflowMode
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
case FieldTypes.TextField:
|
|
88
|
-
default:
|
|
89
|
-
return {
|
|
90
|
-
type: FieldTypes.TextField,
|
|
91
|
-
fieldName: name,
|
|
92
|
-
text: value,
|
|
93
|
-
isDotted: textOverflowMode === 'clip',
|
|
94
|
-
weight: isRead ? undefined : 'bold',
|
|
95
|
-
tooltip: value,
|
|
96
|
-
appendToActionPayload,
|
|
97
|
-
isRead,
|
|
98
|
-
textOverflowMode
|
|
99
|
-
};
|
|
100
|
-
}
|
|
30
|
+
isRead,
|
|
31
|
+
value,
|
|
32
|
+
textOverflowMode
|
|
33
|
+
});
|
|
101
34
|
};
|
|
102
35
|
|
|
103
|
-
|
|
104
|
-
"#1e1e1e": "grey",
|
|
105
|
-
"#fd1d1d": "red",
|
|
106
|
-
"#fd5901": "orange",
|
|
107
|
-
"#71c02b": "green",
|
|
108
|
-
"#405de6": "blue"
|
|
109
|
-
};
|
|
36
|
+
export default PickListFieldTranslator;
|
|
110
37
|
|
|
111
38
|
const ColouredPickListFieldTranslator = (field, value, appendToActionPayload, textOverflowMode, isRead) => {
|
|
112
39
|
const {
|
|
113
40
|
uiType,
|
|
114
41
|
name,
|
|
115
|
-
|
|
116
|
-
pickListValues = EMPTY_ARRAY
|
|
42
|
+
pickListValues
|
|
117
43
|
} = field;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
appendToActionPayload,
|
|
130
|
-
isRead,
|
|
131
|
-
textOverflowMode
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
case FieldTypes.HighlightedValueField:
|
|
135
|
-
{
|
|
136
|
-
const highlightedValueColor = colorMapper[selectedOption?.colorCode?.toLowerCase()] || 'grey';
|
|
137
|
-
return {
|
|
138
|
-
type: FieldTypes.HighlightedValueField,
|
|
139
|
-
fieldName: name,
|
|
140
|
-
text: value,
|
|
141
|
-
color: highlightedValueColor,
|
|
142
|
-
isDotted: textOverflowMode === 'clip',
|
|
143
|
-
weight: isRead ? undefined : 'bold',
|
|
144
|
-
tooltip: value,
|
|
145
|
-
cursor: 'default',
|
|
146
|
-
appendToActionPayload,
|
|
147
|
-
isRead,
|
|
148
|
-
textOverflowMode
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
case FieldTypes.RadioDropdownField:
|
|
153
|
-
{
|
|
154
|
-
const options = pickListValues.map(option => ({
|
|
155
|
-
id: option.value,
|
|
156
|
-
value: option.value,
|
|
157
|
-
secondaryValue: ''
|
|
158
|
-
}));
|
|
159
|
-
const highlightedValueColor = colorMapper[selectedOption?.colorCode?.toLowerCase()] || 'grey';
|
|
160
|
-
return {
|
|
161
|
-
type: FieldTypes.RadioDropdownField,
|
|
162
|
-
fieldName: name,
|
|
163
|
-
options,
|
|
164
|
-
color: highlightedValueColor,
|
|
165
|
-
selectedId: value,
|
|
166
|
-
selectedValue: value,
|
|
167
|
-
dropdownHeading: displayLabel,
|
|
168
|
-
isDotted: textOverflowMode === 'clip',
|
|
169
|
-
weight: isRead ? undefined : 'bold',
|
|
170
|
-
hasSearch: pickListValues.length > 4,
|
|
171
|
-
searchPlaceholder: 'Search',
|
|
172
|
-
emptyStateTitle: 'No results found',
|
|
173
|
-
isDisabled: false,
|
|
174
|
-
isReadOnly: false,
|
|
175
|
-
appendToActionPayload,
|
|
176
|
-
isRead,
|
|
177
|
-
textOverflowMode
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
case FieldTypes.TagField:
|
|
182
|
-
default:
|
|
183
|
-
{
|
|
184
|
-
return {
|
|
185
|
-
type: FieldTypes.TagField,
|
|
186
|
-
fieldName: name,
|
|
187
|
-
label: value,
|
|
188
|
-
color: selectedOption.colorCode || '',
|
|
189
|
-
tooltip: value,
|
|
190
|
-
cursor: 'default',
|
|
191
|
-
appendToActionPayload,
|
|
192
|
-
isRead
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
}
|
|
44
|
+
return ColouredPickListFieldModel({
|
|
45
|
+
uiType: uiType || FieldTypes.ColouredPickListField,
|
|
46
|
+
appendToActionPayload,
|
|
47
|
+
options: pickListValues.map(option => ({ ...option,
|
|
48
|
+
colorCode: option.colorCode || ''
|
|
49
|
+
})),
|
|
50
|
+
name,
|
|
51
|
+
isRead,
|
|
52
|
+
value,
|
|
53
|
+
textOverflowMode
|
|
54
|
+
});
|
|
196
55
|
};
|
package/es/platform/zlist/adapters/presenters/translators/fields/SingleLineFieldTranslator.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
2
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
3
|
+
import TextFieldModel from "../../../../../../cc/fields/text/Model";
|
|
3
4
|
|
|
4
5
|
const SingleLineFieldTranslator = _ref => {
|
|
5
6
|
let {
|
|
@@ -13,22 +14,14 @@ const SingleLineFieldTranslator = _ref => {
|
|
|
13
14
|
uiType,
|
|
14
15
|
name
|
|
15
16
|
} = field;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
isDotted: textOverflowMode === 'clip',
|
|
25
|
-
weight: isRead ? undefined : 'bold',
|
|
26
|
-
tooltip: value,
|
|
27
|
-
appendToActionPayload,
|
|
28
|
-
isRead,
|
|
29
|
-
textOverflowMode
|
|
30
|
-
};
|
|
31
|
-
}
|
|
17
|
+
return TextFieldModel({
|
|
18
|
+
uiType: uiType || FieldTypes.SingleLineField,
|
|
19
|
+
appendToActionPayload,
|
|
20
|
+
name,
|
|
21
|
+
isRead,
|
|
22
|
+
value,
|
|
23
|
+
textOverflowMode
|
|
24
|
+
});
|
|
32
25
|
};
|
|
33
26
|
|
|
34
27
|
export default SingleLineFieldTranslator;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
2
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
3
|
+
import UrlFieldModel from "../../../../../../cc/fields/url/Model";
|
|
3
4
|
|
|
4
5
|
const URLFieldTranslator = _ref => {
|
|
5
6
|
let {
|
|
@@ -13,38 +14,14 @@ const URLFieldTranslator = _ref => {
|
|
|
13
14
|
uiType,
|
|
14
15
|
name
|
|
15
16
|
} = field;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
weight: isRead ? undefined : 'bold',
|
|
25
|
-
tooltip: value,
|
|
26
|
-
appendToActionPayload,
|
|
27
|
-
isRead,
|
|
28
|
-
textOverflowMode
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
case FieldTypes.LinkField:
|
|
32
|
-
default:
|
|
33
|
-
return {
|
|
34
|
-
type: FieldTypes.LinkField,
|
|
35
|
-
fieldName: name,
|
|
36
|
-
text: value,
|
|
37
|
-
variant: 'secondary',
|
|
38
|
-
href: value,
|
|
39
|
-
opensNewTab: true,
|
|
40
|
-
isDotted: textOverflowMode === 'clip',
|
|
41
|
-
weight: isRead ? undefined : 'bold',
|
|
42
|
-
tooltip: value,
|
|
43
|
-
appendToActionPayload,
|
|
44
|
-
isRead,
|
|
45
|
-
textOverflowMode
|
|
46
|
-
};
|
|
47
|
-
}
|
|
17
|
+
return UrlFieldModel({
|
|
18
|
+
uiType: uiType || FieldTypes.URLField,
|
|
19
|
+
appendToActionPayload,
|
|
20
|
+
name,
|
|
21
|
+
isRead,
|
|
22
|
+
value,
|
|
23
|
+
textOverflowMode
|
|
24
|
+
});
|
|
48
25
|
};
|
|
49
26
|
|
|
50
27
|
export default URLFieldTranslator;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/* eslint-disable max-lines-per-function */
|
|
2
|
+
import { i18NProviderUtils } from '@zohodesk/i18n';
|
|
2
3
|
import { TableListConstants } from "../../../../../cc/table-list";
|
|
3
4
|
import { CheckboxConstants } from "../../../../../cc/checkbox";
|
|
4
5
|
import ClientAction from "../../../../client-actions/behaviour/zclient-actions/domain/entities/ClientAction";
|
|
6
|
+
import { SORT_CLICKED } from "../../../../../cc/table-column-sort/Constants";
|
|
7
|
+
import { SMART_TABLE_SORT_BY_REQUESTED } from "../../../../../cc/table-connected/constants/Events";
|
|
5
8
|
const CHECKBOX_TOGGLED = CheckboxConstants.CHECKBOX_TOGGLED;
|
|
6
9
|
const TABLE_LIST_TOGGLE_ALL_SELECTION = TableListConstants.TABLE_LIST_TOGGLE_ALL_SELECTION;
|
|
7
10
|
|
|
@@ -22,8 +25,8 @@ class DefaultClientActions {
|
|
|
22
25
|
name: 'SortBy',
|
|
23
26
|
propertiesValueMapping: {
|
|
24
27
|
value: '{{@context.field.sort.order}}',
|
|
25
|
-
ascendingLabel: '
|
|
26
|
-
descendingLabel: '
|
|
28
|
+
ascendingLabel: i18NProviderUtils.getI18NValue('crm.report.wizard.groupings.asc'),
|
|
29
|
+
descendingLabel: i18NProviderUtils.getI18NValue('crm.report.wizard.groupings.desc')
|
|
27
30
|
},
|
|
28
31
|
eventMappings: [{
|
|
29
32
|
payloadValueMapping: {
|
|
@@ -31,8 +34,8 @@ class DefaultClientActions {
|
|
|
31
34
|
name: '{{@context.field.name}}',
|
|
32
35
|
order: `{{@payload.value}}`
|
|
33
36
|
},
|
|
34
|
-
sourceEvent:
|
|
35
|
-
targetEvent:
|
|
37
|
+
sourceEvent: SORT_CLICKED,
|
|
38
|
+
targetEvent: SMART_TABLE_SORT_BY_REQUESTED,
|
|
36
39
|
id: '4000000080005'
|
|
37
40
|
}],
|
|
38
41
|
id: '4000000080003'
|
|
@@ -4,13 +4,13 @@ class ListFactory {
|
|
|
4
4
|
static createList(input) {
|
|
5
5
|
const {
|
|
6
6
|
limit,
|
|
7
|
-
|
|
7
|
+
sortConfig,
|
|
8
8
|
query,
|
|
9
9
|
context,
|
|
10
10
|
errorState,
|
|
11
11
|
isReOrderLoading
|
|
12
12
|
} = input;
|
|
13
|
-
return new List(limit,
|
|
13
|
+
return new List(limit, sortConfig, query, context, isReOrderLoading, errorState);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/platform/zlist/applications/interfaces/input/RefreshRecordsRequestedUseCaseInputModel.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
|
|
3
|
+
class GetSortConfigUseCase extends AbstractUseCase {
|
|
4
|
+
execute(input) {
|
|
5
|
+
const {
|
|
6
|
+
callback
|
|
7
|
+
} = input;
|
|
8
|
+
const {
|
|
9
|
+
repository
|
|
10
|
+
} = this.dependencies;
|
|
11
|
+
const list = repository.getList();
|
|
12
|
+
callback?.(list.getSortConfig());
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default GetSortConfigUseCase;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
|
|
3
|
+
class RefreshRecordsRequestedUseCase extends AbstractUseCase {
|
|
4
|
+
execute(input) {
|
|
5
|
+
const {
|
|
6
|
+
dispatch
|
|
7
|
+
} = input;
|
|
8
|
+
const {
|
|
9
|
+
repository
|
|
10
|
+
} = this.dependencies;
|
|
11
|
+
const list = repository.getList();
|
|
12
|
+
dispatch(list.createRecordsRefetchAction());
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default RefreshRecordsRequestedUseCase;
|