@zohodesk/library-platform 1.1.13 → 1.2.0
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/.DS_Store +0 -0
- package/es/bc/column-chooser/EventHandlers.js +1 -2
- package/es/bc/zform/Properties.js +20 -0
- package/es/bc/zform/Symbol.js +3 -0
- package/es/bc/zrecord/Constants.js +2 -0
- package/es/cc/action-band/Properties.js +37 -0
- package/es/cc/action-band/constants/ExternalConstants.js +3 -1
- package/es/cc/component/LifeCycleEventsEnum.js +1 -0
- package/es/cc/fields/currency/Properties.js +9 -0
- package/es/cc/fields/decimal/Properties.js +9 -0
- package/es/cc/fields/email/Properties.js +9 -0
- package/es/cc/fields/lookup/Properties.js +10 -26
- package/es/cc/fields/multi-line/Properties.js +1 -0
- package/es/cc/fields/number/Properties.js +10 -1
- package/es/cc/fields/phone/Properties.js +9 -0
- package/es/cc/fields/text/Properties.js +2 -2
- package/es/cc/fields/url/Properties.js +9 -0
- package/es/cc/table-column-chooser/Constants.js +2 -1
- package/es/cc/table-connected/SdkContract.js +22 -0
- package/es/cc/text/Properties.js +100 -0
- package/es/cc/textbox/Properties.js +1 -1
- package/es/index.js +1 -0
- package/es/library/behaviours/clip-wrap/applications/usecases/ClipWrapUpdateUseCase.js +19 -0
- package/es/library/behaviours/search/adapters/controllers/UpdatePropertiesController.js +9 -4
- package/es/library/custom-component/adapters/gateways/event-manager/EventManager.js +4 -3
- package/es/library/custom-component/applications/usecases/DispatchUseCase.js +1 -0
- package/es/library/custom-component/applications/usecases/InitializeUseCase.js +1 -0
- package/es/library/custom-component/applications/usecases/MountUseCase.js +1 -0
- package/es/library/custom-component/applications/usecases/SetRefUseCase.js +7 -0
- package/es/library/custom-component/applications/usecases/UnmountUseCase.js +1 -0
- package/es/library/custom-component/applications/usecases/UpdatePropertyUseCase.js +1 -0
- package/es/library/custom-component/domain/entities/Component.js +1 -0
- package/es/library/custom-component/domain/entities/Logger.js +4 -9
- package/es/library/dot/components/form-fields/currency/frameworks/ui/CurrencyView.js +2 -0
- package/es/library/dot/components/form-fields/decimal/frameworks/ui/DecimalView.js +2 -0
- package/es/library/dot/components/form-fields/email/frameworks/ui/Email.js +1 -1
- package/es/library/dot/components/form-fields/email/frameworks/ui/EmailView.js +2 -0
- package/es/library/dot/components/form-fields/number/frameworks/ui/NumberView.js +2 -0
- package/es/library/dot/components/form-fields/phone/frameworks/ui/PhoneView.js +2 -0
- package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextArea.js +1 -1
- package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextAreaView.js +4 -2
- package/es/library/dot/components/form-fields/textbox/frameworks/ui/TextBoxView.js +2 -0
- package/es/library/dot/components/form-fields/url/frameworks/ui/UrlView.js +2 -0
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +1 -1
- 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/text/frameworks/ui/Text.js +2 -2
- package/es/library/dot/legacy-to-new-arch/text/frameworks/ui/TextView.js +22 -1
- package/es/platform/.DS_Store +0 -0
- package/es/platform/app-context-behaviour/adapters/controllers/AbstractController.js +9 -0
- package/es/platform/app-context-behaviour/adapters/controllers/UpdatePropertiesController.js +32 -0
- package/es/platform/app-context-behaviour/adapters/gateway/Repository.js +22 -0
- package/es/platform/app-context-behaviour/adapters/gateway/Service.js +10 -0
- package/es/platform/app-context-behaviour/adapters/presenter/Presenter.js +16 -0
- package/es/platform/app-context-behaviour/applications/interfaces/UseCaseDependencies.js +1 -0
- package/es/platform/app-context-behaviour/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/platform/app-context-behaviour/applications/interfaces/gateways/IService.js +1 -0
- package/es/platform/app-context-behaviour/applications/interfaces/input/UpdatePropertiesInputModel.js +1 -0
- package/es/platform/app-context-behaviour/applications/interfaces/output/BehaviourOutputModel.js +1 -0
- package/es/platform/app-context-behaviour/applications/interfaces/output/IPresenter.js +1 -0
- package/es/platform/app-context-behaviour/applications/usecases/AbstractUseCase.js +17 -0
- package/es/platform/app-context-behaviour/applications/usecases/UpdatePropertiesUsecase.js +25 -0
- package/es/platform/app-context-behaviour/domain/entities/AppContext.js +44 -0
- package/es/platform/app-context-behaviour/domain/entities/interfaces/IAppContext.js +1 -0
- package/es/platform/app-context-behaviour/frameworks/AppContextBehaviourFactory.js +2 -2
- package/es/platform/app-context-behaviour/frameworks/EventHandlerFactory.js +22 -0
- package/es/platform/column-chooser/adapters/controllers/ColumnChooserOpenController.js +14 -6
- package/es/platform/column-chooser/adapters/controllers/ColumnChooserUpdateController.js +22 -0
- package/es/platform/column-chooser/adapters/gateways/Repository.js +12 -1
- package/es/platform/column-chooser/adapters/gateways/Service.js +2 -0
- package/es/platform/column-chooser/applications/interfaces/input/ColumnChooserUpdateInput.js +1 -0
- package/es/platform/column-chooser/applications/usecases/ColumnChooserSaveUseCase.js +8 -1
- package/es/platform/column-chooser/applications/usecases/ColumnChooserUpdateUseCase.js +35 -0
- package/es/platform/column-chooser/domain/entities/ColumnChooserImp.js +6 -0
- package/es/platform/column-chooser/frameworks/EventHandlersFactory.js +6 -4
- package/es/platform/components/smart-action-band/adapters/presenters/ActionBandTranslator.js +64 -5
- package/es/platform/components/smart-action-band/adapters/presenters/utils/DefaultClientActions.js +32 -0
- package/es/platform/components/smart-action-band/frameworks/EventHandlersFactory.js +42 -1
- package/es/platform/components/smart-action-band/frameworks/SmartActionBandFactory.js +4 -1
- package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +52 -0
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +1 -7
- package/es/platform/components/table-connected/frameworks/ListSdkFactory.js +4 -2
- package/es/platform/data-source/http-template/fetchLookupFields.js +0 -6
- package/es/platform/data-source/http-template/getSingleRecord.js +51 -0
- package/es/platform/data-source/index.js +2 -0
- package/es/platform/data-source/utils/validation-rules/FieldConditions.js +1 -1
- package/es/platform/sdk-behaviour/adapters/controllers/InitializeController.js +7 -2
- package/es/platform/sdk-behaviour/applications/usecases/CreateResourceInstanceUseCase.js +10 -1
- package/es/platform/zform/adapters/controllers/GetInitialRecordSuccessController.js +31 -0
- package/es/platform/zform/adapters/gateway/FormRepository.js +10 -2
- package/es/platform/zform/adapters/gateway/Service.js +2 -0
- package/es/platform/zform/adapters/presenter/FormTranslator.js +9 -0
- package/es/platform/zform/adapters/presenter/translators/fields/CurrencyFieldTranslator.js +1 -0
- package/es/platform/zform/adapters/presenter/translators/fields/DecimalFieldTranslator.js +1 -0
- package/es/platform/zform/adapters/presenter/translators/fields/EmailFieldTranslator.js +1 -0
- package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +11 -7
- package/es/platform/zform/adapters/presenter/translators/fields/NumberFieldTranslator.js +1 -0
- package/es/platform/zform/adapters/presenter/translators/fields/PhoneFieldTranslator.js +1 -0
- package/es/platform/zform/adapters/presenter/translators/fields/TextAreaFieldTranslator.js +1 -0
- package/es/platform/zform/adapters/presenter/translators/fields/TextFieldTranslator.js +1 -0
- package/es/platform/zform/adapters/presenter/translators/fields/URLFieldTranslator.js +1 -0
- package/es/platform/zform/adapters/presenter/utils/sanitizeHtmlString.js +2 -2
- package/es/platform/zform/applications/interfaces/input/GetInitialRecordSuccessUseCaseInputModel.js +1 -0
- package/es/platform/zform/applications/usecases/GetInitialRecordSuccessUseCase.js +132 -0
- package/es/platform/zform/applications/usecases/InitializeUseCase.js +54 -30
- package/es/platform/zform/applications/usecases/LookupFieldSuccessUseCase.js +5 -0
- package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +12 -11
- package/es/platform/zform/applications/usecases/SubmitValidationCompletedUseCase.js +21 -8
- package/es/platform/zform/domain/ZField.js +7 -5
- package/es/platform/zform/domain/ZForm.js +97 -20
- package/es/platform/zform/frameworks/ui/EventHandlerFactory.js +23 -5
- package/es/platform/zform/frameworks/ui/ZFormBehaviourFactory.js +2 -0
- package/es/platform/zrecord/adapters/controllers/UpdateRecordController.js +30 -0
- package/es/platform/zrecord/adapters/gateways/Service.js +2 -0
- package/es/platform/zrecord/applications/interfaces/input/UpdateRecordInputModel.js +0 -0
- package/es/platform/zrecord/applications/usecases/UpdateRecordUseCase.js +30 -0
- package/es/platform/zrecord/frameworks/ActionsHandlersFactory.js +4 -1
- package/package.json +8 -11
- package/es/platform/components/table-connected/adapters/controllers/ColumnChooserOpenedController.js +0 -28
- package/es/platform/components/table-connected/adapters/controllers/ColumnChooserUpdateController.js +0 -31
|
@@ -13,6 +13,7 @@ function DecimalView(_ref, ref) {
|
|
|
13
13
|
label,
|
|
14
14
|
value,
|
|
15
15
|
placeholder,
|
|
16
|
+
maxLength,
|
|
16
17
|
errorMessage,
|
|
17
18
|
disabled,
|
|
18
19
|
readonly,
|
|
@@ -42,6 +43,7 @@ function DecimalView(_ref, ref) {
|
|
|
42
43
|
id: id,
|
|
43
44
|
placeholder: placeholder,
|
|
44
45
|
value: value,
|
|
46
|
+
maxLength: maxLength,
|
|
45
47
|
required: required,
|
|
46
48
|
disabled: disabled,
|
|
47
49
|
readonly: readonly,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
-
import EmailProperties from "../../../../../../../cc/fields/
|
|
2
|
+
import EmailProperties from "../../../../../../../cc/fields/email/Properties";
|
|
3
3
|
import EmailView from "./EmailView";
|
|
4
4
|
import EventHandlersFactory from "./EventHandlerFactory";
|
|
5
5
|
import FocusFieldBehaviourFactory from "../../../../../../behaviours/field-focus/frameworks/ui/FocusFieldBehaviourFactory";
|
|
@@ -13,6 +13,7 @@ function EmailView(_ref, ref) {
|
|
|
13
13
|
label,
|
|
14
14
|
value,
|
|
15
15
|
placeholder,
|
|
16
|
+
maxLength,
|
|
16
17
|
disabled,
|
|
17
18
|
readonly,
|
|
18
19
|
errorMessage,
|
|
@@ -42,6 +43,7 @@ function EmailView(_ref, ref) {
|
|
|
42
43
|
id: id,
|
|
43
44
|
placeholder: placeholder,
|
|
44
45
|
value: value,
|
|
46
|
+
maxLength: maxLength,
|
|
45
47
|
disabled: disabled,
|
|
46
48
|
readonly: readonly,
|
|
47
49
|
required: required,
|
|
@@ -13,6 +13,7 @@ function NumberView(_ref, ref) {
|
|
|
13
13
|
label,
|
|
14
14
|
value,
|
|
15
15
|
placeholder,
|
|
16
|
+
maxLength,
|
|
16
17
|
errorMessage,
|
|
17
18
|
disabled,
|
|
18
19
|
readonly,
|
|
@@ -42,6 +43,7 @@ function NumberView(_ref, ref) {
|
|
|
42
43
|
id: id,
|
|
43
44
|
placeholder: placeholder,
|
|
44
45
|
value: value,
|
|
46
|
+
maxLength: maxLength,
|
|
45
47
|
disabled: disabled,
|
|
46
48
|
readonly: readonly,
|
|
47
49
|
required: required,
|
|
@@ -13,6 +13,7 @@ function PhoneView(_ref, ref) {
|
|
|
13
13
|
label,
|
|
14
14
|
value,
|
|
15
15
|
placeholder,
|
|
16
|
+
maxLength,
|
|
16
17
|
errorMessage,
|
|
17
18
|
disabled,
|
|
18
19
|
readonly,
|
|
@@ -42,6 +43,7 @@ function PhoneView(_ref, ref) {
|
|
|
42
43
|
id: id,
|
|
43
44
|
placeholder: placeholder,
|
|
44
45
|
value: value,
|
|
46
|
+
maxLength: maxLength,
|
|
45
47
|
disabled: disabled,
|
|
46
48
|
readonly: readonly,
|
|
47
49
|
required: required,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
-
import TextAreaProperties from "../../../../../../../cc/fields/
|
|
2
|
+
import TextAreaProperties from "../../../../../../../cc/fields/multi-line/Properties";
|
|
3
3
|
import TextAreaView from "./TextAreaView";
|
|
4
4
|
import EventHandlerFactory from "./EventHandlerFactory";
|
|
5
5
|
import FocusFieldBehaviourFactory from "../../../../../../behaviours/field-focus/frameworks/ui/FocusFieldBehaviourFactory";
|
|
@@ -20,7 +20,8 @@ function TextAreaView(_ref, ref) {
|
|
|
20
20
|
uiConfig,
|
|
21
21
|
labelActions,
|
|
22
22
|
actions,
|
|
23
|
-
clientScripts
|
|
23
|
+
clientScripts,
|
|
24
|
+
maxLength
|
|
24
25
|
} = state.properties;
|
|
25
26
|
const {
|
|
26
27
|
size,
|
|
@@ -46,7 +47,8 @@ function TextAreaView(_ref, ref) {
|
|
|
46
47
|
disabled: disabled,
|
|
47
48
|
readonly: readonly,
|
|
48
49
|
actions: actions,
|
|
49
|
-
clientScripts: clientScripts
|
|
50
|
+
clientScripts: clientScripts,
|
|
51
|
+
maxLength: maxLength
|
|
50
52
|
})));
|
|
51
53
|
}
|
|
52
54
|
|
|
@@ -13,6 +13,7 @@ function TextBoxView(_ref, ref) {
|
|
|
13
13
|
label,
|
|
14
14
|
value,
|
|
15
15
|
placeholder,
|
|
16
|
+
maxLength,
|
|
16
17
|
errorMessage,
|
|
17
18
|
disabled,
|
|
18
19
|
readonly,
|
|
@@ -42,6 +43,7 @@ function TextBoxView(_ref, ref) {
|
|
|
42
43
|
id: id,
|
|
43
44
|
placeholder: placeholder,
|
|
44
45
|
value: value,
|
|
46
|
+
maxLength: maxLength,
|
|
45
47
|
required: required,
|
|
46
48
|
disabled: disabled,
|
|
47
49
|
readonly: readonly,
|
|
@@ -13,6 +13,7 @@ function UrlView(_ref, ref) {
|
|
|
13
13
|
label,
|
|
14
14
|
value,
|
|
15
15
|
placeholder,
|
|
16
|
+
maxLength,
|
|
16
17
|
uiConfig,
|
|
17
18
|
errorMessage,
|
|
18
19
|
disabled,
|
|
@@ -42,6 +43,7 @@ function UrlView(_ref, ref) {
|
|
|
42
43
|
id: id,
|
|
43
44
|
placeholder: placeholder,
|
|
44
45
|
value: value,
|
|
46
|
+
maxLength: maxLength,
|
|
45
47
|
disabled: disabled,
|
|
46
48
|
readonly: readonly,
|
|
47
49
|
required: required,
|
package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js
CHANGED
|
@@ -41,7 +41,7 @@ function HeaderData(_ref) {
|
|
|
41
41
|
},
|
|
42
42
|
$customProps_container: hasActions ? {
|
|
43
43
|
$ui_displayMode: 'flex',
|
|
44
|
-
$ui_alignItems: 'center',
|
|
44
|
+
$ui_alignItems: isMultiline ? 'baseline' : 'center',
|
|
45
45
|
$ui_justifyContent: AlignmentOfFlex[alignment]
|
|
46
46
|
} : null,
|
|
47
47
|
customStyle: hasActions ? {
|
|
@@ -6,6 +6,16 @@ export default function TextFieldView(_ref, ref) {
|
|
|
6
6
|
} = _ref;
|
|
7
7
|
const {
|
|
8
8
|
text,
|
|
9
|
+
size,
|
|
10
|
+
display,
|
|
11
|
+
decoration,
|
|
12
|
+
textAlign,
|
|
13
|
+
lineClamp,
|
|
14
|
+
lineHeight,
|
|
15
|
+
transform,
|
|
16
|
+
whiteSpace,
|
|
17
|
+
wordWrap,
|
|
18
|
+
wordBreak,
|
|
9
19
|
weight,
|
|
10
20
|
isDotted,
|
|
11
21
|
tooltip
|
|
@@ -13,6 +23,16 @@ export default function TextFieldView(_ref, ref) {
|
|
|
13
23
|
return /*#__PURE__*/React.createElement(Text, {
|
|
14
24
|
getRef: ref,
|
|
15
25
|
text: text,
|
|
26
|
+
size: size,
|
|
27
|
+
display: display,
|
|
28
|
+
decoration: decoration,
|
|
29
|
+
textAlign: textAlign,
|
|
30
|
+
lineClamp: lineClamp,
|
|
31
|
+
lineHeight: lineHeight,
|
|
32
|
+
transform: transform,
|
|
33
|
+
whiteSpace: whiteSpace,
|
|
34
|
+
wordWrap: wordWrap,
|
|
35
|
+
wordBreak: isDotted ? wordBreak : 'breakWord',
|
|
16
36
|
tooltip: tooltip,
|
|
17
37
|
weight: weight,
|
|
18
38
|
isDotted: isDotted
|
|
@@ -12,7 +12,18 @@ function TextView(_ref, ref) {
|
|
|
12
12
|
} = helpers;
|
|
13
13
|
let {
|
|
14
14
|
text,
|
|
15
|
+
size,
|
|
16
|
+
display,
|
|
17
|
+
decoration,
|
|
18
|
+
textAlign,
|
|
19
|
+
lineClamp,
|
|
20
|
+
lineHeight,
|
|
21
|
+
letterSpacing,
|
|
22
|
+
transform,
|
|
23
|
+
whiteSpace,
|
|
24
|
+
wordWrap,
|
|
15
25
|
weight,
|
|
26
|
+
wordBreak,
|
|
16
27
|
tooltip,
|
|
17
28
|
isDotted
|
|
18
29
|
} = state.properties;
|
|
@@ -27,9 +38,19 @@ function TextView(_ref, ref) {
|
|
|
27
38
|
});
|
|
28
39
|
}
|
|
29
40
|
},
|
|
30
|
-
$ui_size:
|
|
41
|
+
$ui_size: size,
|
|
31
42
|
$flag_dotted: isDotted,
|
|
43
|
+
$ui_display: display,
|
|
44
|
+
$ui_decoration: decoration,
|
|
32
45
|
$ui_weight: weight,
|
|
46
|
+
$ui_textAlign: textAlign,
|
|
47
|
+
$ui_wordBreak: wordBreak,
|
|
48
|
+
$ui_lineClamp: lineClamp,
|
|
49
|
+
$ui_letterSpacing: letterSpacing,
|
|
50
|
+
$ui_lineHeight: lineHeight,
|
|
51
|
+
$ui_transform: transform,
|
|
52
|
+
$ui_whiteSpace: whiteSpace,
|
|
53
|
+
$ui_wordWrap: wordWrap,
|
|
33
54
|
$i18n_dataTitle: tooltip || text
|
|
34
55
|
}, text);
|
|
35
56
|
}
|
|
Binary file
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
|
|
3
|
+
class UpdatePropertiesController extends AbstractController {
|
|
4
|
+
handle(event) {
|
|
5
|
+
const {
|
|
6
|
+
updatePropertiesUsecase
|
|
7
|
+
} = this.service;
|
|
8
|
+
const {
|
|
9
|
+
state,
|
|
10
|
+
updateState,
|
|
11
|
+
action
|
|
12
|
+
} = event;
|
|
13
|
+
const {
|
|
14
|
+
currentProperties,
|
|
15
|
+
previousProperties
|
|
16
|
+
} = action.payload;
|
|
17
|
+
const {
|
|
18
|
+
context
|
|
19
|
+
} = previousProperties;
|
|
20
|
+
const {
|
|
21
|
+
context: newContext
|
|
22
|
+
} = currentProperties;
|
|
23
|
+
updatePropertiesUsecase.updateDependencies(state, updateState);
|
|
24
|
+
updatePropertiesUsecase.execute({
|
|
25
|
+
context,
|
|
26
|
+
newContext
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default UpdatePropertiesController;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { platformSDK } from "../../../sdk/frameworks/Sdk";
|
|
2
|
+
import ResourceNamesEnum from "../../../../bc/sdk/ResourceNamesEnum";
|
|
3
|
+
import AppContext from "../../domain/entities/AppContext";
|
|
4
|
+
const EMPTY_OBJ = {};
|
|
5
|
+
export default class Repository {
|
|
6
|
+
init(state) {
|
|
7
|
+
this.state = state;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
getAppContextEntity() {
|
|
11
|
+
const {
|
|
12
|
+
context
|
|
13
|
+
} = this.state.properties;
|
|
14
|
+
const appResource = platformSDK[ResourceNamesEnum.APP];
|
|
15
|
+
const headers = appResource ? appResource.getApiHeader() : EMPTY_OBJ;
|
|
16
|
+
const appContext = appResource ? appResource.getContext() : EMPTY_OBJ;
|
|
17
|
+
return new AppContext({ ...appContext,
|
|
18
|
+
...context
|
|
19
|
+
}, headers);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default class Presenter {
|
|
2
|
+
updateDependencies(state, updateState) {
|
|
3
|
+
this.state = state;
|
|
4
|
+
this.updateState = updateState;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
updateBehaviourState(data) {
|
|
8
|
+
this.state = { ...this.state,
|
|
9
|
+
behaviours: { ...this.state.behaviours,
|
|
10
|
+
appContext: data
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
this.updateState(this.state);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/platform/app-context-behaviour/applications/interfaces/output/BehaviourOutputModel.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class AbstractUseCase {
|
|
2
|
+
constructor(dependencies) {
|
|
3
|
+
this.dependencies = dependencies;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
updateDependencies(state, updateState) {
|
|
7
|
+
const {
|
|
8
|
+
repository,
|
|
9
|
+
presenter
|
|
10
|
+
} = this.dependencies;
|
|
11
|
+
repository.init(state);
|
|
12
|
+
presenter.updateDependencies(state, updateState);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default AbstractUseCase;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
|
|
3
|
+
class UpdatePropertiesUsecase extends AbstractUseCase {
|
|
4
|
+
execute(input) {
|
|
5
|
+
const {
|
|
6
|
+
repository,
|
|
7
|
+
presenter
|
|
8
|
+
} = this.dependencies;
|
|
9
|
+
const {
|
|
10
|
+
context,
|
|
11
|
+
newContext
|
|
12
|
+
} = input;
|
|
13
|
+
const appContext = repository.getAppContextEntity();
|
|
14
|
+
|
|
15
|
+
if (appContext.isEqualContext(context, newContext)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
appContext.updateContext(newContext);
|
|
20
|
+
presenter.updateBehaviourState(appContext.toObject());
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default UpdatePropertiesUsecase;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
class AppContext {
|
|
2
|
+
constructor(context, headers) {
|
|
3
|
+
this.context = context;
|
|
4
|
+
this.headers = headers;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
updateContext(context) {
|
|
8
|
+
this.context = { ...this.context,
|
|
9
|
+
...context
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
getContext() {
|
|
14
|
+
return this.context;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
isEqualContext(context1, context2) {
|
|
18
|
+
// shallow comparison
|
|
19
|
+
const keys1 = Object.keys(context1);
|
|
20
|
+
const keys2 = Object.keys(context2);
|
|
21
|
+
|
|
22
|
+
if (keys1.length !== keys2.length) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
for (const key of keys1) {
|
|
27
|
+
if (context1[key] !== context2[key]) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
toObject() {
|
|
36
|
+
return {
|
|
37
|
+
context: this.context,
|
|
38
|
+
headers: this.headers
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default AppContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import AppContextProperties from "../../../bc/app-context/Properties";
|
|
2
2
|
import { platformSDK } from "../../sdk/frameworks/Sdk";
|
|
3
3
|
import ResourceNamesEnum from "../../../bc/sdk/ResourceNamesEnum";
|
|
4
|
+
import EventHandlersFactory from "./EventHandlerFactory";
|
|
4
5
|
|
|
5
6
|
class AppContextBehaviourFactory {
|
|
6
7
|
static create() {
|
|
@@ -20,8 +21,7 @@ class AppContextBehaviourFactory {
|
|
|
20
21
|
}
|
|
21
22
|
};
|
|
22
23
|
},
|
|
23
|
-
|
|
24
|
-
eventHandlers: {},
|
|
24
|
+
eventHandlers: EventHandlersFactory.create(),
|
|
25
25
|
properties: AppContextProperties
|
|
26
26
|
};
|
|
27
27
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import LifeCycleAction from "../../../cc/architecture/LifeCycleActionEnum";
|
|
2
|
+
import Repository from "../adapters/gateway/Repository";
|
|
3
|
+
import Service from "../adapters/gateway/Service";
|
|
4
|
+
import Presenter from "../adapters/presenter/Presenter";
|
|
5
|
+
import UpdatePropertiesController from "../adapters/controllers/UpdatePropertiesController";
|
|
6
|
+
|
|
7
|
+
class EventHandlersFactory {
|
|
8
|
+
static create() {
|
|
9
|
+
const presenter = new Presenter();
|
|
10
|
+
const repository = new Repository();
|
|
11
|
+
const service = new Service({
|
|
12
|
+
presenter,
|
|
13
|
+
repository
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
[LifeCycleAction.UPDATE_PROPERTIES]: new UpdatePropertiesController(service).handle
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default EventHandlersFactory;
|
|
@@ -4,20 +4,28 @@ class ColumnChooserOpenController extends AbstractController {
|
|
|
4
4
|
handle(event) {
|
|
5
5
|
const {
|
|
6
6
|
state,
|
|
7
|
-
action,
|
|
8
7
|
updateState
|
|
9
8
|
} = event;
|
|
10
9
|
const {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
zfield
|
|
11
|
+
} = state.behaviours;
|
|
12
|
+
const {
|
|
13
|
+
fields: availableFields,
|
|
14
|
+
selectedFields
|
|
15
|
+
} = zfield;
|
|
16
|
+
const columnChooserOptionsOrder = [...selectedFields];
|
|
17
|
+
availableFields.forEach(field => {
|
|
18
|
+
if (!selectedFields.includes(field.name)) {
|
|
19
|
+
columnChooserOptionsOrder.push(field.name);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
14
22
|
const {
|
|
15
23
|
columnChooserOpenUseCase
|
|
16
24
|
} = this.service;
|
|
17
25
|
columnChooserOpenUseCase.updateDependencies(state, updateState);
|
|
18
26
|
columnChooserOpenUseCase.execute({
|
|
19
|
-
order,
|
|
20
|
-
selectedArray
|
|
27
|
+
order: columnChooserOptionsOrder,
|
|
28
|
+
selectedArray: selectedFields
|
|
21
29
|
});
|
|
22
30
|
}
|
|
23
31
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
export default class ColumnChooserUpdateController extends AbstractController {
|
|
3
|
+
handle(event) {
|
|
4
|
+
const {
|
|
5
|
+
state,
|
|
6
|
+
dispatch,
|
|
7
|
+
action
|
|
8
|
+
} = event;
|
|
9
|
+
const {
|
|
10
|
+
selectedArray
|
|
11
|
+
} = action.payload;
|
|
12
|
+
const {
|
|
13
|
+
columnChooserUpdateUseCase
|
|
14
|
+
} = this.service;
|
|
15
|
+
columnChooserUpdateUseCase.updateDependencies(state, dispatch);
|
|
16
|
+
columnChooserUpdateUseCase.execute({
|
|
17
|
+
selectedArray,
|
|
18
|
+
dispatch
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|
|
@@ -13,10 +13,21 @@ class Repository {
|
|
|
13
13
|
const {
|
|
14
14
|
columnChooser
|
|
15
15
|
} = this.state.behaviours;
|
|
16
|
+
const {
|
|
17
|
+
context
|
|
18
|
+
} = this.state.behaviours.appContext;
|
|
19
|
+
const {
|
|
20
|
+
viewId,
|
|
21
|
+
departmentId
|
|
22
|
+
} = this.state.properties;
|
|
16
23
|
const reorderEntity = new ReorderEntityImp(columnChooser.order);
|
|
17
24
|
const searchEntity = this.createSearchEntity();
|
|
18
25
|
const selectEntity = new SelectEntityImp(columnChooser.selected, DEFAULT_COLUMN_CHOOSE_MAX_COUNT);
|
|
19
|
-
return new ColumnChooserImp(columnChooser.isSaved, reorderEntity, searchEntity, selectEntity
|
|
26
|
+
return new ColumnChooserImp(columnChooser.isSaved, reorderEntity, searchEntity, selectEntity, {
|
|
27
|
+
context,
|
|
28
|
+
viewId,
|
|
29
|
+
departmentId
|
|
30
|
+
});
|
|
20
31
|
}
|
|
21
32
|
|
|
22
33
|
createSearchEntity() {
|
|
@@ -4,6 +4,7 @@ import ColumnChooserReorderUseCase from "../../applications/usecases/ColumnChoos
|
|
|
4
4
|
import ColumnChooserSearchUseCase from "../../applications/usecases/ColumnChooserSearchUseCase";
|
|
5
5
|
import ColumnChooserSaveUseCase from "../../applications/usecases/ColumnChooserSaveUseCase";
|
|
6
6
|
import ColumnChooserCloseUseCase from "../../applications/usecases/ColumnChooserCloseUseCase";
|
|
7
|
+
import ColumnChooserUpdateUseCase from "../../applications/usecases/ColumnChooserUpdateUseCase";
|
|
7
8
|
|
|
8
9
|
class Service {
|
|
9
10
|
constructor(dependencies) {
|
|
@@ -13,6 +14,7 @@ class Service {
|
|
|
13
14
|
this.columnChooserSearchUseCase = new ColumnChooserSearchUseCase(dependencies);
|
|
14
15
|
this.columnChooserSaveUseCase = new ColumnChooserSaveUseCase(dependencies);
|
|
15
16
|
this.columnChooserCloseUseCase = new ColumnChooserCloseUseCase(dependencies);
|
|
17
|
+
this.columnChooserUpdateUseCase = new ColumnChooserUpdateUseCase(dependencies);
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { COLUMN_CHOOSER_SAVED } from "../../../../cc/table-column-chooser/Constants";
|
|
1
2
|
import AbstractUseCase from "./AbstractUseCase";
|
|
2
3
|
import { COLUMN_CHOOSER_BEHAVIOUR_UPDATED } from "../../../../bc/column-chooser/Constants";
|
|
3
4
|
|
|
@@ -16,6 +17,7 @@ class ColumnChooserSaveUseCase extends AbstractUseCase {
|
|
|
16
17
|
columnChooser.markAsSaved();
|
|
17
18
|
presenter.updateView(columnChooser.toObject()); // TODO: exposer.columnChooserUpdated({ fields });
|
|
18
19
|
|
|
20
|
+
presenter.updateView(columnChooser.toObject());
|
|
19
21
|
dispatch({
|
|
20
22
|
type: COLUMN_CHOOSER_BEHAVIOUR_UPDATED,
|
|
21
23
|
payload: {
|
|
@@ -23,7 +25,12 @@ class ColumnChooserSaveUseCase extends AbstractUseCase {
|
|
|
23
25
|
order
|
|
24
26
|
}
|
|
25
27
|
});
|
|
26
|
-
|
|
28
|
+
dispatch({
|
|
29
|
+
type: COLUMN_CHOOSER_SAVED,
|
|
30
|
+
payload: {
|
|
31
|
+
selectedArray
|
|
32
|
+
}
|
|
33
|
+
});
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FIELD_EXECUTE } from "../../../../bc/zfield/Constants";
|
|
2
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
3
|
+
|
|
4
|
+
class ColumnChooserUpdateUseCase extends AbstractUseCase {
|
|
5
|
+
execute(_ref) {
|
|
6
|
+
let {
|
|
7
|
+
selectedArray,
|
|
8
|
+
dispatch
|
|
9
|
+
} = _ref;
|
|
10
|
+
const {
|
|
11
|
+
repository
|
|
12
|
+
} = this.dependencies;
|
|
13
|
+
const columnChooser = repository.getColumnChooser();
|
|
14
|
+
const {
|
|
15
|
+
context,
|
|
16
|
+
viewId,
|
|
17
|
+
departmentId
|
|
18
|
+
} = columnChooser.getContexts();
|
|
19
|
+
dispatch({
|
|
20
|
+
type: FIELD_EXECUTE,
|
|
21
|
+
payload: {
|
|
22
|
+
actionName: 'updateSelectedFields',
|
|
23
|
+
props: { ...context,
|
|
24
|
+
fields: selectedArray,
|
|
25
|
+
viewId,
|
|
26
|
+
departmentId
|
|
27
|
+
},
|
|
28
|
+
apiName: 'updateSelectedFields'
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default ColumnChooserUpdateUseCase;
|
|
@@ -4,10 +4,16 @@ export default class ColumnChooserImp {
|
|
|
4
4
|
let reorderEntity = arguments.length > 1 ? arguments[1] : undefined;
|
|
5
5
|
let searchEntity = arguments.length > 2 ? arguments[2] : undefined;
|
|
6
6
|
let selectEntity = arguments.length > 3 ? arguments[3] : undefined;
|
|
7
|
+
let contexts = arguments.length > 4 ? arguments[4] : undefined;
|
|
7
8
|
this.isSaved = isSaved;
|
|
8
9
|
this.reorderEntity = reorderEntity;
|
|
9
10
|
this.searchEntity = searchEntity;
|
|
10
11
|
this.selectEntity = selectEntity;
|
|
12
|
+
this.contexts = contexts;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
getContexts() {
|
|
16
|
+
return this.contexts;
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
markAsSaved() {
|