@admin-layout/client 10.0.9-alpha.9 → 10.1.1-alpha.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/lib/{antd-themes/colors.d.ts → colors/colorsList.d.ts} +1 -1
- package/lib/colors/colorsList.d.ts.map +1 -0
- package/lib/{antd-themes/colors.js → colors/colorsList.js} +1 -1
- package/lib/colors/colorsList.js.map +1 -0
- package/lib/colors/index.d.ts +1 -0
- package/lib/colors/index.d.ts.map +1 -1
- package/lib/colors/presets/black.js +0 -3
- package/lib/colors/presets/black.js.map +1 -1
- package/lib/colors/presets/brinkPink.js +11 -0
- package/lib/colors/presets/brinkPink.js.map +1 -0
- package/lib/colors/presets/cyan.js +11 -0
- package/lib/colors/presets/cyan.js.map +1 -0
- package/lib/colors/presets/lime.js +11 -0
- package/lib/colors/presets/lime.js.map +1 -0
- package/lib/colors/presets/pink.js +11 -0
- package/lib/colors/presets/pink.js.map +1 -0
- package/lib/colors/presets/purple.js +11 -0
- package/lib/colors/presets/purple.js.map +1 -0
- package/lib/colors/presets/skyBlue.js +11 -0
- package/lib/colors/presets/skyBlue.js.map +1 -0
- package/lib/colors/presets/turquoise.js +11 -0
- package/lib/colors/presets/turquoise.js.map +1 -0
- package/lib/colors/presets/white.js +0 -3
- package/lib/colors/presets/white.js.map +1 -1
- package/lib/components/ApplicationErrorFillWrapper.d.ts.map +1 -1
- package/lib/components/ApplicationErrorHandlerCommon.d.ts.map +1 -1
- package/lib/components/LayoutCookieProvider.d.ts.map +1 -1
- package/lib/components/LayoutCookieProvider.js +3 -3
- package/lib/components/UpdateSettings/SettingsConfigurationModel.test.d.ts +2 -0
- package/lib/components/UpdateSettings/SettingsConfigurationModel.test.d.ts.map +1 -0
- package/lib/components/UpdateSettings/UpdateSettings.server.d.ts +1 -1
- package/lib/components/UpdateSettings/UpdateSettings.server.d.ts.map +1 -1
- package/lib/components/UpdateSettings/UpdateSettings.server.js +89 -28
- package/lib/components/UpdateSettings/UpdateSettings.server.js.map +1 -1
- package/lib/config/defaultSettings.d.ts +99 -1
- package/lib/config/defaultSettings.d.ts.map +1 -1
- package/lib/config/defaultSettings.js +155 -19
- package/lib/config/defaultSettings.js.map +1 -1
- package/lib/config/env-config.d.ts.map +1 -1
- package/lib/config/env-config.js +10 -3
- package/lib/config/env-config.js.map +1 -1
- package/lib/graphql/link/error-link.d.ts.map +1 -1
- package/lib/graphql/link/error-link.js +1 -1
- package/lib/graphql/link/error-link.js.map +1 -1
- package/lib/hooks/Client-only.d.ts +28 -0
- package/lib/hooks/Client-only.d.ts.map +1 -0
- package/lib/hooks/Client-only.js +18 -0
- package/lib/hooks/Client-only.js.map +1 -0
- package/lib/hooks/hooks.d.ts +4 -0
- package/lib/hooks/hooks.d.ts.map +1 -0
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/use-hydrated.d.ts +19 -0
- package/lib/hooks/use-hydrated.d.ts.map +1 -0
- package/lib/hooks/use-hydrated.js +24 -0
- package/lib/hooks/use-hydrated.js.map +1 -0
- package/lib/hooks/useLayoutSettings.d.ts +1 -0
- package/lib/hooks/useLayoutSettings.d.ts.map +1 -1
- package/lib/hooks/useLayoutSettings.js +13 -25
- package/lib/hooks/useLayoutSettings.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.native.js +1 -1
- package/lib/interfaces/index.d.ts +2 -0
- package/lib/interfaces/index.d.ts.map +1 -1
- package/lib/interfaces/pure-settings.d.ts +9 -1
- package/lib/interfaces/pure-settings.d.ts.map +1 -1
- package/lib/interfaces/searchbar-settings.d.ts +61 -0
- package/lib/interfaces/searchbar-settings.d.ts.map +1 -0
- package/lib/interfaces/settings.d.ts +166 -0
- package/lib/interfaces/settings.d.ts.map +1 -0
- package/lib/interfaces/settings.js +5 -0
- package/lib/interfaces/settings.js.map +1 -0
- package/lib/redux/actions/error-actions.d.ts.map +1 -1
- package/lib/redux/reducers/settings.d.ts.map +1 -1
- package/lib/redux/reducers/settings.js +2 -2
- package/lib/redux/reducers/settings.js.map +1 -1
- package/lib/redux/store.js +1 -1
- package/lib/utils/generateMenuLink.d.ts.map +1 -1
- package/lib/utils/generateMenuLink.js +13 -1
- package/lib/utils/generateMenuLink.js.map +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/matchMenuKeys.d.ts.map +1 -1
- package/lib/utils/matchMenuKeys.js.map +1 -1
- package/lib/utils/menuUtils.d.ts.map +1 -1
- package/lib/utils/menuUtils.js +1 -1
- package/lib/utils/menuUtils.js.map +1 -1
- package/lib/utils/parentRoute.d.ts.map +1 -1
- package/lib/utils/settingsDiff.test.d.ts +2 -0
- package/lib/utils/settingsDiff.test.d.ts.map +1 -0
- package/lib/utils/settingsDifference.d.ts +5 -0
- package/lib/utils/settingsDifference.d.ts.map +1 -0
- package/lib/utils/settingsDifference.js +207 -0
- package/lib/utils/settingsDifference.js.map +1 -0
- package/lib/utils/settingsDifference.test.d.ts +2 -0
- package/lib/utils/settingsDifference.test.d.ts.map +1 -0
- package/package.json +5 -5
- package/lib/antd-themes/ThemeProvider.d.ts +0 -10
- package/lib/antd-themes/ThemeProvider.d.ts.map +0 -1
- package/lib/antd-themes/ThemeProvider.js +0 -34
- package/lib/antd-themes/ThemeProvider.js.map +0 -1
- package/lib/antd-themes/airbnb-dark-theme.d.ts +0 -2
- package/lib/antd-themes/airbnb-dark-theme.d.ts.map +0 -1
- package/lib/antd-themes/airbnb-dark-theme.js +0 -168
- package/lib/antd-themes/airbnb-dark-theme.js.map +0 -1
- package/lib/antd-themes/airbnb-light-theme.d.ts +0 -230
- package/lib/antd-themes/airbnb-light-theme.d.ts.map +0 -1
- package/lib/antd-themes/airbnb-light-theme.js +0 -168
- package/lib/antd-themes/airbnb-light-theme.js.map +0 -1
- package/lib/antd-themes/colors.d.ts.map +0 -1
- package/lib/antd-themes/colors.js.map +0 -1
- package/lib/antd-themes/default-dark-theme.d.ts +0 -2
- package/lib/antd-themes/default-dark-theme.d.ts.map +0 -1
- package/lib/antd-themes/default-dark-theme.js +0 -136
- package/lib/antd-themes/default-dark-theme.js.map +0 -1
- package/lib/antd-themes/default-light-theme.d.ts +0 -199
- package/lib/antd-themes/default-light-theme.d.ts.map +0 -1
- package/lib/antd-themes/default-light-theme.js +0 -136
- package/lib/antd-themes/default-light-theme.js.map +0 -1
- package/lib/antd-themes/github-dark-theme.d.ts +0 -2
- package/lib/antd-themes/github-dark-theme.d.ts.map +0 -1
- package/lib/antd-themes/github-dark-theme.js +0 -168
- package/lib/antd-themes/github-dark-theme.js.map +0 -1
- package/lib/antd-themes/github-light-theme.d.ts +0 -230
- package/lib/antd-themes/github-light-theme.d.ts.map +0 -1
- package/lib/antd-themes/github-light-theme.js +0 -168
- package/lib/antd-themes/github-light-theme.js.map +0 -1
- package/lib/antd-themes/index.d.ts +0 -14
- package/lib/antd-themes/index.d.ts.map +0 -1
- package/lib/antd-themes/slack-dark-theme.d.ts +0 -2
- package/lib/antd-themes/slack-dark-theme.d.ts.map +0 -1
- package/lib/antd-themes/slack-dark-theme.js +0 -167
- package/lib/antd-themes/slack-dark-theme.js.map +0 -1
- package/lib/antd-themes/slack-light-theme.d.ts +0 -229
- package/lib/antd-themes/slack-light-theme.d.ts.map +0 -1
- package/lib/antd-themes/slack-light-theme.js +0 -167
- package/lib/antd-themes/slack-light-theme.js.map +0 -1
- package/lib/antd-themes/spotify-dark-theme.d.ts +0 -2
- package/lib/antd-themes/spotify-dark-theme.d.ts.map +0 -1
- package/lib/antd-themes/spotify-dark-theme.js +0 -168
- package/lib/antd-themes/spotify-dark-theme.js.map +0 -1
- package/lib/antd-themes/spotify-light-theme.d.ts +0 -230
- package/lib/antd-themes/spotify-light-theme.d.ts.map +0 -1
- package/lib/antd-themes/spotify-light-theme.js +0 -168
- package/lib/antd-themes/spotify-light-theme.js.map +0 -1
- package/lib/antd-themes/themeRegistry.d.ts +0 -2
- package/lib/antd-themes/themeRegistry.d.ts.map +0 -1
- package/lib/antd-themes/themeRegistry.js +0 -12
- package/lib/antd-themes/themeRegistry.js.map +0 -1
- package/lib/utils/getAntdLocale.d.ts +0 -3
- package/lib/utils/getAntdLocale.d.ts.map +0 -1
- package/lib/utils/getAntdLocale.js +0 -18
- package/lib/utils/getAntdLocale.js.map +0 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export interface AmenityItem {
|
|
2
|
+
name: string;
|
|
3
|
+
}
|
|
4
|
+
export interface AdvanceFilterConfig {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
fields: {
|
|
7
|
+
distance: boolean;
|
|
8
|
+
price: boolean;
|
|
9
|
+
petsAllowed: boolean;
|
|
10
|
+
instantBooking: boolean;
|
|
11
|
+
amenities: boolean;
|
|
12
|
+
datasources: boolean;
|
|
13
|
+
};
|
|
14
|
+
amenitiesList: AmenityItem[];
|
|
15
|
+
}
|
|
16
|
+
export interface DatePickerConfig {
|
|
17
|
+
enableSingleDayMode: boolean;
|
|
18
|
+
enableTimeSelection: boolean;
|
|
19
|
+
defaultToSingleDay: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface HotelsFieldsConfig {
|
|
22
|
+
location: boolean;
|
|
23
|
+
dates: boolean;
|
|
24
|
+
guests: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface FlightsFieldsConfig {
|
|
27
|
+
fromLocation: boolean;
|
|
28
|
+
toLocation: boolean;
|
|
29
|
+
dates: boolean;
|
|
30
|
+
returnFlight: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface CarsFieldsConfig {
|
|
33
|
+
pickupLocation: boolean;
|
|
34
|
+
dropoffLocation: boolean;
|
|
35
|
+
dates: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface FieldsConfig {
|
|
38
|
+
HOTELS: HotelsFieldsConfig;
|
|
39
|
+
FLIGHTS: FlightsFieldsConfig;
|
|
40
|
+
CARS: CarsFieldsConfig;
|
|
41
|
+
}
|
|
42
|
+
export interface EnabledSearchBars {
|
|
43
|
+
HOTELS: boolean;
|
|
44
|
+
FLIGHTS: boolean;
|
|
45
|
+
CARS: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface SearchbarSettings {
|
|
48
|
+
enabledSearchBars: EnabledSearchBars;
|
|
49
|
+
fieldsConfig: FieldsConfig;
|
|
50
|
+
datePickerConfig: {
|
|
51
|
+
HOTELS: DatePickerConfig;
|
|
52
|
+
FLIGHTS: DatePickerConfig;
|
|
53
|
+
CARS: DatePickerConfig;
|
|
54
|
+
};
|
|
55
|
+
advanceFilterConfig: AdvanceFilterConfig;
|
|
56
|
+
showTypeSelector: boolean;
|
|
57
|
+
isSettingsPanelOpen: boolean;
|
|
58
|
+
showTravelPlanner: boolean;
|
|
59
|
+
showAIAgent: boolean;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=searchbar-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchbar-settings.d.ts","sourceRoot":"","sources":["../../src/interfaces/searchbar-settings.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE;QACJ,QAAQ,EAAE,OAAO,CAAC;QAClB,KAAK,EAAE,OAAO,CAAC;QACf,WAAW,EAAE,OAAO,CAAC;QACrB,cAAc,EAAE,OAAO,CAAC;QACxB,SAAS,EAAE,OAAO,CAAC;QACnB,WAAW,EAAE,OAAO,CAAC;KACxB,CAAC;IACF,aAAa,EAAE,WAAW,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,kBAAkB,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAChC,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IACzB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,IAAI,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAC9B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,EAAE;QACd,MAAM,EAAE,gBAAgB,CAAC;QACzB,OAAO,EAAE,gBAAgB,CAAC;QAC1B,IAAI,EAAE,gBAAgB,CAAC;KAC1B,CAAC;IACF,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { ContentWidth } from './pure-settings';
|
|
2
|
+
export type ThemeColor = 'blue' | 'indigo' | 'red' | 'orange' | 'yellow' | 'teal' | 'green' | 'blue' | 'purple';
|
|
3
|
+
export type NavigationMode = 'sidebar' | 'topbar' | 'mixed';
|
|
4
|
+
export type SideMenuType = 'expanded' | 'collapsed';
|
|
5
|
+
export declare enum SearchBarBehavior {
|
|
6
|
+
PERMANENT = "permanent",
|
|
7
|
+
ON_SCROLL = "on-scroll"
|
|
8
|
+
}
|
|
9
|
+
export interface ComponentSettings {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
settings: Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
export interface SettingsContext {
|
|
15
|
+
navTheme: 'light' | 'dark' | 'realDark';
|
|
16
|
+
primaryColor: string;
|
|
17
|
+
secondaryColor: string;
|
|
18
|
+
theme?: string;
|
|
19
|
+
logo: string;
|
|
20
|
+
showSettingPanel: boolean;
|
|
21
|
+
titleColor: string;
|
|
22
|
+
language: string;
|
|
23
|
+
fontFamily: string;
|
|
24
|
+
titleFontWeight: string;
|
|
25
|
+
titleHeight: string;
|
|
26
|
+
titleFontSize: string;
|
|
27
|
+
letterSpacings: string;
|
|
28
|
+
siderBgColor: string;
|
|
29
|
+
headerBgColor: string;
|
|
30
|
+
textColor: string;
|
|
31
|
+
themeType: string;
|
|
32
|
+
loginThemeColor: string;
|
|
33
|
+
loginFormPosition: string;
|
|
34
|
+
loginSocials: string;
|
|
35
|
+
loginBackgroundImage: string;
|
|
36
|
+
verifyFormLayout: string;
|
|
37
|
+
verifyFormImageUrl: string;
|
|
38
|
+
verifyFormBackgroundStyle: string;
|
|
39
|
+
verifyFormVisibleFields: string;
|
|
40
|
+
verifyFormShowSkipButton: boolean;
|
|
41
|
+
components: ComponentSettings[];
|
|
42
|
+
activeComponent?: string;
|
|
43
|
+
currentRoute?: string;
|
|
44
|
+
routeSettings: Record<string, {
|
|
45
|
+
layout?: {
|
|
46
|
+
desktop: {
|
|
47
|
+
navigationMode: NavigationMode;
|
|
48
|
+
sideMenuType: SideMenuType;
|
|
49
|
+
contentWidth: ContentWidth;
|
|
50
|
+
fixedHeader: boolean;
|
|
51
|
+
fixedSidebar: boolean;
|
|
52
|
+
splitMenus: boolean;
|
|
53
|
+
upperMenuDividerName?: string;
|
|
54
|
+
middleMenuDividerName?: string;
|
|
55
|
+
lowerMenuDividerName?: string;
|
|
56
|
+
};
|
|
57
|
+
mobile: {
|
|
58
|
+
navigationMode: NavigationMode;
|
|
59
|
+
sideMenuType: SideMenuType;
|
|
60
|
+
contentWidth: ContentWidth;
|
|
61
|
+
fixedHeader: boolean;
|
|
62
|
+
fixedSidebar: boolean;
|
|
63
|
+
splitMenus: boolean;
|
|
64
|
+
upperMenuDividerName?: string;
|
|
65
|
+
middleMenuDividerName?: string;
|
|
66
|
+
lowerMenuDividerName?: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
regions?: {
|
|
70
|
+
desktop?: {
|
|
71
|
+
header?: {
|
|
72
|
+
showLogo?: boolean;
|
|
73
|
+
showSearchSlot?: boolean;
|
|
74
|
+
showRightContent?: boolean;
|
|
75
|
+
showMenuToggle?: boolean;
|
|
76
|
+
showBackButton?: boolean;
|
|
77
|
+
showPageTitle?: boolean;
|
|
78
|
+
showActionButtons?: boolean;
|
|
79
|
+
position?: 'fixed' | 'static';
|
|
80
|
+
height?: string;
|
|
81
|
+
backgroundColor?: string;
|
|
82
|
+
elevation?: number;
|
|
83
|
+
showHeader?: boolean;
|
|
84
|
+
showMenu?: boolean;
|
|
85
|
+
menuHeaderRender?: boolean;
|
|
86
|
+
searchBarRender?: boolean;
|
|
87
|
+
searchBarBehavior?: SearchBarBehavior;
|
|
88
|
+
searchBarOverlay?: boolean;
|
|
89
|
+
scrollThreshold?: number;
|
|
90
|
+
};
|
|
91
|
+
footer?: {
|
|
92
|
+
showFooter?: boolean;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
mobile?: {
|
|
96
|
+
header?: {
|
|
97
|
+
showLogo?: boolean;
|
|
98
|
+
showSearchSlot?: boolean;
|
|
99
|
+
showRightContent?: boolean;
|
|
100
|
+
showMenuToggle?: boolean;
|
|
101
|
+
showBackButton?: boolean;
|
|
102
|
+
showPageTitle?: boolean;
|
|
103
|
+
showActionButtons?: boolean;
|
|
104
|
+
position?: 'fixed' | 'static';
|
|
105
|
+
height?: string;
|
|
106
|
+
backgroundColor?: string;
|
|
107
|
+
elevation?: number;
|
|
108
|
+
showHeader?: boolean;
|
|
109
|
+
showMenu?: boolean;
|
|
110
|
+
menuHeaderRender?: boolean;
|
|
111
|
+
searchBarRender?: boolean;
|
|
112
|
+
searchBarBehavior?: SearchBarBehavior;
|
|
113
|
+
searchBarOverlay?: boolean;
|
|
114
|
+
scrollThreshold?: number;
|
|
115
|
+
};
|
|
116
|
+
footer?: {
|
|
117
|
+
showFooter?: boolean;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
}>;
|
|
122
|
+
}
|
|
123
|
+
export type UpdateEvent = {
|
|
124
|
+
type: 'UPDATE';
|
|
125
|
+
value?: Partial<SettingsContext>;
|
|
126
|
+
};
|
|
127
|
+
export type ComponentEvent = {
|
|
128
|
+
type: 'REGISTER_COMPONENT';
|
|
129
|
+
component: ComponentSettings;
|
|
130
|
+
} | {
|
|
131
|
+
type: 'UPDATE_COMPONENT_SETTINGS';
|
|
132
|
+
componentId: string;
|
|
133
|
+
settings: Record<string, any>;
|
|
134
|
+
} | {
|
|
135
|
+
type: 'SELECT_COMPONENT';
|
|
136
|
+
componentId: string;
|
|
137
|
+
} | {
|
|
138
|
+
type: 'CLEAR_COMPONENT_SELECTION';
|
|
139
|
+
};
|
|
140
|
+
export type MachineEvent = {
|
|
141
|
+
type: 'UPDATE';
|
|
142
|
+
value: Partial<SettingsContext>;
|
|
143
|
+
} | {
|
|
144
|
+
type: 'REGISTER_COMPONENT';
|
|
145
|
+
component: any;
|
|
146
|
+
} | {
|
|
147
|
+
type: 'UPDATE_COMPONENT_SETTINGS';
|
|
148
|
+
componentId: string;
|
|
149
|
+
settings: any;
|
|
150
|
+
} | {
|
|
151
|
+
type: 'SELECT_COMPONENT';
|
|
152
|
+
componentId: string;
|
|
153
|
+
} | {
|
|
154
|
+
type: 'CLEAR_COMPONENT_SELECTION';
|
|
155
|
+
} | {
|
|
156
|
+
type: 'RESET';
|
|
157
|
+
} | {
|
|
158
|
+
type: 'SAVE';
|
|
159
|
+
} | {
|
|
160
|
+
type: 'ROUTE_CHANGE';
|
|
161
|
+
pathname: string;
|
|
162
|
+
} | {
|
|
163
|
+
type: 'UPDATE_ROUTE_SETTINGS';
|
|
164
|
+
settings: Record<string, Partial<SettingsContext>>;
|
|
165
|
+
};
|
|
166
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/interfaces/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAChH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC5D,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAEpD,oBAAY,iBAAiB;IACzB,SAAS,cAAc;IACvB,SAAS,cAAc;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,M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,CAAC;CACrC,CAAC;AAER,MAAM,MAAM,YAAY,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAAE,GACnD;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,SAAS,EAAE,GAAG,CAAA;CAAE,GAC9C;IAAE,IAAI,EAAE,2BAA2B,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,GAAG,CAAA;CAAE,GACzE;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,2BAA2B,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,IAAI,EAAE,uBAAuB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sources":["../../src/interfaces/settings.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAS,IAAA;AAET,CAAM,UAAA,iBAAmB,EAAA;AACzB,IAAM,6BAAuB,CAAA,GAAA,WAAoB;AACjD,IAAA,iBAAwB,CAAA,WAAa,CAAA,GAAA;AAErC,CAAA,EAAA,iBAAY,KAAiB,iBAAA,GAAA,EAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-actions.d.ts","sourceRoot":"","sources":["../../../src/redux/actions/error-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,iBAAiB,CAAC;AAGzB,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"error-actions.d.ts","sourceRoot":"","sources":["../../../src/redux/actions/error-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,iBAAiB,CAAC;AAGzB,eAAO,MAAM,mBAAmB,GAAI,SAAS,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC;;;CAK/E,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,MAAM;;;;;EAO5D;AAED,eAAO,MAAM,uBAAuB,GAAI,SAAS,qBAAqB,EAAE;;;CAKvE,CAAC;AAEF,MAAM,MAAM,YAAY,GACtB;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAA;CAAE,GAC3E;IAAE,IAAI,EAAE,yBAAyB,CAAC;IAAC,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GACvE;IAAE,IAAI,EAAE,wBAAwB,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,0BAA0B,CAAC;IAAC,OAAO,EAAE,qBAAqB,EAAE,CAAA;CAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/redux/reducers/settings.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAiBnD,QAAA,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/redux/reducers/settings.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAiBnD,QAAA,MAAM,eAAe,GACjB,OAAO,GAA4B,EACnC,mBAAwB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE,QAyBrE,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'../../constants/constants.js';import {config}from'../../config/env-config.js';import {
|
|
1
|
+
import {CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'../../constants/constants.js';import {config}from'../../config/env-config.js';import'../../config/defaultSettings.js';import {cloneDeep}from'lodash-es';/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
2
2
|
/* eslint-disable no-case-declarations */
|
|
3
3
|
// Note: We customize reducer part as AntPro uses inbuild way.
|
|
4
4
|
const updateColorWeak = (colorWeak) => {
|
|
@@ -27,7 +27,7 @@ const settingsReducer = (state = config.LAYOUT_SETTINGS, { type, payload = {} })
|
|
|
27
27
|
updateColorWeak(!!colorWeak);
|
|
28
28
|
return {
|
|
29
29
|
...state,
|
|
30
|
-
...
|
|
30
|
+
...cloneDeep(payload),
|
|
31
31
|
};
|
|
32
32
|
case CHANGE_LANGUAGE:
|
|
33
33
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sources":["../../../src/redux/reducers/settings.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"settings.js","sources":["../../../src/redux/reducers/settings.ts"],"sourcesContent":[null],"names":[],"mappings":"4MAIA;AAiBA;AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/redux/store.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {combineReducers,configureStore}from'@reduxjs/toolkit';import {applicationErrors}from'./reducers/error.js';import'../config/env-config.js';import'lodash-es';// Combine the reducers into an object
|
|
1
|
+
import {combineReducers,configureStore}from'@reduxjs/toolkit';import {applicationErrors}from'./reducers/error.js';import'../config/env-config.js';import'../config/defaultSettings.js';import'lodash-es';// Combine the reducers into an object
|
|
2
2
|
const rootReducer = combineReducers({
|
|
3
3
|
applicationErrors: applicationErrors, // Adding applicationErrors reducer
|
|
4
4
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateMenuLink.d.ts","sourceRoot":"","sources":["../../src/utils/generateMenuLink.ts"],"names":[],"mappings":"AAwEA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"generateMenuLink.d.ts","sourceRoot":"","sources":["../../src/utils/generateMenuLink.ts"],"names":[],"mappings":"AAwEA,eAAO,MAAM,gBAAgB,GAAI,SAAI,EAAE,WAAM,WA2B5C,CAAC"}
|
|
@@ -67,12 +67,24 @@ function generatePath(originalPath, params) {
|
|
|
67
67
|
return prefix + segments.join('/');
|
|
68
68
|
}
|
|
69
69
|
const generateMenuPath = (path, params) => {
|
|
70
|
+
// Check if all required parameters exist before attempting to generate the path
|
|
71
|
+
const requiredParams = [];
|
|
72
|
+
path.split('/').forEach((segment) => {
|
|
73
|
+
if (segment.startsWith(':') && !segment.endsWith('?')) {
|
|
74
|
+
const paramName = segment.substring(1);
|
|
75
|
+
requiredParams.push(paramName);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
// If any required parameter is missing, return null immediately
|
|
79
|
+
const missingParams = requiredParams.filter((param) => params[param] === undefined);
|
|
80
|
+
if (missingParams.length > 0) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
70
83
|
try {
|
|
71
84
|
const generatedPath = generatePath(path, params);
|
|
72
85
|
return generatedPath;
|
|
73
86
|
}
|
|
74
87
|
catch (err) {
|
|
75
|
-
console.error('Error generating path:', err);
|
|
76
88
|
console.log('Path:', path);
|
|
77
89
|
console.log('Params:', params);
|
|
78
90
|
console.warn(`menu path ${path} is errored due to missing params. If it is not required, please use hidemenu option`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateMenuLink.js","sources":["../../src/utils/generateMenuLink.ts"],"sourcesContent":[null],"names":[],"mappings":"AAwEA,
|
|
1
|
+
{"version":3,"file":"generateMenuLink.js","sources":["../../src/utils/generateMenuLink.ts"],"sourcesContent":[null],"names":[],"mappings":"AAwEA,SAAA,eAA6B,EAAA,OAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export * from './componentSize';
|
|
|
3
3
|
export * from './parentRoute';
|
|
4
4
|
export * from './menuUtils';
|
|
5
5
|
export * from './matchMenuKeys';
|
|
6
|
-
export * from './getAntdLocale';
|
|
7
6
|
export * from './generateMenuLink';
|
|
7
|
+
export * from './settingsDifference';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchMenuKeys.d.ts","sourceRoot":"","sources":["../../src/utils/matchMenuKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;;;;;GAOG;AAEH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"matchMenuKeys.d.ts","sourceRoot":"","sources":["../../src/utils/matchMenuKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;;;;;GAOG;AAEH,eAAO,MAAM,gBAAgB,GAAI,WAAW,YAAY,EAAE,EAAE,aAAa,MAAM,KAAG,MAAM,EA2CvF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchMenuKeys.js","sources":["../../src/utils/matchMenuKeys.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;AAEA;;;;;;;AAOG,MAAA,gBAAA,GAAA,CAAA,SAAA,EAAA,WAAA,KAAA;AAEH,
|
|
1
|
+
{"version":3,"file":"matchMenuKeys.js","sources":["../../src/utils/matchMenuKeys.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;AAEA;;;;;;;AAOG,MAAA,gBAAA,GAAA,CAAA,SAAA,EAAA,WAAA,KAAA;AAEH,IAAA,MAAA,SAAa,GAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuUtils.d.ts","sourceRoot":"","sources":["../../src/utils/menuUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAChF;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"menuUtils.d.ts","sourceRoot":"","sources":["../../src/utils/menuUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAChF;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,SAAS,EAAE,EAAE,gBAAW,KAAG,SAAS,EAqB5E,CAAC;AAMF,wBAAgB,aAAa,CAAC,IAAI,KAAA,OAcjC;AACD,wBAAgB,SAAS,CAAC,GAAG,KAAA,EAAE,UAAU,SAAK,QAO7C;AAED,eAAO,MAAM,sBAAsB,GAAI,WAAW,GAAG,EAAE,EAAE,aAAY,MAAM,EAAO,UASjF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,WAAM,QAa5C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,KAAA,QAY9C"}
|
package/lib/utils/menuUtils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {get,sortBy
|
|
1
|
+
import {get,cloneDeep,sortBy}from'lodash-es';import {PermissionType}from'common';import {logger}from'@cdm-logger/client';/**
|
|
2
2
|
* Custom menuDataRender function which will be called on component render
|
|
3
3
|
* to filter out menus from props.menuData on the basis of authorities.
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuUtils.js","sources":["../../src/utils/menuUtils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAaG;AACH;AA2BA;AAeA,MAAA,uCAA+B;AAS/B,IAAO,MAAA,CAAA,KAAA,CAAA,kCAA2C,CAAA;AAWlD,
|
|
1
|
+
{"version":3,"file":"menuUtils.js","sources":["../../src/utils/menuUtils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAaG;AACH;AA2BA;AAeA,MAAA,uCAA+B;AAS/B,IAAO,MAAA,CAAA,KAAA,CAAA,kCAA2C,CAAA;AAWlD,IAAA,MAAA,cAAa,GAAA,mBAA0B,CAAA,QAAA,CAAA;AAevC,IAAA,QAAA;;;AAGG,QAAA,MAAA,EAAA,SAAA,EAAA,GAAA,IAAA;AACH,QAAA,IAAA,KAAA,CAAA,OAA2C,CAAA,SAAA,CAAA,IAAA,SAAA,EAAA,MAAI,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parentRoute.d.ts","sourceRoot":"","sources":["../../src/utils/parentRoute.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"parentRoute.d.ts","sourceRoot":"","sources":["../../src/utils/parentRoute.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,GAAa,cAAS,EAAE,iBAAY,QAwBhE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settingsDiff.test.d.ts","sourceRoot":"","sources":["../../src/utils/settingsDiff.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settingsDifference.d.ts","sourceRoot":"","sources":["../../src/utils/settingsDifference.ts"],"names":[],"mappings":"AAuKA;;GAEG;AACH,eAAO,MAAM,iCAAiC,GAAI,iBAAiB,GAAG,EAAE,iBAAiB,GAAG,QAoD3F,CAAC"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import {cloneDeep,get,isObject,isEqual,transform}from'lodash-es';/**
|
|
2
|
+
* Gets the deep differences between two objects
|
|
3
|
+
* Returns only the values that differ from obj2
|
|
4
|
+
*/
|
|
5
|
+
const getDifference = (obj1, obj2) => {
|
|
6
|
+
// Create copies to avoid modifying the original objects
|
|
7
|
+
const source = cloneDeep(obj1);
|
|
8
|
+
const target = cloneDeep(obj2);
|
|
9
|
+
// If obj1 is undefined or null, return undefined to avoid adding to result
|
|
10
|
+
if (source === undefined || source === null) {
|
|
11
|
+
// Only include null/undefined if they differ from obj2
|
|
12
|
+
return source !== target ? source : undefined;
|
|
13
|
+
}
|
|
14
|
+
// If we're comparing different types, or if obj2 is null/undefined, return obj1
|
|
15
|
+
if (typeof source !== typeof target || target === undefined || target === null) {
|
|
16
|
+
return source;
|
|
17
|
+
}
|
|
18
|
+
// Handle non-object comparisons (primitives, functions, etc.)
|
|
19
|
+
if (!isObject(source) || !isObject(target)) {
|
|
20
|
+
// Case-insensitive string comparison
|
|
21
|
+
if (typeof source === 'string' && typeof target === 'string') {
|
|
22
|
+
return source.toLowerCase() !== target.toLowerCase() ? source : undefined;
|
|
23
|
+
}
|
|
24
|
+
return !isEqual(source, target) ? source : undefined;
|
|
25
|
+
}
|
|
26
|
+
// For arrays, do a simple equality check and return the full array if different
|
|
27
|
+
if (Array.isArray(source) && Array.isArray(target)) {
|
|
28
|
+
return !isEqual(source, target) ? source : undefined;
|
|
29
|
+
}
|
|
30
|
+
// For objects, do deep comparison
|
|
31
|
+
const result = transform(source, (result, value, key) => {
|
|
32
|
+
// Skip keys that are in source but have the exact same value in target
|
|
33
|
+
if (key in target && isEqual(value, target[key])) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// If the key doesn't exist in target, add it to the result
|
|
37
|
+
if (!(key in target)) {
|
|
38
|
+
result[key] = value;
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
// For nested objects, recursively get differences
|
|
42
|
+
if (isObject(value) && isObject(target[key])) {
|
|
43
|
+
const nestedDiff = getDifference(value, target[key]);
|
|
44
|
+
if (nestedDiff !== undefined && (Array.isArray(nestedDiff) || Object.keys(nestedDiff).length > 0)) {
|
|
45
|
+
result[key] = nestedDiff;
|
|
46
|
+
}
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
// For non-objects (primitives, etc.), only add if different
|
|
50
|
+
if (!isEqual(value, target[key])) {
|
|
51
|
+
result[key] = value;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
// Return undefined if the resulting object is empty
|
|
55
|
+
return Object.keys(result).length > 0 ? result : undefined;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Special handler for route settings differences with improved nested comparison
|
|
59
|
+
*/
|
|
60
|
+
const getRouteSettingsDifferences = (currentRouteSettings, defaultRouteSettings) => {
|
|
61
|
+
const differences = {};
|
|
62
|
+
// Get the default route template (typically from '/')
|
|
63
|
+
const defaultRouteTemplate = defaultRouteSettings['/'] || Object.values(defaultRouteSettings)[0];
|
|
64
|
+
if (!defaultRouteTemplate) {
|
|
65
|
+
console.warn('No default route template found for comparison');
|
|
66
|
+
return currentRouteSettings;
|
|
67
|
+
}
|
|
68
|
+
// Compare each route's settings
|
|
69
|
+
Object.keys(currentRouteSettings).forEach((route) => {
|
|
70
|
+
const currentRouteConfig = currentRouteSettings[route];
|
|
71
|
+
// Use the specific route config if it exists, otherwise use the default template
|
|
72
|
+
const defaultRouteConfig = defaultRouteSettings[route] || defaultRouteTemplate;
|
|
73
|
+
// Compare each section separately (layout, regions, etc)
|
|
74
|
+
const routeDiff = {};
|
|
75
|
+
Object.keys(currentRouteConfig).forEach((section) => {
|
|
76
|
+
if (section === 'layout' || section === 'regions') {
|
|
77
|
+
const sectionDiff = {};
|
|
78
|
+
// Compare desktop and mobile separately
|
|
79
|
+
['desktop', 'mobile'].forEach((device) => {
|
|
80
|
+
if (!currentRouteConfig[section][device]) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
// For regions section with header/footer/background
|
|
84
|
+
if (section === 'regions') {
|
|
85
|
+
const regionsDiff = {};
|
|
86
|
+
['header', 'footer', 'background'].forEach((region) => {
|
|
87
|
+
if (!currentRouteConfig[section][device][region]) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
// Get default path for comparison
|
|
91
|
+
const defaultRegionPath = `${section}.${device}.${region}`;
|
|
92
|
+
const defaultRegion = get(defaultRouteConfig, defaultRegionPath);
|
|
93
|
+
if (defaultRegion) {
|
|
94
|
+
const regionDiff = getDifference(currentRouteConfig[section][device][region], defaultRegion);
|
|
95
|
+
if (regionDiff !== undefined &&
|
|
96
|
+
(Array.isArray(regionDiff) || Object.keys(regionDiff).length > 0)) {
|
|
97
|
+
regionsDiff[region] = regionDiff;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
if (Object.keys(regionsDiff).length > 0) {
|
|
102
|
+
sectionDiff[device] = regionsDiff;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
// For other sections (like layout)
|
|
107
|
+
const defaultDevicePath = `${section}.${device}`;
|
|
108
|
+
const defaultDevice = get(defaultRouteConfig, defaultDevicePath);
|
|
109
|
+
if (defaultDevice) {
|
|
110
|
+
const deviceDiff = getDifference(currentRouteConfig[section][device], defaultDevice);
|
|
111
|
+
if (deviceDiff !== undefined && Object.keys(deviceDiff).length > 0) {
|
|
112
|
+
sectionDiff[device] = deviceDiff;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
if (Object.keys(sectionDiff).length > 0) {
|
|
118
|
+
routeDiff[section] = sectionDiff;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
const sectionDiff = getDifference(currentRouteConfig[section], defaultRouteConfig[section]);
|
|
123
|
+
if (sectionDiff !== undefined && Object.keys(sectionDiff).length > 0) {
|
|
124
|
+
routeDiff[section] = sectionDiff;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
// Only include the route if there are actual differences
|
|
129
|
+
if (Object.keys(routeDiff).length > 0) {
|
|
130
|
+
differences[route] = routeDiff;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
return Object.keys(differences).length > 0 ? differences : undefined;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Compares settings objects and saves only the differences
|
|
137
|
+
*/
|
|
138
|
+
const compareAndSaveSettingsDifferences = (currentSettings, defaultSettings) => {
|
|
139
|
+
try {
|
|
140
|
+
if (!currentSettings || !defaultSettings) {
|
|
141
|
+
console.warn('Missing settings objects for comparison');
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
// Make deep clones to avoid modifying the original objects
|
|
145
|
+
const current = cloneDeep(currentSettings);
|
|
146
|
+
const defaults = cloneDeep(defaultSettings);
|
|
147
|
+
// Handle route settings separately
|
|
148
|
+
const routeSettingsDiff = current.routeSettings
|
|
149
|
+
? getRouteSettingsDifferences(current.routeSettings, defaults?.routeSettings || {})
|
|
150
|
+
: undefined;
|
|
151
|
+
// Make a copy of settings without routeSettings to compare separately
|
|
152
|
+
const currentWithoutRoutes = { ...current };
|
|
153
|
+
const defaultWithoutRoutes = { ...defaults };
|
|
154
|
+
delete currentWithoutRoutes.routeSettings;
|
|
155
|
+
delete defaultWithoutRoutes.routeSettings;
|
|
156
|
+
// Get differences for all other settings
|
|
157
|
+
const otherSettingsDiff = getDifference(currentWithoutRoutes, defaultWithoutRoutes);
|
|
158
|
+
// Combine the differences
|
|
159
|
+
const diffSettings = {};
|
|
160
|
+
// Add other settings differences if any exist and are not empty objects
|
|
161
|
+
if (otherSettingsDiff && Object.keys(otherSettingsDiff).length > 0) {
|
|
162
|
+
Object.assign(diffSettings, otherSettingsDiff);
|
|
163
|
+
}
|
|
164
|
+
// Add route settings differences if any exist
|
|
165
|
+
if (routeSettingsDiff && Object.keys(routeSettingsDiff).length > 0) {
|
|
166
|
+
diffSettings.routeSettings = routeSettingsDiff;
|
|
167
|
+
}
|
|
168
|
+
// If there are no differences at all, return early
|
|
169
|
+
if (Object.keys(diffSettings).length === 0) {
|
|
170
|
+
return {};
|
|
171
|
+
}
|
|
172
|
+
// Remove empty objects from the diff
|
|
173
|
+
// This helps prevent unnecessary properties in the payload
|
|
174
|
+
const cleanDiffSettings = removeEmptyObjects(diffSettings);
|
|
175
|
+
return cleanDiffSettings;
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
console.error('Error comparing settings differences:', error);
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Recursively removes empty objects from an object
|
|
184
|
+
* This helps clean up the diff payload
|
|
185
|
+
*/
|
|
186
|
+
function removeEmptyObjects(obj) {
|
|
187
|
+
if (!isObject(obj) || Array.isArray(obj)) {
|
|
188
|
+
return obj;
|
|
189
|
+
}
|
|
190
|
+
const result = {};
|
|
191
|
+
let hasKeys = false;
|
|
192
|
+
Object.keys(obj).forEach((key) => {
|
|
193
|
+
const value = obj[key];
|
|
194
|
+
if (isObject(value) && !Array.isArray(value)) {
|
|
195
|
+
const cleanValue = removeEmptyObjects(value);
|
|
196
|
+
if (Object.keys(cleanValue).length > 0) {
|
|
197
|
+
result[key] = cleanValue;
|
|
198
|
+
hasKeys = true;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
else if (value !== undefined) {
|
|
202
|
+
result[key] = value;
|
|
203
|
+
hasKeys = true;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
return hasKeys ? result : {};
|
|
207
|
+
}export{compareAndSaveSettingsDifferences};//# sourceMappingURL=settingsDifference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settingsDifference.js","sources":["../../src/utils/settingsDifference.ts"],"sourcesContent":[null],"names":[],"mappings":";AAyKG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settingsDifference.test.d.ts","sourceRoot":"","sources":["../../src/utils/settingsDifference.test.ts"],"names":[],"mappings":""}
|