@zohodesk/library-platform 1.1.11 → 1.1.12-exp.2
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/index.js +0 -1
- 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/fields/lookup/Properties.js +10 -26
- package/es/cc/radio-dropdown/Constants.js +6 -0
- package/es/cc/radio-dropdown/Data.js +1 -0
- package/es/cc/radio-dropdown/Events.js +42 -0
- package/es/cc/radio-dropdown/Properties.js +142 -0
- package/es/cc/radio-dropdown/index.js +4 -0
- package/es/cc/table-column-filter/Properties.js +9 -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 +0 -1
- package/es/cc/table-list/Events.js +0 -2
- package/es/cc/table-list/Properties.js +0 -3
- package/es/cc/tag/Constants.js +6 -0
- package/es/cc/tag/Data.js +14 -0
- package/es/cc/tag/EventHandlers.js +1 -0
- package/es/cc/tag/Events.js +26 -0
- package/es/cc/tag/Model.js +30 -0
- package/es/cc/tag/Properties.js +104 -0
- package/es/cc/tag/index.js +6 -0
- package/es/cc/tags-list-dropdown/Constants.js +5 -0
- package/es/cc/tags-list-dropdown/Data.js +1 -0
- package/es/cc/tags-list-dropdown/Events.js +14 -0
- package/es/cc/tags-list-dropdown/Properties.js +96 -0
- package/es/cc/tags-list-dropdown/index.js +4 -0
- package/es/library/custom-component/frameworks/ui/CustomComponentFactory.js +56 -0
- package/es/library/dot/components/form/frameworks/ui/css/Form.module.css +13 -13
- package/es/library/dot/components/form-fields/field/css/FieldItem.module.css +2 -2
- package/es/library/dot/components/section/frameworks/ui/css/Section.module.css +3 -3
- 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/css/TableList.module.css +21 -21
- package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/css/Breadcrumb.module.css +4 -4
- package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/css/DateView.module.css +1 -1
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/css/Label.module.css +4 -4
- package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/css/MultiSelectView.module.css +7 -7
- package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/RadioDropdown.js +12 -0
- package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/RadioDropdownView.js +124 -0
- package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/css/RadioDropdown.module.css +23 -0
- package/es/library/dot/legacy-to-new-arch/select/frameworks/ui/css/Select.module.css +2 -2
- package/es/library/dot/legacy-to-new-arch/table-column-chooser/frameworks/ui/css/TableColumnChooserView.module.css +1 -1
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js +2 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/highlighted-value-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/highlighted-value-field/frameworks/ui/HighlightedValueField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/highlighted-value-field/frameworks/ui/HighlightedValueFieldView.js +24 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/labeled-avatar-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/labeled-avatar-field/frameworks/ui/LabeledAvatarField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/labeled-avatar-field/frameworks/ui/LabeledAvatarFieldView.js +22 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/link-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/link-field/frameworks/ui/LinkField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/link-field/frameworks/ui/LinkFieldView.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/EventHandlersFactory.js +32 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/RadioDropdownField.js +32 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/RadioDropdownFieldView.js +43 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/css/RadioDropdownField.module.css +3 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tag-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tag-field/frameworks/ui/TagField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tag-field/frameworks/ui/TagFieldView.js +34 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-field/frameworks/ui/TagsField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-field/frameworks/ui/TagsFieldView.js +18 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-list-dropdown-field/frameworks/ui/TagsListDropdownField.js +12 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-list-dropdown-field/frameworks/ui/TagsListDropdownFieldView.js +24 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/text-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/text-field/frameworks/ui/TextField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/text-field/frameworks/ui/TextFieldView.js +20 -0
- package/es/library/dot/legacy-to-new-arch/tag/frameworks/ui/Tag.js +11 -0
- package/es/library/dot/legacy-to-new-arch/tag/frameworks/ui/Tag.module.css +8 -0
- package/es/library/dot/legacy-to-new-arch/tag/frameworks/ui/TagView.js +96 -0
- package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagContractAdapter.js +24 -0
- package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagsListDropdown.js +12 -0
- package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagsListDropdownView.js +42 -0
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/css/TextAreaView.module.css +3 -3
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer.module.css +5 -5
- package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +169 -8
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +11 -2
- package/es/platform/data-source/http-template/fetchLookupFields.js +0 -6
- package/es/platform/data-source/http-template/getComponentMapping.js +17 -0
- package/es/platform/data-source/http-template/getRecords.js +1 -0
- package/es/platform/zform/adapters/gateway/FormRepository.js +3 -1
- package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +12 -11
- package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +9 -10
- package/es/platform/zform/domain/ZForm.js +2 -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 +9 -6
- package/es/platform/zlist/adapters/presenters/translators/FieldVariations.js +25 -0
- 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/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/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/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/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 +2 -2
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TagConstants } from "../../../../../../cc/tag";
|
|
3
|
+
import Tag from '@zohodesk/components/es/Tag/Tag';
|
|
4
|
+
import ColoredTag from '@zohodesk-private/desk-components/es/ColoredTag/ColoredTag'; // @ts-ignore
|
|
5
|
+
|
|
6
|
+
import style from "./Tag.module.css";
|
|
7
|
+
|
|
8
|
+
function TagView(_ref, ref) {
|
|
9
|
+
let {
|
|
10
|
+
state,
|
|
11
|
+
helpers
|
|
12
|
+
} = _ref;
|
|
13
|
+
let {
|
|
14
|
+
dispatch
|
|
15
|
+
} = helpers;
|
|
16
|
+
let {
|
|
17
|
+
id,
|
|
18
|
+
label,
|
|
19
|
+
color,
|
|
20
|
+
isDisabled,
|
|
21
|
+
iconName,
|
|
22
|
+
imageAltText,
|
|
23
|
+
imageSrc,
|
|
24
|
+
isRemovable,
|
|
25
|
+
cursor,
|
|
26
|
+
size,
|
|
27
|
+
tooltip
|
|
28
|
+
} = state.properties;
|
|
29
|
+
|
|
30
|
+
if (!!color) {
|
|
31
|
+
return /*#__PURE__*/React.createElement(ColoredTag, {
|
|
32
|
+
$data_id: id,
|
|
33
|
+
$data_text: label,
|
|
34
|
+
$data_color: color,
|
|
35
|
+
$event_onClick: id => {
|
|
36
|
+
dispatch({
|
|
37
|
+
type: TagConstants.TAG_CLICKED,
|
|
38
|
+
payload: {
|
|
39
|
+
id
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
$event_onRemove: isRemovable ? id => {
|
|
44
|
+
dispatch({
|
|
45
|
+
type: TagConstants.TAG_REMOVED,
|
|
46
|
+
payload: {
|
|
47
|
+
id
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
} : undefined,
|
|
51
|
+
customStyle: {
|
|
52
|
+
chip: cursor && !isDisabled ? style[`cursor_${cursor}`] : ''
|
|
53
|
+
},
|
|
54
|
+
$customProps_tag: {
|
|
55
|
+
getRef: ref,
|
|
56
|
+
disabled: isDisabled,
|
|
57
|
+
size,
|
|
58
|
+
tooltip
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
64
|
+
getRef: ref,
|
|
65
|
+
id: id,
|
|
66
|
+
text: label,
|
|
67
|
+
imageURL: imageSrc,
|
|
68
|
+
initial: imageAltText || label,
|
|
69
|
+
hasAvatar: !!imageSrc || !!imageAltText,
|
|
70
|
+
iconName: iconName,
|
|
71
|
+
size: size,
|
|
72
|
+
tooltip: tooltip,
|
|
73
|
+
disabled: isDisabled,
|
|
74
|
+
customClass: {
|
|
75
|
+
customTag: cursor && !isDisabled ? style[`cursor_${cursor}`] : ''
|
|
76
|
+
},
|
|
77
|
+
onSelectTag: id => {
|
|
78
|
+
dispatch({
|
|
79
|
+
type: TagConstants.TAG_CLICKED,
|
|
80
|
+
payload: {
|
|
81
|
+
id
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
onRemove: isRemovable ? id => {
|
|
86
|
+
dispatch({
|
|
87
|
+
type: TagConstants.TAG_REMOVED,
|
|
88
|
+
payload: {
|
|
89
|
+
id
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
} : undefined
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export default TagView;
|
package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagContractAdapter.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default function TagContractAdapter(tag) {
|
|
2
|
+
const {
|
|
3
|
+
id,
|
|
4
|
+
label,
|
|
5
|
+
imageSrc,
|
|
6
|
+
imageAltText,
|
|
7
|
+
iconName,
|
|
8
|
+
iconSize,
|
|
9
|
+
disabled,
|
|
10
|
+
tooltip
|
|
11
|
+
} = tag;
|
|
12
|
+
return {
|
|
13
|
+
id,
|
|
14
|
+
text: label,
|
|
15
|
+
name: imageAltText,
|
|
16
|
+
imageUrl: imageSrc,
|
|
17
|
+
iconName,
|
|
18
|
+
iconSize,
|
|
19
|
+
customProps: {
|
|
20
|
+
disabled,
|
|
21
|
+
tooltip
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagsListDropdown.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../custom-component";
|
|
2
|
+
import TagsListDropdownProperties from "../../../../../../cc/tags-list-dropdown/Properties";
|
|
3
|
+
import TagsListDropdownEvents from "../../../../../../cc/tags-list-dropdown/Events";
|
|
4
|
+
import TagsListDropdownView from "./TagsListDropdownView";
|
|
5
|
+
let TagsListDropdown = createCustomComponent({
|
|
6
|
+
name: "TagsListDropdown",
|
|
7
|
+
View: TagsListDropdownView,
|
|
8
|
+
properties: TagsListDropdownProperties,
|
|
9
|
+
events: TagsListDropdownEvents,
|
|
10
|
+
eventHandlers: {}
|
|
11
|
+
});
|
|
12
|
+
export default TagsListDropdown;
|
package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagsListDropdownView.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import TagsListDropdown from '@zohodesk-private/desk-components/es/TagsListDropdown/TagsListDropdown';
|
|
3
|
+
import Constants from "../../../../../../cc/tags-list-dropdown/Constants";
|
|
4
|
+
import TagContractAdapter from "./TagContractAdapter";
|
|
5
|
+
|
|
6
|
+
function TagsListDropdownView(_ref, ref) {
|
|
7
|
+
let {
|
|
8
|
+
state,
|
|
9
|
+
helpers
|
|
10
|
+
} = _ref;
|
|
11
|
+
let {
|
|
12
|
+
dispatch
|
|
13
|
+
} = helpers;
|
|
14
|
+
let {
|
|
15
|
+
tags,
|
|
16
|
+
hasSearch,
|
|
17
|
+
searchPlaceholder,
|
|
18
|
+
text,
|
|
19
|
+
dropdownHeading,
|
|
20
|
+
emptyMessage
|
|
21
|
+
} = state.properties;
|
|
22
|
+
let tagsList = tags.map(TagContractAdapter);
|
|
23
|
+
return /*#__PURE__*/React.createElement(TagsListDropdown, {
|
|
24
|
+
getRef: ref,
|
|
25
|
+
listData: tagsList,
|
|
26
|
+
hasSearch: hasSearch,
|
|
27
|
+
searchPlaceholder: searchPlaceholder,
|
|
28
|
+
text: text,
|
|
29
|
+
dropdownHeading: dropdownHeading,
|
|
30
|
+
emptyMessage: emptyMessage,
|
|
31
|
+
onSearch: value => {
|
|
32
|
+
dispatch({
|
|
33
|
+
type: Constants.TAG_LIST_DROPDOWN_SEARCHED,
|
|
34
|
+
payload: {
|
|
35
|
+
value
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default TagsListDropdownView;
|
package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/css/TextAreaView.module.css
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
.rightPlaceholder {
|
|
6
6
|
position: absolute;
|
|
7
|
-
bottom:
|
|
7
|
+
bottom: var(--zd_size4) ;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
[dir=ltr] .rightPlaceholder {
|
|
11
|
-
right:
|
|
11
|
+
right: var(--zd_size12) ;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
[dir=rtl] .rightPlaceholder {
|
|
15
|
-
left:
|
|
15
|
+
left: var(--zd_size12) ;
|
|
16
16
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
.wrapper {
|
|
2
|
-
max-width: 100%
|
|
2
|
+
max-width: 100%
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.gap_small {
|
|
6
|
-
gap:
|
|
6
|
+
gap: var(--zd_size4)
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.gap_xmedium {
|
|
10
|
-
gap:
|
|
10
|
+
gap: var(--zd_size6)
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.gap_medium {
|
|
14
|
-
gap:
|
|
14
|
+
gap: var(--zd_size8)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.gap_large {
|
|
18
|
-
gap:
|
|
18
|
+
gap: var(--zd_size10)
|
|
19
19
|
}
|
|
@@ -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,6 +23,9 @@ 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";
|
|
26
29
|
const {
|
|
27
30
|
TABLE_LIST_RESIZE_START_REQUESTED,
|
|
28
31
|
TABLE_LIST_RESIZE_MOVE_REQUESTED,
|
|
@@ -330,14 +333,20 @@ export default class EventHandlersFactory {
|
|
|
330
333
|
[RESIZE_FINISHED]: new ResizeFinishController().handle,
|
|
331
334
|
[TABLE_LIST_RESIZE_START_REQUESTED]: new ResizeStartController().handle,
|
|
332
335
|
[TABLE_LIST_RESIZE_MOVE_REQUESTED]: new ResizeByMouseController().handle,
|
|
333
|
-
[
|
|
336
|
+
[SMART_TABLE_SORT_BY_REQUESTED]: _ref => {
|
|
334
337
|
let {
|
|
335
338
|
action,
|
|
336
339
|
dispatch
|
|
337
340
|
} = _ref;
|
|
338
341
|
return dispatch({
|
|
339
342
|
type: ZLIST_SORT,
|
|
340
|
-
payload:
|
|
343
|
+
payload: {
|
|
344
|
+
fieldName: action.payload.name,
|
|
345
|
+
order: {
|
|
346
|
+
[SortedBy.Ascending]: SortOrder.ASC,
|
|
347
|
+
[SortedBy.Descending]: SortOrder.DES
|
|
348
|
+
}[action.payload.order] || SortOrder.NONE
|
|
349
|
+
}
|
|
341
350
|
});
|
|
342
351
|
},
|
|
343
352
|
[TABLE_LIST_RESIZE_END_REQUESTED]: new ResizeEndController().handle,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
let getComponentMapping = {
|
|
2
|
+
name: 'getComponentMapping',
|
|
3
|
+
api: '/{{servicePrefix}}/{{orgName}}',
|
|
4
|
+
parameters: `{}`,
|
|
5
|
+
type: 'GET',
|
|
6
|
+
getResponse: async _ref => {
|
|
7
|
+
let {
|
|
8
|
+
params,
|
|
9
|
+
payload,
|
|
10
|
+
headers
|
|
11
|
+
} = _ref;
|
|
12
|
+
return {};
|
|
13
|
+
},
|
|
14
|
+
transformer: res => res,
|
|
15
|
+
properties: {}
|
|
16
|
+
};
|
|
17
|
+
export default getComponentMapping;
|
|
@@ -25,7 +25,8 @@ class FormRepository {
|
|
|
25
25
|
validationRules = [],
|
|
26
26
|
sections = [],
|
|
27
27
|
layoutRules = [],
|
|
28
|
-
dependencyMappings = []
|
|
28
|
+
dependencyMappings = [],
|
|
29
|
+
layoutId
|
|
29
30
|
} = zform;
|
|
30
31
|
let validationRuleEntities = validationRules.map(rule => {
|
|
31
32
|
return new ZValidationRule(rule);
|
|
@@ -59,6 +60,7 @@ class FormRepository {
|
|
|
59
60
|
dependencyMappings: dependencyMappingsEntities,
|
|
60
61
|
layoutRules: layoutRulesEntities,
|
|
61
62
|
context,
|
|
63
|
+
layoutId: layoutId,
|
|
62
64
|
isMyFormFetching: zform.isMyFormFetching,
|
|
63
65
|
isDependencyFetching: zform.isDependencyFetching,
|
|
64
66
|
isLayoutRulesFetching: zform.isLayoutRulesFetching,
|
|
@@ -5,20 +5,21 @@ const LookUpFieldTranslator = _ref => {
|
|
|
5
5
|
fieldPreModified,
|
|
6
6
|
uiConfig
|
|
7
7
|
} = _ref;
|
|
8
|
-
const fieldModified = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
name: field.
|
|
14
|
-
...fieldPreModified,
|
|
8
|
+
const fieldModified = { ...fieldPreModified,
|
|
9
|
+
uiConfig: uiConfig,
|
|
10
|
+
type: type,
|
|
11
|
+
fieldType: field.type,
|
|
12
|
+
value: field.value,
|
|
13
|
+
name: field.name,
|
|
15
14
|
id: field.id,
|
|
16
15
|
label: field.i18NLabel,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// visibility: field.isVisible,
|
|
16
|
+
apiName: field.apiName,
|
|
17
|
+
errorMessage: field.errorMessage,
|
|
20
18
|
isVisible: field.isVisible,
|
|
21
|
-
|
|
19
|
+
readonly: field.isReadOnly,
|
|
20
|
+
required: field.isMandatory,
|
|
21
|
+
isCustomField: field.isCustomField,
|
|
22
|
+
maxLength: field.maxLength,
|
|
22
23
|
lookup: field.lookup
|
|
23
24
|
};
|
|
24
25
|
return fieldModified;
|
|
@@ -21,8 +21,9 @@ class MyFormSuccessUseCase extends AbstractUseCase {
|
|
|
21
21
|
sections
|
|
22
22
|
} = myForm;
|
|
23
23
|
const zFormEntity = repository.getFormEntity();
|
|
24
|
+
const layoutId = zFormEntity.getLayoutId();
|
|
24
25
|
const context = { ...zFormEntity.getContext(),
|
|
25
|
-
layoutId:
|
|
26
|
+
layoutId: layoutId
|
|
26
27
|
};
|
|
27
28
|
const lookupFields = sections.flatMap(section => section.fields.filter(field => field.type === 'LookUp'));
|
|
28
29
|
const sectionEntities = sections.map(section => {
|
|
@@ -63,24 +64,22 @@ class MyFormSuccessUseCase extends AbstractUseCase {
|
|
|
63
64
|
type: DATA_SOURCE_EXECUTE,
|
|
64
65
|
payload: {
|
|
65
66
|
actionName: 'fetchLookupFields',
|
|
66
|
-
props:
|
|
67
|
-
}
|
|
67
|
+
props: context
|
|
68
68
|
},
|
|
69
69
|
metaData: {
|
|
70
70
|
actionName: 'fetchLookupFields',
|
|
71
|
-
//hack
|
|
72
71
|
[DATA_SOURCE_NO_CONTENT]: {
|
|
73
72
|
type: ZFORM_LOOKUP_FIELD_SUCCESS,
|
|
74
73
|
metaData: {
|
|
75
74
|
actionName: 'fetchLookupFields'
|
|
76
75
|
}
|
|
77
76
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
[DATA_SOURCE_FAILURE]: {
|
|
78
|
+
type: ZFORM_API_FAILURE,
|
|
79
|
+
metaData: {
|
|
80
|
+
actionName: 'fetchLookupFields'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
84
83
|
[DATA_SOURCE_SUCCESS]: {
|
|
85
84
|
type: ZFORM_LOOKUP_FIELD_SUCCESS,
|
|
86
85
|
metaData: {
|
|
@@ -21,6 +21,7 @@ export default class ZForm {
|
|
|
21
21
|
dependencyMappings,
|
|
22
22
|
context,
|
|
23
23
|
focusedFieldName,
|
|
24
|
+
layoutId,
|
|
24
25
|
|
|
25
26
|
/*hack*/
|
|
26
27
|
isMyFormFetching,
|
|
@@ -45,6 +46,7 @@ export default class ZForm {
|
|
|
45
46
|
this.dependencyMappings = dependencyMappings;
|
|
46
47
|
this.context = context;
|
|
47
48
|
this.focusedFieldName = focusedFieldName || null;
|
|
49
|
+
this.layoutId = layoutId;
|
|
48
50
|
/*hack*/
|
|
49
51
|
|
|
50
52
|
this.isMyFormFetching = isMyFormFetching;
|
|
@@ -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;
|
|
@@ -11,10 +11,10 @@ class SortController extends AbstractController {
|
|
|
11
11
|
action,
|
|
12
12
|
dispatch
|
|
13
13
|
} = event;
|
|
14
|
-
const
|
|
14
|
+
const sortConfig = action.payload;
|
|
15
15
|
sortUseCase.updateDependency(state, updateState);
|
|
16
16
|
sortUseCase.execute({
|
|
17
|
-
|
|
17
|
+
sortConfig,
|
|
18
18
|
dispatch
|
|
19
19
|
});
|
|
20
20
|
}
|