@zohodesk/library-platform 1.1.10-exp.3 → 1.1.10-temp-1
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/Constants.js +5 -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 +24 -0
- package/es/cc/table-connected/Properties.js +12 -0
- package/es/cc/table-list/Properties.js +2 -1
- package/es/cc/table-primary-field/Constants.js +5 -0
- package/es/cc/table-primary-field/Events.js +4 -0
- package/es/cc/table-primary-field/Properties.js +29 -0
- package/es/{platform → library/dot/components/table-list}/.DS_Store +0 -0
- package/es/library/dot/legacy-to-new-arch/table-column-chooser/frameworks/ui/TableColumnChooserView.module.css +3 -0
- package/es/library/dot/legacy-to-new-arch/table-column-chooser/frameworks/ui/css/TableColumnChooserView.module.css +3 -0
- 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/EventHandlersFactory.js +28 -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 +38 -0
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +6 -2
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +20 -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 +52 -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 +2 -1
- package/es/.DS_Store +0 -0
- package/es/cc/form-connected/Constants.js +0 -12
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
},
|
|
20
|
+
required: ['value', 'url']
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
@@ -59,6 +59,18 @@ export default {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
+
nameFieldsConfig: {
|
|
63
|
+
required: false,
|
|
64
|
+
defaultValue: {
|
|
65
|
+
isEnabled: true,
|
|
66
|
+
constructUrl: null
|
|
67
|
+
},
|
|
68
|
+
typeMetadata: {
|
|
69
|
+
schema: {
|
|
70
|
+
type: 'object'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
62
74
|
reOrderConfig: {
|
|
63
75
|
required: false,
|
|
64
76
|
defaultValue: {
|
|
@@ -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: {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
id: {
|
|
3
|
+
required: false,
|
|
4
|
+
defaultValue: false,
|
|
5
|
+
typeMetadata: {
|
|
6
|
+
schema: {
|
|
7
|
+
type: 'string'
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
value: {
|
|
12
|
+
required: false,
|
|
13
|
+
defaultValue: false,
|
|
14
|
+
typeMetadata: {
|
|
15
|
+
schema: {
|
|
16
|
+
type: 'string'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
url: {
|
|
21
|
+
required: false,
|
|
22
|
+
defaultValue: false,
|
|
23
|
+
typeMetadata: {
|
|
24
|
+
schema: {
|
|
25
|
+
type: 'string'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
Binary file
|
|
@@ -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,28 @@
|
|
|
1
|
+
import NameFieldConstants from "../../../../../../../cc/fields/name/Constants";
|
|
2
|
+
import FieldConstants from "../../../../../../../cc/fields/field/Constants";
|
|
3
|
+
export class EventHandlersFactory {
|
|
4
|
+
static create() {
|
|
5
|
+
const clickHandler = input => {
|
|
6
|
+
const {
|
|
7
|
+
state,
|
|
8
|
+
dispatch
|
|
9
|
+
} = input;
|
|
10
|
+
const {
|
|
11
|
+
name: fieldName,
|
|
12
|
+
url
|
|
13
|
+
} = state.properties;
|
|
14
|
+
dispatch({
|
|
15
|
+
type: FieldConstants.FIELD_CLICKED,
|
|
16
|
+
payload: {
|
|
17
|
+
fieldName,
|
|
18
|
+
url
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
[NameFieldConstants.NAME_FIELD_CLICKED]: clickHandler
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -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,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import TableLink from "@zohodesk-private/desk-components/es/table/TableLink/TableLink";
|
|
3
|
+
import FieldConstants from "../../../../../../../cc/fields/field/Constants";
|
|
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
|
+
} = propValue;
|
|
20
|
+
return /*#__PURE__*/React.createElement(TableLink, {
|
|
21
|
+
$customProps_link: {
|
|
22
|
+
ref
|
|
23
|
+
},
|
|
24
|
+
$data_text: value,
|
|
25
|
+
$data_url: url,
|
|
26
|
+
$data_target: "_self",
|
|
27
|
+
$flag_hoverableFromList: true,
|
|
28
|
+
$event_onClick: () => {
|
|
29
|
+
dispatch({
|
|
30
|
+
type: FieldConstants.FIELD_CLICKED,
|
|
31
|
+
payload: {
|
|
32
|
+
fieldName,
|
|
33
|
+
url
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -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,19 @@ 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
|
+
})
|
|
80
87
|
};
|
|
81
88
|
|
|
82
89
|
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,52 @@
|
|
|
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
|
+
} = _ref2;
|
|
26
|
+
const {
|
|
27
|
+
uiType,
|
|
28
|
+
name
|
|
29
|
+
} = field;
|
|
30
|
+
let nameFieldValue = undefined;
|
|
31
|
+
nameFieldValue = typeof value !== 'object' ? {
|
|
32
|
+
value,
|
|
33
|
+
id: appendToActionPayload.recordId
|
|
34
|
+
} : value;
|
|
35
|
+
nameFieldValue.url = constructUrl ? constructUrl({
|
|
36
|
+
record: appendToActionPayload,
|
|
37
|
+
context,
|
|
38
|
+
moduleName
|
|
39
|
+
}) : getNameFieldUrlConstructions({
|
|
40
|
+
record: appendToActionPayload,
|
|
41
|
+
context,
|
|
42
|
+
moduleName
|
|
43
|
+
});
|
|
44
|
+
return NameFieldModel({
|
|
45
|
+
uiType: FieldTypes.PrimaryField,
|
|
46
|
+
appendToActionPayload,
|
|
47
|
+
name,
|
|
48
|
+
value: nameFieldValue
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
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-
|
|
3
|
+
"version": "1.1.10-temp-1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"files": [
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"publish:alpha": "npm publish --tag alpha",
|
|
21
21
|
"publish:beta": "npm publish --tag beta",
|
|
22
22
|
"publish:exp": "npm publish --tag experimental",
|
|
23
|
+
"publish:temp": "npm publish --tag temp",
|
|
23
24
|
"postpublish": "node ./post_publish.js",
|
|
24
25
|
"lint:setup": "ZDPrecommit setupPlugins",
|
|
25
26
|
"lint": "eslint -c .eslintrc.js --ext .ts,.js,.tsx",
|
package/es/.DS_Store
DELETED
|
Binary file
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
class SmartFormConstants {
|
|
2
|
-
static SMART_FORM_FIELD_FOCUSED = 'SMART_FORM#FIELD_FOCUSED';
|
|
3
|
-
static SMART_FORM_FIELD_BLURRED = 'SMART_FORM#FIELD_BLURRED';
|
|
4
|
-
static SMART_FORM_FIELD_VALUE_CHANGED = 'SMART_FORM#FIELD_VALUE_CHANGED';
|
|
5
|
-
static SMART_FORM_SUBMIT = 'SMART_FORM#SUBMIT';
|
|
6
|
-
static SMART_FORM_SUBMIT_CLICKED = 'SMART_FORM#SUBMIT_CLICKED';
|
|
7
|
-
static SMART_FORM_CANCEL_CLICKED = 'SMART_FORM#CANCEL_CLICKED';
|
|
8
|
-
static SMART_FORM_SUBMIT_SUCCESS = 'SMART_FORM#SUBMIT_SUCCESS';
|
|
9
|
-
static SMART_FORM_SUBMIT_FAILURE = 'SMART_FORM#SUBMIT_FAILED';
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default SmartFormConstants;
|