@zohodesk/library-platform 1.1.10-exp.4 → 1.1.10-exp.5
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/cc/fields/field/Types.js +1 -0
- package/es/cc/fields/name/Events.js +3 -0
- package/es/cc/fields/name/Model.js +14 -0
- package/es/cc/fields/name/Properties.js +27 -0
- package/es/cc/table-connected/Properties.js +13 -0
- package/es/cc/table-connected/constants/ExternalConstants.js +1 -0
- package/es/cc/table-list/Constants.js +1 -0
- package/es/cc/table-list/Events.js +20 -0
- package/es/cc/table-list/Properties.js +2 -1
- package/es/library/dot/components/form/frameworks/ui/FormView.js +0 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/index.js +2 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/primary-field/frameworks/ui/PrimaryField.js +12 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/primary-field/frameworks/ui/PrimaryFieldView.js +46 -0
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +14 -1
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +6 -2
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +21 -13
- package/es/platform/zlist/adapters/presenters/translators/Row.js +3 -2
- package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +4 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/BooleanFieldTranslator.js +7 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/CurrencyFieldTranslator.js +8 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/DateFieldTranslator.js +7 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/DateTimeFieldTranslator.js +7 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/DecimalFieldTranslator.js +7 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/EmailFieldTranslator.js +6 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/FormulaFieldTranslator.js +8 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/LookUpFieldTranslator.js +6 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiLineFieldTranslator.js +7 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiSelectFieldTranslator.js +7 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/NameFieldTranslator.js +54 -0
- package/es/platform/zlist/adapters/presenters/translators/fields/NumberFieldTranslator.js +7 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/PercentageFieldTranslator.js +7 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/PhoneFieldTranslator.js +7 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/PickListFieldTranslator.js +7 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/SingleLineFieldTranslator.js +7 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/URLFieldTranslator.js +7 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/index.js +3 -1
- package/package.json +1 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import FieldProperties from "../field/Properties";
|
|
2
|
+
export default { ...FieldProperties,
|
|
3
|
+
value: {
|
|
4
|
+
required: true,
|
|
5
|
+
defaultValue: {},
|
|
6
|
+
typeMetadata: {
|
|
7
|
+
schema: {
|
|
8
|
+
type: 'object',
|
|
9
|
+
properties: {
|
|
10
|
+
id: {
|
|
11
|
+
type: 'string'
|
|
12
|
+
},
|
|
13
|
+
value: {
|
|
14
|
+
type: 'string'
|
|
15
|
+
},
|
|
16
|
+
url: {
|
|
17
|
+
type: 'string'
|
|
18
|
+
},
|
|
19
|
+
isPreventDefault: {
|
|
20
|
+
type: 'boolean'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
required: ['value', 'url']
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -59,6 +59,19 @@ export default {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
+
nameFieldsConfig: {
|
|
63
|
+
required: false,
|
|
64
|
+
defaultValue: {
|
|
65
|
+
isEnabled: true,
|
|
66
|
+
isPreventDefault: false,
|
|
67
|
+
constructUrl: null
|
|
68
|
+
},
|
|
69
|
+
typeMetadata: {
|
|
70
|
+
schema: {
|
|
71
|
+
type: 'object'
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
62
75
|
reOrderConfig: {
|
|
63
76
|
required: false,
|
|
64
77
|
defaultValue: {
|
|
@@ -5,5 +5,6 @@ export default {
|
|
|
5
5
|
RECORDS_SELECTED: 'SMART_TABLE#RECORDS_SELECTED',
|
|
6
6
|
RECORDS_DESELECTED: 'SMART_TABLE#RECORDS_DESELECTED',
|
|
7
7
|
SMART_TABLE_ROW_ACTION_TRIGGERED: 'SMART_TABLE#ROW_ACTION_TRIGGERED',
|
|
8
|
+
SMART_TABLE_NAME_FIELD_CLICKED: 'SMART_TABLE#NAME_FIELD_CLICKED',
|
|
8
9
|
SELECTION_LIMIT_EXCEEDED: 'SMART_TABLE#SELECTION_LIMIT_EXCEEDED'
|
|
9
10
|
};
|
|
@@ -11,6 +11,7 @@ class Constants {
|
|
|
11
11
|
static TABLE_LIST_ROW_CLICKED = 'TABLE_LIST#ROW_CLICKED';
|
|
12
12
|
static TABLE_LIST_ROW_DRAG_START = 'TABLE_LIST#ROW_DRAG_START';
|
|
13
13
|
static TABLE_LIST_ROW_DRAG_END = 'TABLE_LIST#ROW_DRAG_END';
|
|
14
|
+
static TABLE_LIST_NAME_FIELD_CLICKED = 'TABLE_LIST#NAME_FIELD_CLICKED';
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export default Constants;
|
|
@@ -55,5 +55,25 @@ const Events = [{
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
+
}, {
|
|
59
|
+
type: Constants.TABLE_LIST_NAME_FIELD_CLICKED,
|
|
60
|
+
payload: {
|
|
61
|
+
fieldName: {
|
|
62
|
+
name: 'fieldName',
|
|
63
|
+
typeMetadata: {
|
|
64
|
+
schema: {
|
|
65
|
+
type: 'string'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
url: {
|
|
70
|
+
name: 'url',
|
|
71
|
+
typeMetadata: {
|
|
72
|
+
schema: {
|
|
73
|
+
type: 'string'
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
58
78
|
}];
|
|
59
79
|
export default Events;
|
|
@@ -17,6 +17,7 @@ import PhoneProperties from "../fields/phone/Properties";
|
|
|
17
17
|
import PickListProperties from "../fields/pick-list/Properties";
|
|
18
18
|
import TextProperties from "../fields/text/Properties";
|
|
19
19
|
import UrlProperties from "../fields/url/Properties";
|
|
20
|
+
import NameFieldProperties from "../fields/name/Properties";
|
|
20
21
|
const TableListProperties = {
|
|
21
22
|
isReOrderLoading: {
|
|
22
23
|
required: false,
|
|
@@ -203,7 +204,7 @@ const TableListProperties = {
|
|
|
203
204
|
required: ['id', 'name', 'text']
|
|
204
205
|
},
|
|
205
206
|
Column: {
|
|
206
|
-
anyOf: [PropertiesConverter.toJsonSchema(BooleanProperties), PropertiesConverter.toJsonSchema(CurrencyProperties), PropertiesConverter.toJsonSchema(DateProperties), PropertiesConverter.toJsonSchema(DatetimeProperties), PropertiesConverter.toJsonSchema(DecimalProperties), PropertiesConverter.toJsonSchema(EmailProperties), PropertiesConverter.toJsonSchema(LookupProperties), PropertiesConverter.toJsonSchema(MultiSelectProperties), PropertiesConverter.toJsonSchema(NumberProperties), PropertiesConverter.toJsonSchema(PercentProperties), PropertiesConverter.toJsonSchema(PhoneProperties), PropertiesConverter.toJsonSchema(PickListProperties), PropertiesConverter.toJsonSchema(TextProperties), PropertiesConverter.toJsonSchema(UrlProperties), // Below field is for the empty cell
|
|
207
|
+
anyOf: [PropertiesConverter.toJsonSchema(BooleanProperties), PropertiesConverter.toJsonSchema(CurrencyProperties), PropertiesConverter.toJsonSchema(DateProperties), PropertiesConverter.toJsonSchema(DatetimeProperties), PropertiesConverter.toJsonSchema(DecimalProperties), PropertiesConverter.toJsonSchema(EmailProperties), PropertiesConverter.toJsonSchema(LookupProperties), PropertiesConverter.toJsonSchema(MultiSelectProperties), PropertiesConverter.toJsonSchema(NumberProperties), PropertiesConverter.toJsonSchema(PercentProperties), PropertiesConverter.toJsonSchema(PhoneProperties), PropertiesConverter.toJsonSchema(PickListProperties), PropertiesConverter.toJsonSchema(TextProperties), PropertiesConverter.toJsonSchema(UrlProperties), PropertiesConverter.toJsonSchema(NameFieldProperties), // Below field is for the empty cell
|
|
207
208
|
{
|
|
208
209
|
type: 'object',
|
|
209
210
|
properties: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import FieldTypes from "../../../../cc/fields/field/Types";
|
|
2
|
+
import PrimaryField from "./primary-field/frameworks/ui/PrimaryField";
|
|
2
3
|
import CheckboxField from "./checkbox-field/frameworks/ui/CheckboxField";
|
|
3
4
|
import SwitchField from "./switch-field/frameworks/ui/SwitchField";
|
|
4
5
|
import SingleLineField from "./singleline-field/frameworks/ui/SingleLineField";
|
|
@@ -17,6 +18,7 @@ import NumberField from "./number-field/frameworks/ui/NumberField";
|
|
|
17
18
|
import DecimalField from "./decimal-field/frameworks/ui/DecimalField";
|
|
18
19
|
import MultiSelectField from "./multiselect-field/frameworks/ui/MultiSelectField";
|
|
19
20
|
const FieldComponents = {
|
|
21
|
+
[FieldTypes.PrimaryField]: PrimaryField,
|
|
20
22
|
[FieldTypes.CheckboxField]: CheckboxField,
|
|
21
23
|
[FieldTypes.SwitchField]: SwitchField,
|
|
22
24
|
// TODO: Need to register SwitchField
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import NameFieldProperties from "../../../../../../../cc/fields/name/Properties";
|
|
3
|
+
import NameFieldEvents from "../../../../../../../cc/fields/name/Events";
|
|
4
|
+
import PrimaryFieldView from "./PrimaryFieldView";
|
|
5
|
+
const PrimaryField = createCustomComponent({
|
|
6
|
+
name: 'PrimaryField',
|
|
7
|
+
View: PrimaryFieldView,
|
|
8
|
+
properties: NameFieldProperties,
|
|
9
|
+
events: NameFieldEvents,
|
|
10
|
+
eventHandlers: {}
|
|
11
|
+
});
|
|
12
|
+
export default PrimaryField;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import TableLink from "@zohodesk-private/desk-components/es/table/TableLink/TableLink";
|
|
3
|
+
import { TableListConstants } from "../../../../../../../cc/table-list";
|
|
4
|
+
export default function PrimaryFieldView(_ref, ref) {
|
|
5
|
+
let {
|
|
6
|
+
state,
|
|
7
|
+
helpers
|
|
8
|
+
} = _ref;
|
|
9
|
+
let {
|
|
10
|
+
dispatch
|
|
11
|
+
} = helpers;
|
|
12
|
+
let {
|
|
13
|
+
value: propValue,
|
|
14
|
+
name: fieldName
|
|
15
|
+
} = state.properties;
|
|
16
|
+
let {
|
|
17
|
+
value,
|
|
18
|
+
url,
|
|
19
|
+
isPreventDefault
|
|
20
|
+
} = propValue;
|
|
21
|
+
|
|
22
|
+
function handleClick(event) {
|
|
23
|
+
if (isPreventDefault) {
|
|
24
|
+
event && event.preventDefault();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
dispatch({
|
|
28
|
+
type: TableListConstants.TABLE_LIST_NAME_FIELD_CLICKED,
|
|
29
|
+
payload: {
|
|
30
|
+
fieldName,
|
|
31
|
+
url
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return /*#__PURE__*/React.createElement(TableLink, {
|
|
37
|
+
$customProps_link: {
|
|
38
|
+
ref,
|
|
39
|
+
onClick: handleClick
|
|
40
|
+
},
|
|
41
|
+
$data_text: value,
|
|
42
|
+
$data_url: url,
|
|
43
|
+
$data_target: "_self",
|
|
44
|
+
$flag_hoverableFromList: true
|
|
45
|
+
});
|
|
46
|
+
}
|
|
@@ -24,7 +24,8 @@ const {
|
|
|
24
24
|
TABLE_LIST_RESIZE_MOVE_REQUESTED,
|
|
25
25
|
TABLE_LIST_RESIZE_END_REQUESTED,
|
|
26
26
|
TABLE_LIST_SCROLLED,
|
|
27
|
-
TABLE_LIST_ROW_DRAG_END
|
|
27
|
+
TABLE_LIST_ROW_DRAG_END,
|
|
28
|
+
TABLE_LIST_NAME_FIELD_CLICKED
|
|
28
29
|
} = TableListEventConstants;
|
|
29
30
|
|
|
30
31
|
function createHandlerWithSdk(handler) {
|
|
@@ -261,9 +262,21 @@ export default class EventHandlersFactory {
|
|
|
261
262
|
});
|
|
262
263
|
};
|
|
263
264
|
|
|
265
|
+
const navigationHandler = args => {
|
|
266
|
+
const {
|
|
267
|
+
action,
|
|
268
|
+
dispatch
|
|
269
|
+
} = args;
|
|
270
|
+
dispatch({
|
|
271
|
+
type: SmartTableConstants.ExternalConstants.SMART_TABLE_NAME_FIELD_CLICKED,
|
|
272
|
+
payload: action.payload
|
|
273
|
+
});
|
|
274
|
+
};
|
|
275
|
+
|
|
264
276
|
const defaultEventHandlers = {
|
|
265
277
|
NAVIGATION: NavigationHandler,
|
|
266
278
|
// [`${name}#${LifeCycleEvents.MOUNT}`]: smartTableRenderedMetrics,
|
|
279
|
+
[TABLE_LIST_NAME_FIELD_CLICKED]: navigationHandler,
|
|
267
280
|
[`${name}#${LifeCycleEvents.STATE_UPDATED}`]: addMetrics,
|
|
268
281
|
[RESIZE_FINISHED]: new ResizeFinishController().handle,
|
|
269
282
|
[TABLE_LIST_RESIZE_START_REQUESTED]: new ResizeStartController().handle,
|
|
@@ -38,8 +38,12 @@ export default class TableTranslator {
|
|
|
38
38
|
const {
|
|
39
39
|
resizeConfig,
|
|
40
40
|
preferences,
|
|
41
|
-
keyboardControlsConfig
|
|
41
|
+
keyboardControlsConfig,
|
|
42
|
+
nameFieldsConfig
|
|
42
43
|
} = properties;
|
|
44
|
+
const {
|
|
45
|
+
modules
|
|
46
|
+
} = context;
|
|
43
47
|
context['servicePrefix'] = 'supportapi/zd'; // FIX: servicePrefix defaultValue should be available from properties
|
|
44
48
|
|
|
45
49
|
const {
|
|
@@ -108,7 +112,7 @@ export default class TableTranslator {
|
|
|
108
112
|
const modifiedWidths = calculateFieldWidths(fields, localStorageFieldWidths, preferences);
|
|
109
113
|
const recordsForDisplay = isRecordsShouldBeEmptied ? EMPTY_ARRAY : records;
|
|
110
114
|
const headersTranslator = new HeadersTranslator(fields, headerActions, context, modifiedWidths, sortBy, records, instanceName, moduleName);
|
|
111
|
-
const rowsTranslator = new RowsTranslator(recordsForDisplay, fields, rowActions, context, preferences, fieldComponentMapping, rowActionsUiType, fieldActions, instanceName, moduleName); // const actionTranslator = new ClientActionsTranslator(clientActions, records, fields, pageContext);
|
|
115
|
+
const rowsTranslator = new RowsTranslator(recordsForDisplay, fields, rowActions, context, preferences, fieldComponentMapping, rowActionsUiType, fieldActions, instanceName, moduleName, nameFieldsConfig); // const actionTranslator = new ClientActionsTranslator(clientActions, records, fields, pageContext);
|
|
112
116
|
// const translators = [headersTranslator.getTranslator(), rowsTranslator.getTranslator(), actionTranslator.getTranslator()];
|
|
113
117
|
|
|
114
118
|
const translators = [headersTranslator.getTranslator(), rowsTranslator.getTranslator()];
|
|
@@ -17,13 +17,15 @@ function getLookupUrlConstructions(_ref) {
|
|
|
17
17
|
return `/agent/${orgName}/${departmentName}/${lookupModuleName}/details/${value.id}`;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, context, preferences, instanceName, moduleName) {
|
|
20
|
+
function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, context, preferences, instanceName, moduleName, nameFieldsConfig) {
|
|
21
21
|
const {
|
|
22
22
|
isCustomField,
|
|
23
23
|
name,
|
|
24
24
|
type
|
|
25
25
|
} = field;
|
|
26
|
-
|
|
26
|
+
const {
|
|
27
|
+
modules
|
|
28
|
+
} = context;
|
|
27
29
|
const fieldEntry = fieldComponentMapping[name];
|
|
28
30
|
|
|
29
31
|
if (typeof fieldEntry == 'string') {
|
|
@@ -45,7 +47,11 @@ function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, co
|
|
|
45
47
|
field.uiType = fieldComponentMapping[name];
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
let nameFieldTypes = ['Text'];
|
|
51
|
+
let moduleApiKeyCheck = modules && modules.some(m => {
|
|
52
|
+
return m.apiKey === field.name;
|
|
53
|
+
});
|
|
54
|
+
const fieldTranslator = nameFieldsConfig.isEnabled && nameFieldTypes.includes(field.type) && moduleApiKeyCheck ? FieldTranslators['NameField'] : FieldTranslators[type];
|
|
49
55
|
|
|
50
56
|
if (!fieldTranslator) {
|
|
51
57
|
console.error(`Field type ${type} not supported`);
|
|
@@ -65,18 +71,20 @@ function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, co
|
|
|
65
71
|
});
|
|
66
72
|
}
|
|
67
73
|
|
|
68
|
-
let finalValue = value;
|
|
69
|
-
|
|
70
|
-
if (fieldToUiValue !== undefined) {
|
|
71
|
-
finalValue = fieldToUiValue;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
finalValue = tempValue ? tempValue : finalValue;
|
|
75
74
|
const viewModel = {
|
|
76
75
|
actions,
|
|
77
|
-
...fieldTranslator(
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
...fieldTranslator({
|
|
77
|
+
field,
|
|
78
|
+
value: tempValue ? tempValue : value,
|
|
79
|
+
appendToActionPayload: {
|
|
80
|
+
recordId: record.id
|
|
81
|
+
},
|
|
82
|
+
context,
|
|
83
|
+
preferences,
|
|
84
|
+
moduleName,
|
|
85
|
+
constructUrl: nameFieldsConfig.constructUrl,
|
|
86
|
+
isPreventDefault: nameFieldsConfig.isPreventDefault || false
|
|
87
|
+
})
|
|
80
88
|
};
|
|
81
89
|
|
|
82
90
|
if (fieldEntry && typeof fieldEntry === 'object') {
|
|
@@ -11,14 +11,15 @@ export default function RowTranslator(_ref) {
|
|
|
11
11
|
context,
|
|
12
12
|
preferences,
|
|
13
13
|
instanceName,
|
|
14
|
-
moduleName
|
|
14
|
+
moduleName,
|
|
15
|
+
nameFieldsConfig
|
|
15
16
|
} = _ref;
|
|
16
17
|
const actions = ClientActionsTranslator.transform(rowActions, instanceName, moduleName, { ...context,
|
|
17
18
|
record
|
|
18
19
|
});
|
|
19
20
|
return {
|
|
20
21
|
id: record.id,
|
|
21
|
-
columns: fields.map(field => ColumnTranslator(field, record, fieldComponentMapping, fieldActions, context, preferences, instanceName, moduleName)),
|
|
22
|
+
columns: fields.map(field => ColumnTranslator(field, record, fieldComponentMapping, fieldActions, context, preferences, instanceName, moduleName, nameFieldsConfig)),
|
|
22
23
|
rowActionLocation: {
|
|
23
24
|
type: rowActionsUiType,
|
|
24
25
|
actions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import RowTranslator from "./Row";
|
|
2
2
|
export default class RowsTranslator {
|
|
3
|
-
constructor(records, fields, rowActions, context, preferences, fieldComponentMapping, rowActionsUiType, fieldActions, instanceName, moduleName) {
|
|
3
|
+
constructor(records, fields, rowActions, context, preferences, fieldComponentMapping, rowActionsUiType, fieldActions, instanceName, moduleName, nameFieldsConfig) {
|
|
4
4
|
this.records = records;
|
|
5
5
|
this.fields = fields;
|
|
6
6
|
this.rowActions = rowActions;
|
|
@@ -11,6 +11,7 @@ export default class RowsTranslator {
|
|
|
11
11
|
this.fieldActions = fieldActions;
|
|
12
12
|
this.instanceName = instanceName;
|
|
13
13
|
this.moduleName = moduleName;
|
|
14
|
+
this.nameFieldsConfig = nameFieldsConfig;
|
|
14
15
|
this.pipe = this.pipe.bind(this);
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -29,7 +30,8 @@ export default class RowsTranslator {
|
|
|
29
30
|
context: this.context,
|
|
30
31
|
preferences: this.preferences,
|
|
31
32
|
instanceName: this.instanceName,
|
|
32
|
-
moduleName: this.moduleName
|
|
33
|
+
moduleName: this.moduleName,
|
|
34
|
+
nameFieldsConfig: this.nameFieldsConfig
|
|
33
35
|
}));
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
1
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
3
|
import BooleanFieldModel from "../../../../../../cc/fields/boolean/Model";
|
|
3
4
|
|
|
4
|
-
const BooleanFieldTranslator =
|
|
5
|
+
const BooleanFieldTranslator = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
field,
|
|
8
|
+
value,
|
|
9
|
+
appendToActionPayload
|
|
10
|
+
} = _ref;
|
|
5
11
|
const {
|
|
6
12
|
uiType,
|
|
7
13
|
name
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
2
|
import CurrencyFieldModel from "../../../../../../cc/fields/currency/Model";
|
|
3
3
|
|
|
4
|
-
const CurrencyFieldTranslator =
|
|
4
|
+
const CurrencyFieldTranslator = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
field,
|
|
7
|
+
value,
|
|
8
|
+
appendToActionPayload,
|
|
9
|
+
context,
|
|
10
|
+
preferences
|
|
11
|
+
} = _ref;
|
|
5
12
|
const {
|
|
6
13
|
uiType,
|
|
7
14
|
name
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
1
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
3
|
import DateFieldModel from "../../../../../../cc/fields/date/Model";
|
|
3
4
|
|
|
4
|
-
const DateFieldTranslator =
|
|
5
|
+
const DateFieldTranslator = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
field,
|
|
8
|
+
value,
|
|
9
|
+
appendToActionPayload
|
|
10
|
+
} = _ref;
|
|
5
11
|
const {
|
|
6
12
|
uiType,
|
|
7
13
|
name
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
1
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
3
|
import DateTimeFieldModel from "../../../../../../cc/fields/datetime/Model";
|
|
3
4
|
|
|
4
|
-
const DateTimeFieldTranslator =
|
|
5
|
+
const DateTimeFieldTranslator = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
field,
|
|
8
|
+
value,
|
|
9
|
+
appendToActionPayload
|
|
10
|
+
} = _ref;
|
|
5
11
|
const {
|
|
6
12
|
uiType,
|
|
7
13
|
name
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
1
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
3
|
import DecimalFieldModel from "../../../../../../cc/fields/decimal/Model";
|
|
3
4
|
|
|
4
|
-
const DecimalFieldTranslator =
|
|
5
|
+
const DecimalFieldTranslator = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
field,
|
|
8
|
+
value,
|
|
9
|
+
appendToActionPayload
|
|
10
|
+
} = _ref;
|
|
5
11
|
const {
|
|
6
12
|
uiType,
|
|
7
13
|
name
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
2
|
import EmailFieldModel from "../../../../../../cc/fields/email/Model";
|
|
3
3
|
|
|
4
|
-
const EmailFieldTranslator =
|
|
4
|
+
const EmailFieldTranslator = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
field,
|
|
7
|
+
value,
|
|
8
|
+
appendToActionPayload
|
|
9
|
+
} = _ref;
|
|
5
10
|
const {
|
|
6
11
|
uiType,
|
|
7
12
|
name
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
2
|
import FormulaFieldModel from "../../../../../../cc/fields/formula/Model";
|
|
3
3
|
|
|
4
|
-
const FormulaFieldTranslator =
|
|
4
|
+
const FormulaFieldTranslator = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
field,
|
|
7
|
+
value,
|
|
8
|
+
appendToActionPayload,
|
|
9
|
+
context,
|
|
10
|
+
preferences
|
|
11
|
+
} = _ref;
|
|
5
12
|
const {
|
|
6
13
|
uiType,
|
|
7
14
|
name
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
2
|
import LookupFieldModel from "../../../../../../cc/fields/lookup/Model";
|
|
3
3
|
|
|
4
|
-
const LookUpFieldTranslator =
|
|
4
|
+
const LookUpFieldTranslator = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
field,
|
|
7
|
+
value,
|
|
8
|
+
appendToActionPayload
|
|
9
|
+
} = _ref;
|
|
5
10
|
const {
|
|
6
11
|
uiType,
|
|
7
12
|
name
|
package/es/platform/zlist/adapters/presenters/translators/fields/MultiLineFieldTranslator.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
1
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
3
|
import MultiLineFieldModel from "../../../../../../cc/fields/multi-select/Model";
|
|
3
4
|
|
|
4
|
-
const MultiLineFieldTranslator =
|
|
5
|
+
const MultiLineFieldTranslator = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
field,
|
|
8
|
+
value,
|
|
9
|
+
appendToActionPayload
|
|
10
|
+
} = _ref;
|
|
5
11
|
const {
|
|
6
12
|
uiType,
|
|
7
13
|
name
|
package/es/platform/zlist/adapters/presenters/translators/fields/MultiSelectFieldTranslator.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
1
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
3
|
import MultiListFieldModel from "../../../../../../cc/fields/multi-select/Model";
|
|
3
4
|
import ColouredMultiListFieldModel from "../../../../../../cc/fields/coloured-multi-select/Model";
|
|
4
5
|
|
|
5
|
-
const MultiSelectFieldTranslator =
|
|
6
|
+
const MultiSelectFieldTranslator = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
field,
|
|
9
|
+
value,
|
|
10
|
+
appendToActionPayload
|
|
11
|
+
} = _ref;
|
|
6
12
|
const {
|
|
7
13
|
uiType,
|
|
8
14
|
name,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
|
+
import NameFieldModel from "../../../../../../cc/fields/name/Model";
|
|
3
|
+
|
|
4
|
+
function getNameFieldUrlConstructions(_ref) {
|
|
5
|
+
let {
|
|
6
|
+
record,
|
|
7
|
+
context,
|
|
8
|
+
moduleName
|
|
9
|
+
} = _ref;
|
|
10
|
+
let {
|
|
11
|
+
orgName,
|
|
12
|
+
departmentName
|
|
13
|
+
} = context;
|
|
14
|
+
return `/agent/${orgName}/${departmentName}/${moduleName}/details/${record.recordId}`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const NameFieldTranslator = _ref2 => {
|
|
18
|
+
let {
|
|
19
|
+
field,
|
|
20
|
+
value,
|
|
21
|
+
appendToActionPayload,
|
|
22
|
+
context,
|
|
23
|
+
moduleName,
|
|
24
|
+
constructUrl,
|
|
25
|
+
isPreventDefault
|
|
26
|
+
} = _ref2;
|
|
27
|
+
const {
|
|
28
|
+
uiType,
|
|
29
|
+
name
|
|
30
|
+
} = field;
|
|
31
|
+
let nameFieldValue = undefined;
|
|
32
|
+
nameFieldValue = typeof value !== 'object' ? {
|
|
33
|
+
value,
|
|
34
|
+
isPreventDefault,
|
|
35
|
+
id: appendToActionPayload.recordId
|
|
36
|
+
} : value;
|
|
37
|
+
nameFieldValue.url = constructUrl ? constructUrl({
|
|
38
|
+
record: appendToActionPayload,
|
|
39
|
+
context,
|
|
40
|
+
moduleName
|
|
41
|
+
}) : getNameFieldUrlConstructions({
|
|
42
|
+
record: appendToActionPayload,
|
|
43
|
+
context,
|
|
44
|
+
moduleName
|
|
45
|
+
});
|
|
46
|
+
return NameFieldModel({
|
|
47
|
+
uiType: FieldTypes.PrimaryField,
|
|
48
|
+
appendToActionPayload,
|
|
49
|
+
name,
|
|
50
|
+
value: nameFieldValue
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default NameFieldTranslator;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
1
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
3
|
import NumberFieldModel from "../../../../../../cc/fields/number/Model";
|
|
3
4
|
|
|
4
|
-
const NumberLineFieldTranslator =
|
|
5
|
+
const NumberLineFieldTranslator = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
field,
|
|
8
|
+
value,
|
|
9
|
+
appendToActionPayload
|
|
10
|
+
} = _ref;
|
|
5
11
|
const {
|
|
6
12
|
uiType,
|
|
7
13
|
name
|
package/es/platform/zlist/adapters/presenters/translators/fields/PercentageFieldTranslator.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
1
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
3
|
import PercentFieldModel from "../../../../../../cc/fields/percent/Model";
|
|
3
4
|
|
|
4
|
-
const PercentageFieldTranslator =
|
|
5
|
+
const PercentageFieldTranslator = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
field,
|
|
8
|
+
value,
|
|
9
|
+
appendToActionPayload
|
|
10
|
+
} = _ref;
|
|
5
11
|
const {
|
|
6
12
|
uiType,
|
|
7
13
|
name
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
1
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
3
|
import PhoneFieldModel from "../../../../../../cc/fields/phone/Model";
|
|
3
4
|
|
|
4
|
-
const PhoneFieldTranslator =
|
|
5
|
+
const PhoneFieldTranslator = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
field,
|
|
8
|
+
value,
|
|
9
|
+
appendToActionPayload
|
|
10
|
+
} = _ref;
|
|
5
11
|
const {
|
|
6
12
|
uiType,
|
|
7
13
|
name
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
1
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
3
|
import PickListFieldModel from "../../../../../../cc/fields/pick-list/Model";
|
|
3
4
|
import ColouredPickListFieldModel from "../../../../../../cc/fields/coloured-pick-list/Model";
|
|
4
5
|
|
|
5
|
-
const PickListFieldTranslator =
|
|
6
|
+
const PickListFieldTranslator = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
field,
|
|
9
|
+
value,
|
|
10
|
+
appendToActionPayload
|
|
11
|
+
} = _ref;
|
|
6
12
|
const {
|
|
7
13
|
uiType,
|
|
8
14
|
name,
|
package/es/platform/zlist/adapters/presenters/translators/fields/SingleLineFieldTranslator.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
1
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
3
|
import TextFieldModel from "../../../../../../cc/fields/text/Model";
|
|
3
4
|
|
|
4
|
-
const SingleLineFieldTranslator =
|
|
5
|
+
const SingleLineFieldTranslator = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
field,
|
|
8
|
+
value,
|
|
9
|
+
appendToActionPayload
|
|
10
|
+
} = _ref;
|
|
5
11
|
const {
|
|
6
12
|
uiType,
|
|
7
13
|
name
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
// import FieldModel from '@platform/zfield/entities/interfaces/FieldModel';
|
|
1
2
|
import FieldTypes from "../../../../../../cc/fields/field/Types";
|
|
2
3
|
import UrlFieldModel from "../../../../../../cc/fields/url/Model";
|
|
3
4
|
|
|
4
|
-
const URLFieldTranslator =
|
|
5
|
+
const URLFieldTranslator = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
field,
|
|
8
|
+
value,
|
|
9
|
+
appendToActionPayload
|
|
10
|
+
} = _ref;
|
|
5
11
|
const {
|
|
6
12
|
uiType,
|
|
7
13
|
name
|
|
@@ -14,7 +14,9 @@ export { default as DateTime } from "./DateTimeFieldTranslator";
|
|
|
14
14
|
export { default as Picklist } from "./PickListFieldTranslator";
|
|
15
15
|
export { default as Multiselect } from "./MultiSelectFieldTranslator";
|
|
16
16
|
export { default as LookUp } from "./LookUpFieldTranslator";
|
|
17
|
-
export { default as Formula } from "./FormulaFieldTranslator"; //
|
|
17
|
+
export { default as Formula } from "./FormulaFieldTranslator"; // Special Field Type
|
|
18
|
+
|
|
19
|
+
export { default as NameField } from "./NameFieldTranslator"; // // Field Name is to be similar to the API response
|
|
18
20
|
// class FieldTranslator {
|
|
19
21
|
// static translate(field, value) {
|
|
20
22
|
// const { type } = field;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/library-platform",
|
|
3
|
-
"version": "1.1.10-exp.
|
|
3
|
+
"version": "1.1.10-exp.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"files": [
|
|
@@ -93,7 +93,6 @@
|
|
|
93
93
|
"react-sortable-hoc": "1.11.0"
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
|
-
"@zoho/securityJS": "npm:@zoho/SecurityJS@^7.2.4",
|
|
97
96
|
"ajv": "6.12.6",
|
|
98
97
|
"jsep": "0.3.5",
|
|
99
98
|
"object-path-immutable": "4.1.2"
|