@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
|
@@ -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 BooleanFieldModel from "../../../../../../cc/fields/boolean/Model";
|
|
3
4
|
|
|
4
5
|
const BooleanFieldTranslator = _ref => {
|
|
5
6
|
let {
|
|
@@ -11,99 +12,23 @@ const BooleanFieldTranslator = _ref => {
|
|
|
11
12
|
} = _ref;
|
|
12
13
|
const {
|
|
13
14
|
uiType,
|
|
14
|
-
name
|
|
15
|
-
displayLabel
|
|
15
|
+
name
|
|
16
16
|
} = field;
|
|
17
|
-
let newValue = value;
|
|
18
17
|
|
|
19
18
|
if (value === 'true') {
|
|
20
|
-
|
|
19
|
+
value = true;
|
|
21
20
|
} else if (value === 'false') {
|
|
22
|
-
|
|
21
|
+
value = false;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
tooltip: value,
|
|
34
|
-
appendToActionPayload,
|
|
35
|
-
isRead,
|
|
36
|
-
textOverflowMode
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
case FieldTypes.HighlightedValueField:
|
|
40
|
-
return {
|
|
41
|
-
type: FieldTypes.HighlightedValueField,
|
|
42
|
-
fieldName: name,
|
|
43
|
-
text: value,
|
|
44
|
-
color: newValue ? 'green' : 'red',
|
|
45
|
-
tooltip: value,
|
|
46
|
-
cursor: 'default',
|
|
47
|
-
appendToActionPayload,
|
|
48
|
-
isRead,
|
|
49
|
-
textOverflowMode
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
case FieldTypes.RadioDropdownField:
|
|
53
|
-
{
|
|
54
|
-
const options = [{
|
|
55
|
-
id: 'true',
|
|
56
|
-
value: 'true',
|
|
57
|
-
secondaryValue: ''
|
|
58
|
-
}, {
|
|
59
|
-
id: 'false',
|
|
60
|
-
value: 'false',
|
|
61
|
-
secondaryValue: ''
|
|
62
|
-
}];
|
|
63
|
-
const highlightedValueColor = newValue ? 'green' : 'red';
|
|
64
|
-
return {
|
|
65
|
-
type: FieldTypes.RadioDropdownField,
|
|
66
|
-
fieldName: name,
|
|
67
|
-
fieldType: 'boolean',
|
|
68
|
-
options,
|
|
69
|
-
color: highlightedValueColor,
|
|
70
|
-
selectedId: value,
|
|
71
|
-
selectedValue: value,
|
|
72
|
-
dropdownHeading: displayLabel,
|
|
73
|
-
isDotted: textOverflowMode === 'clip',
|
|
74
|
-
weight: isRead ? undefined : 'bold',
|
|
75
|
-
hasSearch: false,
|
|
76
|
-
isDisabled: false,
|
|
77
|
-
isReadOnly: false,
|
|
78
|
-
appendToActionPayload,
|
|
79
|
-
isRead,
|
|
80
|
-
textOverflowMode
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
case FieldTypes.SwitchField:
|
|
85
|
-
return {
|
|
86
|
-
type: FieldTypes.SwitchField,
|
|
87
|
-
fieldName: name,
|
|
88
|
-
checked: newValue,
|
|
89
|
-
disabled: false,
|
|
90
|
-
tooltip: '',
|
|
91
|
-
appendToActionPayload,
|
|
92
|
-
isRead,
|
|
93
|
-
textOverflowMode
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
case FieldTypes.CheckboxField:
|
|
97
|
-
default:
|
|
98
|
-
return {
|
|
99
|
-
type: FieldTypes.CheckboxField,
|
|
100
|
-
fieldName: name,
|
|
101
|
-
checked: newValue,
|
|
102
|
-
appendToActionPayload,
|
|
103
|
-
isRead,
|
|
104
|
-
textOverflowMode
|
|
105
|
-
};
|
|
106
|
-
}
|
|
24
|
+
return BooleanFieldModel({
|
|
25
|
+
uiType: uiType || FieldTypes.CheckboxField,
|
|
26
|
+
name,
|
|
27
|
+
appendToActionPayload,
|
|
28
|
+
isRead,
|
|
29
|
+
value,
|
|
30
|
+
textOverflowMode
|
|
31
|
+
});
|
|
107
32
|
};
|
|
108
33
|
|
|
109
34
|
export default BooleanFieldTranslator;
|
|
@@ -1,49 +1,7 @@
|
|
|
1
1
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
|
+
import CurrencyFieldModel from "../../../../../../cc/fields/currency/Model";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
5
|
-
const rejexPattern = new RegExp('^(\\d+\\.?\\d*|\\.\\d+)$');
|
|
6
|
-
const isValidInt = rejexPattern.test(value);
|
|
7
|
-
return isValidInt;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function formatCurrency(_ref) {
|
|
11
|
-
let {
|
|
12
|
-
value,
|
|
13
|
-
locale = 'IN',
|
|
14
|
-
symbol = 'Rs.'
|
|
15
|
-
} = _ref;
|
|
16
|
-
const isValidInt = isValidNumber(value);
|
|
17
|
-
|
|
18
|
-
if (isValidInt && symbol) {
|
|
19
|
-
const currencyArr = new Intl.NumberFormat(`en-${locale}`).formatToParts(value);
|
|
20
|
-
let currencyVal = '';
|
|
21
|
-
currencyArr.map(val => {
|
|
22
|
-
if (val.type == 'group') {
|
|
23
|
-
currencyVal += ',';
|
|
24
|
-
} else if (val.type == 'integer') {
|
|
25
|
-
currencyVal += val.value;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
if (value.indexOf('.') != -1) {
|
|
30
|
-
const fractionVal = value.split(".")[1];
|
|
31
|
-
|
|
32
|
-
for (let i = fractionVal.length - 1; i >= 0; i--) {
|
|
33
|
-
if (fractionVal[i] != 0) {
|
|
34
|
-
currencyVal += `.${fractionVal.slice(0, i + 1)}`;
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return `${symbol}${currencyVal}`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return value;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const CurrencyFieldTranslator = _ref2 => {
|
|
4
|
+
const CurrencyFieldTranslator = _ref => {
|
|
47
5
|
let {
|
|
48
6
|
field,
|
|
49
7
|
value,
|
|
@@ -52,7 +10,7 @@ const CurrencyFieldTranslator = _ref2 => {
|
|
|
52
10
|
preferences,
|
|
53
11
|
textOverflowMode,
|
|
54
12
|
isRead
|
|
55
|
-
} =
|
|
13
|
+
} = _ref;
|
|
56
14
|
const {
|
|
57
15
|
uiType,
|
|
58
16
|
name
|
|
@@ -61,29 +19,16 @@ const CurrencyFieldTranslator = _ref2 => {
|
|
|
61
19
|
let contextCurrencyLocale = context?.currencyLocale;
|
|
62
20
|
let prefCurrencySymbol = preferences?.fields?.[field.apiName]?.currencySymbol;
|
|
63
21
|
let contextCurrencySymbol = context?.currencySymbol;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
22
|
+
return CurrencyFieldModel({
|
|
23
|
+
uiType: uiType || FieldTypes.CurrencyField,
|
|
24
|
+
appendToActionPayload,
|
|
25
|
+
name,
|
|
26
|
+
currencyLocale: prefCurrencyLocale || contextCurrencyLocale,
|
|
27
|
+
currencySymbol: prefCurrencySymbol || contextCurrencySymbol,
|
|
28
|
+
isRead,
|
|
67
29
|
value,
|
|
68
|
-
|
|
69
|
-
symbol
|
|
30
|
+
textOverflowMode
|
|
70
31
|
});
|
|
71
|
-
|
|
72
|
-
switch (uiType) {
|
|
73
|
-
case FieldTypes.TextField:
|
|
74
|
-
default:
|
|
75
|
-
return {
|
|
76
|
-
type: FieldTypes.TextField,
|
|
77
|
-
fieldName: name,
|
|
78
|
-
text: formatedValue,
|
|
79
|
-
isDotted: textOverflowMode === 'clip',
|
|
80
|
-
weight: isRead ? undefined : 'bold',
|
|
81
|
-
tooltip: formatedValue,
|
|
82
|
-
appendToActionPayload,
|
|
83
|
-
isRead,
|
|
84
|
-
textOverflowMode
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
32
|
};
|
|
88
33
|
|
|
89
34
|
export default CurrencyFieldTranslator;
|
|
@@ -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 DateFieldModel from "../../../../../../cc/fields/date/Model";
|
|
3
4
|
|
|
4
5
|
const DateFieldTranslator = _ref => {
|
|
5
6
|
let {
|
|
@@ -13,22 +14,14 @@ const DateFieldTranslator = _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 DateFieldModel({
|
|
18
|
+
uiType: uiType || FieldTypes.DateField,
|
|
19
|
+
appendToActionPayload,
|
|
20
|
+
name,
|
|
21
|
+
isRead,
|
|
22
|
+
value,
|
|
23
|
+
textOverflowMode
|
|
24
|
+
});
|
|
32
25
|
};
|
|
33
26
|
|
|
34
27
|
export default DateFieldTranslator;
|
|
@@ -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 DateTimeFieldModel from "../../../../../../cc/fields/datetime/Model";
|
|
3
4
|
|
|
4
5
|
const DateTimeFieldTranslator = _ref => {
|
|
5
6
|
let {
|
|
@@ -13,22 +14,14 @@ const DateTimeFieldTranslator = _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 DateTimeFieldModel({
|
|
18
|
+
uiType: uiType || FieldTypes.DateTimeField,
|
|
19
|
+
appendToActionPayload,
|
|
20
|
+
name,
|
|
21
|
+
isRead,
|
|
22
|
+
value,
|
|
23
|
+
textOverflowMode
|
|
24
|
+
});
|
|
32
25
|
};
|
|
33
26
|
|
|
34
27
|
export default DateTimeFieldTranslator;
|
|
@@ -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 DecimalFieldModel from "../../../../../../cc/fields/decimal/Model";
|
|
3
4
|
|
|
4
5
|
const DecimalFieldTranslator = _ref => {
|
|
5
6
|
let {
|
|
@@ -13,22 +14,14 @@ const DecimalFieldTranslator = _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 DecimalFieldModel({
|
|
18
|
+
uiType: uiType || FieldTypes.DecimalField,
|
|
19
|
+
appendToActionPayload,
|
|
20
|
+
name,
|
|
21
|
+
isRead,
|
|
22
|
+
value,
|
|
23
|
+
textOverflowMode
|
|
24
|
+
});
|
|
32
25
|
};
|
|
33
26
|
|
|
34
27
|
export default DecimalFieldTranslator;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
|
+
import EmailFieldModel from "../../../../../../cc/fields/email/Model";
|
|
2
3
|
|
|
3
4
|
const EmailFieldTranslator = _ref => {
|
|
4
5
|
let {
|
|
@@ -12,35 +13,14 @@ const EmailFieldTranslator = _ref => {
|
|
|
12
13
|
uiType,
|
|
13
14
|
name
|
|
14
15
|
} = field;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
weight: isRead ? undefined : 'bold',
|
|
24
|
-
tooltip: value,
|
|
25
|
-
appendToActionPayload,
|
|
26
|
-
isRead,
|
|
27
|
-
textOverflowMode
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
case FieldTypes.EmailField:
|
|
31
|
-
default:
|
|
32
|
-
return {
|
|
33
|
-
type: FieldTypes.EmailField,
|
|
34
|
-
fieldName: name,
|
|
35
|
-
email: value,
|
|
36
|
-
isDotted: textOverflowMode === 'clip',
|
|
37
|
-
weight: isRead ? undefined : 'bold',
|
|
38
|
-
tooltip: value,
|
|
39
|
-
appendToActionPayload,
|
|
40
|
-
isRead,
|
|
41
|
-
textOverflowMode
|
|
42
|
-
};
|
|
43
|
-
}
|
|
16
|
+
return EmailFieldModel({
|
|
17
|
+
uiType: uiType || FieldTypes.EmailField,
|
|
18
|
+
appendToActionPayload,
|
|
19
|
+
name,
|
|
20
|
+
isRead,
|
|
21
|
+
value,
|
|
22
|
+
textOverflowMode
|
|
23
|
+
});
|
|
44
24
|
};
|
|
45
25
|
|
|
46
26
|
export default EmailFieldTranslator;
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import DecimalFieldTranslator from "./DecimalFieldTranslator";
|
|
4
|
-
import CurrencyFieldTranslator from "./CurrencyFieldTranslator";
|
|
5
|
-
import DateFieldTranslator from "./DateFieldTranslator";
|
|
6
|
-
import DateTimeFieldTranslator from "./DateTimeFieldTranslator";
|
|
7
|
-
const fieldTypeFactory = {
|
|
8
|
-
STRING: SingleLineFieldTranslator,
|
|
9
|
-
BOOLEAN: BooleanFieldTranslator,
|
|
10
|
-
DECIMAL: DecimalFieldTranslator,
|
|
11
|
-
CURRENCY: CurrencyFieldTranslator,
|
|
12
|
-
DATE: DateFieldTranslator,
|
|
13
|
-
DATETIME: DateTimeFieldTranslator
|
|
14
|
-
};
|
|
1
|
+
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
|
+
import FormulaFieldModel from "../../../../../../cc/fields/formula/Model";
|
|
15
3
|
|
|
16
4
|
const FormulaFieldTranslator = _ref => {
|
|
17
5
|
let {
|
|
@@ -24,17 +12,33 @@ const FormulaFieldTranslator = _ref => {
|
|
|
24
12
|
isRead
|
|
25
13
|
} = _ref;
|
|
26
14
|
const {
|
|
27
|
-
|
|
15
|
+
uiType,
|
|
16
|
+
name
|
|
28
17
|
} = field;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
let prefCurrencyLocale = preferences?.fields?.[field.apiName]?.currencyLocale;
|
|
19
|
+
let contextCurrencyLocale = context?.currencyLocale;
|
|
20
|
+
let prefCurrencySymbol = preferences?.fields?.[field.apiName]?.currencySymbol;
|
|
21
|
+
let contextCurrencySymbol = context?.currencySymbol;
|
|
22
|
+
const fieldTypeFactory = {
|
|
23
|
+
STRING: FieldTypes.SingleLineField,
|
|
24
|
+
BOOLEAN: FieldTypes.CheckboxField,
|
|
25
|
+
DECIMAL: FieldTypes.DecimalField,
|
|
26
|
+
CURRENCY: FieldTypes.CurrencyField,
|
|
27
|
+
DATE: FieldTypes.DateField,
|
|
28
|
+
DATETIME: FieldTypes.DateTimeField
|
|
29
|
+
};
|
|
30
|
+
const setFieldType = fieldTypeFactory[field.returnType] || FieldTypes.SingleLineField;
|
|
31
|
+
return FormulaFieldModel({
|
|
32
|
+
uiType: uiType || setFieldType,
|
|
33
33
|
appendToActionPayload,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
name,
|
|
35
|
+
...(setFieldType === FieldTypes.CurrencyField && {
|
|
36
|
+
currencyLocale: prefCurrencyLocale || contextCurrencyLocale,
|
|
37
|
+
currencySymbol: prefCurrencySymbol || contextCurrencySymbol
|
|
38
|
+
}),
|
|
39
|
+
isRead,
|
|
40
|
+
value,
|
|
41
|
+
textOverflowMode
|
|
38
42
|
});
|
|
39
43
|
};
|
|
40
44
|
|
|
@@ -1,126 +1,37 @@
|
|
|
1
1
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
|
+
import LookupFieldModel from "../../../../../../cc/fields/lookup/Model";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
function getLookupUrlConstructions(_ref) {
|
|
5
|
-
let {
|
|
6
|
-
field,
|
|
7
|
-
value,
|
|
8
|
-
context
|
|
9
|
-
} = _ref;
|
|
10
|
-
let {
|
|
11
|
-
orgName,
|
|
12
|
-
departmentName
|
|
13
|
-
} = context;
|
|
14
|
-
let lookupModuleName = field?.lookup?.module?.apiName;
|
|
15
|
-
return `/agent/${orgName}/${departmentName}/${lookupModuleName}/details/${value.id}`;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function processLookupValue(value, url) {
|
|
19
|
-
if (typeof value === 'string' || typeof value === 'number') {
|
|
20
|
-
return {
|
|
21
|
-
id: value,
|
|
22
|
-
name: value
|
|
23
|
-
};
|
|
24
|
-
} else if (typeof value === 'object' && value !== null) {
|
|
25
|
-
return {
|
|
26
|
-
id: value.id || '',
|
|
27
|
-
name: value.name || '',
|
|
28
|
-
photoURL: value.photoURL || '',
|
|
29
|
-
url: value.url || url
|
|
30
|
-
};
|
|
31
|
-
} else {
|
|
32
|
-
return {
|
|
33
|
-
id: '',
|
|
34
|
-
name: '',
|
|
35
|
-
url
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const LookUpFieldTranslator = _ref2 => {
|
|
4
|
+
const LookUpFieldTranslator = _ref => {
|
|
41
5
|
let {
|
|
42
6
|
field,
|
|
43
7
|
value,
|
|
44
8
|
appendToActionPayload,
|
|
45
|
-
context,
|
|
46
9
|
textOverflowMode,
|
|
47
10
|
isRead
|
|
48
|
-
} =
|
|
11
|
+
} = _ref;
|
|
49
12
|
const {
|
|
50
13
|
uiType,
|
|
51
14
|
name
|
|
52
15
|
} = field;
|
|
53
|
-
const constructedUrl = getLookupUrlConstructions({
|
|
54
|
-
field,
|
|
55
|
-
value,
|
|
56
|
-
context
|
|
57
|
-
});
|
|
58
16
|
const {
|
|
59
17
|
id,
|
|
60
18
|
name: nameValue,
|
|
61
19
|
photoURL,
|
|
62
20
|
url
|
|
63
|
-
} =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
case FieldTypes.TagField:
|
|
80
|
-
return {
|
|
81
|
-
type: FieldTypes.TagField,
|
|
82
|
-
fieldName: name,
|
|
83
|
-
label: nameValue,
|
|
84
|
-
imageAltText: nameValue,
|
|
85
|
-
imageSrc: photoURL,
|
|
86
|
-
isRemovable: false,
|
|
87
|
-
cursor: 'default',
|
|
88
|
-
tooltip: nameValue,
|
|
89
|
-
appendToActionPayload,
|
|
90
|
-
isRead,
|
|
91
|
-
textOverflowMode
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
case FieldTypes.LabeledAvatarField:
|
|
95
|
-
return {
|
|
96
|
-
type: FieldTypes.LabeledAvatarField,
|
|
97
|
-
fieldName: name,
|
|
98
|
-
name: nameValue,
|
|
99
|
-
imageSrc: photoURL,
|
|
100
|
-
label: nameValue,
|
|
101
|
-
tooltip: nameValue,
|
|
102
|
-
appendToActionPayload,
|
|
103
|
-
isRead,
|
|
104
|
-
textOverflowMode
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
case FieldTypes.LinkField:
|
|
108
|
-
default:
|
|
109
|
-
return {
|
|
110
|
-
type: FieldTypes.LinkField,
|
|
111
|
-
fieldName: name,
|
|
112
|
-
text: nameValue,
|
|
113
|
-
variant: 'secondary',
|
|
114
|
-
href: url,
|
|
115
|
-
opensNewTab: false,
|
|
116
|
-
isDotted: textOverflowMode === 'clip',
|
|
117
|
-
weight: isRead ? undefined : 'bold',
|
|
118
|
-
tooltip: nameValue,
|
|
119
|
-
appendToActionPayload,
|
|
120
|
-
isRead,
|
|
121
|
-
textOverflowMode
|
|
122
|
-
};
|
|
123
|
-
}
|
|
21
|
+
} = value;
|
|
22
|
+
return LookupFieldModel({
|
|
23
|
+
uiType: uiType || FieldTypes.LookUpField,
|
|
24
|
+
appendToActionPayload,
|
|
25
|
+
name,
|
|
26
|
+
isRead,
|
|
27
|
+
value: {
|
|
28
|
+
id,
|
|
29
|
+
name: nameValue,
|
|
30
|
+
photoURL,
|
|
31
|
+
url
|
|
32
|
+
},
|
|
33
|
+
textOverflowMode
|
|
34
|
+
});
|
|
124
35
|
};
|
|
125
36
|
|
|
126
37
|
export default LookUpFieldTranslator;
|
package/es/platform/zlist/adapters/presenters/translators/fields/MultiLineFieldTranslator.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 MultiLineFieldModel from "../../../../../../cc/fields/multi-line/Model";
|
|
3
4
|
|
|
4
5
|
const MultiLineFieldTranslator = _ref => {
|
|
5
6
|
let {
|
|
@@ -13,22 +14,14 @@ const MultiLineFieldTranslator = _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 MultiLineFieldModel({
|
|
18
|
+
uiType: uiType || FieldTypes.MultiLineField,
|
|
19
|
+
appendToActionPayload,
|
|
20
|
+
name,
|
|
21
|
+
isRead,
|
|
22
|
+
value,
|
|
23
|
+
textOverflowMode
|
|
24
|
+
});
|
|
32
25
|
};
|
|
33
26
|
|
|
34
27
|
export default MultiLineFieldTranslator;
|