@griddo/ax 1.62.6 → 1.63.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 (84) hide show
  1. package/package.json +6 -5
  2. package/src/GlobalStore.tsx +1 -1
  3. package/src/Style/index.tsx +2 -0
  4. package/src/api/pages.tsx +20 -0
  5. package/src/api/utils.tsx +5 -2
  6. package/src/components/Browser/index.tsx +144 -39
  7. package/src/components/Browser/style.tsx +47 -11
  8. package/src/components/ConfigPanel/index.tsx +3 -3
  9. package/src/components/Fields/RichText/index.tsx +2 -2
  10. package/src/components/Fields/UrlField/utils.tsx +10 -1
  11. package/src/components/Icon/components/Desktop.js +9 -4
  12. package/src/components/Icon/components/Phone.js +4 -4
  13. package/src/components/Icon/components/Share.js +12 -0
  14. package/src/components/Icon/components/Tablet.js +4 -4
  15. package/src/components/Icon/svgs/Share.svg +3 -0
  16. package/src/components/MainWrapper/AppBar/index.tsx +19 -7
  17. package/src/components/MainWrapper/AppBar/style.tsx +20 -4
  18. package/src/components/MainWrapper/index.tsx +1 -1
  19. package/src/components/SideModal/index.tsx +1 -1
  20. package/src/components/TableFilters/DateFilter/index.tsx +48 -0
  21. package/src/components/TableFilters/DateFilter/style.tsx +29 -0
  22. package/src/components/TableFilters/index.tsx +2 -0
  23. package/src/components/Tabs/index.tsx +17 -7
  24. package/src/components/Tabs/style.tsx +29 -16
  25. package/src/components/Tooltip/index.tsx +1 -1
  26. package/src/components/Tooltip/style.tsx +2 -0
  27. package/src/components/index.tsx +2 -0
  28. package/src/containers/App/reducer.tsx +3 -1
  29. package/src/containers/Navigation/Defaults/actions.tsx +2 -1
  30. package/src/containers/PageEditor/actions.tsx +65 -10
  31. package/src/containers/Settings/DataPacks/actions.tsx +4 -1
  32. package/src/containers/Sites/actions.tsx +3 -1
  33. package/src/helpers/dates.tsx +3 -4
  34. package/src/helpers/index.tsx +2 -0
  35. package/src/helpers/strings.tsx +38 -7
  36. package/src/hooks/forms.tsx +1 -2
  37. package/src/index.tsx +2 -2
  38. package/src/modules/Content/OptionTable/index.tsx +29 -2
  39. package/src/modules/Content/PageItem/index.tsx +11 -2
  40. package/src/modules/Content/index.tsx +9 -0
  41. package/src/modules/GlobalEditor/Editor/index.tsx +7 -9
  42. package/src/modules/GlobalEditor/{Editor/PageBrowser → PageBrowser}/index.tsx +14 -6
  43. package/src/modules/GlobalEditor/Preview/index.tsx +19 -0
  44. package/src/modules/GlobalEditor/Preview/style.tsx +9 -0
  45. package/src/modules/GlobalEditor/index.tsx +41 -9
  46. package/src/modules/Navigation/Defaults/DefaultsEditor/Editor/DefaultsBrowser/index.tsx +5 -1
  47. package/src/modules/Navigation/Defaults/DefaultsEditor/index.tsx +9 -7
  48. package/src/modules/PageEditor/Editor/index.tsx +5 -5
  49. package/src/modules/PageEditor/{Editor/PageBrowser → PageBrowser}/index.tsx +11 -4
  50. package/src/modules/PageEditor/Preview/index.tsx +14 -0
  51. package/src/modules/PageEditor/Preview/style.tsx +9 -0
  52. package/src/modules/PageEditor/index.tsx +40 -16
  53. package/src/modules/PublicPreview/index.tsx +92 -0
  54. package/src/modules/PublicPreview/style.tsx +18 -0
  55. package/src/modules/Redirects/BulkHeader/TableHeader/index.tsx +16 -3
  56. package/src/modules/Redirects/BulkHeader/TableHeader/style.tsx +9 -3
  57. package/src/modules/Redirects/BulkHeader/index.tsx +7 -1
  58. package/src/modules/Redirects/RedirectItem/index.tsx +4 -0
  59. package/src/modules/Redirects/RedirectItem/style.tsx +19 -3
  60. package/src/modules/Redirects/atoms.tsx +0 -1
  61. package/src/modules/Redirects/hooks.tsx +67 -0
  62. package/src/modules/Redirects/index.tsx +23 -9
  63. package/src/modules/Redirects/utils.tsx +10 -0
  64. package/src/modules/Settings/ContentTypes/DataPacks/Config/Form/TemplateConfig/TemplateEditor/Editor/ConfigPanel/Field/index.tsx +107 -0
  65. package/src/modules/Settings/ContentTypes/DataPacks/Config/Form/TemplateConfig/TemplateEditor/Editor/ConfigPanel/Field/style.tsx +54 -0
  66. package/src/modules/Settings/ContentTypes/DataPacks/Config/Form/TemplateConfig/TemplateEditor/Editor/ConfigPanel/index.tsx +66 -0
  67. package/src/modules/Settings/ContentTypes/DataPacks/Config/Form/TemplateConfig/TemplateEditor/Editor/ConfigPanel/style.tsx +42 -0
  68. package/src/modules/Settings/ContentTypes/DataPacks/Config/Form/TemplateConfig/TemplateEditor/Editor/TemplateBrowser/index.tsx +58 -0
  69. package/src/modules/Settings/ContentTypes/DataPacks/Config/Form/TemplateConfig/TemplateEditor/Editor/index.tsx +41 -0
  70. package/src/modules/Settings/ContentTypes/DataPacks/Config/Form/TemplateConfig/TemplateEditor/index.tsx +93 -0
  71. package/src/modules/Settings/ContentTypes/DataPacks/Config/Form/TemplateConfig/TemplateEditor/style.tsx +25 -0
  72. package/src/modules/Settings/ContentTypes/DataPacks/Config/Form/TemplateConfig/index.tsx +48 -0
  73. package/src/modules/Settings/ContentTypes/DataPacks/Config/Form/TemplateConfig/style.tsx +53 -0
  74. package/src/modules/Settings/ContentTypes/DataPacks/Config/Form/index.tsx +40 -36
  75. package/src/modules/Settings/ContentTypes/DataPacks/Config/Form/style.tsx +4 -5
  76. package/src/modules/Settings/ContentTypes/DataPacks/Config/index.tsx +4 -4
  77. package/src/modules/Settings/ContentTypes/DataPacks/index.tsx +5 -1
  78. package/src/modules/Settings/{Analytics → SeoAnalyticsSettings/Analytics}/atoms.tsx +0 -0
  79. package/src/modules/Settings/{Analytics → SeoAnalyticsSettings/Analytics}/index.tsx +20 -11
  80. package/src/modules/Settings/{Analytics → SeoAnalyticsSettings/Analytics}/style.tsx +6 -0
  81. package/src/modules/Settings/{SeoSettings → SeoAnalyticsSettings}/index.tsx +11 -4
  82. package/src/routes/publicRoutes.tsx +3 -1
  83. package/src/routes/site.tsx +14 -10
  84. package/src/types/index.tsx +9 -0
