@griddo/ax 11.14.4 → 11.15.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.
Files changed (48) hide show
  1. package/package.json +2 -2
  2. package/src/api/sites.tsx +2 -2
  3. package/src/components/Fields/ImageField/index.tsx +52 -28
  4. package/src/components/Fields/ImageField/style.tsx +22 -13
  5. package/src/components/Fields/NoteField/index.tsx +1 -3
  6. package/src/components/Fields/NoteField/style.tsx +1 -0
  7. package/src/components/Fields/TextArea/style.tsx +5 -2
  8. package/src/components/Fields/ToggleField/index.tsx +3 -2
  9. package/src/components/FieldsBehavior/index.tsx +27 -3
  10. package/src/components/FieldsBehavior/style.tsx +9 -7
  11. package/src/components/FloatingNote/index.tsx +1 -1
  12. package/src/components/FloatingPanel/style.tsx +4 -1
  13. package/src/components/HeadingsPreviewModal/style.tsx +1 -1
  14. package/src/components/Icon/components/Party.js +16 -0
  15. package/src/components/Icon/svgs/Party.svg +3 -0
  16. package/src/components/Image/index.tsx +2 -1
  17. package/src/components/Image/utils.ts +3 -3
  18. package/src/components/MainWrapper/AppBar/atoms.tsx +118 -34
  19. package/src/components/MainWrapper/AppBar/index.tsx +64 -86
  20. package/src/components/MainWrapper/AppBar/style.tsx +5 -0
  21. package/src/components/MainWrapper/index.tsx +2 -41
  22. package/src/containers/Navigation/Defaults/reducer.tsx +2 -2
  23. package/src/containers/Sites/actions.tsx +2 -3
  24. package/src/modules/Content/index.tsx +26 -8
  25. package/src/modules/Content/style.tsx +5 -0
  26. package/src/modules/GlobalSettings/Robots/Item/RobotsPanel/index.tsx +34 -17
  27. package/src/modules/GlobalSettings/Robots/Item/RobotsPanel/style.tsx +37 -5
  28. package/src/modules/GlobalSettings/Robots/index.tsx +4 -3
  29. package/src/modules/Navigation/Defaults/DefaultsEditor/index.tsx +8 -17
  30. package/src/modules/Navigation/Defaults/Item/index.tsx +17 -19
  31. package/src/modules/Navigation/Defaults/index.tsx +5 -8
  32. package/src/modules/Settings/Globals/NavigationModules/index.tsx +1 -1
  33. package/src/modules/Settings/Globals/NavigationModules/style.tsx +1 -2
  34. package/src/modules/Settings/Globals/index.tsx +194 -73
  35. package/src/modules/Settings/Globals/style.tsx +67 -1
  36. package/src/modules/Settings/Integrations/IntegrationItem/index.tsx +2 -3
  37. package/src/modules/Sites/SitesList/GridView/GridSiteItem/index.tsx +13 -5
  38. package/src/modules/Sites/SitesList/GridView/GridSiteItem/style.tsx +16 -8
  39. package/src/modules/Sites/SitesList/ListView/BulkHeader/TableHeader/index.tsx +1 -0
  40. package/src/modules/Sites/SitesList/ListView/BulkHeader/TableHeader/style.tsx +7 -1
  41. package/src/modules/Sites/SitesList/ListView/ListSiteItem/index.tsx +8 -1
  42. package/src/modules/Sites/SitesList/ListView/ListSiteItem/style.tsx +7 -1
  43. package/src/modules/Sites/SitesList/SiteModal/index.tsx +77 -23
  44. package/src/modules/Sites/SitesList/atoms.tsx +4 -4
  45. package/src/modules/Sites/SitesList/index.tsx +9 -47
  46. package/src/modules/Sites/SitesList/style.tsx +8 -4
  47. package/src/modules/Users/UserForm/index.tsx +1 -1
  48. package/src/types/index.tsx +11 -22
@@ -1,8 +1,28 @@
1
- import { Button, Icon } from "@ax/components";
1
+ import { useMemo } from "react";
2
+
3
+ import { Button, Flag, FloatingMenu, Icon, Modal, Tooltip } from "@ax/components";
4
+ import type { IActionMenuOption, ILanguage } from "@ax/types";
2
5
 
3
6
  import * as S from "./style";
