@zohodesk/library-platform 1.1.13 → 1.2.0-exp.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/bc/column-chooser/EventHandlers.js +1 -2
- package/es/bc/sdk/ResourceNamesEnum.js +1 -0
- 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/Dispatch.js +1 -0
- package/es/cc/component/LifeCycleEventsEnum.js +1 -0
- package/es/cc/component/index.js +3 -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/one-unification/Constants.js +24 -0
- package/es/cc/one-unification/unified-navigation/ActionTypes.js +1 -0
- package/es/cc/one-unification/unified-navigation/CommonTypes.js +1 -0
- package/es/cc/one-unification/unified-navigation/ConfigTypes.js +1 -0
- package/es/cc/one-unification/unified-navigation/HandlerTypes.js +1 -0
- package/es/cc/one-unification/unified-navigation/Types.js +1 -0
- package/es/cc/one-unification/unified-navigation/UnifiedNavigation.d.js +0 -0
- package/es/cc/one-unification/unified-navigation/index.js +1 -0
- package/es/cc/smart-navigation/Constants.js +8 -0
- package/es/cc/smart-navigation/Events.js +107 -0
- package/es/cc/smart-navigation/Properties.js +87 -0
- package/es/cc/smart-navigation/index.js +4 -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 +8 -3
- package/es/library/behaviours/clip-wrap/applications/usecases/ClipWrapUpdateUseCase.js +19 -0
- package/es/library/behaviours/library-loader/adapters/controllers/LibraryLoaderController.js +17 -0
- package/es/library/behaviours/library-loader/adapters/gateways/LibraryLoaderAdapter.js +29 -0
- package/es/library/behaviours/library-loader/applications/usecases/LoadLibraryUseCase.js +42 -0
- package/es/library/behaviours/library-loader/domain/entities/interfaces/ILibraryLoader.js +1 -0
- package/es/library/behaviours/library-loader/frameworks/LibraryLoaderBehaviour.js +26 -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/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/client-actions/behaviour/zclient-actions/adapters/presenters/FilterUtils.js +11 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/resources/ClientActionsFetchSDK.js +76 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/ClientActionsAPIGatewayParams.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/ClientActionsFetchSDKParams.js +10 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/IClientActionsFetchSDK.js +0 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/resources/ClientScriptsFetchSDK.js +43 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/ClientScriptsAPIGatewayParams.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/ClientScriptsSDKFetchParams.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/IClientScriptsFetchSDK.js +0 -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/index.js +1 -0
- package/es/platform/components/smart-action-band/adapters/presenters/ActionBandTranslator.js +70 -8
- 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/smart-navigation/adapters/controllers/LoadScriptController.js +0 -0
- package/es/platform/components/smart-navigation/adapters/controllers/UiModelInitializeController.js +0 -0
- package/es/platform/components/smart-navigation/adapters/presenters/OneUnifiedNavigationTranslator.js +248 -0
- package/es/platform/components/smart-navigation/adapters/presenters/Present.js +77 -0
- package/es/platform/components/smart-navigation/adapters/presenters/SampleModel.js +356 -0
- package/es/platform/components/smart-navigation/adapters/resources/SmartNavigationResource.js +96 -0
- package/es/platform/components/smart-navigation/applications/usecases/NavigateModuleUseCase.js +0 -0
- package/es/platform/components/smart-navigation/frameworks/CustomElementRenderer.js +22 -0
- package/es/platform/components/smart-navigation/frameworks/SmartNavigation.js +12 -0
- package/es/platform/components/smart-navigation/frameworks/one-unification/OneUnificationEventHandlers.js +156 -0
- package/es/platform/components/smart-navigation/frameworks/one-unification/SmartNavigation.js +83 -0
- package/es/platform/components/smart-navigation/frameworks/one-unification/SmartNavigation.module.css +3 -0
- package/es/platform/components/smart-navigation/frameworks/one-unification/SmartNavigationEventHandlers.js +173 -0
- package/es/platform/components/smart-navigation/frameworks/one-unification/UnifiedNavigation.js +48 -0
- package/es/platform/components/smart-navigation/frameworks/one-unification/UnifiedNavigationActions.js +144 -0
- 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/getPageClientActions.js +23 -0
- 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 +27 -15
- package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +1 -1
- 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/zlist/adapters/presenters/TableTranslator.js +5 -4
- 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 +9 -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
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import Service from "../adapters/gateways/Service";
|
|
2
2
|
import Presenter from "../adapters/presenters/Presenter";
|
|
3
3
|
import Repository from "../adapters/gateways/Repository";
|
|
4
|
-
import {
|
|
5
|
-
import { COLUMN_CHOOSER_SELECT_REQUESTED, COLUMN_CHOOSER_REORDER_REQUESTED, COLUMN_CHOOSER_SEARCH_REQUESTED, COLUMN_CHOOSER_SAVE_REQUESTED, COLUMN_CHOOSER_CLOSE_REQUESTED } from "../../../cc/table-column-chooser/Constants";
|
|
4
|
+
import { COLUMN_CHOOSER_BEHAVIOUR_UPDATED } from "../../../bc/column-chooser/Constants";
|
|
5
|
+
import { COLUMN_CHOOSER_SELECT_REQUESTED, COLUMN_CHOOSER_REORDER_REQUESTED, COLUMN_CHOOSER_SEARCH_REQUESTED, COLUMN_CHOOSER_SAVE_REQUESTED, COLUMN_CHOOSER_CLOSE_REQUESTED, COLUMN_CHOOSER_OPEN_REQUESTED } from "../../../cc/table-column-chooser/Constants";
|
|
6
6
|
import ColumnChooserOpenController from "../adapters/controllers/ColumnChooserOpenController";
|
|
7
7
|
import ColumnChooserSelectController from "../adapters/controllers/ColumnChooserSelectController";
|
|
8
8
|
import ColumnChooserReorderController from "../adapters/controllers/ColumnChooserReorderController";
|
|
9
9
|
import ColumnChooserSaveController from "../adapters/controllers/ColumnChooserSaveController";
|
|
10
10
|
import ColumnChooserSearchController from "../adapters/controllers/ColumnChooserSearchController";
|
|
11
11
|
import ColumnChooserCloseController from "../adapters/controllers/ColumnChooserCloseController";
|
|
12
|
+
import ColumnChooserUpdateController from "../adapters/controllers/ColumnChooserUpdateController";
|
|
12
13
|
export default class EventHandlersFactory {
|
|
13
14
|
static create() {
|
|
14
15
|
const repository = new Repository();
|
|
@@ -18,12 +19,13 @@ export default class EventHandlersFactory {
|
|
|
18
19
|
presenter
|
|
19
20
|
});
|
|
20
21
|
return {
|
|
21
|
-
[
|
|
22
|
+
[COLUMN_CHOOSER_OPEN_REQUESTED]: new ColumnChooserOpenController(service).handle,
|
|
22
23
|
[COLUMN_CHOOSER_SELECT_REQUESTED]: new ColumnChooserSelectController(service).handle,
|
|
23
24
|
[COLUMN_CHOOSER_REORDER_REQUESTED]: new ColumnChooserReorderController(service).handle,
|
|
24
25
|
[COLUMN_CHOOSER_SEARCH_REQUESTED]: new ColumnChooserSearchController(service).handle,
|
|
25
26
|
[COLUMN_CHOOSER_SAVE_REQUESTED]: new ColumnChooserSaveController(service).handle,
|
|
26
|
-
[COLUMN_CHOOSER_CLOSE_REQUESTED]: new ColumnChooserCloseController(service).handle
|
|
27
|
+
[COLUMN_CHOOSER_CLOSE_REQUESTED]: new ColumnChooserCloseController(service).handle,
|
|
28
|
+
[COLUMN_CHOOSER_BEHAVIOUR_UPDATED]: new ColumnChooserUpdateController(service).handle
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default as TableConnectedFactory } from "./table-connected/frameworks/TableConnectedFactory";
|
|
2
2
|
export { default as FormConnectedFactory } from "./form-connected/frameworks/FormConnectedFactory";
|
|
3
|
+
export { SmartNavigation, createSmartNavigation } from "./smart-navigation/frameworks/one-unification/SmartNavigation";
|
|
3
4
|
export { default as SmartActionBandFactory } from "./smart-action-band/frameworks/SmartActionBandFactory";
|
package/es/platform/components/smart-action-band/adapters/presenters/ActionBandTranslator.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
|
|
2
2
|
import DefaultClientActions from "./utils/DefaultClientActions";
|
|
3
3
|
import { ActionBandLocations } from "../../../../../bc/action-band/Constants";
|
|
4
|
+
import { i18NProviderUtils } from '@zohodesk/i18n';
|
|
5
|
+
import { filterClientActionsByLocation } from "../../../../client-actions/behaviour/zclient-actions/adapters/presenters/FilterUtils";
|
|
4
6
|
export default class ActionBandTranslator {
|
|
5
7
|
static transformState(state) {
|
|
6
8
|
const {
|
|
@@ -8,13 +10,17 @@ export default class ActionBandTranslator {
|
|
|
8
10
|
moduleName,
|
|
9
11
|
reloadConfig,
|
|
10
12
|
searchConfig,
|
|
11
|
-
sortConfig
|
|
13
|
+
sortConfig,
|
|
14
|
+
columnChooserConfig,
|
|
15
|
+
textOverflowConfig
|
|
12
16
|
} = state.properties;
|
|
13
17
|
const {
|
|
14
18
|
zclientAction,
|
|
15
19
|
zclientScriptsEventMapping,
|
|
16
20
|
zfield,
|
|
17
|
-
sortBy
|
|
21
|
+
sortBy,
|
|
22
|
+
textOverflow,
|
|
23
|
+
columnChooser
|
|
18
24
|
} = state.behaviours;
|
|
19
25
|
const {
|
|
20
26
|
context
|
|
@@ -25,15 +31,26 @@ export default class ActionBandTranslator {
|
|
|
25
31
|
} = zclientAction || {};
|
|
26
32
|
let sorttableFields = zfield.fields.filter(field => field.isSortable === true);
|
|
27
33
|
const combinedClientActions = Array.isArray(clientActions) ? [...clientActions] : [];
|
|
34
|
+
const availableFields = zfield.fields;
|
|
35
|
+
const columnChooserProps = getColumnChooserProps(columnChooser, availableFields, context, moduleName, columnChooserConfig);
|
|
28
36
|
|
|
29
|
-
if (
|
|
30
|
-
combinedClientActions.push(DefaultClientActions.
|
|
37
|
+
if (columnChooserConfig?.isEnabled) {
|
|
38
|
+
combinedClientActions.push(DefaultClientActions.createColumnChooserAction({ ...columnChooserProps,
|
|
39
|
+
textOverflowConfig: {
|
|
40
|
+
isEnabled: textOverflowConfig.isEnabled,
|
|
41
|
+
mode: textOverflow.mode
|
|
42
|
+
}
|
|
43
|
+
}));
|
|
31
44
|
}
|
|
32
45
|
|
|
33
46
|
if (searchConfig?.isEnabled) {
|
|
34
47
|
combinedClientActions.push(DefaultClientActions.createSearchAction());
|
|
35
48
|
}
|
|
36
49
|
|
|
50
|
+
if (reloadConfig?.isEnabled) {
|
|
51
|
+
combinedClientActions.push(DefaultClientActions.createReloadAction());
|
|
52
|
+
}
|
|
53
|
+
|
|
37
54
|
if (sortConfig?.isEnabled) {
|
|
38
55
|
combinedClientActions.push(DefaultClientActions.createSortByAction(sortBy, sortConfig, sorttableFields));
|
|
39
56
|
}
|
|
@@ -67,7 +84,52 @@ export default class ActionBandTranslator {
|
|
|
67
84
|
|
|
68
85
|
}
|
|
69
86
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
87
|
+
function mapper(clientActions) {
|
|
88
|
+
return {
|
|
89
|
+
actionBandLeftActions: filterClientActionsByLocation(clientActions, ActionBandLocations.LEFT_ACTIONS),
|
|
90
|
+
actionBandRightActions: filterClientActionsByLocation(clientActions, ActionBandLocations.RIGHT_ACTIONS)
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function getColumnChooserProps(columnChooser) {
|
|
95
|
+
let availableFields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
96
|
+
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
97
|
+
let moduleName = arguments.length > 3 ? arguments[3] : undefined;
|
|
98
|
+
let columnChooserConfig = arguments.length > 4 ? arguments[4] : undefined;
|
|
99
|
+
const {
|
|
100
|
+
searchText: searchString,
|
|
101
|
+
fieldsOrder,
|
|
102
|
+
selected,
|
|
103
|
+
isMaxSelectionReached
|
|
104
|
+
} = columnChooser;
|
|
105
|
+
const fieldMap = mapFieldsToObject(availableFields);
|
|
106
|
+
const moduleConfig = context.modules?.find(module => module.apiKey === moduleName);
|
|
107
|
+
const disabledFieldName = moduleConfig?.nameField;
|
|
108
|
+
const restrictedFields = columnChooserConfig?.fieldRestrictionConfig || [];
|
|
109
|
+
const hasRestrictions = Array.isArray(restrictedFields) && restrictedFields.length > 0;
|
|
110
|
+
const columnChooserOptions = fieldsOrder.map(fieldName => getOption(fieldMap[fieldName], restrictedFields.includes(fieldName) || !!selected[fieldName], restrictedFields.includes(fieldName) || !hasRestrictions && disabledFieldName === fieldName));
|
|
111
|
+
return {
|
|
112
|
+
options: columnChooserOptions,
|
|
113
|
+
searchString,
|
|
114
|
+
hasSearch: searchString !== '' || columnChooserOptions.length > 3,
|
|
115
|
+
errorMessage: isMaxSelectionReached ? i18NProviderUtils.getI18NValue("support.ticket.table.max.colmun") : ''
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function getOption(field, checked, disabled) {
|
|
120
|
+
return {
|
|
121
|
+
id: field?.name || '',
|
|
122
|
+
disabled,
|
|
123
|
+
locked: false,
|
|
124
|
+
// TODO - field.isLocked,
|
|
125
|
+
value: field?.i18NLabel || '',
|
|
126
|
+
checked
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function mapFieldsToObject(availableFields) {
|
|
131
|
+
return availableFields.reduce((acc, field) => {
|
|
132
|
+
acc[field.name] = field;
|
|
133
|
+
return acc;
|
|
134
|
+
}, {});
|
|
135
|
+
}
|
package/es/platform/components/smart-action-band/adapters/presenters/utils/DefaultClientActions.js
CHANGED
|
@@ -142,6 +142,38 @@ class DefaultClientActions {
|
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
static createColumnChooserAction(_ref) {
|
|
146
|
+
let {
|
|
147
|
+
options,
|
|
148
|
+
searchString,
|
|
149
|
+
hasSearch,
|
|
150
|
+
errorMessage,
|
|
151
|
+
textOverflowConfig
|
|
152
|
+
} = _ref;
|
|
153
|
+
return this.constructAction({
|
|
154
|
+
uiComponentMapping: {
|
|
155
|
+
component: 'TableColumnChooser',
|
|
156
|
+
name: 'ColumnChooser',
|
|
157
|
+
propertiesValueMapping: {
|
|
158
|
+
options,
|
|
159
|
+
searchString,
|
|
160
|
+
hasSearch,
|
|
161
|
+
errorMessage,
|
|
162
|
+
textOverflowConfig
|
|
163
|
+
},
|
|
164
|
+
eventMappings: [],
|
|
165
|
+
id: '4000000080013'
|
|
166
|
+
},
|
|
167
|
+
conditions: {
|
|
168
|
+
fields: [],
|
|
169
|
+
pattern: '1'
|
|
170
|
+
},
|
|
171
|
+
location: ActionBandLocations.LEFT_ACTIONS,
|
|
172
|
+
id: '4000000080019',
|
|
173
|
+
name: 'ColumnChooser Action'
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
145
177
|
}
|
|
146
178
|
|
|
147
179
|
export default DefaultClientActions;
|
|
@@ -5,7 +5,10 @@ import { platformSDK } from "../../../sdk/frameworks/Sdk";
|
|
|
5
5
|
import ActionBandSdkFactory from "./SmartActionBandSdkFactory";
|
|
6
6
|
import { SEARCH_TYPE_CLEARED } from "../../../../bc/search-box/Constants";
|
|
7
7
|
import { SmartActionBandConstants } from "../../../../cc/action-band";
|
|
8
|
-
import { SORT_BY_UPDATED } from "../../../../bc/sort-by/Constants";
|
|
8
|
+
import { SORT_BY_UPDATED } from "../../../../bc/sort-by/Constants";
|
|
9
|
+
import { TableTextOverflowConstants } from "../../../../cc/table-text-overflow";
|
|
10
|
+
import { TEXT_OVERFLOW_BEHAVIOUR_UPDATE_REQUESTED, TEXT_OVERFLOW_BEHAVIOUR_UPDATED } from "../../../../bc/clip-wrap/Constants";
|
|
11
|
+
import { COLUMN_CHOOSER_SAVED } from "../../../../cc/table-column-chooser/Constants"; // NOTE: Remove unused import
|
|
9
12
|
// import SortByInitializeController from '@platform/components/smart-action-band/adapters/controllers/SortByInitializeController';
|
|
10
13
|
|
|
11
14
|
function createHandlerWithSdk(handler) {
|
|
@@ -36,6 +39,17 @@ export default class EventHandlersFactory {
|
|
|
36
39
|
// const presenter = new Presenter();
|
|
37
40
|
// const service = new Service({ repository, presenter });
|
|
38
41
|
|
|
42
|
+
const textOverFlowUpdate = args => {
|
|
43
|
+
const {
|
|
44
|
+
action,
|
|
45
|
+
dispatch
|
|
46
|
+
} = args;
|
|
47
|
+
dispatch({
|
|
48
|
+
type: TEXT_OVERFLOW_BEHAVIOUR_UPDATE_REQUESTED,
|
|
49
|
+
payload: action.payload
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
39
53
|
const defaultEventHandlers = {
|
|
40
54
|
// [SEARCH_TYPE_UPDATED]: ({ action, dispatch }) => {
|
|
41
55
|
// const { payload } = action;
|
|
@@ -67,6 +81,33 @@ export default class EventHandlersFactory {
|
|
|
67
81
|
type: SmartActionBandConstants.ExternalConstants.SMART_ACTION_BAND_SORT_APPLIED,
|
|
68
82
|
payload
|
|
69
83
|
});
|
|
84
|
+
},
|
|
85
|
+
[TableTextOverflowConstants.TEXT_OVERFLOW_UPDATED]: textOverFlowUpdate,
|
|
86
|
+
[TEXT_OVERFLOW_BEHAVIOUR_UPDATED]: _ref3 => {
|
|
87
|
+
let {
|
|
88
|
+
action,
|
|
89
|
+
dispatch
|
|
90
|
+
} = _ref3;
|
|
91
|
+
const {
|
|
92
|
+
payload
|
|
93
|
+
} = action;
|
|
94
|
+
dispatch({
|
|
95
|
+
type: SmartActionBandConstants.ExternalConstants.SMART_ACTION_BAND_TEXT_OVERFLOW_UPDATED,
|
|
96
|
+
payload
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
[COLUMN_CHOOSER_SAVED]: _ref4 => {
|
|
100
|
+
let {
|
|
101
|
+
action,
|
|
102
|
+
dispatch
|
|
103
|
+
} = _ref4;
|
|
104
|
+
const {
|
|
105
|
+
payload
|
|
106
|
+
} = action;
|
|
107
|
+
dispatch({
|
|
108
|
+
type: SmartActionBandConstants.ExternalConstants.SMART_ACTION_BAND_COLUMN_CHOOSER_SAVED,
|
|
109
|
+
payload
|
|
110
|
+
});
|
|
70
111
|
}
|
|
71
112
|
};
|
|
72
113
|
return mergeEventHandlers([defaultEventHandlers, wrapped]);
|
|
@@ -14,6 +14,8 @@ import ZHttpBehaviourFactory from "../../../zhttp/frameworks/ZHttpBehaviourFacto
|
|
|
14
14
|
import ActionBandBehaviourFactory from "../../../../library/behaviours/action-band/frameworks/ActionBandBehaviourFactory";
|
|
15
15
|
import ZFieldBehaviourFactory from "../../../zfield/frameworks/ZFieldBehaviourFactory";
|
|
16
16
|
import SortByBehaviourFactory from "../../../../library/behaviours/sort-by/frameworks/ui/SortByBehaviourFactory";
|
|
17
|
+
import ClipWrapBehaviourFactory from "../../../../library/behaviours/clip-wrap/frameworks/ui/ClipWrapBehaviourFactory";
|
|
18
|
+
import ColumnChooserBehaviourFactory from "../../../column-chooser/frameworks/ColumnChooserBehaviourFactory";
|
|
17
19
|
|
|
18
20
|
function combineDataSourceWithDefault(dataSource) {
|
|
19
21
|
return { ...defaultDataSource,
|
|
@@ -47,8 +49,9 @@ export default class SmartActionBandFactory {
|
|
|
47
49
|
getClientScripts: _dataSource.httpTemplates.getClientScripts
|
|
48
50
|
}), ZFieldBehaviourFactory.create({
|
|
49
51
|
availableFields: _dataSource.httpTemplates.getAvailableFields,
|
|
52
|
+
updateSelectedFields: _dataSource.httpTemplates.updateSelectedFields,
|
|
50
53
|
selectedFields: _dataSource.httpTemplates.getSelectedFields
|
|
51
|
-
}), ActionBandBehaviourFactory.create(), SortByBehaviourFactory.create()]
|
|
54
|
+
}), ActionBandBehaviourFactory.create(), ClipWrapBehaviourFactory.create(), SortByBehaviourFactory.create(), ColumnChooserBehaviourFactory.create()]
|
|
52
55
|
});
|
|
53
56
|
}
|
|
54
57
|
|
|
File without changes
|
package/es/platform/components/smart-navigation/adapters/controllers/UiModelInitializeController.js
ADDED
|
File without changes
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { ONE_UNIFICATION } from "../../../../../cc/one-unification/Constants";
|
|
2
|
+
import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// Constants & Configuration
|
|
5
|
+
// ============================================================================
|
|
6
|
+
const EMPTY_STATE_CONFIG = {
|
|
7
|
+
label: 'No Archived views',
|
|
8
|
+
iconSlot: {
|
|
9
|
+
id: 'tab-home-icon',
|
|
10
|
+
width: 120,
|
|
11
|
+
height: 96
|
|
12
|
+
},
|
|
13
|
+
action: {
|
|
14
|
+
label: 'Learn More',
|
|
15
|
+
key: 'learn-more',
|
|
16
|
+
externalLink: 'https://help.zoho.com/portal/kb/articles/archiving-custom-views',
|
|
17
|
+
role: 'primary'
|
|
18
|
+
}
|
|
19
|
+
}; // ============================================================================
|
|
20
|
+
// Translator Service (Use Case)
|
|
21
|
+
// ============================================================================
|
|
22
|
+
|
|
23
|
+
class NavigationTranslatorService {
|
|
24
|
+
overlayModules = [];
|
|
25
|
+
onDemandModules = [];
|
|
26
|
+
clientActions = [];
|
|
27
|
+
selectedModule = null;
|
|
28
|
+
iconMap = {};
|
|
29
|
+
|
|
30
|
+
initialize(overlayModules, onDemandModules, clientActions, selectedModule, iconMap) {
|
|
31
|
+
this.overlayModules = overlayModules || [];
|
|
32
|
+
this.onDemandModules = onDemandModules || [];
|
|
33
|
+
this.clientActions = clientActions || [];
|
|
34
|
+
this.selectedModule = selectedModule || '';
|
|
35
|
+
this.iconMap = iconMap || {};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
translateToViewModel(modules, departments) {
|
|
39
|
+
const viewModel = {
|
|
40
|
+
loadOnDiv: ONE_UNIFICATION.ELEMENTS.SIDE_PANE,
|
|
41
|
+
appName: 'Zoho Desk',
|
|
42
|
+
appLogoURL: '',
|
|
43
|
+
isCommonSearchEnabled: true,
|
|
44
|
+
switcher: this.translateDepartments(departments),
|
|
45
|
+
modules: this.translateModules(modules)
|
|
46
|
+
};
|
|
47
|
+
globalThis.__UNIFIED_NAVIGATION_VIEW_MODEL__ = viewModel;
|
|
48
|
+
|
|
49
|
+
if (process.env.NODE_ENV === 'development') {}
|
|
50
|
+
|
|
51
|
+
return viewModel;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
translateDepartments(departments) {
|
|
55
|
+
if (!Array.isArray(departments) || departments.length === 0) {
|
|
56
|
+
return {};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
label: 'Departments',
|
|
61
|
+
key: ONE_UNIFICATION.ELEMENTS.DEPARTMENT_SWITCHER,
|
|
62
|
+
isSearchEnabled: true,
|
|
63
|
+
isSwitcherConfirmationEnabled: true,
|
|
64
|
+
options: departments.map(dept => ({
|
|
65
|
+
label: dept.displayLabel,
|
|
66
|
+
key: dept.apiKey,
|
|
67
|
+
iconLink: ''
|
|
68
|
+
}))
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
translateModules(modules) {
|
|
73
|
+
if (!Array.isArray(modules)) {
|
|
74
|
+
return [];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return modules.map(module => this.translateModule(module));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
translateModule(module) {
|
|
81
|
+
const viewModel = this.createBaseModuleViewModel(module);
|
|
82
|
+
this.applyOnDemandConfig(viewModel, module);
|
|
83
|
+
this.applyIconConfig(viewModel, module);
|
|
84
|
+
this.applyClientActionsConfig(viewModel, module);
|
|
85
|
+
this.applyOverlayConfig(viewModel, module);
|
|
86
|
+
this.applySubModulesConfig(viewModel, module);
|
|
87
|
+
this.applySelectedModuleConfig(viewModel, module);
|
|
88
|
+
return viewModel;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
createBaseModuleViewModel(module) {
|
|
92
|
+
return {
|
|
93
|
+
label: module.displayLabel,
|
|
94
|
+
key: module.apiKey,
|
|
95
|
+
selected: module.isActive || false,
|
|
96
|
+
moduleSpecificConfig: {
|
|
97
|
+
enableLiveSearch: true,
|
|
98
|
+
loadOnDemand: false,
|
|
99
|
+
actionIcons: []
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
applyOnDemandConfig(viewModel, module) {
|
|
105
|
+
if (this.onDemandModules.includes(module.apiKey)) {
|
|
106
|
+
viewModel.moduleSpecificConfig.loadOnDemand = true;
|
|
107
|
+
viewModel.moduleSpecificConfig.loadOnDemandConfig = {
|
|
108
|
+
loadingText: 'Loading...',
|
|
109
|
+
reloadOnReopen: true,
|
|
110
|
+
showMore: {
|
|
111
|
+
mode: 'pagination',
|
|
112
|
+
batchSize: 10
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
applyClientActionsConfig(viewModel, module) {
|
|
119
|
+
if (this.clientActions.length === 0) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const resolvedActions = ClientActionsTranslator.transform(this.clientActions, 'SmartNavigation', module.apiKey, module);
|
|
124
|
+
|
|
125
|
+
if (!resolvedActions || resolvedActions.length === 0) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const actionById = resolvedActions.reduce((accumulator, action) => {
|
|
130
|
+
accumulator[action.id] = action;
|
|
131
|
+
return accumulator;
|
|
132
|
+
}, {});
|
|
133
|
+
resolvedActions.forEach(clientAction => {
|
|
134
|
+
if (!clientAction) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const configKey = this.getActionConfigKey(clientAction);
|
|
139
|
+
|
|
140
|
+
if (configKey) {
|
|
141
|
+
viewModel.moduleSpecificConfig[configKey] = true;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const moreOptions = this.getMoreOptions(clientAction);
|
|
145
|
+
|
|
146
|
+
if (moreOptions.length > 0) {
|
|
147
|
+
viewModel.moduleSpecificConfig.moreOptions = moreOptions;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
applyIconConfig(viewModel, module) {
|
|
153
|
+
const icon = this.iconMap[module.apiKey];
|
|
154
|
+
|
|
155
|
+
if (icon) {
|
|
156
|
+
viewModel.iconSlot = {
|
|
157
|
+
type: 'svg',
|
|
158
|
+
href: icon
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
getActionConfigKey(action) {
|
|
164
|
+
const ACTION_NAME = {
|
|
165
|
+
add: 'isAddEnabled',
|
|
166
|
+
more: 'isMoreEnabled',
|
|
167
|
+
search: 'isSearchEnabled'
|
|
168
|
+
};
|
|
169
|
+
const resolvedComponent = action.component || '';
|
|
170
|
+
const actionProperties = action.properties || {};
|
|
171
|
+
const icon = actionProperties.icon || '';
|
|
172
|
+
|
|
173
|
+
if (resolvedComponent === 'MoreActions') {
|
|
174
|
+
return ACTION_NAME.more;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (resolvedComponent === 'SearchInput') {
|
|
178
|
+
return ACTION_NAME.search;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (resolvedComponent === 'ActionIcon' && icon === 'plus') {
|
|
182
|
+
return ACTION_NAME.add;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
getMoreOptions(action) {
|
|
189
|
+
const actionProperties = action?.properties;
|
|
190
|
+
|
|
191
|
+
if (!Array.isArray(actionProperties?.options)) {
|
|
192
|
+
return [];
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return actionProperties.options;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
applyOverlayConfig(viewModel, module) {
|
|
199
|
+
if (this.overlayModules.includes(module.apiKey)) {
|
|
200
|
+
viewModel.moduleSpecificConfig.accordionMode = 'Focused';
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
applySubModulesConfig(viewModel, module) {
|
|
205
|
+
if (!module.subModules || !Array.isArray(module.subModules)) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
viewModel.canBeEmpty = true;
|
|
210
|
+
|
|
211
|
+
if (module.subModules.length === 0) {
|
|
212
|
+
viewModel.emptyStateConfig = EMPTY_STATE_CONFIG;
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
viewModel.subModules = module.subModules.map(subModule => this.translateModule(subModule));
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
applySelectedModuleConfig(viewModel, module) {
|
|
220
|
+
if (module.apiKey === this.selectedModule) {
|
|
221
|
+
viewModel.selected = true;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
} // ============================================================================
|
|
226
|
+
// Translator Function (Public API)
|
|
227
|
+
// ============================================================================
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
const translatorService = new NavigationTranslatorService();
|
|
231
|
+
export function OneUnifiedNavigationTranslator(state) {
|
|
232
|
+
globalThis.__SMART_NAVIGATION_STATE__ = state;
|
|
233
|
+
const {
|
|
234
|
+
properties
|
|
235
|
+
} = state;
|
|
236
|
+
const {
|
|
237
|
+
modules,
|
|
238
|
+
departments,
|
|
239
|
+
selectedModule,
|
|
240
|
+
overLayModules,
|
|
241
|
+
onDemandModules,
|
|
242
|
+
clientActions,
|
|
243
|
+
iconMap
|
|
244
|
+
} = properties;
|
|
245
|
+
translatorService.initialize(overLayModules, onDemandModules, clientActions, selectedModule, iconMap);
|
|
246
|
+
return translatorService.translateToViewModel(modules, departments);
|
|
247
|
+
}
|
|
248
|
+
export const translateModule = translatorService.translateModule.bind(translatorService);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export const UnifiedNavigationPresenter = state => ({
|
|
2
|
+
apiKey: state.key || state.optionKey,
|
|
3
|
+
id: state.key
|
|
4
|
+
}); // export const SmartNavigationPresenter = (state, data) => {
|
|
5
|
+
// const { modules: stateData } = state.properties;
|
|
6
|
+
// const findDataInModule = (moduleData, apiKey) => {
|
|
7
|
+
// const key1 = moduleData.apiKey || moduleData.key || moduleData.id || moduleData.optionKey;
|
|
8
|
+
// const key2 = apiKey;
|
|
9
|
+
// if (key1 === key2) {
|
|
10
|
+
// return moduleData;
|
|
11
|
+
// }
|
|
12
|
+
// if (moduleData.subModules && Array.isArray(moduleData.subModules)) {
|
|
13
|
+
// for (const subModule of moduleData.subModules) {
|
|
14
|
+
// const found = findDataInModule(subModule, apiKey);
|
|
15
|
+
// if (found) {
|
|
16
|
+
// return found;
|
|
17
|
+
// }
|
|
18
|
+
// }
|
|
19
|
+
// }
|
|
20
|
+
// return null;
|
|
21
|
+
// };
|
|
22
|
+
// for (const module of stateData) {
|
|
23
|
+
// const result = findDataInModule(module, data.key);
|
|
24
|
+
// if (result) {
|
|
25
|
+
// return result;
|
|
26
|
+
// }
|
|
27
|
+
// }
|
|
28
|
+
// return null;
|
|
29
|
+
// };
|
|
30
|
+
|
|
31
|
+
export class SmartNavigationPresenter {
|
|
32
|
+
constructor(state) {
|
|
33
|
+
this.state = state;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
findModule(moduleKey) {
|
|
37
|
+
const {
|
|
38
|
+
modules: stateData
|
|
39
|
+
} = this.state.properties;
|
|
40
|
+
|
|
41
|
+
const findDataInModule = (moduleData, apiKey) => {
|
|
42
|
+
const key1 = moduleData.apiKey || moduleData.key || moduleData.id || moduleData.optionKey;
|
|
43
|
+
const key2 = apiKey;
|
|
44
|
+
|
|
45
|
+
if (key1 === key2) {
|
|
46
|
+
return moduleData;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (moduleData.subModules && Array.isArray(moduleData.subModules)) {
|
|
50
|
+
for (const subModule of moduleData.subModules) {
|
|
51
|
+
const found = findDataInModule(subModule, apiKey);
|
|
52
|
+
|
|
53
|
+
if (found) {
|
|
54
|
+
return found;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return null;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
for (const module of stateData) {
|
|
63
|
+
const result = findDataInModule(module, moduleKey);
|
|
64
|
+
|
|
65
|
+
if (result) {
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
findDepartment(departmentApiName) {
|
|
74
|
+
return this.state.properties.departments.find(dept => dept.apiKey === departmentApiName) || null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
}
|