@@ -31,6 +31,7 @@ const DataPacks = (props: IProps): JSX.Element => {
31
31
  addDataPacks,
32
32
  deleteSiteDataPack,
33
33
  activatedDataPacks,
34
+ routerAction,
34
35
  } = props;
35
36
 
36
37
  const isFromPage = selected && selected.templates && selected.templates.length > 0;
@@ -55,8 +56,9 @@ const DataPacks = (props: IProps): JSX.Element => {
55
56
  }, [getSiteDataPacks, getDataPacksCategories]);
56
57
 
57
58
  useEffect(() => {
58
- setSelected(null);
59
+ if (routerAction !== "POP") setSelected(null);
59
60
  getActivatedPacks();
61
+ // eslint-disable-next-line react-hooks/exhaustive-deps
60
62
  }, [getActivatedPacks, setSelected]);
61
63
 
62
64
  const deactivateDataPack = (force = false) => {
@@ -212,6 +214,7 @@ interface IProps {
212
214
  selected: any;
213
215
  form: any;
214
216
  activatedDataPacks: IDataPack[];
217
+ routerAction: string;
215
218
  getSiteDataPacks: (queryParams?: string) => void;
216
219
  setSelected: (dataPack?: any) => void;
217
220
  updateDataPack: (dataPack?: any) => void;
@@ -237,6 +240,7 @@ const mapStateToProps = (state: IRootState) => ({
237
240
  selected: state.dataPacks.selected,
238
241
  form: state.dataPacks.configFormData,
239
242
  activatedDataPacks: state.dataPacks.activated,
243
+ routerAction: state.router.action,
240
244
  });
241
245
 
242
246
  export default connect(mapStateToProps, mapDispatchToProps)(DataPacks);
@@ -1,10 +1,10 @@
1
1
  import React, { useEffect, useState } from "react";
2
2
  import { connect } from "react-redux";
3
3
 
4
- import { IAnalytics, IRootState } from "@ax/types";
4
+ import { IAnalytics, INavItem, IRootState } from "@ax/types";
5
5
  import { appActions } from "@ax/containers/App";
6
6
  import { analyticsActions } from "@ax/containers/Analytics";
7
- import { MainWrapper, Loading } from "@ax/components";
7
+ import { MainWrapper, Loading, Nav } from "@ax/components";
8
8
  import { useIsDirty } from "@ax/hooks";
9
9
  import { RouteLeavingGuard } from "@ax/guards";
10
10
 
@@ -13,6 +13,8 @@ import * as S from "./style";
13
13
 
14
14
  const Analytics = (props: IProps): JSX.Element => {
15
15
  const {
16
+ navItems,
17
+ currentNavItem,
16
18
  isSaving,
17
19
  isLoading,
18
20
  analytics,
@@ -33,7 +35,7 @@ const Analytics = (props: IProps): JSX.Element => {
33
35
  useEffect(() => {
34
36
  setScriptCode(analytics.scriptCode);
35
37
  setShowWarning(!analytics.siteScriptCodeExists);
36
- // eslint-disable-next-line react-hooks/exhaustive-deps
38
+ // eslint-disable-next-line react-hooks/exhaustive-deps
37
39
  }, [analytics]);
38
40
 
39
41
  const handleSave = async () => {
@@ -55,24 +57,29 @@ const Analytics = (props: IProps): JSX.Element => {
55
57
  );
56
58
 
57
59
  const analyticsSettings = (
58
- <S.ContentWrapper>
60
+ <>
59
61
  {showWarning ? (
60
62
  <Warning setShowWarning={setShowWarning} />
61
63
  ) : (
62
- <S.AnalyticsWrapper>
63
- <ScriptCode scriptCode={scriptCode} setScriptCode={setScriptCode} />
64
- {analytics.dimensions && <Dimensions dimensions={analytics.dimensions} />}
65
- {analytics.groups && <Groups groups={analytics.groups} />}
66
- </S.AnalyticsWrapper>
64
+ <S.AnalyticsWrapper>
65
+ <ScriptCode scriptCode={scriptCode} setScriptCode={setScriptCode} />
66
+ {analytics.dimensions && <Dimensions dimensions={analytics.dimensions} />}
67
+ {analytics.groups && <Groups groups={analytics.groups} />}
68
+ </S.AnalyticsWrapper>
67
69
  )}
68
- </S.ContentWrapper>
70
+ </>
69
71
  )
70
72
 
71
73
  return (
72
74
  <>
73
75
  <RouteLeavingGuard when={isDirty} action={setRoute} text={modalText} />
74
76
  <MainWrapper backLink={false} title="Analytics Settings" rightButton={rightButtonProps}>
75
- {isLoading ? <Loading /> : analyticsSettings}
77
+ <S.Wrapper>
78
+ <Nav current={currentNavItem} items={navItems} onClick={setRoute} />
79
+ <S.ContentWrapper>
80
+ {isLoading ? <Loading /> : analyticsSettings}
81
+ </S.ContentWrapper>
82
+ </S.Wrapper>
76
83
  </MainWrapper>
77
84
  </>
78
85
  );
@@ -92,6 +99,8 @@ const mapDispatchToProps = {
92
99
  };
93
100
 
94
101
  interface IAnalyticsProps {
102
+ navItems: INavItem[];
103
+ currentNavItem: INavItem;
95
104
  isSaving: boolean;
96
105
  isLoading: boolean;
97
106
  analytics: IAnalytics;
@@ -1,5 +1,10 @@
1
1
  import styled from "styled-components";
2
2
 
3
+ const Wrapper = styled.div`
4
+ display: flex;
5
+ height: 100%;
6
+ `;
7
+
3
8
  const Heading = styled.div`
4
9
  ${(p) => p.theme.textStyle.headingXS};
5
10
  color: ${p => p.theme.color.textHighEmphasis};
@@ -92,6 +97,7 @@ const ContentType = styled.div`
92
97
  `;
93
98
 
94
99
  export {
100
+ Wrapper,
95
101
  Heading,
96
102
  Description,
97
103
  WarningHeading,
@@ -1,16 +1,23 @@
1
1
  import React from "react";
2
2
  import { Switch, Route } from "react-router-dom";
3
+
3
4
  import Redirects from "../../Redirects";
5
+ import Analytics from "./Analytics";
4
6
 
5
7
  const navItems = [
6
8
  {
7
9
  title: "SEO",
8
- path: "/sites/settings/seo-settings",
10
+ path: "/sites/settings/seo",
9
11
  component: Redirects,
10
12
  },
13
+ {
14
+ title: "Analytics",
15
+ path: "/sites/settings/analytics",
16
+ component: Analytics
17
+ },
11
18
  ];
12
19
 
13
- const SeoSettings = (): JSX.Element => {
20
+ const SeoAnalyticsSettings = (): JSX.Element => {
14
21
  return (
15
22
  <Switch>
16
23
  {navItems.map((item, index) => (
@@ -19,7 +26,7 @@ const SeoSettings = (): JSX.Element => {
19
26
  </Route>
20
27
  ))}
21
28
  </Switch>
22
- );
29
+ )
23
30
  };
24
31
 
25
- export default SeoSettings;
32
+ export default SeoAnalyticsSettings;
@@ -1,11 +1,13 @@
1
1
  import ResetPass from "./../modules/ResetPass";
2
2
  import CreatePass from "./../modules/CreatePass";
3
3
  import Login from "./../modules/Login";
4
+ import PublicPreview from "./../modules/PublicPreview";
4
5
 
5
6
  const publicRoutes = [
6
7
  { path: "/login", component: Login, name: "Login", hideNav: true },
7
8
  { path: "/new-password/:id/:token", component: ResetPass, name: "Reset Password", hideNav: true },
8
- { path: "/set-password/:id/:token", component: CreatePass, name: "Create Password", hideNav: true }
9
+ { path: "/set-password/:id/:token", component: CreatePass, name: "Create Password", hideNav: true },
10
+ { path: "/page-preview/:id/:entity", component: PublicPreview, name: "Preview", hideNav: true },
9
11
  ];
10
12
 
11
13
  export default publicRoutes;
@@ -7,8 +7,8 @@ import ContentTypes from "./../modules/Settings/ContentTypes";
7
7
  import Settings from "./../modules/Settings";
8
8
  import CategoriesList from "./../modules/Categories/CategoriesList";
9
9
  import StructuredData from "./../modules/StructuredData";
10
- import SeoSettings from "./../modules/Settings/SeoSettings";
11
- import Analytics from "./../modules/Settings/Analytics";
10
+ import SeoAnalyticsSettings from "./../modules/Settings/SeoAnalyticsSettings";
11
+ import TemplateEditor from "../modules/Settings/ContentTypes/DataPacks/Config/Form/TemplateConfig/TemplateEditor";
12
12
 
13
13
  const BASE_PATH = "/sites";
14
14
 
@@ -60,6 +60,14 @@ export default [
60
60
  hideNav: true,
61
61
  isEditor: true,
62
62
  },
63
+ {
64
+ path: `${BASE_PATH}/settings/content-types/editor`,
65
+ component: TemplateEditor,
66
+ name: "Template Editor",
67
+ showInNav: false,
68
+ hideNav: true,
69
+ isEditor: true,
70
+ },
63
71
  {
64
72
  path: `${BASE_PATH}/settings`,
65
73
  component: null,
@@ -81,14 +89,9 @@ export default [
81
89
  name: "Content types",
82
90
  },
83
91
  {
84
- path: `${BASE_PATH}/settings/seo-settings`,
85
- component: SeoSettings,
86
- name: "SEO Settings",
87
- },
88
- {
89
- path: `${BASE_PATH}/settings/analytics`,
90
- component: Analytics,
91
- name: "Analytics",
92
+ path: `${BASE_PATH}/settings/seo`,
93
+ component: SeoAnalyticsSettings,
94
+ name: "SEO & Analytics",
92
95
  },
93
96
  ],
94
97
  },
@@ -96,4 +99,5 @@ export default [
96
99
  },
97
100
  { path: `${BASE_PATH}/settings/languages`, component: Settings, name: "Languages", showInNav: false },
98
101
  { path: `${BASE_PATH}/settings/social`, component: Settings, name: "Social", showInNav: false },
102
+ { path: `${BASE_PATH}/settings/analytics`, component: SeoAnalyticsSettings, name: "Analytics", showInNav: false },
99
103
  ];
@@ -687,6 +687,7 @@ export interface IRedirect {
687
687
  to: { pageId?: number; url: string; linkTo?: number; href?: string };
688
688
  site?: { siteId: number | null; siteName: string | null; siteUrl: string | null };
689
689
  domain?: string;
690
+ date?: string;
690
691
  }
691
692
 
692
693
  export interface IAnalytics {
@@ -709,6 +710,14 @@ export interface IDimensionsGroup {
709
710
  templates?: string;
710
711
  }
711
712
 
713
+ export interface ITemplate {
714
+ dataPacks: string[],
715
+ id: string,
716
+ thumbnails: Record<string, string>,
717
+ title: string,
718
+ type: { label: string, value: string, mode: string },
719
+ }
720
+
712
721
  export type Field =
713
722
  | "AsyncCheckGroup"
714
723
  | "AsyncSelect"