@zohodesk/library-platform 1.1.8-exp.2 → 1.1.9-alpha.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/bc/zdata-source/Constants.js +6 -11
- package/es/bc/zrecord/Constants.js +10 -19
- package/es/cc/action-icon/Constants.js +3 -5
- package/es/cc/action-location/Constants.js +5 -9
- package/es/cc/avatar/Constants.js +3 -5
- package/es/cc/breadcrumb/Constants.js +3 -5
- package/es/cc/button/Constants.js +3 -5
- package/es/cc/checkbox/Constants.js +5 -9
- package/es/cc/date/Constants.js +5 -9
- package/es/cc/email/Constants.js +3 -5
- package/es/cc/fields/field/Constants.js +9 -13
- package/es/cc/form/Constants.js +6 -11
- package/es/cc/form-connected/Constants.js +10 -19
- package/es/cc/highlighted-value/Constants.js +3 -5
- package/es/cc/icon-button/Constants.js +3 -5
- package/es/cc/link/Constants.js +3 -5
- package/es/cc/list-item/Constants.js +3 -5
- package/es/cc/more-dropdown/Constants.js +3 -5
- package/es/cc/multi-select/Constants.js +5 -9
- package/es/cc/section/Constants.js +5 -9
- package/es/cc/select/Constants.js +6 -11
- package/es/cc/switch/Constants.js +3 -5
- package/es/cc/table-column-filter/Constants.js +5 -9
- package/es/cc/table-list/Constants.js +14 -27
- package/es/cc/table-list/model/index.js +5 -9
- package/es/cc/table-list/row/Constants.js +5 -9
- package/es/cc/tags/Constants.js +3 -5
- package/es/cc/tags/model/index.js +4 -7
- package/es/cc/text/Constants.js +3 -5
- package/es/cc/textarea/Constants.js +5 -9
- package/es/cc/textbox/Constants.js +6 -11
- package/es/library/behaviours/field-focus/frameworks/ui/EventHandlersFactory.js +1 -3
- package/es/library/behaviours/keyboard-controls/adapters/gateways/KeyboardHandler.js +0 -4
- package/es/library/behaviours/keyboard-controls/adapters/gateways/Repository.js +2 -10
- package/es/library/behaviours/keyboard-controls/adapters/gateways/Service.js +0 -14
- package/es/library/behaviours/keyboard-controls/adapters/presenters/Presenter.js +2 -11
- package/es/library/behaviours/list-selection/adapters/gateways/Repository.js +2 -8
- package/es/library/behaviours/list-selection/adapters/gateways/Service.js +0 -16
- package/es/library/behaviours/list-selection/adapters/presenters/Presenter.js +0 -8
- package/es/library/behaviours/local-storage/adapters/gateways/LocalStorageRepository.js +0 -6
- package/es/library/behaviours/local-storage/adapters/gateways/Service.js +0 -4
- package/es/library/behaviours/local-storage/adapters/presenters/Presenter.js +0 -8
- package/es/library/behaviours/local-storage/domain/entities/Storage.js +0 -4
- package/es/library/behaviours/sort-by/adapters/gateway/Repository.js +0 -6
- package/es/library/behaviours/sort-by/adapters/gateway/Service.js +0 -4
- package/es/library/behaviours/sort-by/adapters/presenter/Presenter.js +0 -8
- package/es/library/behaviours/table-column-resizer/adapters/gateways/Repository.js +0 -6
- package/es/library/behaviours/table-column-resizer/adapters/gateways/Service.js +0 -10
- package/es/library/behaviours/table-column-resizer/adapters/gateways/TableElementService.js +0 -8
- package/es/library/behaviours/table-column-resizer/adapters/presenters/AutoScroll.js +0 -12
- package/es/library/behaviours/table-column-resizer/adapters/presenters/Presenter.js +0 -8
- package/es/library/behaviours/table-column-resizer/domain/entities/ColumnResizer.js +0 -12
- package/es/library/behaviours/table-column-resizer/domain/entities/Mouse.js +0 -6
- package/es/library/behaviours/table-column-resizer/domain/entities/ResizeColumnCalculator.js +0 -12
- package/es/library/behaviours/table-column-resizer/domain/entities/ResizerAutoScrollCalculator.js +0 -6
- package/es/library/behaviours/table-column-resizer/domain/entities/ResizingColumn.js +0 -13
- package/es/library/behaviours/table-column-resizer/domain/entities/Table.js +0 -11
- package/es/library/behaviours/text-to-field-click/adapters/gateway/Repository.js +0 -6
- package/es/library/custom-component/adapters/gateways/event-manager/EventManager.js +2 -7
- package/es/library/custom-component/adapters/gateways/repository/Repository.js +1 -5
- package/es/library/custom-component/adapters/gateways/service/Service.js +0 -14
- package/es/library/custom-component/adapters/presenters/Presenter.js +0 -5
- package/es/library/custom-component/domain/entities/Behaviour.js +0 -11
- package/es/library/custom-component/domain/entities/Component.js +0 -24
- package/es/library/custom-component/domain/entities/Event.js +0 -7
- package/es/library/custom-component/domain/entities/EventHandler.js +0 -6
- package/es/library/custom-component/domain/entities/LifeCycleAction.js +0 -10
- package/es/library/custom-component/domain/entities/Payload.js +0 -6
- package/es/library/custom-component/domain/entities/Properties.js +0 -5
- package/es/library/custom-component/domain/entities/Property.js +0 -13
- package/es/library/custom-component/domain/entities/Schema.js +1 -5
- package/es/library/custom-component/domain/entities/State.js +0 -4
- package/es/library/custom-component/domain/entities/Style.js +0 -14
- package/es/library/custom-component/frameworks/ui/ComponentRegistry.js +3 -7
- package/es/library/custom-component/frameworks/ui/CreateCustomComponent.js +9 -26
- package/es/library/custom-component/frameworks/ui/CreateSlotComponent.js +4 -2
- package/es/library/custom-component/frameworks/ui/CustomComponentFactory.js +1 -1
- package/es/library/dot/components/action-location/adapters/gateway/Repository.js +0 -8
- package/es/library/dot/components/action-location/adapters/presenters/Presenter.js +0 -8
- package/es/library/dot/components/action-location/entities/ActionLocationEntity.js +2 -6
- package/es/library/dot/components/actions-renderer/frameworks/ui/ActionsRendererView.js +6 -4
- package/es/library/dot/components/form/frameworks/ui/__test__/Form.test.js +14 -20
- package/es/library/dot/components/form/frameworks/ui/sub-components/SectionsWithRightPanelLayout.js +1 -2
- package/es/library/dot/components/form-fields/field/__test__/common.js +18 -16
- package/es/library/dot/components/section/frameworks/ui/RenderField.js +5 -4
- package/es/library/dot/components/table-list/adapters/controllers/KeyboardRowClickController.js +1 -1
- package/es/library/dot/components/table-list/adapters/controllers/KeyboardRowSelectController.js +1 -1
- package/es/library/dot/components/table-list/adapters/presenters/TableTranslator.js +1 -1
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +6 -6
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/field/FieldComponent.js +1 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +1 -1
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +1 -1
- package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/DateView.js +1 -1
- package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/MultiSelectView.js +2 -2
- package/es/library/dot/legacy-to-new-arch/select/frameworks/ui/SelectView.js +1 -1
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js +5 -3
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +2 -2
- package/es/library/dot/legacy-to-new-arch/textbox/frameworks/ui/TextBoxView.js +1 -1
- package/es/library/slot/frameworks/ui/ConvertSlotToComponent.js +5 -4
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/controllers/MountController.js +15 -18
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/gateways/Repository.js +0 -6
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/gateways/Service.js +0 -16
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/presenters/Presenter.js +0 -8
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/resources/ClientActionResource.js +2 -4
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionLocationUseCase.js +1 -1
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionUIComponentPropertiesUseCase.js +1 -1
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionsUseCase.js +1 -1
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/UpdateClientActionUIComponentPropertiesUseCase.js +1 -1
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientAction.js +0 -26
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientActions.js +0 -9
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/EventMapping.js +0 -12
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/EventMappings.js +0 -4
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/UIComponentMapping.js +0 -14
- package/es/platform/client-actions/components/action-event-mediator/adapters/gateway/Repository.js +0 -8
- package/es/platform/client-actions/components/action-event-mediator/adapters/presenters/Presenter.js +0 -8
- package/es/platform/client-actions/components/action-event-mediator/domain/entities/ActionEventMediatorEntity.js +2 -10
- package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponentView.js +6 -4
- package/es/platform/column-chooser/adapters/gateways/Repository.js +0 -6
- package/es/platform/column-chooser/adapters/gateways/Service.js +0 -14
- package/es/platform/column-chooser/adapters/presenters/Presenter.js +0 -8
- package/es/platform/column-chooser/domain/entities/SelectEntityImp.js +0 -5
- package/es/platform/components/app/adapters/resources/AppResource.js +2 -0
- package/es/platform/components/form-connected/adapters/resources/SmartFormResources.js +2 -4
- package/es/platform/components/form-connected/frameworks/FormConnectedFactory.js +1 -1
- package/es/platform/components/table-connected/adapters/controllers/ResizeFinishController.js +3 -5
- package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +2 -4
- package/es/platform/components/table-connected/frameworks/TableConnectedFactory.js +1 -1
- package/es/platform/sdk/adapters/gateways/Repository.js +5 -9
- package/es/platform/sdk/adapters/gateways/Service.js +0 -14
- package/es/platform/sdk/adapters/presenters/Presenter.js +0 -6
- package/es/platform/sdk/application/interfaces/gateways/AbstractResource.js +0 -6
- package/es/platform/sdk/domain/entities/ResourceManager.js +3 -9
- package/es/platform/sdk/frameworks/Sdk.js +11 -1
- package/es/platform/sdk/frameworks/SdkRegistry.js +2 -8
- package/es/platform/sdk-behaviour/adapters/controllers/AbstractController.js +0 -4
- package/es/platform/sdk-behaviour/adapters/gateways/Repository.js +0 -8
- package/es/platform/sdk-behaviour/adapters/gateways/ResourceManagerGateWay.js +0 -6
- package/es/platform/sdk-behaviour/adapters/gateways/Service.js +0 -8
- package/es/platform/zdata-source/adapters/controllers/FailureController.js +26 -29
- package/es/platform/zdata-source/adapters/controllers/NoContentController.js +21 -24
- package/es/platform/zdata-source/adapters/controllers/RegisterController.js +17 -20
- package/es/platform/zdata-source/adapters/controllers/SuccessController.js +26 -29
- package/es/platform/zdata-source/adapters/gateways/Repository.js +0 -6
- package/es/platform/zdata-source/adapters/gateways/Service.js +0 -12
- package/es/platform/zdata-source/adapters/presenters/Presenter.js +1 -9
- package/es/platform/zdata-source/domain/entities/APITemplate.js +0 -16
- package/es/platform/zfield/adapters/gateways/Repository.js +0 -6
- package/es/platform/zfield/adapters/gateways/Service.js +0 -14
- package/es/platform/zfield/adapters/presenters/Presenter.js +0 -8
- package/es/platform/zfield/applications/entities-factory/FieldBuilder.js +0 -30
- package/es/platform/zfield/applications/entities-factory/FieldsManagerBuilder.js +0 -12
- package/es/platform/zform/adapters/gateway/FormRepository.js +0 -6
- package/es/platform/zform/adapters/gateway/Service.js +0 -38
- package/es/platform/zform/adapters/presenter/FormPresenter.js +0 -8
- package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +43 -34
- package/es/platform/zform/adapters/presenter/utils/DefaultClientActions.js +22 -15
- package/es/platform/zform/applications/usecases/GetFieldValueUseCase.js +1 -1
- package/es/platform/zform/applications/usecases/LookupFieldSuccessUseCase.js +1 -8
- package/es/platform/zform/applications/usecases/MyLayoutSuccessUseCase.js +1 -1
- package/es/platform/zform/domain/ZDependencyMapping.js +0 -17
- package/es/platform/zform/domain/ZField.js +0 -53
- package/es/platform/zform/domain/ZForm.js +1 -42
- package/es/platform/zform/domain/ZLayout.js +0 -14
- package/es/platform/zform/domain/ZLayoutRule.js +0 -31
- package/es/platform/zform/domain/ZSection.js +0 -19
- package/es/platform/zform/domain/ZValidationRule.js +0 -28
- package/es/platform/zform/frameworks/validation-rules/Validator.js +4 -8
- package/es/platform/zlist/adapters/gateways/Repository.js +0 -6
- package/es/platform/zlist/adapters/gateways/Service.js +0 -33
- package/es/platform/zlist/adapters/presenters/Presenters.js +0 -8
- package/es/platform/zlist/adapters/presenters/SelectionTranslator.js +1 -3
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +4 -6
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +2 -6
- package/es/platform/zlist/adapters/presenters/translators/actions/ActionsTranslator.js +4 -15
- package/es/platform/zlist/adapters/presenters/utils/calculateFieldWidths.js +1 -3
- package/es/platform/zlist/applications/usecases/DeleteMultipleRecordUseCase.js +1 -3
- package/es/platform/zlist/applications/usecases/DeleteSingleRecordUseCase.js +1 -3
- package/es/platform/zlist/applications/usecases/GetContextUseCase.js +1 -1
- package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +1 -3
- package/es/platform/zlist/applications/usecases/RecordUpdateUseCase.js +1 -3
- package/es/platform/zlist/applications/usecases/UpdateMultipleRecordUseCase.js +1 -3
- package/es/platform/zlist/domain/entities/List.js +1 -1
- package/es/platform/zrecord/adapters/controllers/AppendRecordsController.js +20 -23
- package/es/platform/zrecord/adapters/controllers/DeleteMultipleRecordLocalController.js +20 -23
- package/es/platform/zrecord/adapters/controllers/FailureController.js +26 -29
- package/es/platform/zrecord/adapters/controllers/FetchStateStopController.js +17 -20
- package/es/platform/zrecord/adapters/controllers/MountController.js +15 -18
- package/es/platform/zrecord/adapters/controllers/NoContentController.js +21 -24
- package/es/platform/zrecord/adapters/controllers/RefetchController.js +26 -29
- package/es/platform/zrecord/adapters/controllers/SetRecordsController.js +24 -27
- package/es/platform/zrecord/adapters/controllers/SuccessController.js +26 -29
- package/es/platform/zrecord/adapters/gateways/Repository.js +0 -6
- package/es/platform/zrecord/adapters/gateways/Service.js +0 -30
- package/es/platform/zrecord/adapters/presenters/Presenter.js +0 -8
- package/es/platform/zrecord/applications/usecases/GetMultipleRecordUseCase.js +1 -1
- package/es/platform/zrecord/applications/usecases/GetSingleRecordUseCase.js +1 -1
- package/es/platform/zrecord/domain/entities/CustomFieldValues.js +0 -4
- package/es/platform/zrecord/domain/entities/Record.js +0 -22
- package/es/platform/zrecord/domain/entities/Records.js +0 -11
- package/package.json +10 -14
|
@@ -18,8 +18,6 @@ const fallbackToDefault = (value, defaultValue) => [undefined, null].includes(va
|
|
|
18
18
|
|
|
19
19
|
export default class TableTranslator {
|
|
20
20
|
static transformState(state) {
|
|
21
|
-
var _preferences$rowActio, _localStorageBehaviou, _localStorageBehaviou2;
|
|
22
|
-
|
|
23
21
|
const {
|
|
24
22
|
behaviours,
|
|
25
23
|
properties
|
|
@@ -82,7 +80,7 @@ export default class TableTranslator {
|
|
|
82
80
|
} = fallbackToDefault(zfield, {}); // FIX: zfield should be available by default
|
|
83
81
|
|
|
84
82
|
const isLoading = !!(isRecordsFetching || isAvailableFieldsFetching || isSelectedFieldsFetching);
|
|
85
|
-
const fields = selectedFields
|
|
83
|
+
const fields = selectedFields?.map(selectedField => availableFields?.find(availableField => availableField.name === selectedField)).filter(f => f != undefined);
|
|
86
84
|
const newClientActions = DefaultClientActions.createSortActions(fields, clientActions || EMPTY_ARRAY);
|
|
87
85
|
const {
|
|
88
86
|
headerActions,
|
|
@@ -92,13 +90,13 @@ export default class TableTranslator {
|
|
|
92
90
|
} = mapClientActions(newClientActions || EMPTY_ARRAY);
|
|
93
91
|
const isRowClickable = noLocation.some(action => action.uiComponentMapping.eventMappings.some(mapping => mapping.sourceEvent === TableListConstants.TABLE_LIST_ROW_CLICKED));
|
|
94
92
|
const rowCursor = isRowClickable ? RowCursor.Pointer : RowCursor.Default;
|
|
95
|
-
const rowActionsWidth = preferences
|
|
93
|
+
const rowActionsWidth = preferences?.rowActions?.width;
|
|
96
94
|
const {
|
|
97
95
|
moduleName,
|
|
98
96
|
viewId
|
|
99
97
|
} = properties; // TODO: move this to a separate file as selector
|
|
100
98
|
|
|
101
|
-
const localStorageFieldWidths = fallbackToDefault(localStorageBehaviour
|
|
99
|
+
const localStorageFieldWidths = fallbackToDefault(localStorageBehaviour?.[moduleName]?.[viewId]?.modifiedWidths, EMPTY_OBJECT);
|
|
102
100
|
const modifiedWidths = calculateFieldWidths(fields, localStorageFieldWidths, preferences);
|
|
103
101
|
const recordsForDisplay = isRecordsShouldBeEmptied ? EMPTY_ARRAY : records;
|
|
104
102
|
const headersTranslator = new HeadersTranslator(fields, headerActions, context, modifiedWidths, sortBy, records);
|
|
@@ -125,7 +123,7 @@ export default class TableTranslator {
|
|
|
125
123
|
modifiedWidths
|
|
126
124
|
}),
|
|
127
125
|
rowActionsConfig: {
|
|
128
|
-
hasActions: Boolean(rowActions
|
|
126
|
+
hasActions: Boolean(rowActions?.length),
|
|
129
127
|
// Boolean(newRowActions?.length),
|
|
130
128
|
columnWidth: typeof rowActionsWidth === 'number' ? rowActionsWidth : ColumnWidth.XSmall
|
|
131
129
|
},
|
|
@@ -4,8 +4,6 @@ import ClientActionsTranslator from "../../../../client-actions/translators/clie
|
|
|
4
4
|
|
|
5
5
|
//hacking temp url construction for lookup
|
|
6
6
|
function getLookupUrlConstructions(_ref) {
|
|
7
|
-
var _field$lookup, _field$lookup$module;
|
|
8
|
-
|
|
9
7
|
let {
|
|
10
8
|
field,
|
|
11
9
|
value,
|
|
@@ -15,13 +13,11 @@ function getLookupUrlConstructions(_ref) {
|
|
|
15
13
|
orgName,
|
|
16
14
|
departmentName
|
|
17
15
|
} = context;
|
|
18
|
-
let lookupModuleName = field
|
|
16
|
+
let lookupModuleName = field?.lookup?.module?.apiName;
|
|
19
17
|
return `/agent/${orgName}/${departmentName}/${lookupModuleName}/details/${value.id}`;
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, context) {
|
|
23
|
-
var _record$cf;
|
|
24
|
-
|
|
25
21
|
const {
|
|
26
22
|
isCustomField,
|
|
27
23
|
name,
|
|
@@ -35,7 +31,7 @@ function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, co
|
|
|
35
31
|
}
|
|
36
32
|
|
|
37
33
|
let tempValue = undefined;
|
|
38
|
-
let value = isCustomField ?
|
|
34
|
+
let value = isCustomField ? record.cf?.[name] : record[name];
|
|
39
35
|
const actions = ClientActionsTranslator.transform(fieldActions, {
|
|
40
36
|
field,
|
|
41
37
|
record
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
import ClientActionsTranslator from "../../../../../client-actions/translators/client-actions-translator";
|
|
4
2
|
|
|
5
3
|
class ActionsTranslator {
|
|
@@ -11,20 +9,11 @@ class ActionsTranslator {
|
|
|
11
9
|
this.records = records;
|
|
12
10
|
this.fields = fields;
|
|
13
11
|
this.context = context;
|
|
14
|
-
|
|
15
|
-
_defineProperty(this, "headerActions", void 0);
|
|
16
|
-
|
|
17
|
-
_defineProperty(this, "fieldActions", void 0);
|
|
18
|
-
|
|
19
|
-
_defineProperty(this, "rowActions", void 0);
|
|
20
|
-
|
|
21
|
-
_defineProperty(this, "noLocation", void 0);
|
|
22
|
-
|
|
23
12
|
this.pipe = this.pipe.bind(this);
|
|
24
|
-
this.headerActions = actions.filter(action =>
|
|
25
|
-
this.fieldActions = actions.filter(action =>
|
|
26
|
-
this.rowActions = actions.filter(action =>
|
|
27
|
-
this.noLocation = actions.filter(action => !
|
|
13
|
+
this.headerActions = actions.filter(action => action?.location === 'header_actions');
|
|
14
|
+
this.fieldActions = actions.filter(action => action?.location === 'field_actions');
|
|
15
|
+
this.rowActions = actions.filter(action => action?.location === 'row_actions');
|
|
16
|
+
this.noLocation = actions.filter(action => !action?.location);
|
|
28
17
|
}
|
|
29
18
|
|
|
30
19
|
getTranslator() {
|
|
@@ -7,13 +7,11 @@ export function calculateFieldWidths(fields, modifiedFieldWidths, preferences) {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
function decideWidth(width, fieldName, type) {
|
|
10
|
-
var _preferences$fields, _preferences$fields$f;
|
|
11
|
-
|
|
12
10
|
if (width !== undefined && width !== null) {
|
|
13
11
|
return width;
|
|
14
12
|
}
|
|
15
13
|
|
|
16
|
-
const initialWidth =
|
|
14
|
+
const initialWidth = preferences.fields?.[fieldName]?.initialWidth;
|
|
17
15
|
|
|
18
16
|
if (initialWidth !== undefined && initialWidth !== null) {
|
|
19
17
|
return initialWidth;
|
|
@@ -3,8 +3,6 @@ import AbstractUseCase from "./AbstractUseCase";
|
|
|
3
3
|
|
|
4
4
|
class DeleteMultipleRecordUseCase extends AbstractUseCase {
|
|
5
5
|
execute(input) {
|
|
6
|
-
var _input$callback;
|
|
7
|
-
|
|
8
6
|
const {
|
|
9
7
|
dispatch,
|
|
10
8
|
recordIds
|
|
@@ -26,7 +24,7 @@ class DeleteMultipleRecordUseCase extends AbstractUseCase {
|
|
|
26
24
|
});
|
|
27
25
|
}
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
input.callback?.({
|
|
30
28
|
data: recordIds.map(id => ({
|
|
31
29
|
id,
|
|
32
30
|
Success: true,
|
|
@@ -2,8 +2,6 @@ import AbstractUseCase from "./AbstractUseCase";
|
|
|
2
2
|
|
|
3
3
|
class DeleteSingleRecordUseCase extends AbstractUseCase {
|
|
4
4
|
execute(input) {
|
|
5
|
-
var _input$callback;
|
|
6
|
-
|
|
7
5
|
const {
|
|
8
6
|
dispatch,
|
|
9
7
|
recordId
|
|
@@ -14,7 +12,7 @@ class DeleteSingleRecordUseCase extends AbstractUseCase {
|
|
|
14
12
|
const list = repository.getList();
|
|
15
13
|
const action = list.getDeleteSingleRecordAction(recordId);
|
|
16
14
|
dispatch(action);
|
|
17
|
-
|
|
15
|
+
input.callback?.({
|
|
18
16
|
data: [{
|
|
19
17
|
id: recordId,
|
|
20
18
|
Success: true,
|
|
@@ -10,7 +10,7 @@ class GetContextUseCase extends AbstractUseCase {
|
|
|
10
10
|
repository
|
|
11
11
|
} = this.dependencies;
|
|
12
12
|
const list = repository.getList();
|
|
13
|
-
callback
|
|
13
|
+
callback?.(list.getContext(variableName));
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
}
|
|
@@ -3,8 +3,6 @@ import AbstractUseCase from "./AbstractUseCase";
|
|
|
3
3
|
|
|
4
4
|
class RecordSuccessCallbackUsecase extends AbstractUseCase {
|
|
5
5
|
execute(_ref) {
|
|
6
|
-
var _metaData$sourceMetaD;
|
|
7
|
-
|
|
8
6
|
let {
|
|
9
7
|
dispatch,
|
|
10
8
|
payload,
|
|
@@ -16,7 +14,7 @@ class RecordSuccessCallbackUsecase extends AbstractUseCase {
|
|
|
16
14
|
} = this.dependencies;
|
|
17
15
|
const list = repository.getList();
|
|
18
16
|
|
|
19
|
-
if (
|
|
17
|
+
if (metaData.sourceMetaData?.isReOrder) {
|
|
20
18
|
list.reOrderEnded();
|
|
21
19
|
presenter.updateView(list.toObject()); // convert to separate use-case
|
|
22
20
|
|
|
@@ -2,8 +2,6 @@ import AbstractUseCase from "./AbstractUseCase";
|
|
|
2
2
|
|
|
3
3
|
class RecordUpdateUseCase extends AbstractUseCase {
|
|
4
4
|
execute(input) {
|
|
5
|
-
var _input$callback;
|
|
6
|
-
|
|
7
5
|
const {
|
|
8
6
|
dispatch,
|
|
9
7
|
recordId,
|
|
@@ -15,7 +13,7 @@ class RecordUpdateUseCase extends AbstractUseCase {
|
|
|
15
13
|
const list = repository.getList();
|
|
16
14
|
const action = list.getUpdateRecordFetchActions(recordId, record);
|
|
17
15
|
dispatch(action);
|
|
18
|
-
|
|
16
|
+
input.callback?.({
|
|
19
17
|
data: [{
|
|
20
18
|
id: recordId,
|
|
21
19
|
Success: true,
|
|
@@ -4,8 +4,6 @@ import { ZLIST_RECORD_UPDATE } from "../../../../bc/zlist/Constants";
|
|
|
4
4
|
|
|
5
5
|
class UpdateMultipleRecordUseCase extends AbstractUseCase {
|
|
6
6
|
execute(input) {
|
|
7
|
-
var _input$callback;
|
|
8
|
-
|
|
9
7
|
const {
|
|
10
8
|
dispatch,
|
|
11
9
|
recordsMap,
|
|
@@ -20,7 +18,7 @@ class UpdateMultipleRecordUseCase extends AbstractUseCase {
|
|
|
20
18
|
}
|
|
21
19
|
});
|
|
22
20
|
});
|
|
23
|
-
|
|
21
|
+
input.callback?.({
|
|
24
22
|
results: recordsMap.map(record => ({
|
|
25
23
|
id: record.id,
|
|
26
24
|
Success: true,
|
|
@@ -56,7 +56,7 @@ class List {
|
|
|
56
56
|
moduleName: query.moduleName
|
|
57
57
|
};
|
|
58
58
|
delete computedContext['servicePrefix'];
|
|
59
|
-
return variableName ? computedContext
|
|
59
|
+
return variableName ? computedContext?.[variableName] : computedContext;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
createApiProps() {
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
export default class AppendRecordsController {
|
|
4
2
|
constructor(service) {
|
|
5
3
|
this.service = service;
|
|
6
|
-
|
|
7
|
-
_defineProperty(this, "handle", event => {
|
|
8
|
-
const {
|
|
9
|
-
state,
|
|
10
|
-
updateState,
|
|
11
|
-
action
|
|
12
|
-
} = event;
|
|
13
|
-
const {
|
|
14
|
-
payload
|
|
15
|
-
} = action;
|
|
16
|
-
const {
|
|
17
|
-
records
|
|
18
|
-
} = payload;
|
|
19
|
-
const {
|
|
20
|
-
appendRecordsUseCase
|
|
21
|
-
} = this.service;
|
|
22
|
-
appendRecordsUseCase.updateDependency(state, updateState);
|
|
23
|
-
appendRecordsUseCase.execute({
|
|
24
|
-
records
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
4
|
}
|
|
28
5
|
|
|
6
|
+
handle = event => {
|
|
7
|
+
const {
|
|
8
|
+
state,
|
|
9
|
+
updateState,
|
|
10
|
+
action
|
|
11
|
+
} = event;
|
|
12
|
+
const {
|
|
13
|
+
payload
|
|
14
|
+
} = action;
|
|
15
|
+
const {
|
|
16
|
+
records
|
|
17
|
+
} = payload;
|
|
18
|
+
const {
|
|
19
|
+
appendRecordsUseCase
|
|
20
|
+
} = this.service;
|
|
21
|
+
appendRecordsUseCase.updateDependency(state, updateState);
|
|
22
|
+
appendRecordsUseCase.execute({
|
|
23
|
+
records
|
|
24
|
+
});
|
|
25
|
+
};
|
|
29
26
|
}
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
export default class DeleteMultipleRecordLocalController {
|
|
4
2
|
constructor(service) {
|
|
5
3
|
this.service = service;
|
|
6
|
-
|
|
7
|
-
_defineProperty(this, "handle", event => {
|
|
8
|
-
const {
|
|
9
|
-
state,
|
|
10
|
-
updateState,
|
|
11
|
-
action
|
|
12
|
-
} = event;
|
|
13
|
-
const {
|
|
14
|
-
payload
|
|
15
|
-
} = action;
|
|
16
|
-
const {
|
|
17
|
-
recordIds
|
|
18
|
-
} = payload;
|
|
19
|
-
const {
|
|
20
|
-
deleteMultipleRecordUseCase
|
|
21
|
-
} = this.service;
|
|
22
|
-
deleteMultipleRecordUseCase.updateDependency(state, updateState);
|
|
23
|
-
deleteMultipleRecordUseCase.execute({
|
|
24
|
-
recordIds
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
4
|
}
|
|
28
5
|
|
|
6
|
+
handle = event => {
|
|
7
|
+
const {
|
|
8
|
+
state,
|
|
9
|
+
updateState,
|
|
10
|
+
action
|
|
11
|
+
} = event;
|
|
12
|
+
const {
|
|
13
|
+
payload
|
|
14
|
+
} = action;
|
|
15
|
+
const {
|
|
16
|
+
recordIds
|
|
17
|
+
} = payload;
|
|
18
|
+
const {
|
|
19
|
+
deleteMultipleRecordUseCase
|
|
20
|
+
} = this.service;
|
|
21
|
+
deleteMultipleRecordUseCase.updateDependency(state, updateState);
|
|
22
|
+
deleteMultipleRecordUseCase.execute({
|
|
23
|
+
recordIds
|
|
24
|
+
});
|
|
25
|
+
};
|
|
29
26
|
}
|
|
@@ -1,35 +1,32 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
export default class FailureController {
|
|
4
2
|
constructor(service) {
|
|
5
3
|
this.service = service;
|
|
6
|
-
|
|
7
|
-
_defineProperty(this, "handle", event => {
|
|
8
|
-
const {
|
|
9
|
-
state,
|
|
10
|
-
updateState
|
|
11
|
-
} = event;
|
|
12
|
-
const {
|
|
13
|
-
action,
|
|
14
|
-
dispatch
|
|
15
|
-
} = event;
|
|
16
|
-
const {
|
|
17
|
-
metaData,
|
|
18
|
-
payload
|
|
19
|
-
} = action;
|
|
20
|
-
const {
|
|
21
|
-
error
|
|
22
|
-
} = payload;
|
|
23
|
-
const {
|
|
24
|
-
failureUseCase
|
|
25
|
-
} = this.service;
|
|
26
|
-
failureUseCase.updateDependency(state, updateState);
|
|
27
|
-
failureUseCase.execute({
|
|
28
|
-
dispatch,
|
|
29
|
-
error,
|
|
30
|
-
metaData
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
4
|
}
|
|
34
5
|
|
|
6
|
+
handle = event => {
|
|
7
|
+
const {
|
|
8
|
+
state,
|
|
9
|
+
updateState
|
|
10
|
+
} = event;
|
|
11
|
+
const {
|
|
12
|
+
action,
|
|
13
|
+
dispatch
|
|
14
|
+
} = event;
|
|
15
|
+
const {
|
|
16
|
+
metaData,
|
|
17
|
+
payload
|
|
18
|
+
} = action;
|
|
19
|
+
const {
|
|
20
|
+
error
|
|
21
|
+
} = payload;
|
|
22
|
+
const {
|
|
23
|
+
failureUseCase
|
|
24
|
+
} = this.service;
|
|
25
|
+
failureUseCase.updateDependency(state, updateState);
|
|
26
|
+
failureUseCase.execute({
|
|
27
|
+
dispatch,
|
|
28
|
+
error,
|
|
29
|
+
metaData
|
|
30
|
+
});
|
|
31
|
+
};
|
|
35
32
|
}
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
export default class FetchStateStopController {
|
|
4
2
|
constructor(service) {
|
|
5
3
|
this.service = service;
|
|
6
|
-
|
|
7
|
-
_defineProperty(this, "handle", event => {
|
|
8
|
-
const {
|
|
9
|
-
state,
|
|
10
|
-
updateState,
|
|
11
|
-
action
|
|
12
|
-
} = event;
|
|
13
|
-
const {
|
|
14
|
-
metaData
|
|
15
|
-
} = action;
|
|
16
|
-
const {
|
|
17
|
-
fetchStateStopUseCase
|
|
18
|
-
} = this.service;
|
|
19
|
-
fetchStateStopUseCase.updateDependency(state, updateState);
|
|
20
|
-
fetchStateStopUseCase.execute({
|
|
21
|
-
metaData
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
4
|
}
|
|
25
5
|
|
|
6
|
+
handle = event => {
|
|
7
|
+
const {
|
|
8
|
+
state,
|
|
9
|
+
updateState,
|
|
10
|
+
action
|
|
11
|
+
} = event;
|
|
12
|
+
const {
|
|
13
|
+
metaData
|
|
14
|
+
} = action;
|
|
15
|
+
const {
|
|
16
|
+
fetchStateStopUseCase
|
|
17
|
+
} = this.service;
|
|
18
|
+
fetchStateStopUseCase.updateDependency(state, updateState);
|
|
19
|
+
fetchStateStopUseCase.execute({
|
|
20
|
+
metaData
|
|
21
|
+
});
|
|
22
|
+
};
|
|
26
23
|
}
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
export default class MountController {
|
|
4
2
|
constructor(recordApis, service) {
|
|
5
3
|
this.recordApis = recordApis;
|
|
6
4
|
this.service = service;
|
|
7
|
-
|
|
8
|
-
_defineProperty(this, "handle", event => {
|
|
9
|
-
const {
|
|
10
|
-
state,
|
|
11
|
-
updateState,
|
|
12
|
-
dispatch
|
|
13
|
-
} = event;
|
|
14
|
-
const {
|
|
15
|
-
initializeUseCase
|
|
16
|
-
} = this.service;
|
|
17
|
-
initializeUseCase.updateDependency(state, updateState);
|
|
18
|
-
initializeUseCase.execute({
|
|
19
|
-
dispatch,
|
|
20
|
-
apiTemplates: this.recordApis
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
5
|
}
|
|
24
6
|
|
|
7
|
+
handle = event => {
|
|
8
|
+
const {
|
|
9
|
+
state,
|
|
10
|
+
updateState,
|
|
11
|
+
dispatch
|
|
12
|
+
} = event;
|
|
13
|
+
const {
|
|
14
|
+
initializeUseCase
|
|
15
|
+
} = this.service;
|
|
16
|
+
initializeUseCase.updateDependency(state, updateState);
|
|
17
|
+
initializeUseCase.execute({
|
|
18
|
+
dispatch,
|
|
19
|
+
apiTemplates: this.recordApis
|
|
20
|
+
});
|
|
21
|
+
};
|
|
25
22
|
}
|
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
export default class NoContentController {
|
|
4
2
|
constructor(service) {
|
|
5
3
|
this.service = service;
|
|
6
|
-
|
|
7
|
-
_defineProperty(this, "handle", event => {
|
|
8
|
-
const {
|
|
9
|
-
state,
|
|
10
|
-
updateState
|
|
11
|
-
} = event;
|
|
12
|
-
const {
|
|
13
|
-
action,
|
|
14
|
-
dispatch
|
|
15
|
-
} = event;
|
|
16
|
-
const {
|
|
17
|
-
metaData
|
|
18
|
-
} = action;
|
|
19
|
-
const {
|
|
20
|
-
noContentUseCase
|
|
21
|
-
} = this.service;
|
|
22
|
-
noContentUseCase.updateDependency(state, updateState);
|
|
23
|
-
noContentUseCase.execute({
|
|
24
|
-
dispatch,
|
|
25
|
-
metaData
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
4
|
}
|
|
29
5
|
|
|
6
|
+
handle = event => {
|
|
7
|
+
const {
|
|
8
|
+
state,
|
|
9
|
+
updateState
|
|
10
|
+
} = event;
|
|
11
|
+
const {
|
|
12
|
+
action,
|
|
13
|
+
dispatch
|
|
14
|
+
} = event;
|
|
15
|
+
const {
|
|
16
|
+
metaData
|
|
17
|
+
} = action;
|
|
18
|
+
const {
|
|
19
|
+
noContentUseCase
|
|
20
|
+
} = this.service;
|
|
21
|
+
noContentUseCase.updateDependency(state, updateState);
|
|
22
|
+
noContentUseCase.execute({
|
|
23
|
+
dispatch,
|
|
24
|
+
metaData
|
|
25
|
+
});
|
|
26
|
+
};
|
|
30
27
|
}
|
|
@@ -1,35 +1,32 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
export default class RefetchController {
|
|
4
2
|
constructor(service) {
|
|
5
3
|
this.service = service;
|
|
6
|
-
|
|
7
|
-
_defineProperty(this, "handle", event => {
|
|
8
|
-
const {
|
|
9
|
-
state,
|
|
10
|
-
updateState
|
|
11
|
-
} = event;
|
|
12
|
-
const {
|
|
13
|
-
action,
|
|
14
|
-
dispatch
|
|
15
|
-
} = event;
|
|
16
|
-
const {
|
|
17
|
-
refetchUseCase
|
|
18
|
-
} = this.service;
|
|
19
|
-
refetchUseCase.updateDependency(state, updateState);
|
|
20
|
-
const {
|
|
21
|
-
actionName,
|
|
22
|
-
props,
|
|
23
|
-
apiName
|
|
24
|
-
} = action.payload;
|
|
25
|
-
refetchUseCase.execute({
|
|
26
|
-
dispatch,
|
|
27
|
-
actionName,
|
|
28
|
-
apiName,
|
|
29
|
-
props,
|
|
30
|
-
sourceMetaData: action.metaData
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
4
|
}
|
|
34
5
|
|
|
6
|
+
handle = event => {
|
|
7
|
+
const {
|
|
8
|
+
state,
|
|
9
|
+
updateState
|
|
10
|
+
} = event;
|
|
11
|
+
const {
|
|
12
|
+
action,
|
|
13
|
+
dispatch
|
|
14
|
+
} = event;
|
|
15
|
+
const {
|
|
16
|
+
refetchUseCase
|
|
17
|
+
} = this.service;
|
|
18
|
+
refetchUseCase.updateDependency(state, updateState);
|
|
19
|
+
const {
|
|
20
|
+
actionName,
|
|
21
|
+
props,
|
|
22
|
+
apiName
|
|
23
|
+
} = action.payload;
|
|
24
|
+
refetchUseCase.execute({
|
|
25
|
+
dispatch,
|
|
26
|
+
actionName,
|
|
27
|
+
apiName,
|
|
28
|
+
props,
|
|
29
|
+
sourceMetaData: action.metaData
|
|
30
|
+
});
|
|
31
|
+
};
|
|
35
32
|
}
|
|
@@ -1,33 +1,30 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
export default class SetRecordsController {
|
|
4
2
|
constructor(service) {
|
|
5
3
|
this.service = service;
|
|
6
|
-
|
|
7
|
-
_defineProperty(this, "handle", event => {
|
|
8
|
-
const {
|
|
9
|
-
state,
|
|
10
|
-
updateState,
|
|
11
|
-
action,
|
|
12
|
-
dispatch
|
|
13
|
-
} = event;
|
|
14
|
-
const {
|
|
15
|
-
payload,
|
|
16
|
-
metaData
|
|
17
|
-
} = action;
|
|
18
|
-
const {
|
|
19
|
-
records
|
|
20
|
-
} = payload;
|
|
21
|
-
const {
|
|
22
|
-
setRecordsUseCase
|
|
23
|
-
} = this.service;
|
|
24
|
-
setRecordsUseCase.updateDependency(state, updateState);
|
|
25
|
-
setRecordsUseCase.execute({
|
|
26
|
-
records,
|
|
27
|
-
metaData,
|
|
28
|
-
dispatch
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
4
|
}
|
|
32
5
|
|
|
6
|
+
handle = event => {
|
|
7
|
+
const {
|
|
8
|
+
state,
|
|
9
|
+
updateState,
|
|
10
|
+
action,
|
|
11
|
+
dispatch
|
|
12
|
+
} = event;
|
|
13
|
+
const {
|
|
14
|
+
payload,
|
|
15
|
+
metaData
|
|
16
|
+
} = action;
|
|
17
|
+
const {
|
|
18
|
+
records
|
|
19
|
+
} = payload;
|
|
20
|
+
const {
|
|
21
|
+
setRecordsUseCase
|
|
22
|
+
} = this.service;
|
|
23
|
+
setRecordsUseCase.updateDependency(state, updateState);
|
|
24
|
+
setRecordsUseCase.execute({
|
|
25
|
+
records,
|
|
26
|
+
metaData,
|
|
27
|
+
dispatch
|
|
28
|
+
});
|
|
29
|
+
};
|
|
33
30
|
}
|