@griddo/ax 11.14.4 → 11.14.5-rc.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/package.json +2 -2
- package/src/api/sites.tsx +2 -2
- package/src/components/Fields/ImageField/index.tsx +52 -28
- package/src/components/Fields/ImageField/style.tsx +22 -13
- package/src/components/Fields/NoteField/index.tsx +1 -3
- package/src/components/Fields/NoteField/style.tsx +1 -0
- package/src/components/Fields/TextArea/style.tsx +5 -2
- package/src/components/Fields/ToggleField/index.tsx +3 -2
- package/src/components/FieldsBehavior/index.tsx +27 -3
- package/src/components/FieldsBehavior/style.tsx +9 -7
- package/src/components/FloatingNote/index.tsx +1 -1
- package/src/components/FloatingPanel/style.tsx +4 -1
- package/src/components/HeadingsPreviewModal/style.tsx +1 -1
- package/src/components/Icon/components/Party.js +16 -0
- package/src/components/Icon/svgs/Party.svg +3 -0
- package/src/components/Image/index.tsx +2 -1
- package/src/components/Image/utils.ts +3 -3
- package/src/components/MainWrapper/AppBar/atoms.tsx +118 -34
- package/src/components/MainWrapper/AppBar/index.tsx +64 -86
- package/src/components/MainWrapper/AppBar/style.tsx +5 -0
- package/src/components/MainWrapper/index.tsx +2 -41
- package/src/containers/Navigation/Defaults/reducer.tsx +2 -2
- package/src/containers/Sites/actions.tsx +2 -3
- package/src/modules/Content/index.tsx +26 -8
- package/src/modules/Content/style.tsx +5 -0
- package/src/modules/GlobalSettings/Robots/Item/RobotsPanel/index.tsx +34 -17
- package/src/modules/GlobalSettings/Robots/Item/RobotsPanel/style.tsx +37 -5
- package/src/modules/GlobalSettings/Robots/index.tsx +4 -3
- package/src/modules/Navigation/Defaults/DefaultsEditor/index.tsx +8 -17
- package/src/modules/Navigation/Defaults/Item/index.tsx +17 -19
- package/src/modules/Navigation/Defaults/index.tsx +5 -8
- package/src/modules/Settings/Globals/NavigationModules/index.tsx +1 -1
- package/src/modules/Settings/Globals/NavigationModules/style.tsx +1 -2
- package/src/modules/Settings/Globals/index.tsx +194 -73
- package/src/modules/Settings/Globals/style.tsx +67 -1
- package/src/modules/Settings/Integrations/IntegrationItem/index.tsx +2 -3
- package/src/modules/Sites/SitesList/GridView/GridSiteItem/index.tsx +13 -5
- package/src/modules/Sites/SitesList/GridView/GridSiteItem/style.tsx +16 -8
- package/src/modules/Sites/SitesList/ListView/BulkHeader/TableHeader/index.tsx +1 -0
- package/src/modules/Sites/SitesList/ListView/BulkHeader/TableHeader/style.tsx +7 -1
- package/src/modules/Sites/SitesList/ListView/ListSiteItem/index.tsx +8 -1
- package/src/modules/Sites/SitesList/ListView/ListSiteItem/style.tsx +7 -1
- package/src/modules/Sites/SitesList/SiteModal/index.tsx +77 -23
- package/src/modules/Sites/SitesList/atoms.tsx +4 -4
- package/src/modules/Sites/SitesList/index.tsx +9 -47
- package/src/modules/Sites/SitesList/style.tsx +8 -4
- package/src/modules/Users/UserForm/index.tsx +1 -1
- package/src/types/index.tsx +11 -22
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState } from "react";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Button, FloatingPanel } from "@ax/components";
|
|
4
|
+
import type { IDomainRobot } from "@ax/types";
|
|
5
5
|
|
|
6
6
|
import * as S from "./style";
|
|
7
7
|
|
|
@@ -26,23 +26,40 @@ const RobotsPanel = (props: IProps): JSX.Element => {
|
|
|
26
26
|
|
|
27
27
|
const placeholder = "User-agent: * \nAllow: *";
|
|
28
28
|
|
|
29
|
+
const noteTitle = "From site settings · read-only";
|
|
30
|
+
|
|
31
|
+
const noteText = (
|
|
32
|
+
<>
|
|
33
|
+
Each site under this domain can define its own sitemap and visibility rules for search engines and LLMs from its
|
|
34
|
+
{` `}
|
|
35
|
+
<strong>site settings</strong>. Rules from all sites are listed below and will be combined with your custom rules
|
|
36
|
+
above to generate the final robots.txt.
|
|
37
|
+
<br />
|
|
38
|
+
<br />
|
|
39
|
+
{item.computedContent}
|
|
40
|
+
</>
|
|
41
|
+
);
|
|
42
|
+
|
|
29
43
|
return (
|
|
30
44
|
<FloatingPanel title={title} toggleModal={toggleModal} isOpen={isOpen}>
|
|
31
45
|
<S.Wrapper>
|
|
32
|
-
<S.
|
|
33
|
-
<S.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
<S.Content>
|
|
47
|
+
<S.Item>
|
|
48
|
+
<S.ItemHeader>You are editing</S.ItemHeader>
|
|
49
|
+
<S.ItemContent>{item.fullUrl}</S.ItemContent>
|
|
50
|
+
</S.Item>
|
|
51
|
+
<S.StyledFieldsBehavior
|
|
52
|
+
fieldType="TextArea"
|
|
53
|
+
onChange={setValue}
|
|
54
|
+
value={value}
|
|
55
|
+
title="Robots.txt"
|
|
56
|
+
placeholder={placeholder}
|
|
57
|
+
/>
|
|
58
|
+
<Button buttonStyle="text" type="button" icon="refresh" disabled={!value} onClick={resetItem}>
|
|
59
|
+
Reset to default
|
|
60
|
+
</Button>
|
|
61
|
+
{item.computedContent?.length > 0 && <S.StyledFNoteField value={{ title: noteTitle, text: noteText }} />}
|
|
62
|
+
</S.Content>
|
|
46
63
|
<S.Footer>
|
|
47
64
|
<Button className="button" type="button" onClick={editButton.action}>
|
|
48
65
|
{editButton.label}
|
|
@@ -1,8 +1,31 @@
|
|
|
1
|
+
import { FieldsBehavior, NoteField } from "@ax/components";
|
|
2
|
+
|
|
1
3
|
import styled from "styled-components";
|
|
2
4
|
|
|
3
5
|
const Wrapper = styled.div`
|
|
4
|
-
|
|
6
|
+
display: flex;
|
|
7
|
+
|
|
8
|
+
flex-direction: column;
|
|
5
9
|
height: 100%;
|
|
10
|
+
max-height: 100%;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
const Content = styled.div`
|
|
15
|
+
flex: 1;
|
|
16
|
+
overflow-y: auto;
|
|
17
|
+
padding: ${(p) => p.theme.spacing.m};
|
|
18
|
+
|
|
19
|
+
&::-webkit-scrollbar {
|
|
20
|
+
-webkit-appearance: none;
|
|
21
|
+
width: 4px;
|
|
22
|
+
height: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&::-webkit-scrollbar-thumb {
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
background-color: ${(p) => p.theme.colors.iconNonActive};
|
|
28
|
+
}
|
|
6
29
|
`;
|
|
7
30
|
|
|
8
31
|
const Item = styled.div`
|
|
@@ -27,9 +50,18 @@ const ItemContent = styled.div`
|
|
|
27
50
|
`;
|
|
28
51
|
|
|
29
52
|
const Footer = styled.div`
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
padding: ${(p) => p.theme.spacing.m};
|
|
56
|
+
justify-content: flex-end;
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
const StyledFieldsBehavior = styled((props) => <FieldsBehavior {...props} />)`
|
|
60
|
+
margin-bottom: 0;
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
const StyledFNoteField = styled((props) => <NoteField {...props} />)`
|
|
64
|
+
margin-top: ${(p) => p.theme.spacing.m};
|
|
33
65
|
`;
|
|
34
66
|
|
|
35
|
-
export { Wrapper, Item, ItemHeader, ItemContent, Footer };
|
|
67
|
+
export { Wrapper, Content, Item, ItemHeader, ItemContent, Footer, StyledFieldsBehavior, StyledFNoteField };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
2
|
import { connect } from "react-redux";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { ErrorToast, Loading, MainWrapper, Nav } from "@ax/components";
|
|
5
5
|
import { appActions } from "@ax/containers/App";
|
|
6
6
|
import { domainsActions } from "@ax/containers/Domains";
|
|
7
|
-
import { MainWrapper, ErrorToast, Nav, Loading } from "@ax/components";
|
|
8
7
|
import { RouteLeavingGuard } from "@ax/guards";
|
|
9
8
|
import { useIsDirty } from "@ax/hooks";
|
|
9
|
+
import type { IDomainRobot, INavItem, IRootState } from "@ax/types";
|
|
10
|
+
|
|
10
11
|
import Item from "./Item";
|
|
11
12
|
|
|
12
13
|
import * as S from "./style";
|
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
-
import { connect } from "react-redux";
|
|
3
2
|
import { withErrorBoundary } from "react-error-boundary";
|
|
3
|
+
import { connect } from "react-redux";
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
INotification,
|
|
9
|
-
ILanguage,
|
|
10
|
-
INavigationLanguage,
|
|
11
|
-
IHeader,
|
|
12
|
-
IFooter,
|
|
13
|
-
INavigation,
|
|
14
|
-
} from "@ax/types";
|
|
15
|
-
import { useIsDirty, useModal, usePermission } from "@ax/hooks";
|
|
5
|
+
import { ErrorPage, ErrorToast, Loading, MainWrapper, Modal, Notification, RestoreModal } from "@ax/components";
|
|
6
|
+
import { appActions } from "@ax/containers/App";
|
|
7
|
+
import { menuActions, navigationActions } from "@ax/containers/Navigation";
|
|
16
8
|
import { RouteLeavingGuard } from "@ax/guards";
|
|
9
|
+
import { useIsDirty, useModal, usePermission } from "@ax/hooks";
|
|
10
|
+
import type { ILanguage, INavigation, INavigationLanguage, INotification, IRootState, ISite } from "@ax/types";
|
|
17
11
|
|
|
18
|
-
import { appActions } from "@ax/containers/App";
|
|
19
|
-
import { navigationActions, menuActions } from "@ax/containers/Navigation";
|
|
20
|
-
import { ErrorPage, ErrorToast, Loading, MainWrapper, Modal, Notification, RestoreModal } from "@ax/components";
|
|
21
12
|
import Editor from "./Editor";
|
|
22
13
|
|
|
23
14
|
import * as S from "./style";
|
|
@@ -87,7 +78,7 @@ const DefaultsEditor = (props: IProps) => {
|
|
|
87
78
|
useEffect(() => {
|
|
88
79
|
const editorType = editorContent?.type;
|
|
89
80
|
const navigationModuleComponent = editorType ? currentSiteInfo?.navigationModules?.[editorType] : undefined;
|
|
90
|
-
const currentNavigation = currentDefaultsContent?.find((item
|
|
81
|
+
const currentNavigation = currentDefaultsContent?.find((item) => item.id === editorContent?.id);
|
|
91
82
|
if (navigationModuleComponent && editorContent && currentNavigation) {
|
|
92
83
|
const isNavigationModuleChanged = navigationModuleComponent !== currentNavigation.component;
|
|
93
84
|
if (isNavigationModuleChanged) setIsDirty(true);
|
|
@@ -260,7 +251,7 @@ interface IStateProps {
|
|
|
260
251
|
isLoading: boolean;
|
|
261
252
|
lang: { locale: string; id: number | null };
|
|
262
253
|
siteLanguages: ILanguage[];
|
|
263
|
-
currentDefaultsContent:
|
|
254
|
+
currentDefaultsContent: INavigation[];
|
|
264
255
|
selectedDefault: string;
|
|
265
256
|
editorContent: INavigation | null;
|
|
266
257
|
header: number | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState } from "react";
|
|
2
2
|
import { connect } from "react-redux";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import type { ICheck, ILanguage, INavigationLanguage, INavigation } from "@ax/types";
|
|
5
5
|
import { useModal, usePermission } from "@ax/hooks";
|
|
6
6
|
import { appActions } from "@ax/containers/App";
|
|
7
7
|
import { navigationActions, menuActions } from "@ax/containers/Navigation";
|
|
@@ -58,16 +58,16 @@ const DefaultItem = (props: IProps): JSX.Element => {
|
|
|
58
58
|
|
|
59
59
|
const handleRenameItem = () => {
|
|
60
60
|
const updatedItem = { ...defaultContent, title: inputValue };
|
|
61
|
-
updateNavigation(defaultContent.id
|
|
61
|
+
updateNavigation(defaultContent.id!, updatedItem);
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
const handleSetDefault = () => setDefaultNavigation(defaultContent.id
|
|
64
|
+
const handleSetDefault = () => setDefaultNavigation(defaultContent.id!, defaultContent.type);
|
|
65
65
|
|
|
66
66
|
const handleErrorAction = () => toggleReplaceModal();
|
|
67
67
|
|
|
68
68
|
const removeItem = async () => {
|
|
69
|
-
const deleted = await deleteNavigation(defaultContent.id
|
|
70
|
-
setDeletedNav(defaultContent.id);
|
|
69
|
+
const deleted = await deleteNavigation(defaultContent.id!, defaultContent.type, handleErrorAction);
|
|
70
|
+
setDeletedNav(defaultContent.id!);
|
|
71
71
|
if (deleted) {
|
|
72
72
|
toggleToast();
|
|
73
73
|
}
|
|
@@ -104,15 +104,13 @@ const DefaultItem = (props: IProps): JSX.Element => {
|
|
|
104
104
|
|
|
105
105
|
const getCurrentLanguages = () => {
|
|
106
106
|
const availables: ILanguage[] = [];
|
|
107
|
-
navigationLanguages.forEach(
|
|
108
|
-
(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}),
|
|
115
|
-
);
|
|
107
|
+
navigationLanguages.forEach((navLang) => {
|
|
108
|
+
languages?.forEach((siteLang) => {
|
|
109
|
+
if (siteLang.id === navLang.languageId) {
|
|
110
|
+
availables.push(siteLang);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
});
|
|
116
114
|
|
|
117
115
|
return availables;
|
|
118
116
|
};
|
|
@@ -146,7 +144,7 @@ const DefaultItem = (props: IProps): JSX.Element => {
|
|
|
146
144
|
const setNav = (id: number) => (isHeader ? setHeader(id) : setFooter(id));
|
|
147
145
|
const selectedNavLanguage = getSelectedNavLanguage(navigationLanguages, language);
|
|
148
146
|
const setTranslation = () =>
|
|
149
|
-
selectedNavLanguage ? setNav(selectedNavLanguage.navigationId) : setNav(defaultContent.id);
|
|
147
|
+
selectedNavLanguage ? setNav(selectedNavLanguage.navigationId) : setNav(defaultContent.id!);
|
|
150
148
|
setTranslation();
|
|
151
149
|
!selectedNavLanguage && createNewTranslation(true);
|
|
152
150
|
await getMenus();
|
|
@@ -162,7 +160,7 @@ const DefaultItem = (props: IProps): JSX.Element => {
|
|
|
162
160
|
<S.CheckCell role="cell">
|
|
163
161
|
<CheckField
|
|
164
162
|
name="check"
|
|
165
|
-
value={defaultContent.id}
|
|
163
|
+
value={defaultContent.id!}
|
|
166
164
|
checked={isSelected || hoverCheck}
|
|
167
165
|
onChange={handleOnChange}
|
|
168
166
|
/>
|
|
@@ -229,12 +227,12 @@ const DefaultItem = (props: IProps): JSX.Element => {
|
|
|
229
227
|
};
|
|
230
228
|
|
|
231
229
|
interface IProps {
|
|
232
|
-
defaultContent:
|
|
230
|
+
defaultContent: INavigation;
|
|
233
231
|
languages: ILanguage[];
|
|
234
232
|
lang: { locale: string; id: number | null };
|
|
235
233
|
handleClick: (e: any) => void;
|
|
236
234
|
setHistoryPush(path: string, isEditor?: boolean): any;
|
|
237
|
-
updateNavigation(navID: number, data:
|
|
235
|
+
updateNavigation(navID: number, data: INavigation): void;
|
|
238
236
|
isSelected: boolean;
|
|
239
237
|
toggleToast(): void;
|
|
240
238
|
onChange: (e: any) => void;
|
|
@@ -6,7 +6,7 @@ import { appActions } from "@ax/containers/App";
|
|
|
6
6
|
import { menuActions, navigationActions } from "@ax/containers/Navigation";
|
|
7
7
|
import { capitalize, isMultipleNavigationModules } from "@ax/helpers";
|
|
8
8
|
import { useBulkSelection, useModal, usePermission, useToast } from "@ax/hooks";
|
|
9
|
-
import type { IFooter, IHeader, ILanguage, IRootState, ISite } from "@ax/types";
|
|
9
|
+
import type { IFooter, IHeader, ILanguage, INavigation, IRootState, ISite } from "@ax/types";
|
|
10
10
|
|
|
11
11
|
import { NavigationModulesWarning } from "./atoms";
|
|
12
12
|
import BulkHeader from "./BulkHeader";
|
|
@@ -54,10 +54,7 @@ const DefaultsList = (props: IProps): JSX.Element => {
|
|
|
54
54
|
const isAllowedToCreate = usePermission(`navigation.createSite${selectedDefault}`);
|
|
55
55
|
const isAllowedToDelete = usePermission(`navigation.deleteSite${selectedDefault}`);
|
|
56
56
|
|
|
57
|
-
const navIds = useMemo(
|
|
58
|
-
() => currentDefaultsContent?.map((nav: IHeader | IFooter) => nav.id),
|
|
59
|
-
[currentDefaultsContent],
|
|
60
|
-
);
|
|
57
|
+
const navIds = useMemo(() => currentDefaultsContent?.map((nav) => nav.id), [currentDefaultsContent]);
|
|
61
58
|
|
|
62
59
|
const {
|
|
63
60
|
resetBulkSelection,
|
|
@@ -105,7 +102,7 @@ const DefaultsList = (props: IProps): JSX.Element => {
|
|
|
105
102
|
const isNavigationModulesChanged = Boolean(
|
|
106
103
|
currentSiteInfo?.navigationModules?.[currentType] &&
|
|
107
104
|
currentDefaultsContent.some(
|
|
108
|
-
(navigation) => navigation.component !== currentSiteInfo?.navigationModules[currentType],
|
|
105
|
+
(navigation) => navigation.component !== currentSiteInfo?.navigationModules?.[currentType],
|
|
109
106
|
),
|
|
110
107
|
);
|
|
111
108
|
setIsNavigationNotificationOpen(isNavigationModulesChanged);
|
|
@@ -251,7 +248,7 @@ const DefaultsList = (props: IProps): JSX.Element => {
|
|
|
251
248
|
hasFixedHeader={true}
|
|
252
249
|
tableRef={tableRef}
|
|
253
250
|
>
|
|
254
|
-
{currentDefaultsContent?.map((defaultContent
|
|
251
|
+
{currentDefaultsContent?.map((defaultContent) => {
|
|
255
252
|
const isItemSelected = isSelected(defaultContent.id);
|
|
256
253
|
return (
|
|
257
254
|
<DefaultItem
|
|
@@ -315,7 +312,7 @@ interface IDefaultsProps {
|
|
|
315
312
|
lang: { locale: string; id: number | null };
|
|
316
313
|
siteLanguages: ILanguage[];
|
|
317
314
|
selectedDefault: string;
|
|
318
|
-
currentDefaultsContent:
|
|
315
|
+
currentDefaultsContent: INavigation[];
|
|
319
316
|
totalItems: number;
|
|
320
317
|
currentSiteInfo: ISite | null;
|
|
321
318
|
}
|
|
@@ -3,7 +3,7 @@ import styled from "styled-components";
|
|
|
3
3
|
const Wrapper = styled.div`
|
|
4
4
|
border-top: 1px solid ${(p) => p.theme.color.uiLine};
|
|
5
5
|
margin: ${(p) => p.theme.spacing.m} 0;
|
|
6
|
-
padding: ${(p) => p.theme.spacing.m}
|
|
6
|
+
padding-top: ${(p) => p.theme.spacing.m};
|
|
7
7
|
`;
|
|
8
8
|
|
|
9
9
|
const Heading = styled.div`
|
|
@@ -15,7 +15,6 @@ const Heading = styled.div`
|
|
|
15
15
|
const Text = styled.div`
|
|
16
16
|
${(p) => p.theme.textStyle.uiM};
|
|
17
17
|
color: ${(p) => p.theme.color.textMediumEmphasis};
|
|
18
|
-
width: calc(${(p) => p.theme.spacing.l} * 12);
|
|
19
18
|
`;
|
|
20
19
|
|
|
21
20
|
const Separator = styled.div`
|