4
7
 
5
- const ActionMenuItem = (item: any, color?: boolean) => {
8
+ interface IMenuButton {
9
+ action: () => void;
10
+ disabled?: boolean;
11
+ label: string;
12
+ helpText?: string | null;
13
+ }
14
+
15
+ interface IMenu {
16
+ button?: IMenuButton | null;
17
+ options: IActionMenuOption[];
18
+ }
19
+
20
+ interface IDownArrowButtonProps {
21
+ inversed?: boolean;
22
+ disabled?: boolean;
23
+ }
24
+
25
+ const ActionMenuItem = (item: IActionMenuOption, color?: boolean) => {
6
26
  const { icon, action, label } = item;
7
27
  return (
8
28
  <S.ActionItem data-testid="action-menu-item" className={color ? "" : "grey"} key={icon} onClick={action}>
@@ -12,47 +32,111 @@ const ActionMenuItem = (item: any, color?: boolean) => {
12
32
  );
13
33
  };
14
34
 
15
- const ActionMenuBtn = (props: any) => {
16
- const { menu } = props;
35
+ const ActionMenuBtn = ({ menu }: { menu?: IMenu }) => {
36
+ if (!menu?.button) return null;
17
37
  return (
18
- menu?.button && (
19
- <S.ButtonWrapper>
20
- <Button type="button" buttonStyle="line" onClick={menu.button.action} disabled={menu.button.disabled}>
21
- {menu.button.label}
22
- </Button>
23
- {menu.button.helpText && <S.HelpText>{menu.button.helpText}</S.HelpText>}
24
- </S.ButtonWrapper>
25
- )
38
+ <S.ButtonWrapper>
39
+ <Button type="button" buttonStyle="line" onClick={menu.button.action} disabled={menu.button.disabled}>
40
+ {menu.button.label}
41
+ </Button>
42
+ {menu.button.helpText && <S.HelpText>{menu.button.helpText}</S.HelpText>}
43
+ </S.ButtonWrapper>
26
44
  );
27
45
  };
28
46
 
29
- const ActionMenu = (props: any) => {
30
- const { menu } = props;
31
- return (
32
- <S.ActionMenu>
33
- <S.ActionMenuTitle> More actions </S.ActionMenuTitle>
34
- <ActionMenuBtn menu={menu} />
35
- {menu?.options.map((item: any) => item && ActionMenuItem(item))}
36
- </S.ActionMenu>
37
- );
38
- };
47
+ const ActionMenu = ({ menu }: { menu: IMenu }) => (
48
+ <S.ActionMenu>
49
+ <S.ActionMenuTitle> More actions </S.ActionMenuTitle>
50
+ <ActionMenuBtn menu={menu} />
51
+ {menu?.options.map((item) => item && ActionMenuItem(item))}
52
+ </S.ActionMenu>
53
+ );
39
54
 
40
- const DownArrowButton = (props: any) => (
41
- <S.IconWrapper inversed={props.inversed} disabled={props.disabled} data-testid="down-arrow-button-wrapper">
55
+ const DownArrowButton = ({ inversed, disabled }: IDownArrowButtonProps) => (
56
+ <S.IconWrapper inversed={inversed} disabled={disabled} data-testid="down-arrow-button-wrapper">
42
57
  <Icon name="DownArrow" />
43
58
  </S.IconWrapper>
44
59
  );
45
60
 
46
- const ActionSimpleMenu = (props: any) => {
47
- const { menu } = props;
48
- return (
49
- menu &&
50
- menu.options.length > 0 && (
51
- <S.ActionMenu data-testid="action-simple-menu">
52
- {menu.options.map((item: any) => ActionMenuItem(item, true))}
53
- </S.ActionMenu>
54
- )
61
+ const ActionSimpleMenu = ({ menu }: { menu?: IMenu }) =>
62
+ menu && menu.options.length > 0 ? (
63
+ <S.ActionMenu data-testid="action-simple-menu">
64
+ {menu.options.map((item) => item && ActionMenuItem(item, true))}
65
+ </S.ActionMenu>
66
+ ) : null;
67
+
68
+ const StatusBtn = ({ pageStatus }: { pageStatus: string }) => (
69
+ <S.StatusBtn data-testid="status-button">
70
+ <Icon name={pageStatus} size="24" />
71
+ </S.StatusBtn>
72
+ );
73
+
74
+ interface IPageStatusProps {
75
+ pageStatus?: string;
76
+ pageStatusActions?: IActionMenuOption[];
77
+ hasRightButton?: boolean;
78
+ }
79
+
80
+ const PageStatus = ({ pageStatus, pageStatusActions, hasRightButton }: IPageStatusProps) => {
81
+ const ps = pageStatus ?? "offline";
82
+ const statusMenu: IMenu = { options: pageStatusActions ?? [] };
83
+ const offset = hasRightButton ? -20 : -135;
84
+ const BoundStatusBtn = useMemo(() => () => <StatusBtn pageStatus={ps} />, [ps]);
85
+ return statusMenu.options && statusMenu.options.length > 0 ? (
86
+ <FloatingMenu Button={BoundStatusBtn} isInAppBar position="left" offset={offset}>
87
+ <ActionSimpleMenu menu={statusMenu} />
88
+ </FloatingMenu>
89
+ ) : (
90
+ <Icon name={ps} size="24" />
55
91
  );
56
92
  };
57
93
 
58
- export { ActionMenu, ActionSimpleMenu, DownArrowButton };
94
+ const ErrorCenterBtn = () => (
95
+ <S.ErrorWrapper>
96
+ <Tooltip content="Error center" bottom>
97
+ <Icon name="alert" size="24" />
98
+ </Tooltip>
99
+ </S.ErrorWrapper>
100
+ );
101
+
102
+ interface ILanguageBtnProps {
103
+ language: { locale: string; id: number | null };
104
+ availableLanguages?: ILanguage[];
105
+ }
106
+
107
+ const LanguageBtn = ({ language, availableLanguages }: ILanguageBtnProps) => (
108
+ <>
109
+ <S.FlagWrapper data-testid="language-menu-btn">
110
+ <Flag name={language.locale} size="24" />
111
+ </S.FlagWrapper>
112
+ <S.LanguageTextWrapper data-testid="language-locale-label">{language.locale}</S.LanguageTextWrapper>
113
+ {!!availableLanguages?.length && <DownArrowButton />}
114
+ </>
115
+ );
116
+
117
+ interface IChangeLanguageModalProps {
118
+ isOpen: boolean;
119
+ hide: () => void;
120
+ title: string;
121
+ mainAction: { title: string; onClick: () => void };
122
+ secondaryAction: { title: string; onClick: () => void };
123
+ }
124
+
125
+ const ChangeLanguageModal = ({ isOpen, hide, title, mainAction, secondaryAction }: IChangeLanguageModalProps) => (
126
+ <Modal isOpen={isOpen} hide={hide} title={title} mainAction={mainAction} secondaryAction={secondaryAction}>
127
+ <S.ModalContent>
128
+ If you change without saving it, it will be lost. Do you want to discard your changes?
129
+ </S.ModalContent>
130
+ </Modal>
131
+ );
132
+
133
+ export {
134
+ ActionMenu,
135
+ ActionSimpleMenu,
136
+ ChangeLanguageModal,
137
+ DownArrowButton,
138
+ ErrorCenterBtn,
139
+ LanguageBtn,
140
+ PageStatus,
141
+ type IMenuButton,
142
+ };
@@ -1,25 +1,31 @@
1
- import { useState } from "react";
1
+ import { useEffect, useMemo, useState } from "react";
2
2
  import { type RouteComponentProps, withRouter } from "react-router-dom";
3
3
 
4
4
  import {
5
5
  Button,
6
6
  ErrorCenter,
7
7
  ExportButton,
8
- Flag,
9
8
  FloatingMenu,
10
- Icon,
11
9
  IconAction,
12
10
  LanguageMenu,
13
- Modal,
14
11
  SearchField,
15
12
  Tabs,
13
+ Tag,
16
14
  Tooltip,
17
15
  } from "@ax/components";
18
16
  import { getScheduleFormatDate, trimText } from "@ax/helpers";
19
17
  import { useModal } from "@ax/hooks";
20
- import type { IErrorItem, ILanguage } from "@ax/types";
18
+ import type { IActionMenuOption, IErrorItem, ILanguage } from "@ax/types";
21
19
 
22
- import { ActionMenu, ActionSimpleMenu, DownArrowButton } from "./atoms";
20
+ import {
21
+ ActionMenu,
22
+ ChangeLanguageModal,
23
+ DownArrowButton,
24
+ ErrorCenterBtn,
25
+ type IMenuButton,
26
+ LanguageBtn,
27
+ PageStatus,
28
+ } from "./atoms";
23
29
 
24
30
  import * as S from "./style";
25
31
 
@@ -54,6 +60,7 @@ const AppBar = (props: IProps): JSX.Element => {
54
60
  exportAction,
55
61
  scheduledPublication,
56
62
  isSaving,
63
+ showTagHidden = false,
57
64
  } = props;
58
65
 
59
66
  const publishedTooltip: Record<string, string> = {
@@ -69,9 +76,21 @@ const AppBar = (props: IProps): JSX.Element => {
69
76
  const isScheduledPub = !!scheduledPublication && pageStatus === "scheduled";
70
77
  const currentLang = availableLanguages?.find((lang) => lang.id === language?.id);
71
78
 
79
+ const hasLanguageOrMore = !!(language || pageStatus || rightButton || rightLineButton);
80
+ const hasStatusOrMore = !!(pageStatus || rightButton || rightLineButton);
81
+ const hasActionItems = !!(rightButton || rightLineButton);
82
+
83
+ const languageTooltip = typeof currentPageID === "number" ? "Add language" : undefined;
84
+
85
+ const classes = [fixedClass, additionalClass, hasAnimation && "animate"].filter(Boolean).join(" ");
86
+
72
87
  const { isOpen, toggleModal } = useModal();
73
88
  const [langSelected, setLangSelected] = useState<ILanguage | undefined>(currentLang);
74
89
 
90
+ useEffect(() => {
91
+ setLangSelected(currentLang);
92
+ }, [currentLang]);
93
+
75
94
  const goToPages = () =>
76
95
  typeof backLink === "string" ? props.history.push(backLink, { isFromEditor }) : props.history.goBack();
77
96
 
@@ -87,53 +106,6 @@ const AppBar = (props: IProps): JSX.Element => {
87
106
  languageAction(item);
88
107
  };
89
108
 
90
- const LanguageBtn = () =>
91
- language ? (
92
- <>
93
- <S.FlagWrapper data-testid="language-menu-btn">
94
- <Flag name={language.locale} size="24" />
95
- </S.FlagWrapper>
96
- <S.LanguageTextWrapper data-testid="language-locale-label">{language.locale}</S.LanguageTextWrapper>
97
- {!!availableLanguages?.length && <DownArrowButton />}
98
- </>
99
- ) : (
100
- <></>
101
- );
102
-
103
- const ErrorCenterBtn = () => (
104
- <S.ErrorWrapper>
105
- <Tooltip content="Error center" bottom>
106
- <Icon name="alert" size="24" />
107
- </Tooltip>
108
- </S.ErrorWrapper>
109
- );
110
-
111
- const StatusBtn = () =>
112
- pageStatus ? (
113
- <S.StatusBtn data-testid="status-button">
114
- <Icon name={pageStatus} size="24" />
115
- </S.StatusBtn>
116
- ) : (
117
- <></>
118
- );
119
-
120
- const statusMenu = {
121
- options: pageStatusActions,
122
- };
123
-
124
- const PageStatus = () => {
125
- const offset = rightButton || rightLineButton ? -20 : -135;
126
- return statusMenu.options && statusMenu.options.length > 0 ? (
127
- <FloatingMenu Button={StatusBtn} isInAppBar={true} position="left" offset={offset}>
128
- <ActionSimpleMenu menu={statusMenu} />
129
- </FloatingMenu>
130
- ) : (
131
- <Icon name={pageStatus ?? "offline"} size="24" />
132
- );
133
- };
134
-
135
- const modalText = <>If you change without saving it, it will be lost. Do you want to discard your changes?</>;
136
-
137
109
  const mainAction = {
138
110
  title: "Change language",
139
111
  onClick: () => handleLanguage(langSelected),
@@ -147,24 +119,11 @@ const AppBar = (props: IProps): JSX.Element => {
147
119
  },
148
120
  };
149
121
 
150
- const changeLanguageModalProps = {
151
- isOpen,
152
- hide: toggleModal,
153
- title: "Change language",
154
- mainAction,
155
- secondaryAction,
156
- };
157
-
158
- const ChangeLanguageModal = () => (
159
- <Modal {...changeLanguageModalProps}>
160
- <S.ModalContent>{modalText}</S.ModalContent>
161
- </Modal>
122
+ const BoundLanguageBtn = useMemo(
123
+ () => () => <LanguageBtn language={language!} availableLanguages={availableLanguages} />,
124
+ [language, availableLanguages],
162
125
  );
163
126
 
164
- const languageTooltip = typeof currentPageID === "number" && "Add language";
165
-
166
- const classes = hasAnimation ? `${fixedClass} ${additionalClass} animate` : `${fixedClass} ${additionalClass}`;
167
-
168
127
  return (
169
128
  <S.Header className={classes} inversed={inversed} data-testid="appbar-header">
170
129
  <S.WrapperTitle>
@@ -188,7 +147,7 @@ const AppBar = (props: IProps): JSX.Element => {
188
147
  icons={tabs.icons}
189
148
  active={tabs.selectedTab}
190
149
  setSelectedTab={tabs.action}
191
- isInAppBar={true}
150
+ isInAppBar
192
151
  inversed={inversed}
193
152
  disabled={tabs.disabled}
194
153
  />
@@ -207,17 +166,31 @@ const AppBar = (props: IProps): JSX.Element => {
207
166
  closeOnInactive
208
167
  />
209
168
  </S.SearchWrapper>
210
- {(language || pageStatus || rightButton || rightLineButton) && <S.Separator />}
169
+ {hasLanguageOrMore && <S.Separator />}
170
+ </>
171
+ )}
172
+ {showTagHidden && (
173
+ <>
174
+ <S.TagWrapper>
175
+ <Tag text="Hidden" type="square" icon="hide" />
176
+ </S.TagWrapper>
177
+ {hasLanguageOrMore && <S.Separator />}
211
178
  </>
212
179
  )}
213
180
  {language && availableLanguages && (
214
181
  <>
215
- <ChangeLanguageModal />
182
+ <ChangeLanguageModal
183
+ isOpen={isOpen}
184
+ hide={toggleModal}
185
+ title="Change language"
186
+ mainAction={mainAction}
187
+ secondaryAction={secondaryAction}
188
+ />
216
189
  <S.LanguageWrapper data-testid="language-wrapper">
217
190
  <Tooltip content={languageTooltip} hideOnClick bottom>
218
191
  <FloatingMenu
219
- Button={LanguageBtn}
220
- isInAppBar={true}
192
+ Button={BoundLanguageBtn}
193
+ isInAppBar
221
194
  position="left"
222
195
  offset={rightButton || rightLineButton ? 0 : -85}
223
196
  disabled={!availableLanguages.length}
@@ -227,32 +200,36 @@ const AppBar = (props: IProps): JSX.Element => {
227
200
  availableLanguages={availableLanguages}
228
201
  currentLanguages={currentLanguages || availableLanguages}
229
202
  setLanguage={handleLanguage}
230
- isInAppBar={true}
203
+ isInAppBar
231
204
  isDraft={pageStatus === "modified"}
232
205
  />
233
206
  </FloatingMenu>
234
207
  </Tooltip>
235
208
  </S.LanguageWrapper>
236
- {(pageStatus || rightButton || rightLineButton) && <S.Separator />}
209
+ {hasStatusOrMore && <S.Separator />}
237
210
  </>
238
211
  )}
239
212
  {pageStatus && (
240
213
  <>
241
214
  <S.IconStatusWrapper data-testid="page-status-wrapper" last={!rightButton && !rightLineButton}>
242
215
  <Tooltip content={publishedTooltip[pageStatus]} bottom>
243
- <PageStatus />
216
+ <PageStatus
217
+ pageStatus={pageStatus}
218
+ pageStatusActions={pageStatusActions}
219
+ hasRightButton={!!(rightButton || rightLineButton)}
220
+ />
244
221
  </Tooltip>
245
222
  {isScheduledPub && (
246
223
  <S.ScheduledDate inversed={inversed}>{getScheduleFormatDate(scheduledPublication)}</S.ScheduledDate>
247
224
  )}
248
225
  </S.IconStatusWrapper>
249
- {(rightButton || rightLineButton) && <S.Separator />}
226
+ {hasActionItems && <S.Separator />}
250
227
  </>
251
228
  )}
252
229
  {isFromEditor && errors && errors.length > 0 && (
253
230
  <>
254
231
  <S.IconStatusWrapper last={false} data-testid="error-center-wrapper">
255
- <FloatingMenu Button={ErrorCenterBtn} isInAppBar={true} position="left" offset={-20}>
232
+ <FloatingMenu Button={ErrorCenterBtn} isInAppBar position="left" offset={-20}>
256
233
  <ErrorCenter errors={errors} actions={errorActions} />
257
234
  </FloatingMenu>
258
235
  </S.IconStatusWrapper>
@@ -278,7 +255,7 @@ const AppBar = (props: IProps): JSX.Element => {
278
255
  )}
279
256
  {downArrowMenu?.displayed && (downArrowMenu.button || downArrowMenu.options.length > 0) && (
280
257
  <Tooltip content="Actions" hideOnClick bottom>
281
- <FloatingMenu Button={DownArrowButton} isInAppBar={true} disabled={isSaving}>
258
+ <FloatingMenu Button={DownArrowButton} isInAppBar disabled={isSaving}>
282
259
  <ActionMenu menu={downArrowMenu} />
283
260
  </FloatingMenu>
284
261
  </Tooltip>
@@ -290,16 +267,16 @@ const AppBar = (props: IProps): JSX.Element => {
290
267
 
291
268
  export interface IAppBarProps {
292
269
  backLink?: boolean | string;
293
- rightButton?: { label: string; disabled?: boolean; action: (e: any) => void };
294
- rightLineButton?: { label: string; disabled?: boolean; action: (e: any) => void };
270
+ rightButton?: { label: string; disabled?: boolean; action: () => void };
271
+ rightLineButton?: { label: string; disabled?: boolean; action: () => void };
295
272
  tabs?: {
296
- tabSet?: any;
273
+ tabSet?: any[];
297
274
  icons?: { name: string; text: string }[];
298
275
  selectedTab: string;
299
- action: (e: any) => void;
276
+ action: (tab: string) => void;
300
277
  disabled?: boolean;
301
278
  };
302
- downArrowMenu?: { displayed: boolean; options: any; button: any };
279
+ downArrowMenu?: { displayed: boolean; options: IActionMenuOption[]; button?: IMenuButton | null };
303
280
  title: string;
304
281
  subtitle?: string;
305
282
  fixedAppBar?: boolean;
@@ -320,13 +297,14 @@ export interface IAppBarProps {
320
297
  goToPackage?(): void;
321
298
  };
322
299
  isFromEditor?: boolean;
323
- pageStatusActions?: any[];
300
+ pageStatusActions?: IActionMenuOption[];
324
301
  hasAnimation?: boolean;
325
302
  searchValue?: string;
326
303
  isDirty?: boolean;
327
304
  exportAction?(formats: (number | string)[]): void;
328
305
  scheduledPublication?: string | null;
329
306
  isSaving?: boolean;
307
+ showTagHidden?: boolean;
330
308
  }
331
309
 
332
310
  type IProps = IAppBarProps & RouteComponentProps;
@@ -233,6 +233,10 @@ const ScheduledDate = styled.div<{ inversed?: boolean }>`
233
233
  margin-left: ${(p) => p.theme.spacing.xs};
234
234
  `;
235
235
 
236
+ const TagWrapper = styled.div`
237
+
238
+ `;
239
+
236
240
  export {
237
241
  ActionItem,
238
242
  ActionMenu,
@@ -258,4 +262,5 @@ export {
258
262
  WrapperEnd,
259
263
  WrapperTabs,
260
264
  WrapperTitle,
265
+ TagWrapper,
261
266
  };
@@ -1,8 +1,7 @@
1
1
  import { Notification } from "@ax/components";
2
2
  import { useNetworkStatus } from "@ax/hooks";
3
- import type { IErrorItem, ILanguage } from "@ax/types";
4
3
 
5
- import AppBar from "./AppBar";
4
+ import AppBar, { type IAppBarProps } from "./AppBar";
6
5
 
7
6
  import * as S from "./style";
8
7
 
@@ -28,47 +27,9 @@ const MainWrapper = (props: IWrapperProps): JSX.Element => {
28
27
  );
29
28
  };
30
29
 
31
- export interface IWrapperProps {
30
+ export interface IWrapperProps extends IAppBarProps {
32
31
  children?: any[] | JSX.Element;
33
- backLink?: boolean | string;
34
- rightButton?: { label: string; disabled?: boolean; action: (e: any) => void };
35
- rightLineButton?: { label: string; disabled?: boolean; action: (e: any) => void };
36
- title: string;
37
- subtitle?: string;
38
- fixedAppBar?: boolean;
39
- additionalClass?: string;
40
- downArrowMenu?: { displayed: boolean; options: any; button: any };
41
- tabs?: {
42
- tabSet?: any;
43
- icons?: { name: string; text: string }[];
44
- selectedTab: string;
45
- action: (e: any) => void;
46
- disabled?: boolean;
47
- };
48
- pageStatus?: string;
49
- language?: { locale: string; id: number | null } | null;
50
- availableLanguages?: ILanguage[];
51
- currentLanguages?: ILanguage[];
52
- inversed?: boolean;
53
- currentPageID?: number;
54
32
  fullWidth?: boolean;
55
- isFromEditor?: boolean;
56
- languageAction?: (lang: ILanguage) => void;
57
- searchAction?(query: string): void;
58
- filterSearchAction?(filter: string): void;
59
- searchFilters?: any;
60
- errors?: IErrorItem[];
61
- errorActions?: {
62
- goToError(editorID: number, tab: string, template: boolean, parentEditorID?: number): void;
63
- goToPackage?(): void;
64
- };
65
- pageStatusActions?: any[];
66
- hasAnimation?: boolean;
67
- searchValue?: string;
68
- isDirty?: boolean;
69
- exportAction?(formats: (number | string)[]): void;
70
- scheduledPublication?: string | null;
71
- isSaving?: boolean;
72
33
  }
73
34
 
74
35
  export default MainWrapper;
@@ -1,4 +1,4 @@
1
- import { IBreadcrumbItem, IModule, INavigation, INavPages, ISchema } from "@ax/types";
1
+ import type { IBreadcrumbItem, IModule, INavigation, INavPages, ISchema } from "@ax/types";
2
2
 
3
3
  import {
4
4
  SET_EDITOR_CONTENT,
@@ -30,7 +30,7 @@ export interface INavigationState {
30
30
  selectedEditorID: number | undefined;
31
31
  header: number | null;
32
32
  footer: number | null;
33
- currentDefaultsContent: any;
33
+ currentDefaultsContent: INavigation[];
34
34
  totalItems: number;
35
35
  currentNavigationLanguages: any[];
36
36
  isNewTranslation: boolean;
@@ -16,7 +16,6 @@ import type {
16
16
  IPage,
17
17
  IQueryValue,
18
18
  IRootState,
19
- ISettingsForm,
20
19
  ISite,
21
20
  ISiteListConfig,
22
21
  IThemeElements,
@@ -228,7 +227,7 @@ function getAllSites(): (dispatch: Dispatch) => Promise<void> {
228
227
  };
229
228
  }
230
229
 
231
- function saveSettings(form: ISettingsForm): (dispatch: Dispatch, getState: () => IRootState) => Promise<boolean> {
230
+ function saveSettings(form: ISite): (dispatch: Dispatch, getState: () => IRootState) => Promise<boolean> {
232
231
  return async (dispatch, getState) => {
233
232
  try {
234
233
  const {
@@ -770,7 +769,7 @@ function deleteAndRemoveFromSiteBulk(
770
769
  }
771
770
  }
772
771
 
773
- return errors > 0 ? false : true;
772
+ return !(errors > 0);
774
773
  } catch (e) {
775
774
  console.log(e);
776
775
  return false;
@@ -6,6 +6,7 @@ import {
6
6
  EmptyState,
7
7
  ErrorToast,
8
8
  FilterTagsBar,
9
+ FloatingNote,
9
10
  Loading,
10
11
  MainWrapper,
11
12
  Notification,
@@ -137,10 +138,6 @@ const Content = (props: IProps): JSX.Element => {
137
138
  exportDataContent,
138
139
  } = props;
139
140
 
140
- if (!currentSiteInfo) {
141
- throw new Error(`ERROR: User reached Content with null site info`);
142
- }
143
-
144
141
  const itemsPerPage = 50;
145
142
  const firstPage = 1;
146
143
 
@@ -169,6 +166,8 @@ const Content = (props: IProps): JSX.Element => {
169
166
  const isDataEditable = (!isStructuredData || currentStructuredData?.editable) ?? null;
170
167
  const isDataPrivate = currentStructuredData?.private || false;
171
168
  const isDataExportable = currentStructuredData?.exportable || false;
169
+ const title = currentSiteInfo ? currentSiteInfo.name : `Site Content`;
170
+ const isSiteLlmsHidden = currentSiteInfo.hidden;
172
171
 
173
172
  const pagesIds = currentSitePages?.map((page) => page.id);
174
173
  const dataIds = currentDataContent?.map((data) => data.id);
@@ -786,8 +785,6 @@ const Content = (props: IProps): JSX.Element => {
786
785
 
787
786
  const content = isStructuredData ? mapStructuredData() : mapPages();
788
787
 
789
- const title = currentSiteInfo ? currentSiteInfo.name : `Site Content`;
790
-
791
788
  const options = {
792
789
  filters: getOptionFilters(structuredData, activatedDataPacks),
793
790
  values: getOptionValues(structuredData),
@@ -845,6 +842,11 @@ const Content = (props: IProps): JSX.Element => {
845
842
  setPage(1);
846
843
  };
847
844
 
845
+ const handleGoToSettings = () => {
846
+ const path = `/sites/settings/globals`;
847
+ setHistoryPush(path, false);
848
+ };
849
+
848
850
  const rightButtonProps = isAllowedToCreatePages
849
851
  ? {
850
852
  label: "New",
@@ -880,6 +882,7 @@ const Content = (props: IProps): JSX.Element => {
880
882
  errors={errors}
881
883
  searchValue={currentSearch}
882
884
  exportAction={exportContent}
885
+ showTagHidden={isSiteLlmsHidden}
883
886
  >
884
887
  <S.ContentListWrapper>
885
888
  <ContentFilters
@@ -919,6 +922,21 @@ const Content = (props: IProps): JSX.Element => {
919
922
  resetError={() => setNotification(null)}
920
923
  />
921
924
  )}
925
+ {isSiteLlmsHidden && (
926
+ <S.NoteWrapper>
927
+ <FloatingNote
928
+ icon="working"
929
+ message={
930
+ <>
931
+ Please note that this is site is <strong>hidden from search engines and AI models</strong>. To index
932
+ it, go to <strong>General Settings</strong>.
933
+ </>
934
+ }
935
+ btnText="Go to Settings"
936
+ onClick={handleGoToSettings}
937
+ />
938
+ </S.NoteWrapper>
939
+ )}
922
940
  <TableList
923
941
  tableHeader={Header}
924
942
  pagination={pagination}
@@ -978,7 +996,7 @@ const Content = (props: IProps): JSX.Element => {
978
996
  };
979
997
 
980
998
  const mapStateToProps = (state: IRootState) => ({
981
- currentSiteInfo: state.sites.currentSiteInfo,
999
+ currentSiteInfo: state.sites.currentSiteInfo!,
982
1000
  currentSitePages: state.sites.currentSitePages,
983
1001
  allSitePages: state.sites.allSitePages,
984
1002
  filter: state.sites.currentFilter,
@@ -1085,7 +1103,7 @@ const mapDispatchToProps = {
1085
1103
  };
1086
1104
 
1087
1105
  interface IPagesProps {
1088
- currentSiteInfo: ISite | null;
1106
+ currentSiteInfo: ISite;
1089
1107
  currentSitePages: IPage[];
1090
1108
  allSitePages: IPage[];
1091
1109
  filter: any;
@@ -55,6 +55,10 @@ const SearchTags = styled.div`
55
55
  }
56
56
  `;
57
57
 
58
+ const NoteWrapper = styled.div`
59
+ padding: ${(p) => `${p.theme.spacing.s} ${p.theme.spacing.m} 0 ${p.theme.spacing.m}`};
60
+ `;
61
+
58
62
  const LoadingWrapper = styled.div`
59
63
  position: relative;
60
64
  width: 100%;
@@ -71,4 +75,5 @@ export {
71
75
  SelectWrapper,
72
76
  NotificationWrapper,
73
77
  SearchTags,
78
+ NoteWrapper,
74
79
  };