@antscorp/antsomi-ui 1.3.5-beta.272 → 1.3.5-beta.273
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/components/organism/ContentSources/Settings.js +2 -3
- package/es/components/organism/ContentSources/constants.js +1 -0
- package/es/components/organism/ContentSources/provider.d.ts +1 -0
- package/es/components/organism/ContentSources/provider.js +4 -0
- package/es/components/organism/ContentSources/reducer.d.ts +2 -1
- package/es/components/organism/ContentSources/reducer.js +8 -0
- package/es/components/organism/ContentSources/types.d.ts +5 -1
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@ import { useDeepCompareEffect } from '@antscorp/antsomi-ui/es/hooks';
|
|
|
31
31
|
import { useDebounce } from '@antscorp/antsomi-ui/es/hooks/useDebounceV2';
|
|
32
32
|
// Provider
|
|
33
33
|
import { useContentSourceDispatch, useSelectBoIdByGroupFromCS, useSelectContentSources, useSelectModeView, } from './provider';
|
|
34
|
-
import { deleteContentSourceGroup, setContentSourceGroup, setContentSourceGroupBOData, updateContentSourceSettings, updateModeView, } from './reducer';
|
|
34
|
+
import { deleteContentSourceGroup, setContentSourceGroup, setContentSourceGroupBOData, updateContentSourceSettings, updateModeView, emitItemTypeChange, } from './reducer';
|
|
35
35
|
// Utils
|
|
36
36
|
import { handleError } from '@antscorp/antsomi-ui/es/utils';
|
|
37
37
|
const PATH = 'src/components/organism/ContentSources/Settings.tsx';
|
|
@@ -150,8 +150,7 @@ const Settings = (props) => {
|
|
|
150
150
|
const { itemTypeId } = action.payload;
|
|
151
151
|
if (itemTypeId) {
|
|
152
152
|
handleChangeItemTypeId({ groupId, id: itemTypeId });
|
|
153
|
-
|
|
154
|
-
onBOChange({ itemTypeId });
|
|
153
|
+
contentSourceDispatch(emitItemTypeChange());
|
|
155
154
|
}
|
|
156
155
|
break;
|
|
157
156
|
}
|
|
@@ -13,5 +13,6 @@ export declare const useSelectServiceAuth: () => import("@antscorp/antsomi-ui/es
|
|
|
13
13
|
export declare const useSelectContentSources: () => import("./types").TContentSourceSettings;
|
|
14
14
|
export declare const useSelectCSGroups: () => import("./types").TContentSourceGroup[];
|
|
15
15
|
export declare const useSelectModeView: () => import("./types").ContentSourceModeView;
|
|
16
|
+
export declare const useSelectEmitContentSourceItemType: () => number;
|
|
16
17
|
export declare const useSelectBoIdByGroupFromCS: () => Record<string, number>;
|
|
17
18
|
export declare const useSelectDataTableBOByGroupId: (groupId: string) => Record<string, any>[];
|
|
@@ -30,6 +30,10 @@ export const useSelectModeView = () => {
|
|
|
30
30
|
const { mode } = useContentSourceState();
|
|
31
31
|
return useMemo(() => mode, [mode]);
|
|
32
32
|
};
|
|
33
|
+
export const useSelectEmitContentSourceItemType = () => {
|
|
34
|
+
const { emitItemTypeChange } = useSelectContentSources();
|
|
35
|
+
return useMemo(() => emitItemTypeChange, [emitItemTypeChange]);
|
|
36
|
+
};
|
|
33
37
|
export const useSelectBoIdByGroupFromCS = () => {
|
|
34
38
|
const csGroups = useSelectCSGroups();
|
|
35
39
|
const result = useMemo(() => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UpdateGroupAction, TContentSourceSettings, TContentSourceGroup, ActionSetContentSourceGroup, ActionDeleteContentSourceGroup, ContentSourceModeView, ActionUpdateModeView, ActionUpdateContentSourceSettings, ActionSetContentSourceGroupBOData } from './types';
|
|
1
|
+
import { UpdateGroupAction, TContentSourceSettings, TContentSourceGroup, ActionSetContentSourceGroup, ActionDeleteContentSourceGroup, ContentSourceModeView, ActionUpdateModeView, ActionUpdateContentSourceSettings, ActionSetContentSourceGroupBOData, ActionEmitItemTypeChange } from './types';
|
|
2
2
|
import { TServiceAuth } from '@antscorp/antsomi-ui/es/types';
|
|
3
3
|
export interface ContentSourceState {
|
|
4
4
|
serviceAuth: TServiceAuth;
|
|
@@ -16,3 +16,4 @@ export declare const deleteContentSourceGroup: (groupId: string) => ActionDelete
|
|
|
16
16
|
export declare const updateModeView: (mode: ContentSourceModeView) => ActionUpdateModeView;
|
|
17
17
|
export declare const updateContentSourceSettings: (contentSources: TContentSourceSettings) => ActionUpdateContentSourceSettings;
|
|
18
18
|
export declare const setContentSourceGroupBOData: (boDataByGroupId: Record<string, any[]>) => ActionSetContentSourceGroupBOData;
|
|
19
|
+
export declare const emitItemTypeChange: () => ActionEmitItemTypeChange;
|
|
@@ -72,6 +72,10 @@ export const contentSourceReducer = (state, action) => produce(state, draft => {
|
|
|
72
72
|
});
|
|
73
73
|
break;
|
|
74
74
|
}
|
|
75
|
+
case 'EMIT_ITEM_TYPE_CHANGE': {
|
|
76
|
+
draft.contentSources.emitItemTypeChange += 1;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
75
79
|
default: {
|
|
76
80
|
return state;
|
|
77
81
|
}
|
|
@@ -102,3 +106,7 @@ export const setContentSourceGroupBOData = (boDataByGroupId) => ({
|
|
|
102
106
|
boDataByGroupId,
|
|
103
107
|
},
|
|
104
108
|
});
|
|
109
|
+
export const emitItemTypeChange = () => ({
|
|
110
|
+
type: 'EMIT_ITEM_TYPE_CHANGE',
|
|
111
|
+
payload: null,
|
|
112
|
+
});
|
|
@@ -43,6 +43,7 @@ export type TContentSourceSettings = {
|
|
|
43
43
|
groups: TContentSourceGroup[];
|
|
44
44
|
expanded: string[];
|
|
45
45
|
isLoadingDataBO: boolean;
|
|
46
|
+
emitItemTypeChange: number;
|
|
46
47
|
};
|
|
47
48
|
export interface HideOptionTypes {
|
|
48
49
|
filter?: boolean;
|
|
@@ -141,5 +142,8 @@ export interface ActionSetContentSourceGroupBOData extends Action {
|
|
|
141
142
|
boDataByGroupId: Record<string, any[]>;
|
|
142
143
|
};
|
|
143
144
|
}
|
|
144
|
-
export
|
|
145
|
+
export interface ActionEmitItemTypeChange extends Action {
|
|
146
|
+
type: 'EMIT_ITEM_TYPE_CHANGE';
|
|
147
|
+
}
|
|
148
|
+
export type UpdateGroupAction = ActionUpdateContentSourceSettings | ActionSetContentSourceGroupBOData | ActionServiceAuth | ActionAddContentSource | ActionUpdateModeView | ActionDeleteContentSourceGroup | ActionSetContentSourceGroup | ActionUpdateSource | ActionUpdateFilter | ActionUpdateFallback | ActionUpdateName | ActionUpdateAlgorithms | ActionUpdateExpanded | ActionUpdateLevel | ActionEmitItemTypeChange;
|
|
145
149
|
export {};
|