@zohodesk/library-platform 1.1.12-exp.1 → 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/index.js +0 -1
- 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/bc/zlist/Constants.js +0 -1
- package/es/bc/zlist/Types.js +10 -0
- package/es/bc/zrecord/Constants.js +1 -0
- package/es/bc/zrecord/Schemas.js +29 -0
- package/es/bc/zrecord/Types.js +45 -0
- package/es/cc/action-icon/Properties.js +20 -1
- 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/ribbon/Properties.js +59 -0
- package/es/cc/ribbon/index.js +1 -0
- package/es/cc/table-connected/Properties.js +16 -0
- package/es/cc/table-connected/SdkContract.js +21 -0
- package/es/cc/table-connected/constants/Events.js +2 -0
- package/es/cc/table-list/Actions.js +0 -2
- package/es/cc/table-list/Constants.js +1 -1
- package/es/cc/table-list/Events.js +0 -2
- package/es/cc/table-list/Properties.js +34 -3
- 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/adapters/controllers/index.js +0 -2
- package/es/library/dot/components/table-list/frameworks/ui/EventHandlersFactory.js +1 -2
- package/es/library/dot/components/table-list/frameworks/ui/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 +1 -5
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIconView.js +5 -1
- 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/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/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/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/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/adapters/resources/SmartTableResource.js +169 -8
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +37 -6
- 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/getComponentMapping.js +1 -1
- package/es/platform/data-source/http-template/getRecords.js +1 -0
- package/es/platform/data-source/http-template/getSingleRecord.js +51 -0
- package/es/platform/zform/adapters/controllers/GetInitialRecordSuccessController.js +31 -0
- package/es/platform/zform/applications/interfaces/input/GetInitialRecordSuccessUseCaseInputModel.js +1 -0
- package/es/platform/zform/applications/usecases/GetInitialRecordSuccessUseCase.js +132 -0
- package/es/platform/zlist/adapters/controllers/RefreshRecordsRequestedController.js +21 -0
- package/es/platform/zlist/adapters/controllers/SortController.js +2 -2
- package/es/platform/zlist/adapters/gateways/Repository.js +6 -11
- package/es/platform/zlist/adapters/gateways/Service.js +2 -0
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +41 -13
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +15 -3
- package/es/platform/zlist/adapters/presenters/translators/Header.js +29 -21
- package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +3 -3
- package/es/platform/zlist/adapters/presenters/translators/Row.js +14 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/DateFieldTranslator.js +21 -3
- package/es/platform/zlist/adapters/presenters/translators/fields/DateTimeFieldTranslator.js +21 -3
- package/es/platform/zlist/adapters/presenters/translators/fields/PhoneFieldTranslator.js +17 -1
- package/es/platform/zlist/adapters/presenters/utils/DateAndTimeFormat.js +25 -0
- package/es/platform/zlist/adapters/presenters/utils/DefaultClientActions.js +7 -4
- package/es/platform/zlist/applications/entities-factory/ListFactory.js +2 -2
- package/es/platform/zlist/applications/interfaces/input/GetSortConfigUseCaseInputModel.js +1 -0
- package/es/platform/zlist/applications/interfaces/input/RefreshRecordsRequestedUseCaseInputModel.js +1 -0
- package/es/platform/zlist/applications/interfaces/input/SetSortConfigUseCaseInputModel.js +1 -0
- package/es/platform/zlist/applications/usecases/GetSortConfigUseCase.js +17 -0
- package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +1 -1
- package/es/platform/zlist/applications/usecases/RefreshRecordsRequestedUseCase.js +17 -0
- package/es/platform/zlist/applications/usecases/SetSortConfigUseCase.js +26 -0
- package/es/platform/zlist/applications/usecases/SortUseCase.js +6 -6
- package/es/platform/zlist/domain/entities/List.js +27 -15
- package/es/platform/zlist/domain/entities/interfaces/Properties.js +5 -5
- package/es/platform/zlist/frameworks/EventHandlersFactory.js +3 -4
- package/es/platform/zlist/frameworks/ZListBehaviourFactory.js +2 -5
- package/es/platform/zrecord/adapters/controllers/UpdateRecordController.js +30 -0
- package/es/platform/zrecord/adapters/gateways/Repository.js +5 -2
- package/es/platform/zrecord/applications/entities-factory/RecordsManagerFactory.js +2 -2
- package/es/platform/zrecord/applications/interfaces/input/ClearAllFiltersUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/GetFilterConditionUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/GetFilterConfigUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/RefreshRecordsUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/SetFilterUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/UpdateRecordInputModel.js +0 -0
- package/es/platform/zrecord/applications/usecases/ClearAllFiltersUseCase.js +24 -0
- package/es/platform/zrecord/applications/usecases/GetFilterConditionUseCase.js +15 -0
- package/es/platform/zrecord/applications/usecases/GetFilterConfigUseCase.js +15 -0
- package/es/platform/zrecord/applications/usecases/RefreshRecordsUseCase.js +14 -0
- package/es/platform/zrecord/applications/usecases/SetFilterUseCase.js +24 -0
- package/es/platform/zrecord/applications/usecases/UpdateRecordUseCase.js +30 -0
- package/es/platform/zrecord/domain/entities/Filter.js +247 -0
- package/es/platform/zrecord/domain/entities/RecordsManager.js +19 -1
- package/es/platform/zrecord/domain/entities/interfaces/IFilter.js +1 -0
- package/es/platform/zrecord/frameworks/RecordBehaviourFactory.js +11 -1
- package/package.json +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/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/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
|
@@ -1,15 +1,36 @@
|
|
|
1
1
|
import { RESIZE_SCROLL } from "../../../../../bc/table-column-resizer/Constants";
|
|
2
2
|
import AbstractController from "./AbstractController";
|
|
3
|
+
import { FLOAT_PAGINATION_BEHAVIOUR_UPDATE_REQUESTED } from "../../../../../bc/float-pagination/Constants";
|
|
3
4
|
export default class ScrollController extends AbstractController {
|
|
4
|
-
handle(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
handle(_ref) {
|
|
6
|
+
let {
|
|
7
|
+
host,
|
|
8
|
+
dispatch,
|
|
9
|
+
state
|
|
10
|
+
} = _ref;
|
|
11
|
+
const {
|
|
12
|
+
properties: {
|
|
13
|
+
resizeConfig,
|
|
14
|
+
floatPaginationConfig
|
|
11
15
|
}
|
|
12
|
-
}
|
|
16
|
+
} = state;
|
|
17
|
+
|
|
18
|
+
if (floatPaginationConfig?.isEnabled) {
|
|
19
|
+
dispatch({
|
|
20
|
+
type: FLOAT_PAGINATION_BEHAVIOUR_UPDATE_REQUESTED
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (resizeConfig?.isEnabled) {
|
|
25
|
+
// const tableElement = event.host;
|
|
26
|
+
const tableElement = host.getElementsByTagName('table')[0];
|
|
27
|
+
dispatch({
|
|
28
|
+
type: RESIZE_SCROLL,
|
|
29
|
+
payload: {
|
|
30
|
+
tableElement
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
13
34
|
}
|
|
14
35
|
|
|
15
36
|
}
|
package/es/platform/components/table-connected/adapters/controllers/ScrollEndReachedController.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ZLIST_FETCH_MORE } from "../../../../../bc/zlist/Constants";
|
|
2
|
+
import AbstractController from "./AbstractController";
|
|
3
|
+
export default class ScrollEndReachedController extends AbstractController {
|
|
4
|
+
handle(_ref) {
|
|
5
|
+
let {
|
|
6
|
+
dispatch,
|
|
7
|
+
state
|
|
8
|
+
} = _ref;
|
|
9
|
+
const {
|
|
10
|
+
behaviours: {
|
|
11
|
+
zrecord
|
|
12
|
+
}
|
|
13
|
+
} = state;
|
|
14
|
+
|
|
15
|
+
if (zrecord?.records?.length) {
|
|
16
|
+
dispatch({
|
|
17
|
+
type: ZLIST_FETCH_MORE,
|
|
18
|
+
payload: {}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AbstractResource } from "../../../../sdk/application/interfaces/gateways/AbstractResource";
|
|
2
2
|
import ZListRepository from "../../../../zlist/adapters/gateways/Repository";
|
|
3
|
-
import ZListSortBy from "../../../../zlist/adapters/gateways/SortBy";
|
|
4
3
|
import ZListPresenters from "../../../../zlist/adapters/presenters/Presenters";
|
|
5
4
|
import ZRecordRepository from "../../../../zrecord/adapters/gateways/Repository";
|
|
6
5
|
import ZRecordPresenter from "../../../../zrecord/adapters/presenters/Presenter";
|
|
@@ -17,10 +16,17 @@ import UpdateMultipleRecordUseCase from "../../../../zlist/applications/usecases
|
|
|
17
16
|
import GetContextUseCase from "../../../../zlist/applications/usecases/GetContextUseCase";
|
|
18
17
|
import ReOrderUseCase from "../../../../zlist/applications/usecases/ReOrderUseCase";
|
|
19
18
|
import { SdkContracts } from "../../../../../cc/table-connected/SdkContract";
|
|
20
|
-
import SortUseCase from "../../../../zlist/applications/usecases/SortUseCase";
|
|
21
19
|
import { Analytics } from "../../../../../library/analytics";
|
|
22
20
|
import MarkAsReadUseCase from "../../../../zrecord/applications/usecases/MarkAsReadUseCase";
|
|
23
21
|
import MarkAsUnReadUseCase from "../../../../zrecord/applications/usecases/MarkAsUnReadUseCase";
|
|
22
|
+
import GetFilterConditionUseCase from "../../../../zrecord/applications/usecases/GetFilterConditionUseCase";
|
|
23
|
+
import SetFilterUseCase from "../../../../zrecord/applications/usecases/SetFilterUseCase";
|
|
24
|
+
import ClearAllFiltersUseCase from "../../../../zrecord/applications/usecases/ClearAllFiltersUseCase";
|
|
25
|
+
import RefreshRecordsUseCase from "../../../../zrecord/applications/usecases/RefreshRecordsUseCase";
|
|
26
|
+
import GetFilterConfigUseCase from "../../../../zrecord/applications/usecases/GetFilterConfigUseCase";
|
|
27
|
+
import { initialSortConfig } from "../../../../../bc/zlist/Types";
|
|
28
|
+
import GetSortConfigUseCase from "../../../../zlist/applications/usecases/GetSortConfigUseCase";
|
|
29
|
+
import SetSortConfigUseCase from "../../../../zlist/applications/usecases/SetSortConfigUseCase";
|
|
24
30
|
export class SmartTableResource extends AbstractResource {
|
|
25
31
|
initialize() {}
|
|
26
32
|
|
|
@@ -37,8 +43,7 @@ export class SmartTableResource extends AbstractResource {
|
|
|
37
43
|
getListDependencies() {
|
|
38
44
|
const dependencies = {
|
|
39
45
|
repository: new ZListRepository(),
|
|
40
|
-
presenter: new ZListPresenters()
|
|
41
|
-
sortBy: new ZListSortBy()
|
|
46
|
+
presenter: new ZListPresenters()
|
|
42
47
|
};
|
|
43
48
|
return dependencies;
|
|
44
49
|
}
|
|
@@ -68,7 +73,7 @@ export class SmartTableResource extends AbstractResource {
|
|
|
68
73
|
} = this.dependencies;
|
|
69
74
|
const now = new Date().toISOString();
|
|
70
75
|
const smartTableSdkMethodUsed = {
|
|
71
|
-
event:
|
|
76
|
+
event: 'smart_table_sdk_method_used',
|
|
72
77
|
timestamp: now,
|
|
73
78
|
contextDetails: {
|
|
74
79
|
moduleName: state.moduleName,
|
|
@@ -237,6 +242,95 @@ export class SmartTableResource extends AbstractResource {
|
|
|
237
242
|
return getData();
|
|
238
243
|
}
|
|
239
244
|
|
|
245
|
+
getFilterCondition() {
|
|
246
|
+
const {
|
|
247
|
+
dispatch
|
|
248
|
+
} = this.dependencies;
|
|
249
|
+
const {
|
|
250
|
+
getData,
|
|
251
|
+
setData
|
|
252
|
+
} = this.createCallback();
|
|
253
|
+
const dependencies = this.getRecordDependencies();
|
|
254
|
+
const usecase = this.createUseCase(dependencies, GetFilterConditionUseCase);
|
|
255
|
+
usecase.execute({
|
|
256
|
+
dispatch,
|
|
257
|
+
callback: setData
|
|
258
|
+
});
|
|
259
|
+
return getData();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
getFilterConfig() {
|
|
263
|
+
const {
|
|
264
|
+
dispatch
|
|
265
|
+
} = this.dependencies;
|
|
266
|
+
const {
|
|
267
|
+
getData,
|
|
268
|
+
setData
|
|
269
|
+
} = this.createCallback();
|
|
270
|
+
const dependencies = this.getRecordDependencies();
|
|
271
|
+
const usecase = this.createUseCase(dependencies, GetFilterConfigUseCase);
|
|
272
|
+
usecase.execute({
|
|
273
|
+
dispatch,
|
|
274
|
+
callback: setData
|
|
275
|
+
});
|
|
276
|
+
return getData();
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
setFilter(filterConfig) {
|
|
280
|
+
this.validateInput('setFilter', {
|
|
281
|
+
filterConfig
|
|
282
|
+
}, SdkContracts.setFilterInputMeta);
|
|
283
|
+
const {
|
|
284
|
+
dispatch
|
|
285
|
+
} = this.dependencies;
|
|
286
|
+
const {
|
|
287
|
+
getData,
|
|
288
|
+
setData
|
|
289
|
+
} = this.createCallback();
|
|
290
|
+
const dependencies = this.getRecordDependencies();
|
|
291
|
+
const usecase = this.createUseCase(dependencies, SetFilterUseCase);
|
|
292
|
+
usecase.execute({
|
|
293
|
+
filterConfig,
|
|
294
|
+
dispatch,
|
|
295
|
+
callback: setData
|
|
296
|
+
});
|
|
297
|
+
return getData();
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
clearAllFilters() {
|
|
301
|
+
const {
|
|
302
|
+
dispatch
|
|
303
|
+
} = this.dependencies;
|
|
304
|
+
const {
|
|
305
|
+
getData,
|
|
306
|
+
setData
|
|
307
|
+
} = this.createCallback();
|
|
308
|
+
const dependencies = this.getRecordDependencies();
|
|
309
|
+
const usecase = this.createUseCase(dependencies, ClearAllFiltersUseCase);
|
|
310
|
+
usecase.execute({
|
|
311
|
+
dispatch,
|
|
312
|
+
callback: setData
|
|
313
|
+
});
|
|
314
|
+
return getData();
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
refreshRecords() {
|
|
318
|
+
const {
|
|
319
|
+
dispatch
|
|
320
|
+
} = this.dependencies;
|
|
321
|
+
const {
|
|
322
|
+
getData,
|
|
323
|
+
setData
|
|
324
|
+
} = this.createCallback();
|
|
325
|
+
const dependencies = this.getRecordDependencies();
|
|
326
|
+
const usecase = this.createUseCase(dependencies, RefreshRecordsUseCase);
|
|
327
|
+
usecase.execute({
|
|
328
|
+
dispatch,
|
|
329
|
+
callback: setData
|
|
330
|
+
});
|
|
331
|
+
return getData();
|
|
332
|
+
}
|
|
333
|
+
|
|
240
334
|
selectRecords(ids) {
|
|
241
335
|
this.validateInput('selectRecords', {
|
|
242
336
|
ids
|
|
@@ -304,7 +398,8 @@ export class SmartTableResource extends AbstractResource {
|
|
|
304
398
|
oldIndex: fromIndex,
|
|
305
399
|
dispatch
|
|
306
400
|
});
|
|
307
|
-
}
|
|
401
|
+
} // @deprecated use sortRecords
|
|
402
|
+
|
|
308
403
|
|
|
309
404
|
sortRecords(sortBy) {
|
|
310
405
|
this.validateInput('sortRecords', {
|
|
@@ -313,12 +408,78 @@ export class SmartTableResource extends AbstractResource {
|
|
|
313
408
|
const {
|
|
314
409
|
dispatch
|
|
315
410
|
} = this.dependencies;
|
|
411
|
+
const {
|
|
412
|
+
getData,
|
|
413
|
+
setData
|
|
414
|
+
} = this.createCallback();
|
|
415
|
+
const dependencies = this.getListDependencies();
|
|
416
|
+
const usecase = this.createUseCase(dependencies, SetSortConfigUseCase);
|
|
417
|
+
const sortConfig = {
|
|
418
|
+
fieldName: sortBy.name,
|
|
419
|
+
order: sortBy.order
|
|
420
|
+
};
|
|
421
|
+
usecase.execute({
|
|
422
|
+
sortConfig,
|
|
423
|
+
dispatch,
|
|
424
|
+
callback: setData
|
|
425
|
+
});
|
|
426
|
+
return getData();
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
getSortConfig() {
|
|
430
|
+
const {
|
|
431
|
+
dispatch
|
|
432
|
+
} = this.dependencies;
|
|
433
|
+
const {
|
|
434
|
+
getData,
|
|
435
|
+
setData
|
|
436
|
+
} = this.createCallback();
|
|
437
|
+
const dependencies = this.getListDependencies();
|
|
438
|
+
const usecase = this.createUseCase(dependencies, GetSortConfigUseCase);
|
|
439
|
+
usecase.execute({
|
|
440
|
+
dispatch,
|
|
441
|
+
callback: setData
|
|
442
|
+
});
|
|
443
|
+
return getData();
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
setSortConfig(sortConfig) {
|
|
447
|
+
this.validateInput('setSortConfig', {
|
|
448
|
+
sortConfig
|
|
449
|
+
}, SdkContracts.setSortConfigInputMeta);
|
|
450
|
+
const {
|
|
451
|
+
dispatch
|
|
452
|
+
} = this.dependencies;
|
|
453
|
+
const {
|
|
454
|
+
getData,
|
|
455
|
+
setData
|
|
456
|
+
} = this.createCallback();
|
|
316
457
|
const dependencies = this.getListDependencies();
|
|
317
|
-
const usecase = this.createUseCase(dependencies,
|
|
458
|
+
const usecase = this.createUseCase(dependencies, SetSortConfigUseCase);
|
|
318
459
|
usecase.execute({
|
|
319
|
-
|
|
460
|
+
sortConfig,
|
|
461
|
+
dispatch,
|
|
462
|
+
callback: setData
|
|
463
|
+
});
|
|
464
|
+
return getData();
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
clearSorting() {
|
|
468
|
+
const {
|
|
320
469
|
dispatch
|
|
470
|
+
} = this.dependencies;
|
|
471
|
+
const {
|
|
472
|
+
getData,
|
|
473
|
+
setData
|
|
474
|
+
} = this.createCallback();
|
|
475
|
+
const dependencies = this.getListDependencies();
|
|
476
|
+
const usecase = this.createUseCase(dependencies, SetSortConfigUseCase);
|
|
477
|
+
usecase.execute({
|
|
478
|
+
sortConfig: initialSortConfig,
|
|
479
|
+
dispatch,
|
|
480
|
+
callback: setData
|
|
321
481
|
});
|
|
482
|
+
return getData();
|
|
322
483
|
}
|
|
323
484
|
|
|
324
485
|
markAsRead(recordId) {
|
|
@@ -23,13 +23,20 @@ import { TableListConstants } from "../../../../cc/table-list";
|
|
|
23
23
|
import ResolutionBasedLimitController from "../adapters/controllers/ResolutionBasedLimitController";
|
|
24
24
|
import { TableTextOverflowConstants } from "../../../../cc/table-text-overflow";
|
|
25
25
|
import { TEXT_OVERFLOW_BEHAVIOUR_UPDATE_REQUESTED } from "../../../../bc/clip-wrap/Constants";
|
|
26
|
+
import { SMART_TABLE_SORT_BY_REQUESTED } from "../../../../cc/table-connected/constants/Events";
|
|
27
|
+
import { SortedBy } from "../../../../cc/table-list/data-types/Header";
|
|
28
|
+
import { SortOrder } from "../../../../bc/zlist/Types";
|
|
29
|
+
import { FloatingPaginationConstants } from "../../../../cc/floating-pagination";
|
|
30
|
+
import { FLOAT_PAGINATION_BEHAVIOUR_BOTTOM_UPDATED, FLOAT_PAGINATION_BEHAVIOUR_TOP_UPDATED } from "../../../../bc/float-pagination/Constants";
|
|
31
|
+
import ScrollEndReachedController from "../adapters/controllers/ScrollEndReachedController";
|
|
26
32
|
const {
|
|
27
33
|
TABLE_LIST_RESIZE_START_REQUESTED,
|
|
28
34
|
TABLE_LIST_RESIZE_MOVE_REQUESTED,
|
|
29
35
|
TABLE_LIST_RESIZE_END_REQUESTED,
|
|
30
36
|
TABLE_LIST_SCROLLED,
|
|
31
37
|
TABLE_LIST_ROW_DRAG_END,
|
|
32
|
-
TABLE_LIST_NAME_FIELD_CLICKED
|
|
38
|
+
TABLE_LIST_NAME_FIELD_CLICKED,
|
|
39
|
+
TABLE_LIST_SCROLL_END_REACHED
|
|
33
40
|
} = TableListEventConstants;
|
|
34
41
|
|
|
35
42
|
function createHandlerWithSdk(handler) {
|
|
@@ -154,8 +161,8 @@ export default class EventHandlersFactory {
|
|
|
154
161
|
contextDetails: {
|
|
155
162
|
moduleName,
|
|
156
163
|
instanceName,
|
|
157
|
-
sortBy: zlist.
|
|
158
|
-
direction: zlist.
|
|
164
|
+
sortBy: zlist.sortConfig.fieldName,
|
|
165
|
+
direction: zlist.sortConfig.order
|
|
159
166
|
}
|
|
160
167
|
}; // -------------------------
|
|
161
168
|
// 5. Column Resized
|
|
@@ -326,18 +333,41 @@ export default class EventHandlersFactory {
|
|
|
326
333
|
[SmartTableConstants.ExternalConstants.SMART_TABLE_MARK_AS_READ_REQUESTED]: markAsReadHandler,
|
|
327
334
|
[SmartTableConstants.ExternalConstants.SMART_TABLE_MARK_AS_UNREAD_REQUESTED]: markAsUnReadHandler,
|
|
328
335
|
[TABLE_LIST_NAME_FIELD_CLICKED]: navigationHandler,
|
|
336
|
+
[TABLE_LIST_SCROLL_END_REACHED]: new ScrollEndReachedController().handle,
|
|
337
|
+
[FloatingPaginationConstants.SCROLL_UP_CLICKED]: args => {
|
|
338
|
+
const {
|
|
339
|
+
dispatch
|
|
340
|
+
} = args;
|
|
341
|
+
dispatch({
|
|
342
|
+
type: FLOAT_PAGINATION_BEHAVIOUR_TOP_UPDATED
|
|
343
|
+
});
|
|
344
|
+
},
|
|
345
|
+
[FloatingPaginationConstants.SCROLL_DOWN_CLICKED]: args => {
|
|
346
|
+
const {
|
|
347
|
+
dispatch
|
|
348
|
+
} = args;
|
|
349
|
+
dispatch({
|
|
350
|
+
type: FLOAT_PAGINATION_BEHAVIOUR_BOTTOM_UPDATED
|
|
351
|
+
});
|
|
352
|
+
},
|
|
329
353
|
[`${name}#${LifeCycleEvents.STATE_UPDATED}`]: addMetrics,
|
|
330
354
|
[RESIZE_FINISHED]: new ResizeFinishController().handle,
|
|
331
355
|
[TABLE_LIST_RESIZE_START_REQUESTED]: new ResizeStartController().handle,
|
|
332
356
|
[TABLE_LIST_RESIZE_MOVE_REQUESTED]: new ResizeByMouseController().handle,
|
|
333
|
-
[
|
|
357
|
+
[SMART_TABLE_SORT_BY_REQUESTED]: _ref => {
|
|
334
358
|
let {
|
|
335
359
|
action,
|
|
336
360
|
dispatch
|
|
337
361
|
} = _ref;
|
|
338
362
|
return dispatch({
|
|
339
363
|
type: ZLIST_SORT,
|
|
340
|
-
payload:
|
|
364
|
+
payload: {
|
|
365
|
+
fieldName: action.payload.name,
|
|
366
|
+
order: {
|
|
367
|
+
[SortedBy.Ascending]: SortOrder.ASC,
|
|
368
|
+
[SortedBy.Descending]: SortOrder.DES
|
|
369
|
+
}[action.payload.order] || SortOrder.NONE
|
|
370
|
+
}
|
|
341
371
|
});
|
|
342
372
|
},
|
|
343
373
|
[TABLE_LIST_RESIZE_END_REQUESTED]: new ResizeEndController().handle,
|
|
@@ -417,7 +447,8 @@ function createMergedHandler(eventHandlersList, eventName) {
|
|
|
417
447
|
if (typeof handler === 'function') {
|
|
418
448
|
try {
|
|
419
449
|
handler(...arguments);
|
|
420
|
-
} catch {
|
|
450
|
+
} catch (error) {
|
|
451
|
+
__DEVELOPMENT__ && console.error(error);
|
|
421
452
|
}
|
|
422
453
|
}
|
|
423
454
|
}
|
|
@@ -42,6 +42,7 @@ import { SmartTableEventsContracts } from "../../../../cc/table-connected";
|
|
|
42
42
|
import ClientScriptsBehaviourFactory from "../../../client-scripts/behaviour/zclient-scripts-fetch/frameworks/ClientScriptsBehaviourFactory";
|
|
43
43
|
import AppContextBehaviourFactory from "../../../app-context-behaviour/frameworks/AppContextBehaviourFactory";
|
|
44
44
|
import ClipWrapBehaviourFactory from "../../../../library/behaviours/clip-wrap/frameworks/ui/ClipWrapBehaviourFactory";
|
|
45
|
+
import FloatPaginationBehaviourFactory from "../../../../library/behaviours/float-pagination/frameworks/ui/FloatPaginationBehaviourFactory";
|
|
45
46
|
export default class TableConnectedFactory {
|
|
46
47
|
static create(_ref) {
|
|
47
48
|
let {
|
|
@@ -70,7 +71,7 @@ export default class TableConnectedFactory {
|
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
static getBehaviours(_dataSource) {
|
|
73
|
-
return [SdkBehaviourFactory.create([ResourceNamesEnum.SMART_TABLE, ResourceNamesEnum.CLIENT_ACTION]), TableColumnResizerBehaviorFactory.create(), KeyboardControlBehaviourFactory.create(), ClipWrapBehaviourFactory.create(), LocalStorageBehaviourFactory.create(), ZHttpBehaviourFactory.create(), DataSourceBehaviourFactory.create(), ...TableConnectedFactory.getPlatformBehaviours(_dataSource), ColumnChooserBehaviourFactory.create(), ListItemSelectionBehaviourFactory.create()];
|
|
74
|
+
return [SdkBehaviourFactory.create([ResourceNamesEnum.SMART_TABLE, ResourceNamesEnum.CLIENT_ACTION]), TableColumnResizerBehaviorFactory.create(), KeyboardControlBehaviourFactory.create(), ClipWrapBehaviourFactory.create(), FloatPaginationBehaviourFactory.create(), LocalStorageBehaviourFactory.create(), ZHttpBehaviourFactory.create(), DataSourceBehaviourFactory.create(), ...TableConnectedFactory.getPlatformBehaviours(_dataSource), ColumnChooserBehaviourFactory.create(), ListItemSelectionBehaviourFactory.create()];
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
static getPlatformBehaviours(_dataSource) {
|
|
@@ -18,6 +18,7 @@ function View(_ref, ref) {
|
|
|
18
18
|
focussedRow,
|
|
19
19
|
keyboardControlsConfig,
|
|
20
20
|
textOverflowConfig,
|
|
21
|
+
floatPaginationConfig,
|
|
21
22
|
reOrderConfig
|
|
22
23
|
} = state.viewModel;
|
|
23
24
|
const {
|
|
@@ -48,6 +49,7 @@ function View(_ref, ref) {
|
|
|
48
49
|
selectionConfig: selectionConfig,
|
|
49
50
|
keyboardControlsConfig: keyboardControlsConfig,
|
|
50
51
|
textOverflowConfig: textOverflowConfig,
|
|
52
|
+
floatPaginationConfig: floatPaginationConfig,
|
|
51
53
|
focussedRow: focussedRow
|
|
52
54
|
});
|
|
53
55
|
}
|
|
@@ -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;
|
|
@@ -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;
|
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;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
|
|
3
|
+
class RefreshRecordsRequestedController extends AbstractController {
|
|
4
|
+
handle(event) {
|
|
5
|
+
const {
|
|
6
|
+
refreshRecordsRequestedUseCase
|
|
7
|
+
} = this.service;
|
|
8
|
+
const {
|
|
9
|
+
state,
|
|
10
|
+
updateState,
|
|
11
|
+
dispatch
|
|
12
|
+
} = event;
|
|
13
|
+
refreshRecordsRequestedUseCase.updateDependency(state, updateState);
|
|
14
|
+
refreshRecordsRequestedUseCase.execute({
|
|
15
|
+
dispatch
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default RefreshRecordsRequestedController;
|