@zohodesk/library-platform 1.1.12-exp.2 → 1.1.12-exp.3
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/app-context/Properties.js +19 -0
- package/es/bc/float-pagination/ActionHandlers.js +1 -0
- package/es/bc/float-pagination/Constants.js +4 -0
- package/es/bc/float-pagination/Properties.js +18 -0
- package/es/bc/float-pagination/index.js +2 -0
- package/es/bc/search/Constants.js +3 -0
- package/es/bc/search/EventHandlers.js +1 -0
- package/es/bc/search/Properties.js +11 -0
- package/es/bc/search/index.js +2 -0
- package/es/cc/action-icon/Properties.js +20 -1
- package/es/cc/checkbox/Properties.js +2 -1
- package/es/cc/email/Properties.js +8 -0
- package/es/cc/fields/field/Types.js +31 -23
- package/es/cc/fields/lookup/Properties.js +26 -10
- package/es/cc/floating-pagination/Constants.js +6 -0
- package/es/cc/floating-pagination/Events.js +8 -0
- package/es/cc/floating-pagination/Properties.js +56 -0
- package/es/cc/floating-pagination/index.js +3 -0
- package/es/cc/highlighted-value/Properties.js +18 -0
- package/es/cc/link/Properties.js +13 -3
- package/es/cc/ribbon/Properties.js +59 -0
- package/es/cc/ribbon/index.js +1 -0
- package/es/cc/switch/Properties.js +2 -2
- package/es/cc/table-connected/Properties.js +16 -0
- package/es/cc/table-list/Constants.js +1 -0
- package/es/cc/table-list/Properties.js +35 -35
- package/es/cc/tags/Data.js +0 -6
- package/es/cc/tags/model/index.js +1 -1
- package/es/library/behaviours/float-pagination/adapters/controllers/DestructController.js +18 -0
- package/es/library/behaviours/float-pagination/adapters/controllers/FloatPaginationController.js +25 -0
- package/es/library/behaviours/float-pagination/adapters/controllers/InitializeController.js +18 -0
- package/es/library/behaviours/float-pagination/adapters/controllers/ScrollBottomController.js +23 -0
- package/es/library/behaviours/float-pagination/adapters/controllers/ScrollTopController.js +23 -0
- package/es/library/behaviours/float-pagination/adapters/controllers/UpdateIndexController.js +30 -0
- package/es/library/behaviours/float-pagination/adapters/gateway/Repository.js +27 -0
- package/es/library/behaviours/float-pagination/adapters/gateway/Service.js +20 -0
- package/es/library/behaviours/float-pagination/adapters/presenter/Presenter.js +16 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/input/ScrollTopInputModel.js +1 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/input/ScrollbottomInputModel.js +1 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/input/UpdateIndexInputModel.js +1 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/output/FloatPaginationOutputModel.js +1 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/output/IPresenter.js +1 -0
- package/es/library/behaviours/float-pagination/applications/usecases/DestructUsecase.js +15 -0
- package/es/library/behaviours/float-pagination/applications/usecases/FloatPaginationUseCase.js +31 -0
- package/es/library/behaviours/float-pagination/applications/usecases/InitializeUsecase.js +16 -0
- package/es/library/behaviours/float-pagination/applications/usecases/ScrollBottomUseCase.js +23 -0
- package/es/library/behaviours/float-pagination/applications/usecases/ScrollTopUseCase.js +23 -0
- package/es/library/behaviours/float-pagination/applications/usecases/UpdateIndexUseCase.js +28 -0
- package/es/library/behaviours/float-pagination/domain/entities/FloatPagination.js +28 -0
- package/es/library/behaviours/float-pagination/domain/entities/interfaces/IFloatPagination.js +1 -0
- package/es/library/behaviours/float-pagination/frameworks/ui/ActionsHandlerFactory.js +37 -0
- package/es/library/behaviours/float-pagination/frameworks/ui/FloatPaginationBehaviourFactory.js +21 -0
- package/es/library/behaviours/float-pagination/frameworks/utils.js +70 -0
- package/es/library/behaviours/keyboard-controls/adapters/gateways/Repository.js +2 -1
- package/es/library/behaviours/keyboard-controls/applications/usecases/SpacePress.js +1 -1
- package/es/library/behaviours/keyboard-controls/domain/entities/KeyboardControls.js +6 -1
- package/es/library/behaviours/list-selection/domain/entities/ListItemSelection.js +21 -18
- package/es/library/behaviours/search/adapters/controllers/AbstractController.js +9 -0
- package/es/library/behaviours/search/adapters/controllers/SearchController.js +26 -0
- package/es/library/behaviours/search/adapters/controllers/UpdatePropertiesController.js +27 -0
- package/es/library/behaviours/search/adapters/gateway/Repository.js +20 -0
- package/es/library/behaviours/search/adapters/gateway/Service.js +12 -0
- package/es/library/behaviours/{sort-by → search}/adapters/presenter/Presenter.js +2 -2
- package/es/library/behaviours/search/adapters/presenter/SearchTranslator.js +6 -0
- package/es/library/behaviours/search/applications/interfaces/UseCaseDependencies.js +1 -0
- package/es/library/behaviours/search/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/library/behaviours/search/applications/interfaces/gateways/IService.js +1 -0
- package/es/library/behaviours/search/applications/interfaces/input/SearchInputModel.js +1 -0
- package/es/library/behaviours/search/applications/interfaces/input/UpdatePropertiesInputModel.js +1 -0
- package/es/library/behaviours/search/applications/interfaces/output/IPresenter.js +1 -0
- package/es/library/behaviours/search/applications/interfaces/output/SearchOutputModel.js +1 -0
- package/es/library/behaviours/search/applications/usecases/AbstractUseCase.js +17 -0
- package/es/library/behaviours/search/applications/usecases/SearchUseCase.js +28 -0
- package/es/library/behaviours/search/applications/usecases/UpdatePropertiesUsecase.js +25 -0
- package/es/library/behaviours/search/domain/entities/Search.js +23 -0
- package/es/library/behaviours/search/domain/entities/interfaces/ISearch.js +1 -0
- package/es/library/behaviours/search/frameworks/ui/EventHandlerFactory.js +25 -0
- package/es/library/behaviours/search/frameworks/ui/SearchStringStoreBehaviourFactory.js +26 -0
- package/es/library/custom-component/adapters/gateways/event-manager/EventManager.js +5 -0
- package/es/library/custom-component/domain/entities/ComponentProperties.js +1 -1
- package/es/library/custom-component/domain/entities/Logger.js +3 -3
- package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +3 -1
- package/es/library/dot/components/table-list/adapters/controllers/ScrollController.js +2 -2
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +24 -1
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +19 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +4 -6
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIconView.js +5 -1
- package/es/library/dot/legacy-to-new-arch/email/frameworks/ui/EmailView.js +4 -2
- package/es/library/dot/legacy-to-new-arch/floating-pagination/frameworks/ui/FloatingPagination.js +10 -0
- package/es/library/dot/legacy-to-new-arch/floating-pagination/frameworks/ui/FloatingPaginationView.js +47 -0
- package/es/library/dot/legacy-to-new-arch/highlighted-value/frameworks/ui/HighlightedValueView.js +6 -1
- package/es/library/dot/legacy-to-new-arch/index.js +1 -0
- package/es/library/dot/legacy-to-new-arch/link/frameworks/ui/LinkView.js +4 -2
- package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/RadioDropdownView.js +1 -0
- package/es/library/dot/legacy-to-new-arch/ribbon/frameworks/ui/Ribbon.js +10 -0
- package/es/library/dot/legacy-to-new-arch/ribbon/frameworks/ui/RibbonView.js +37 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/CheckboxField.js +12 -2
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/CheckboxFieldView.js +8 -5
- 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 +8 -6
- package/es/library/dot/legacy-to-new-arch/table-field-components/index.js +22 -5
- 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/radio-dropdown-field/frameworks/ui/EventHandlersFactory.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/RadioDropdownField.js +17 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/RadioDropdownFieldView.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 +14 -4
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/SwitchFieldView.js +8 -4
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-list-dropdown-field/frameworks/ui/TagsListDropdownField.js +33 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-list-dropdown-field/frameworks/ui/TagsListDropdownFieldView.js +1 -1
- 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/controllers/ScrollController.js +29 -8
- package/es/platform/components/table-connected/adapters/controllers/ScrollEndReachedController.js +23 -0
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +26 -4
- package/es/platform/components/table-connected/frameworks/TableConnectedFactory.js +2 -1
- package/es/platform/components/table-connected/frameworks/TableConnectedView.js +2 -0
- package/es/platform/data-source/http-template/fetchLookupFields.js +6 -0
- package/es/platform/data-source/http-template/getComponentMapping.js +1 -1
- package/es/platform/data-source/http-template/getSingleRecord.js +51 -0
- package/es/platform/data-source/index.js +3 -1
- package/es/platform/zfield/applications/usecases/FetchSuccessUseCase.js +33 -0
- package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +5 -0
- package/es/platform/zform/adapters/controllers/GetInitialRecordSuccessController.js +31 -0
- package/es/platform/zform/adapters/gateway/FormRepository.js +1 -3
- package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +11 -12
- package/es/platform/zform/applications/interfaces/input/GetInitialRecordSuccessUseCaseInputModel.js +1 -0
- package/es/platform/zform/applications/usecases/GetInitialRecordSuccessUseCase.js +132 -0
- package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +10 -9
- package/es/platform/zform/domain/ZForm.js +0 -2
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +44 -6
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +57 -49
- package/es/platform/zlist/adapters/presenters/translators/Row.js +16 -2
- package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +3 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/BooleanFieldTranslator.js +87 -12
- package/es/platform/zlist/adapters/presenters/translators/fields/CurrencyFieldTranslator.js +66 -11
- package/es/platform/zlist/adapters/presenters/translators/fields/DateFieldTranslator.js +33 -8
- package/es/platform/zlist/adapters/presenters/translators/fields/DateTimeFieldTranslator.js +33 -8
- package/es/platform/zlist/adapters/presenters/translators/fields/DecimalFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/EmailFieldTranslator.js +29 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/FormulaFieldTranslator.js +23 -27
- package/es/platform/zlist/adapters/presenters/translators/fields/LookUpFieldTranslator.js +106 -17
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiLineFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiSelectFieldTranslator.js +100 -26
- package/es/platform/zlist/adapters/presenters/translators/fields/NumberFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/PercentageFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/PhoneFieldTranslator.js +32 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/PickListFieldTranslator.js +167 -26
- package/es/platform/zlist/adapters/presenters/translators/fields/SingleLineFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/URLFieldTranslator.js +32 -9
- package/es/platform/zlist/adapters/presenters/utils/DateAndTimeFormat.js +25 -0
- package/es/platform/zrecord/adapters/controllers/UpdateRecordController.js +30 -0
- package/es/platform/zrecord/applications/interfaces/input/UpdateRecordInputModel.js +0 -0
- package/es/platform/zrecord/applications/usecases/UpdateRecordUseCase.js +30 -0
- package/package.json +20 -20
- package/es/bc/sort-by/ActionHandlers.js +0 -1
- package/es/bc/sort-by/Constants.js +0 -2
- package/es/bc/sort-by/Properties.js +0 -26
- package/es/bc/sort-by/SortOrderEnum.js +0 -8
- package/es/bc/sort-by/index.js +0 -2
- package/es/cc/tags/model/TagModel.js +0 -26
- package/es/library/behaviours/sort-by/adapters/controllers/SortBy.js +0 -28
- package/es/library/behaviours/sort-by/adapters/gateway/Repository.js +0 -19
- package/es/library/behaviours/sort-by/adapters/gateway/Service.js +0 -10
- package/es/library/behaviours/sort-by/applications/usecases/SortBy.js +0 -28
- package/es/library/behaviours/sort-by/domain/entities/SortBy.js +0 -42
- package/es/library/behaviours/sort-by/frameworks/ui/ActionsHandlerFactory.js +0 -23
- package/es/library/behaviours/sort-by/frameworks/ui/DemoBehaviour.js +0 -20
- package/es/library/behaviours/sort-by/frameworks/ui/SortByBehaviourFactory.js +0 -24
- package/es/library/custom-component/frameworks/ui/CustomComponentFactory.js +0 -56
- package/es/library/dot/components/table-list/adapters/controllers/SortByController.js +0 -25
- package/es/library/dot/components/table-list/adapters/controllers/SortedController.js +0 -18
- package/es/library/dot/components/table-list/frameworks/ui/handlers/HandleSortClick.js +0 -12
- package/es/platform/zlist/adapters/gateways/SortBy.js +0 -38
- package/es/platform/zlist/domain/entities/SortBy.js +0 -58
- /package/es/{library/behaviours/sort-by/applications/interfaces/UseCaseDependencies.js → bc/float-pagination/types/FloatPaginationBehaviourState.js} +0 -0
- /package/es/{library/behaviours/sort-by/applications/interfaces/gateways/IRepository.js → bc/list-selection/Types.js} +0 -0
- /package/es/{library/behaviours/sort-by/applications/interfaces/gateways/IService.js → cc/table-list/data-types/FloatPaginationConfig.js} +0 -0
- /package/es/library/behaviours/{sort-by → float-pagination}/adapters/controllers/AbstractController.js +0 -0
- /package/es/library/behaviours/{sort-by/applications/interfaces/input/SortByInputModel.js → float-pagination/applications/interfaces/UseCaseDependencies.js} +0 -0
- /package/es/library/behaviours/{sort-by/applications/interfaces/output/IPresenter.js → float-pagination/applications/interfaces/gateways/IRepository.js} +0 -0
- /package/es/library/behaviours/{sort-by/applications/interfaces/output/SortByOutputModel.js → float-pagination/applications/interfaces/gateways/IService.js} +0 -0
- /package/es/library/behaviours/{sort-by/domain/entities/interfaces/ISortBy.js → float-pagination/applications/interfaces/input/DestructInputModel.js} +0 -0
- /package/es/{platform/zlist/applications/interfaces/gateways/ISortBy.js → library/behaviours/float-pagination/applications/interfaces/input/FloatPaginationInputModel.js} +0 -0
- /package/es/{platform/zlist/domain/entities/interfaces/ISortBy.js → library/behaviours/float-pagination/applications/interfaces/input/InitializeInputModel.js} +0 -0
- /package/es/library/behaviours/{sort-by → float-pagination}/applications/usecases/AbstractUseCase.js +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const getSingleRecord = {
|
|
2
|
+
name: 'records',
|
|
3
|
+
api: '/{{servicePrefix}}/{{orgName}}/api/v1/{{moduleName}}/{{recordId}}',
|
|
4
|
+
parameters: `{}`,
|
|
5
|
+
// parameters: `{ "include": "{{include}}" }`,
|
|
6
|
+
type: 'GET',
|
|
7
|
+
transformer: data => data,
|
|
8
|
+
properties: {
|
|
9
|
+
servicePrefix: {
|
|
10
|
+
required: true,
|
|
11
|
+
typeMetadata: {
|
|
12
|
+
schema: {
|
|
13
|
+
type: 'string'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
orgName: {
|
|
18
|
+
required: true,
|
|
19
|
+
typeMetadata: {
|
|
20
|
+
schema: {
|
|
21
|
+
type: 'string'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
// include: {
|
|
26
|
+
// required: false,
|
|
27
|
+
// typeMetadata: {
|
|
28
|
+
// schema: {
|
|
29
|
+
// type: 'string'
|
|
30
|
+
// }
|
|
31
|
+
// }
|
|
32
|
+
// },
|
|
33
|
+
moduleName: {
|
|
34
|
+
required: true,
|
|
35
|
+
typeMetadata: {
|
|
36
|
+
schema: {
|
|
37
|
+
type: 'string'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
recordId: {
|
|
42
|
+
required: true,
|
|
43
|
+
typeMetadata: {
|
|
44
|
+
schema: {
|
|
45
|
+
type: 'string'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export default getSingleRecord;
|
|
@@ -21,6 +21,7 @@ import fetchLookupFields from "./http-template/fetchLookupFields";
|
|
|
21
21
|
import getClientScripts from "./http-template/getClientScripts";
|
|
22
22
|
import markAsRead from "./http-template/markAsRead";
|
|
23
23
|
import markAsUnRead from "./http-template/markAsUnRead";
|
|
24
|
+
import getComponentMapping from "./http-template/getComponentMapping";
|
|
24
25
|
let dataSource = {
|
|
25
26
|
httpTemplates: {
|
|
26
27
|
[RecordApiActionName.GET_RECORDS]: getRecords,
|
|
@@ -42,7 +43,8 @@ let dataSource = {
|
|
|
42
43
|
[ZFormApiActionName.getLayoutRules]: getLayoutRules,
|
|
43
44
|
[ZFormApiActionName.getDependencyMappings]: getDependencyMappings,
|
|
44
45
|
[ZFormApiActionName.getValidationRules]: getValidationRules,
|
|
45
|
-
[ZFormApiActionName.fetchLookupFields]: fetchLookupFields
|
|
46
|
+
[ZFormApiActionName.fetchLookupFields]: fetchLookupFields,
|
|
47
|
+
getComponentMapping
|
|
46
48
|
}
|
|
47
49
|
};
|
|
48
50
|
export default dataSource; // let ticketsRecordSerice = createRecord(tickets, () => {});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { DATA_SOURCE_EXECUTE } from "../../../../bc/zdata-source/Constants";
|
|
1
2
|
import AbstractUseCase from "./AbstractUseCase";
|
|
3
|
+
import { DATA_SOURCE_FAILURE, DATA_SOURCE_NO_CONTENT, DATA_SOURCE_SUCCESS } from "../../../../bc/zdata-source/Symbols";
|
|
2
4
|
|
|
3
5
|
class FetchSuccessUseCase extends AbstractUseCase {
|
|
4
6
|
execute(input) {
|
|
@@ -16,6 +18,11 @@ class FetchSuccessUseCase extends AbstractUseCase {
|
|
|
16
18
|
} = metaData;
|
|
17
19
|
const fieldManager = repository.getFieldManager();
|
|
18
20
|
|
|
21
|
+
if (String(apiName) === 'getComponentMapping') {
|
|
22
|
+
fieldManager.setFields(fields, apiName);
|
|
23
|
+
presenter.updateFields(fieldManager.toObject());
|
|
24
|
+
}
|
|
25
|
+
|
|
19
26
|
if (!fieldManager.isFieldFetching(metaData)) {
|
|
20
27
|
return;
|
|
21
28
|
}
|
|
@@ -23,6 +30,32 @@ class FetchSuccessUseCase extends AbstractUseCase {
|
|
|
23
30
|
fieldManager.setFields(fields, apiName);
|
|
24
31
|
fieldManager.stopFetching(apiName);
|
|
25
32
|
presenter.updateFields(fieldManager.toObject());
|
|
33
|
+
dispatch({
|
|
34
|
+
type: DATA_SOURCE_EXECUTE,
|
|
35
|
+
payload: {
|
|
36
|
+
props: {},
|
|
37
|
+
actionName: 'getComponentMapping'
|
|
38
|
+
},
|
|
39
|
+
metaData: {
|
|
40
|
+
actionName: 'getComponentMapping',
|
|
41
|
+
[DATA_SOURCE_SUCCESS]: {
|
|
42
|
+
metaData: {
|
|
43
|
+
apiName: 'getComponentMapping'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
[DATA_SOURCE_NO_CONTENT]: {
|
|
47
|
+
metaData: {
|
|
48
|
+
apiName: 'getComponentMapping'
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
[DATA_SOURCE_FAILURE]: {
|
|
52
|
+
metaData: {
|
|
53
|
+
apiName: 'getComponentMapping',
|
|
54
|
+
actionName: 'getComponentMapping'
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
26
59
|
dispatch(fieldManager.createSuccessAction(fields, metaData));
|
|
27
60
|
}
|
|
28
61
|
|
|
@@ -5,10 +5,12 @@ import { DATA_SOURCE_FAILURE, DATA_SOURCE_NO_CONTENT, DATA_SOURCE_SUCCESS } from
|
|
|
5
5
|
|
|
6
6
|
class FieldManager {
|
|
7
7
|
constructor(fields, selectedFields, isFieldsFetching, isSelectedFieldsFetching) {
|
|
8
|
+
let componentMapping = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
8
9
|
this.fields = fields;
|
|
9
10
|
this.selectedFields = selectedFields;
|
|
10
11
|
this.isFieldsFetching = isFieldsFetching;
|
|
11
12
|
this.isSelectedFieldsFetching = isSelectedFieldsFetching;
|
|
13
|
+
this.componentMapping = componentMapping;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
createSuccessAction(fields, metaData) {
|
|
@@ -98,11 +100,14 @@ class FieldManager {
|
|
|
98
100
|
this.selectedFields = data;
|
|
99
101
|
} else if (apiName === FieldApiName.UPDATE_SELECTED_FIELDS) {
|
|
100
102
|
this.selectedFields = data;
|
|
103
|
+
} else if (apiName === 'getComponentMapping') {
|
|
104
|
+
this.componentMapping = data;
|
|
101
105
|
}
|
|
102
106
|
}
|
|
103
107
|
|
|
104
108
|
toObject() {
|
|
105
109
|
return {
|
|
110
|
+
componentMapping: this.componentMapping,
|
|
106
111
|
fields: this.fields,
|
|
107
112
|
selectedFields: this.selectedFields,
|
|
108
113
|
isFieldsFetching: this.isFieldsFetching,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
|
|
3
|
+
class GetInitialRecordSuccessController extends AbstractController {
|
|
4
|
+
handle(event) {
|
|
5
|
+
const {
|
|
6
|
+
getInitialRecordSuccessUseCase
|
|
7
|
+
} = this.service;
|
|
8
|
+
let {
|
|
9
|
+
state,
|
|
10
|
+
updateState,
|
|
11
|
+
action,
|
|
12
|
+
dispatch
|
|
13
|
+
} = event;
|
|
14
|
+
const {
|
|
15
|
+
disableValidationRule,
|
|
16
|
+
disableLayoutRule,
|
|
17
|
+
disableDependencyMapping
|
|
18
|
+
} = state.properties;
|
|
19
|
+
getInitialRecordSuccessUseCase.updateDependency(state, updateState);
|
|
20
|
+
getInitialRecordSuccessUseCase.execute({
|
|
21
|
+
dispatch,
|
|
22
|
+
record: action.payload.response,
|
|
23
|
+
disableValidationRule,
|
|
24
|
+
disableLayoutRule,
|
|
25
|
+
disableDependencyMapping
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default GetInitialRecordSuccessController;
|
|
@@ -25,8 +25,7 @@ class FormRepository {
|
|
|
25
25
|
validationRules = [],
|
|
26
26
|
sections = [],
|
|
27
27
|
layoutRules = [],
|
|
28
|
-
dependencyMappings = []
|
|
29
|
-
layoutId
|
|
28
|
+
dependencyMappings = []
|
|
30
29
|
} = zform;
|
|
31
30
|
let validationRuleEntities = validationRules.map(rule => {
|
|
32
31
|
return new ZValidationRule(rule);
|
|
@@ -60,7 +59,6 @@ class FormRepository {
|
|
|
60
59
|
dependencyMappings: dependencyMappingsEntities,
|
|
61
60
|
layoutRules: layoutRulesEntities,
|
|
62
61
|
context,
|
|
63
|
-
layoutId: layoutId,
|
|
64
62
|
isMyFormFetching: zform.isMyFormFetching,
|
|
65
63
|
isDependencyFetching: zform.isDependencyFetching,
|
|
66
64
|
isLayoutRulesFetching: zform.isLayoutRulesFetching,
|
|
@@ -5,21 +5,20 @@ const LookUpFieldTranslator = _ref => {
|
|
|
5
5
|
fieldPreModified,
|
|
6
6
|
uiConfig
|
|
7
7
|
} = _ref;
|
|
8
|
-
const fieldModified = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
name: field.
|
|
8
|
+
const fieldModified = {
|
|
9
|
+
type,
|
|
10
|
+
uiConfig,
|
|
11
|
+
value: field.value || '',
|
|
12
|
+
//state.behaviours.zform.values[field.apiName],
|
|
13
|
+
name: field.apiName,
|
|
14
|
+
...fieldPreModified,
|
|
14
15
|
id: field.id,
|
|
15
16
|
label: field.i18NLabel,
|
|
16
|
-
apiName: field.apiName,
|
|
17
|
-
errorMessage: field.errorMessage,
|
|
18
|
-
isVisible: field.isVisible,
|
|
19
|
-
readonly: field.isReadOnly,
|
|
20
17
|
required: field.isMandatory,
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
readonly: field.isReadOnly,
|
|
19
|
+
// visibility: field.isVisible,
|
|
20
|
+
isVisible: field.isVisible,
|
|
21
|
+
errorMessage: field.errorMessage || '',
|
|
23
22
|
lookup: field.lookup
|
|
24
23
|
};
|
|
25
24
|
return fieldModified;
|
package/es/platform/zform/applications/interfaces/input/GetInitialRecordSuccessUseCaseInputModel.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
import { ZFORM_API_FAILURE, ZFORM_DEPENDENCY_MAPPINGS_SUCCESS, ZFORM_LAYOUT_RULES_SUCCESS, ZFORM_MY_FORM_SUCCESS } from "../../../../bc/zform/Symbol";
|
|
3
|
+
import { DATA_SOURCE_EXECUTE as DATA_BROKER_EXECUTE } from "../../../../bc/zdata-source/Constants";
|
|
4
|
+
import { DATA_SOURCE_SUCCESS, DATA_SOURCE_NO_CONTENT, DATA_SOURCE_FAILURE } from "../../../../bc/zdata-source/Symbols";
|
|
5
|
+
|
|
6
|
+
class GetInitialRecordSuccessUseCase extends AbstractUseCase {
|
|
7
|
+
execute(input) {
|
|
8
|
+
const {
|
|
9
|
+
disableValidationRule,
|
|
10
|
+
disableLayoutRule,
|
|
11
|
+
disableDependencyMapping
|
|
12
|
+
} = input;
|
|
13
|
+
const {
|
|
14
|
+
dispatch,
|
|
15
|
+
record
|
|
16
|
+
} = input;
|
|
17
|
+
const zformEntity = this.dependencies.repository.getFormEntity();
|
|
18
|
+
zformEntity.setInitialRecord(record);
|
|
19
|
+
const context = { ...zformEntity.getContext(),
|
|
20
|
+
layoutId: zformEntity.getLayoutId()
|
|
21
|
+
};
|
|
22
|
+
dispatch({
|
|
23
|
+
type: DATA_BROKER_EXECUTE,
|
|
24
|
+
payload: {
|
|
25
|
+
actionName: "getMyForm",
|
|
26
|
+
props: context
|
|
27
|
+
},
|
|
28
|
+
metaData: {
|
|
29
|
+
actionName: "getMyForm",
|
|
30
|
+
//hack
|
|
31
|
+
initialRecordData: record,
|
|
32
|
+
// Store record data here for later use
|
|
33
|
+
[DATA_SOURCE_NO_CONTENT]: {
|
|
34
|
+
type: ZFORM_MY_FORM_SUCCESS,
|
|
35
|
+
metaData: {
|
|
36
|
+
actionName: "getMyForm",
|
|
37
|
+
initialRecordData: record
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
//hack
|
|
41
|
+
[DATA_SOURCE_FAILURE]: {
|
|
42
|
+
type: ZFORM_API_FAILURE,
|
|
43
|
+
metaData: {
|
|
44
|
+
actionName: 'getMyForm'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
[DATA_SOURCE_SUCCESS]: {
|
|
48
|
+
type: ZFORM_MY_FORM_SUCCESS,
|
|
49
|
+
metaData: {
|
|
50
|
+
actionName: "getMyForm",
|
|
51
|
+
initialRecordData: record
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (!disableDependencyMapping) {
|
|
58
|
+
dispatch({
|
|
59
|
+
type: DATA_BROKER_EXECUTE,
|
|
60
|
+
payload: {
|
|
61
|
+
actionName: "getDependencyMappings",
|
|
62
|
+
props: context
|
|
63
|
+
},
|
|
64
|
+
metaData: {
|
|
65
|
+
actionName: "getDependencyMappings",
|
|
66
|
+
//hack
|
|
67
|
+
[DATA_SOURCE_SUCCESS]: {
|
|
68
|
+
type: ZFORM_DEPENDENCY_MAPPINGS_SUCCESS,
|
|
69
|
+
metaData: {
|
|
70
|
+
actionName: "getDependencyMappings"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
[DATA_SOURCE_FAILURE]: {
|
|
74
|
+
type: ZFORM_API_FAILURE,
|
|
75
|
+
metaData: {
|
|
76
|
+
actionName: 'getDependencyMappings'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
[DATA_SOURCE_NO_CONTENT]: {
|
|
80
|
+
type: ZFORM_DEPENDENCY_MAPPINGS_SUCCESS,
|
|
81
|
+
metaData: {
|
|
82
|
+
actionName: "getDependencyMappings"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
} else {
|
|
88
|
+
zformEntity.setDependencyFetching(false);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (!disableLayoutRule) {
|
|
92
|
+
dispatch({
|
|
93
|
+
type: DATA_BROKER_EXECUTE,
|
|
94
|
+
payload: {
|
|
95
|
+
actionName: "getLayoutRules",
|
|
96
|
+
props: { ...context,
|
|
97
|
+
activeRulesOnly: true
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
metaData: {
|
|
101
|
+
actionName: "getLayoutRules",
|
|
102
|
+
//hack
|
|
103
|
+
[DATA_SOURCE_NO_CONTENT]: {
|
|
104
|
+
type: ZFORM_LAYOUT_RULES_SUCCESS,
|
|
105
|
+
metaData: {
|
|
106
|
+
actionName: "getLayoutRules"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
[DATA_SOURCE_FAILURE]: {
|
|
110
|
+
type: ZFORM_API_FAILURE,
|
|
111
|
+
metaData: {
|
|
112
|
+
actionName: 'getLayoutRules'
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
[DATA_SOURCE_SUCCESS]: {
|
|
116
|
+
type: ZFORM_LAYOUT_RULES_SUCCESS,
|
|
117
|
+
metaData: {
|
|
118
|
+
actionName: "getLayoutRules"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
} else {
|
|
124
|
+
zformEntity.setLayoutRulesFetching(false);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
this.dependencies.presenter.updateFormResponse(zformEntity.toObject());
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export default GetInitialRecordSuccessUseCase;
|
|
@@ -21,9 +21,8 @@ class MyFormSuccessUseCase extends AbstractUseCase {
|
|
|
21
21
|
sections
|
|
22
22
|
} = myForm;
|
|
23
23
|
const zFormEntity = repository.getFormEntity();
|
|
24
|
-
const layoutId = zFormEntity.getLayoutId();
|
|
25
24
|
const context = { ...zFormEntity.getContext(),
|
|
26
|
-
layoutId:
|
|
25
|
+
layoutId: zFormEntity.getLayoutId()
|
|
27
26
|
};
|
|
28
27
|
const lookupFields = sections.flatMap(section => section.fields.filter(field => field.type === 'LookUp'));
|
|
29
28
|
const sectionEntities = sections.map(section => {
|
|
@@ -64,22 +63,24 @@ class MyFormSuccessUseCase extends AbstractUseCase {
|
|
|
64
63
|
type: DATA_SOURCE_EXECUTE,
|
|
65
64
|
payload: {
|
|
66
65
|
actionName: 'fetchLookupFields',
|
|
67
|
-
props: context
|
|
66
|
+
props: { ...context
|
|
67
|
+
}
|
|
68
68
|
},
|
|
69
69
|
metaData: {
|
|
70
70
|
actionName: 'fetchLookupFields',
|
|
71
|
+
//hack
|
|
71
72
|
[DATA_SOURCE_NO_CONTENT]: {
|
|
72
73
|
type: ZFORM_LOOKUP_FIELD_SUCCESS,
|
|
73
74
|
metaData: {
|
|
74
75
|
actionName: 'fetchLookupFields'
|
|
75
76
|
}
|
|
76
77
|
},
|
|
77
|
-
[DATA_SOURCE_FAILURE]: {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
},
|
|
78
|
+
// [DATA_SOURCE_FAILURE]: {
|
|
79
|
+
// type: ZFORM_LOOKUP_FIELD_SUCCESS,
|
|
80
|
+
// metaData: {
|
|
81
|
+
// actionName: 'fetchValidationRules'
|
|
82
|
+
// }
|
|
83
|
+
// },
|
|
83
84
|
[DATA_SOURCE_SUCCESS]: {
|
|
84
85
|
type: ZFORM_LOOKUP_FIELD_SUCCESS,
|
|
85
86
|
metaData: {
|
|
@@ -21,7 +21,6 @@ export default class ZForm {
|
|
|
21
21
|
dependencyMappings,
|
|
22
22
|
context,
|
|
23
23
|
focusedFieldName,
|
|
24
|
-
layoutId,
|
|
25
24
|
|
|
26
25
|
/*hack*/
|
|
27
26
|
isMyFormFetching,
|
|
@@ -46,7 +45,6 @@ export default class ZForm {
|
|
|
46
45
|
this.dependencyMappings = dependencyMappings;
|
|
47
46
|
this.context = context;
|
|
48
47
|
this.focusedFieldName = focusedFieldName || null;
|
|
49
|
-
this.layoutId = layoutId;
|
|
50
48
|
/*hack*/
|
|
51
49
|
|
|
52
50
|
this.isMyFormFetching = isMyFormFetching;
|
|
@@ -35,7 +35,8 @@ export default class TableTranslator {
|
|
|
35
35
|
localStorage: localStorageBehaviour,
|
|
36
36
|
columnResizer,
|
|
37
37
|
keyboardControls,
|
|
38
|
-
textOverflow
|
|
38
|
+
textOverflow,
|
|
39
|
+
floatPagination
|
|
39
40
|
} = behaviours;
|
|
40
41
|
const {
|
|
41
42
|
resizeConfig,
|
|
@@ -43,7 +44,8 @@ export default class TableTranslator {
|
|
|
43
44
|
keyboardControlsConfig,
|
|
44
45
|
nameFieldsConfig,
|
|
45
46
|
textOverflowConfig,
|
|
46
|
-
recordReadStatusConfig
|
|
47
|
+
recordReadStatusConfig,
|
|
48
|
+
floatPaginationConfig
|
|
47
49
|
} = properties;
|
|
48
50
|
const {
|
|
49
51
|
modules
|
|
@@ -82,7 +84,6 @@ export default class TableTranslator {
|
|
|
82
84
|
isFetching: isClientScriptsFetching
|
|
83
85
|
} = fallbackToDefault(zclientScriptsEventMapping, {});
|
|
84
86
|
const fieldComponentMapping = fallbackToDefault(componentMapping.fields, {});
|
|
85
|
-
const rowActionsUiType = componentMapping.rowActionsComponentName;
|
|
86
87
|
const {
|
|
87
88
|
shouldClearRecords: isRecordsShouldBeEmptied,
|
|
88
89
|
canErrorPage: isError
|
|
@@ -123,9 +124,37 @@ export default class TableTranslator {
|
|
|
123
124
|
const textOverflowData = {
|
|
124
125
|
isEnabled: textOverflowConfig.isEnabled,
|
|
125
126
|
mode: textOverflow.mode
|
|
126
|
-
};
|
|
127
|
+
}; // ComponentMapping support
|
|
128
|
+
|
|
129
|
+
const componentMappingFromApi = Array.isArray(zfield.componentMapping) ? zfield.componentMapping : [];
|
|
130
|
+
let emptyStateUiType = componentMapping.emptyState || '';
|
|
131
|
+
let rowActionsUiType = componentMapping.rowActionsComponentName;
|
|
132
|
+
componentMappingFromApi.forEach(fieldVariation => {
|
|
133
|
+
const {
|
|
134
|
+
fieldName,
|
|
135
|
+
uiType,
|
|
136
|
+
translator,
|
|
137
|
+
contractType
|
|
138
|
+
} = fieldVariation;
|
|
139
|
+
|
|
140
|
+
if (contractType === 'EmptyState') {
|
|
141
|
+
emptyStateUiType = uiType;
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (contractType === 'RowActionsMenu') {
|
|
146
|
+
rowActionsUiType = uiType;
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const field = fields.find(f => f.name === fieldName);
|
|
151
|
+
|
|
152
|
+
if (field) {
|
|
153
|
+
field.uiType = uiType;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
127
156
|
const headersTranslator = new HeadersTranslator(fields, headerActions, context, modifiedWidths, sortConfig, records, instanceName, moduleName);
|
|
128
|
-
const rowsTranslator = new RowsTranslator(recordsForDisplay, fields, rowActions, context, preferences, fieldComponentMapping, rowActionsUiType, fieldActions, instanceName, textOverflowData, moduleName, nameFieldsConfig, recordReadStatusConfig); // const actionTranslator = new ClientActionsTranslator(clientActions, records, fields, pageContext);
|
|
157
|
+
const rowsTranslator = new RowsTranslator(recordsForDisplay, fields, rowActions, context, preferences, fieldComponentMapping, rowActionsUiType, fieldActions, instanceName, textOverflowData, moduleName, nameFieldsConfig, recordReadStatusConfig, Array.isArray(zfield.componentMapping) ? [...zfield.componentMapping] : []); // const actionTranslator = new ClientActionsTranslator(clientActions, records, fields, pageContext);
|
|
129
158
|
// const translators = [headersTranslator.getTranslator(), rowsTranslator.getTranslator(), actionTranslator.getTranslator()];
|
|
130
159
|
|
|
131
160
|
const translators = [headersTranslator.getTranslator(), rowsTranslator.getTranslator()];
|
|
@@ -158,9 +187,18 @@ export default class TableTranslator {
|
|
|
158
187
|
},
|
|
159
188
|
keyboardControlsConfig,
|
|
160
189
|
textOverflowConfig: textOverflowData,
|
|
190
|
+
floatPaginationConfig: { ...floatPaginationConfig,
|
|
191
|
+
scrollCount: floatPagination.currentRecord,
|
|
192
|
+
totalCount: records?.length !== undefined ? records.length : 0,
|
|
193
|
+
scrollToUpTooltip: floatPagination.scrollToUpTooltip,
|
|
194
|
+
scrollToDownTooltip: floatPagination.scrollToDownTooltip,
|
|
195
|
+
isTopReached: false,
|
|
196
|
+
isBottomReached: floatPagination.currentRecord === records?.length,
|
|
197
|
+
isVisible: floatPagination.isVisible
|
|
198
|
+
},
|
|
161
199
|
isLoading,
|
|
162
200
|
isReOrderLoading,
|
|
163
|
-
emptyStateUiType
|
|
201
|
+
emptyStateUiType,
|
|
164
202
|
data: fields.length ? data : {
|
|
165
203
|
headers: EMPTY_ARRAY,
|
|
166
204
|
rows: EMPTY_ARRAY
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import EmptyViewModel from "./EmptyViewModel";
|
|
2
2
|
import * as FieldTranslators from "./fields";
|
|
3
3
|
import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
|
|
4
|
+
import { isValidFieldVariation } from "./FieldVariations";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
function getLookupUrlConstructions(_ref) {
|
|
6
|
+
function ColumnTranslator(_ref) {
|
|
7
7
|
let {
|
|
8
8
|
field,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
record,
|
|
10
|
+
fieldComponentMapping,
|
|
11
|
+
fieldActions,
|
|
12
|
+
context,
|
|
13
|
+
preferences,
|
|
14
|
+
instanceName,
|
|
15
|
+
moduleName,
|
|
16
|
+
textOverflowConfig,
|
|
17
|
+
nameFieldsConfig,
|
|
18
|
+
recordReadStatusConfig,
|
|
19
|
+
componentMapping
|
|
11
20
|
} = _ref;
|
|
12
|
-
let {
|
|
13
|
-
orgName,
|
|
14
|
-
departmentName
|
|
15
|
-
} = context;
|
|
16
|
-
let lookupModuleName = field?.lookup?.module?.apiName;
|
|
17
|
-
return `/agent/${orgName}/${departmentName}/${lookupModuleName}/details/${value.id}`;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, context, preferences, instanceName, textOverflowConfig, moduleName, nameFieldsConfig, recordReadStatusConfig) {
|
|
21
21
|
const {
|
|
22
22
|
isCustomField,
|
|
23
23
|
name,
|
|
@@ -32,7 +32,6 @@ function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, co
|
|
|
32
32
|
__DEVELOPMENT__ && console.warn(`The string format for componentMapping will soon be deprecated. Please update to the new JSON format. REF : ${JSON.stringify(fieldEntry)}`);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
let tempValue = undefined;
|
|
36
35
|
let value = isCustomField ? record.cf?.[name] : record[name];
|
|
37
36
|
const actions = ClientActionsTranslator.transform(fieldActions, instanceName, moduleName, {
|
|
38
37
|
field,
|
|
@@ -43,8 +42,12 @@ function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, co
|
|
|
43
42
|
return EmptyViewModel(name);
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
if (
|
|
47
|
-
field.uiType
|
|
45
|
+
if (field.uiType && !isValidFieldVariation(type, field.uiType)) {
|
|
46
|
+
__DEVELOPMENT__ && console.warn(`The uiType ${field.uiType} is not a valid variation for field type ${type}. Ignoring the uiType.`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (typeof fieldEntry === 'string') {
|
|
50
|
+
field.uiType = fieldEntry;
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
let nameFieldTypes = ['Text'];
|
|
@@ -58,22 +61,9 @@ function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, co
|
|
|
58
61
|
return EmptyViewModel(name);
|
|
59
62
|
}
|
|
60
63
|
|
|
61
|
-
if (field.type == "LookUp") {
|
|
62
|
-
// temp fix for when lookup field don't have value !object
|
|
63
|
-
tempValue = typeof value !== 'object' ? {
|
|
64
|
-
name: value,
|
|
65
|
-
id: value
|
|
66
|
-
} : value;
|
|
67
|
-
tempValue.url = getLookupUrlConstructions({
|
|
68
|
-
field,
|
|
69
|
-
value,
|
|
70
|
-
context
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
64
|
const translatorArgs = {
|
|
75
65
|
field,
|
|
76
|
-
value
|
|
66
|
+
value,
|
|
77
67
|
appendToActionPayload: {
|
|
78
68
|
recordId: record.id
|
|
79
69
|
},
|
|
@@ -96,31 +86,49 @@ function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, co
|
|
|
96
86
|
...fieldTranslator(translatorArgs)
|
|
97
87
|
};
|
|
98
88
|
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (fieldEntry.fieldToUIComponentTranslator) {
|
|
103
|
-
viewModel.value = fieldEntry.fieldToUIComponentTranslator({
|
|
104
|
-
field,
|
|
105
|
-
record,
|
|
106
|
-
context
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (fieldEntry.translator) {
|
|
111
|
-
const newViewModel = fieldEntry.translator({
|
|
89
|
+
if (componentMapping && componentMapping.translator) {
|
|
90
|
+
return { ...viewModel,
|
|
91
|
+
...componentMapping.translator({
|
|
112
92
|
viewModel,
|
|
113
93
|
field,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
94
|
+
record,
|
|
95
|
+
context,
|
|
96
|
+
preferences
|
|
97
|
+
})
|
|
98
|
+
};
|
|
99
|
+
} else {
|
|
100
|
+
//will be deprecated soon
|
|
101
|
+
if (fieldEntry && typeof fieldEntry === 'object') {
|
|
102
|
+
viewModel.type = fieldEntry.UIComponentName;
|
|
103
|
+
|
|
104
|
+
if (fieldEntry.fieldToUIComponentTranslator) {
|
|
105
|
+
viewModel.value = fieldEntry.fieldToUIComponentTranslator({
|
|
106
|
+
field,
|
|
107
|
+
record,
|
|
108
|
+
context
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (fieldEntry.translator) {
|
|
113
|
+
const newViewModel = fieldEntry.translator({
|
|
114
|
+
viewModel: viewModel,
|
|
115
|
+
field,
|
|
116
|
+
record,
|
|
117
|
+
context,
|
|
118
|
+
preferences
|
|
119
|
+
});
|
|
120
|
+
return { ...newViewModel,
|
|
121
|
+
type: fieldEntry.UIComponentName ? fieldEntry.UIComponentName : field.uiType,
|
|
122
|
+
appendToActionPayload: {
|
|
123
|
+
recordId: record.id,
|
|
124
|
+
...newViewModel.appendToActionPayload
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
118
128
|
}
|
|
119
129
|
|
|
120
130
|
return viewModel;
|
|
121
131
|
}
|
|
122
|
-
|
|
123
|
-
return viewModel;
|
|
124
132
|
}
|
|
125
133
|
|
|
126
134
|
export default ColumnTranslator;
|