@griddo/ax 10.4.22 → 10.4.24

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 (66) hide show
  1. package/package.json +3 -2
  2. package/public/img/icons/iconFile.svg +6 -0
  3. package/public/img/icons/iconVideo.svg +5 -0
  4. package/public/img/icons/txt.svg +5 -0
  5. package/src/components/{Login/Circle → Circle}/style.tsx +0 -1
  6. package/src/components/ErrorPage/index.tsx +118 -0
  7. package/src/components/ErrorPage/style.tsx +116 -0
  8. package/src/components/Fields/FileField/index.tsx +6 -2
  9. package/src/components/Fields/ImageField/index.tsx +20 -1
  10. package/src/components/Fields/ImageField/style.tsx +5 -0
  11. package/src/components/FileGallery/GalleryPanel/DetailPanel/index.tsx +1 -2
  12. package/src/components/FileGallery/GalleryPanel/DetailPanel/style.tsx +4 -0
  13. package/src/components/FileGallery/GridItem/index.tsx +1 -2
  14. package/src/components/FileGallery/GridItem/style.tsx +5 -3
  15. package/src/components/Icon/components/Working.js +10 -0
  16. package/src/components/Icon/svgs/Working.svg +3 -0
  17. package/src/components/Login/index.tsx +2 -2
  18. package/src/components/Login/style.tsx +3 -3
  19. package/src/components/index.tsx +4 -0
  20. package/src/containers/App/actions.tsx +19 -16
  21. package/src/containers/App/constants.tsx +0 -2
  22. package/src/containers/App/reducer.tsx +0 -2
  23. package/src/containers/Navigation/Defaults/actions.tsx +8 -12
  24. package/src/containers/Navigation/Defaults/constants.tsx +1 -0
  25. package/src/containers/Navigation/Defaults/interfaces.tsx +5 -0
  26. package/src/containers/Navigation/Defaults/reducer.tsx +3 -0
  27. package/src/containers/PageEditor/actions.tsx +7 -19
  28. package/src/containers/PageEditor/constants.tsx +1 -0
  29. package/src/containers/PageEditor/interfaces.tsx +5 -0
  30. package/src/containers/PageEditor/reducer.tsx +3 -0
  31. package/src/{modules/FileDrive/helpers.tsx → helpers/files.tsx} +10 -1
  32. package/src/helpers/index.tsx +3 -0
  33. package/src/helpers/requests.tsx +20 -12
  34. package/src/hooks/forms.tsx +43 -5
  35. package/src/hooks/index.tsx +2 -1
  36. package/src/hooks/users.tsx +4 -2
  37. package/src/modules/Analytics/index.tsx +25 -17
  38. package/src/modules/App/Routing/Logout/index.tsx +30 -0
  39. package/src/modules/App/Routing/NavMenu/NavItem/index.tsx +3 -1
  40. package/src/modules/App/Routing/PrivateRoute/index.tsx +2 -1
  41. package/src/modules/App/Routing/index.tsx +13 -1
  42. package/src/modules/App/index.tsx +12 -10
  43. package/src/modules/FileDrive/FileDragAndDrop/index.tsx +10 -4
  44. package/src/modules/FileDrive/FileDragAndDrop/style.tsx +2 -1
  45. package/src/modules/FileDrive/FileFilters/Type/index.tsx +1 -2
  46. package/src/modules/FileDrive/FileModal/index.tsx +2 -2
  47. package/src/modules/FileDrive/FileModal/style.tsx +2 -4
  48. package/src/modules/FileDrive/GridItem/index.tsx +4 -5
  49. package/src/modules/FileDrive/GridItem/style.tsx +3 -1
  50. package/src/modules/FileDrive/ListItem/index.tsx +2 -3
  51. package/src/modules/FileDrive/ListItem/style.tsx +2 -2
  52. package/src/modules/FileDrive/index.tsx +1 -1
  53. package/src/modules/FileDrive/utils.tsx +1 -1
  54. package/src/modules/GlobalEditor/index.tsx +5 -2
  55. package/src/modules/Navigation/Defaults/DefaultsEditor/index.tsx +9 -4
  56. package/src/modules/PageEditor/index.tsx +5 -2
  57. package/src/modules/Settings/ContentTypes/DataPacks/hooks.tsx +14 -2
  58. package/src/modules/Settings/ContentTypes/DataPacks/index.tsx +3 -1
  59. package/src/modules/Settings/Globals/index.tsx +4 -4
  60. package/src/modules/Settings/SeoAnalyticsSettings/Analytics/index.tsx +4 -4
  61. package/src/modules/Settings/Social/index.tsx +4 -3
  62. package/src/modules/StructuredData/Form/index.tsx +2 -2
  63. package/src/modules/Users/Profile/index.tsx +16 -6
  64. package/src/modules/Users/UserEdit/index.tsx +6 -3
  65. package/src/components/FileGallery/utils.tsx +0 -19
  66. /package/src/components/{Login/Circle → Circle}/index.tsx +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@griddo/ax",
3
3
  "description": "Griddo Author Experience",
4
- "version": "10.4.22",
4
+ "version": "10.4.24",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Carlos Torres <carlos.torres@secuoyas.com>",
@@ -126,6 +126,7 @@
126
126
  "react-dev-utils": "^11.0.4",
127
127
  "react-dom": "*",
128
128
  "react-draft-wysiwyg": "^1.14.5",
129
+ "react-error-boundary": "^4.0.13",
129
130
  "react-frame-component": "^5.2.1",
130
131
  "react-froala-wysiwyg": "^3.2.7",
131
132
  "react-redux": "^7.2.8",
@@ -231,5 +232,5 @@
231
232
  "publishConfig": {
232
233
  "access": "public"
233
234
  },
234
- "gitHead": "dcf2ff097694c07588c2fc14c0e5934d2d675220"
235
+ "gitHead": "63b4ccb1fb279a272dcc4b6d6050372e366a171e"
235
236
  }
@@ -0,0 +1,6 @@
1
+ <svg width="72" height="81" viewBox="0 0 72 81" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11 0C8.79086 0 7 1.79086 7 4V77C7 79.2091 8.79086 81 11 81H62C64.2091 81 66 79.2091 66 77V21.5663C66 20.5593 65.6202 19.5894 64.9364 18.8502L48.6875 1.28383C47.9304 0.465349 46.8661 0 45.7511 0H11Z" fill="#8C57E3"/>
3
+ <path d="M46.5 20.5V3L62.5 20.5H46.5Z" fill="white"/>
4
+ <rect y="28" width="72" height="33" rx="5" fill="#8C57E3"/>
5
+ <path d="M9.14098 54.5V34.1364H22.6239V37.6861H13.4464V42.5384H21.729V46.0881H13.4464V54.5H9.14098ZM29.8253 34.1364V54.5H25.5199V34.1364H29.8253ZM33.3675 54.5V34.1364H37.6729V50.9503H46.4031V54.5H33.3675ZM49.2543 54.5V34.1364H62.9759V37.6861H53.5597V42.5384H62.2699V46.0881H53.5597V50.9503H63.0156V54.5H49.2543Z" fill="white"/>
6
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="72" height="81" viewBox="0 0 72 81" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11 0C8.79086 0 7 1.79086 7 4V77C7 79.2091 8.79086 81 11 81H62C64.2091 81 66 79.2091 66 77V21.5663C66 20.5593 65.6202 19.5894 64.9364 18.8502L48.6875 1.28383C47.9304 0.465349 46.8661 0 45.7511 0H11Z" fill="#10D5D5"/>
3
+ <path d="M46.5 20.5V3L62.5 20.5H46.5Z" fill="white"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M36 30C24.96 30 16 38.96 16 50C16 61.04 24.96 70 36 70C47.04 70 56 61.04 56 50C56 38.96 47.04 30 36 30ZM32 59L44 50L32 41V59ZM20 50C20 58.82 27.18 66 36 66C44.82 66 52 58.82 52 50C52 41.18 44.82 34 36 34C27.18 34 20 41.18 20 50Z" fill="white"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="262" height="294" viewBox="0 0 262 294" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M39.9257 283.111H225.037C227.041 283.111 228.666 281.486 228.666 279.481V76.2222H166.963V10.8889H39.9257C37.9211 10.8889 36.2961 12.5139 36.2961 14.5185V279.481C36.2961 281.486 37.9212 283.111 39.9257 283.111ZM39.9257 0C31.9074 0 25.4072 6.50015 25.4072 14.5185V279.481C25.4072 287.5 31.9074 294 39.9257 294H225.037C233.055 294 239.555 287.5 239.555 279.481V78.2778C239.555 74.6228 238.177 71.1022 235.695 68.4191L176.718 4.65983C173.97 1.68904 170.106 0 166.06 0H39.9257Z" fill="#066BC9"/>
3
+ <rect y="101.63" width="261.333" height="119.778" rx="18.1481" fill="#066BC9"/>
4
+ <path d="M30.0656 137.49V124.606H90.7691V137.49H68.1406V198.519H52.6941V137.49H30.0656ZM115.419 124.606L130.324 149.797H130.901L145.879 124.606H163.527L140.97 161.562L164.032 198.519H146.059L130.901 173.292H130.324L115.166 198.519H97.2653L120.399 161.562L97.6984 124.606H115.419ZM170.6 137.49V124.606H231.304V137.49H208.675V198.519H193.229V137.49H170.6Z" fill="white"/>
5
+ </svg>
@@ -13,7 +13,6 @@ const animation2 = keyframes`
13
13
  const animations = [animation1, animation2];
14
14
  const colors = ["#A950CF", "#FBE15C"];
15
15
 
16
-
17
16
  const Circle = styled.div<{ size: number; animation: number }>`
18
17
  position: absolute;
19
18
  width: ${(p) => `${p.size}px`};
@@ -0,0 +1,118 @@
1
+ import React from "react";
2
+ import { RouteComponentProps, withRouter } from "react-router-dom";
3
+ import { Button, Circle, Icon } from "@ax/components";
4
+
5
+ import * as S from "./style";
6
+
7
+ const ErrorPage = (props: IProps): JSX.Element => {
8
+ const { type, history } = props;
9
+
10
+ const griddoLogo = "/img/logos/logoGriddoExtended@3x.svg";
11
+
12
+ const errorTexts: Record<string, IErrorText> = {
13
+ "404": {
14
+ title: "Page not found",
15
+ description: (
16
+ <>
17
+ Sorry, the page you are trying to access does not exist.
18
+ <br />
19
+ Do you want to try another one?
20
+ </>
21
+ ),
22
+ buttonText: "Go to sites",
23
+ buttonAction: () => history.push("/sites"),
24
+ },
25
+ "500": {
26
+ title: "Unexpected error",
27
+ description: (
28
+ <>
29
+ Sorry, we are working to fixing the problem.
30
+ <br />
31
+ Be back soon
32
+ </>
33
+ ),
34
+ buttonText: "Go back",
35
+ buttonAction: () => history.goBack(),
36
+ },
37
+ wrong: {
38
+ icon: "working",
39
+ title: "Something went wrong",
40
+ description: <>Try refreshing the page, or try again later</>,
41
+ buttonText: "Refresh page",
42
+ buttonAction: () => history.push("/logout"),
43
+ },
44
+ wrongEditor: {
45
+ icon: "working",
46
+ title: "Something went wrong",
47
+ description: <>Go back or try again later</>,
48
+ buttonText: "Go back",
49
+ buttonAction: () => history.goBack(),
50
+ },
51
+ forbidden: {
52
+ icon: "alert",
53
+ title: "Access Denied",
54
+ description: (
55
+ <>
56
+ You don&apos;t have the necessary permissions to access this section. Please contact your administrator if you{" "}
57
+ require access.
58
+ </>
59
+ ),
60
+ buttonText: "Go to sites",
61
+ buttonAction: () => history.push("/sites"),
62
+ },
63
+ };
64
+
65
+ return (
66
+ <S.Wrapper>
67
+ <S.BackgroundAnimation>
68
+ <Circle animation={1} />
69
+ <Circle animation={2} />
70
+ <S.Content>
71
+ <S.Logo src={griddoLogo} alt="Griddo Logo" />
72
+ {!errorTexts[type].icon && (
73
+ <S.ContentNumber>
74
+ <S.ErrorNumber>{type}</S.ErrorNumber>
75
+ <S.ErrorTitle>{errorTexts[type].title}</S.ErrorTitle>
76
+ <S.ErrorDescription>{errorTexts[type].description}</S.ErrorDescription>
77
+ <S.ErrorAction>
78
+ <Button className="button" type="button" onClick={errorTexts[type].buttonAction}>
79
+ {errorTexts[type].buttonText}
80
+ </Button>
81
+ </S.ErrorAction>
82
+ </S.ContentNumber>
83
+ )}
84
+ {errorTexts[type].icon && (
85
+ <S.ContentWrong>
86
+ <S.IconWrapper>
87
+ <Icon name={errorTexts[type].icon || "working"} size="32" />
88
+ </S.IconWrapper>
89
+ <S.ErrorTitleWrong>{errorTexts[type].title}</S.ErrorTitleWrong>
90
+ <S.ErrorDescriptionWrong>{errorTexts[type].description}</S.ErrorDescriptionWrong>
91
+ <S.ErrorAction>
92
+ <Button className="button" type="button" onClick={errorTexts[type].buttonAction}>
93
+ {errorTexts[type].buttonText}
94
+ </Button>
95
+ </S.ErrorAction>
96
+ </S.ContentWrong>
97
+ )}
98
+ </S.Content>
99
+ </S.BackgroundAnimation>
100
+ </S.Wrapper>
101
+ );
102
+ };
103
+
104
+ interface IErrorPateProps {
105
+ type: string;
106
+ }
107
+
108
+ interface IErrorText {
109
+ title: string;
110
+ icon?: string;
111
+ description: JSX.Element;
112
+ buttonText: string;
113
+ buttonAction: () => void;
114
+ }
115
+
116
+ type IProps = IErrorPateProps & RouteComponentProps;
117
+
118
+ export default withRouter(ErrorPage);
@@ -0,0 +1,116 @@
1
+ import styled from "styled-components";
2
+
3
+ const Wrapper = styled.div`
4
+ display: flex;
5
+ justify-content: center;
6
+ align-items: center;
7
+ height: 100%;
8
+ width: 100%;
9
+ background-color: ${(p) => p.theme.color.uiBackground04};
10
+ `;
11
+
12
+ const BackgroundAnimation = styled.div`
13
+ position: relative;
14
+ display: flex;
15
+ justify-content: center;
16
+ align-items: center;
17
+ height: 100%;
18
+ width: 900px;
19
+ `;
20
+
21
+ const Content = styled.div`
22
+ display: flex;
23
+ flex-direction: column;
24
+ width: 400px;
25
+ z-index: 1;
26
+ `;
27
+
28
+ const Logo = styled.img`
29
+ display: block;
30
+ max-height: 46px;
31
+ height: 100%;
32
+ width: auto;
33
+ `;
34
+
35
+ const ErrorNumber = styled.div`
36
+ font-size: 228px;
37
+ line-height: 228px;
38
+ letter-spacing: 32px;
39
+ color: ${(p) => p.theme.color.textHighEmphasisInverse};
40
+ text-align: center;
41
+ `;
42
+
43
+ const ErrorTitle = styled.div`
44
+ font-size: 24px;
45
+ line-height: 24px;
46
+ font-weight: 700;
47
+ color: ${(p) => p.theme.color.textHighEmphasisInverse};
48
+ text-align: center;
49
+ margin-bottom: ${(p) => p.theme.spacing.xs};
50
+ text-transform: uppercase;
51
+ letter-spacing: 0.75px;
52
+ `;
53
+
54
+ const ErrorTitleWrong = styled.div`
55
+ ${(p) => p.theme.textStyle.headingM};
56
+ color: ${(p) => p.theme.color.textHighEmphasisInverse};
57
+ text-align: center;
58
+ margin-bottom: ${(p) => p.theme.spacing.xs};
59
+ `;
60
+
61
+ const ErrorDescription = styled.div`
62
+ ${(p) => p.theme.textStyle.uiL};
63
+ color: ${(p) => p.theme.color.textMediumEmphasisInverse};
64
+ text-align: center;
65
+ `;
66
+
67
+ const ErrorDescriptionWrong = styled.div`
68
+ ${(p) => p.theme.textStyle.uiM};
69
+ color: ${(p) => p.theme.color.textHighEmphasisInverse};
70
+ text-align: center;
71
+ `;
72
+
73
+ const ErrorAction = styled.div`
74
+ display: flex;
75
+ margin-top: ${(p) => p.theme.spacing.m};
76
+ justify-content: center;
77
+ `;
78
+
79
+ const ContentNumber = styled.div``;
80
+
81
+ const ContentWrong = styled.div`
82
+ display: flex;
83
+ flex-direction: column;
84
+ background-color: rgba(32, 34, 76, 0.6);
85
+ width: 390px;
86
+ align-items: center;
87
+ padding-top: ${(p) => `calc(${p.theme.spacing.m} + ${p.theme.spacing.xs})`};
88
+ padding-bottom: ${(p) => `calc(${p.theme.spacing.m} + ${p.theme.spacing.xs})`};
89
+ padding-left: ${(p) => p.theme.spacing.m};
90
+ padding-right: ${(p) => p.theme.spacing.m};
91
+ margin-top: ${(p) => `calc(${p.theme.spacing.m} + ${p.theme.spacing.s})`};
92
+ `;
93
+
94
+ const IconWrapper = styled.div`
95
+ width: ${(p) => p.theme.spacing.xl};
96
+ background-color: ${(p) => p.theme.color.uiBackground03};
97
+ padding: ${(p) => p.theme.spacing.s};
98
+ border-radius: 50%;
99
+ margin-bottom: ${(p) => p.theme.spacing.m};
100
+ `;
101
+
102
+ export {
103
+ Wrapper,
104
+ Content,
105
+ ErrorNumber,
106
+ ErrorTitle,
107
+ ErrorTitleWrong,
108
+ ErrorDescription,
109
+ ErrorDescriptionWrong,
110
+ Logo,
111
+ ErrorAction,
112
+ ContentNumber,
113
+ ContentWrong,
114
+ BackgroundAnimation,
115
+ IconWrapper,
116
+ };
@@ -8,11 +8,14 @@ import { Icon, Modal, TextField, FileGallery } from "@ax/components";
8
8
  import * as S from "./style";
9
9
 
10
10
  const FileField = (props: IFileFieldProps): JSX.Element => {
11
- const { disabled, value, site, onChange } = props;
11
+ const { disabled, value, site, onChange, allowedFormats } = props;
12
12
 
13
13
  const { isOpen, toggleModal } = useModal(false);
14
14
 
15
- const validFormats = ["pdf", "doc", "docx", "xls", "xlsx", "zip", "csv"];
15
+ const validFormats =
16
+ allowedFormats && allowedFormats.length
17
+ ? allowedFormats
18
+ : ["pdf", "doc", "docx", "xls", "xlsx", "zip", "csv", "txt"];
16
19
 
17
20
  const handleClick = () => {
18
21
  if (!disabled) {
@@ -113,6 +116,7 @@ export interface IFileFieldProps {
113
116
  onChange: (value: any) => void;
114
117
  disabled?: boolean;
115
118
  site: ISite | null;
119
+ allowedFormats?: string[];
116
120
  }
117
121
 
118
122
  export default FileField;
@@ -1,5 +1,5 @@
1
1
  import React, { memo, useEffect, useRef, useState } from "react";
2
- import { Icon, IconAction, Gallery, Modal, Image } from "@ax/components";
2
+ import { Icon, IconAction, Gallery, Modal, Image, FieldsBehavior } from "@ax/components";
3
3
 
4
4
  import { formatBytes, getFormattedDateWithTimezone } from "@ax/helpers";
5
5
  import { IImage, ISite } from "@ax/types";
@@ -97,6 +97,14 @@ const ImageField = (props: IImageFieldProps) => {
97
97
  }
98
98
  };
99
99
 
100
+ const isImage = (object: IImage | null | string): object is IImage => {
101
+ return object !== null && typeof object === "object" && "url" in object;
102
+ };
103
+
104
+ const handleAltChange = (altValue: string) => {
105
+ isImage(value) && onChange({ ...value, alt: altValue });
106
+ };
107
+
100
108
  return (
101
109
  <>
102
110
  <S.FieldWrapper
@@ -150,6 +158,17 @@ const ImageField = (props: IImageFieldProps) => {
150
158
  <IconAction icon="delete" onClick={handleDelete} />
151
159
  </S.PreviewActions>
152
160
  </S.Preview>
161
+ {value && isImage(value) && (
162
+ <S.FieldsWrapper>
163
+ <FieldsBehavior
164
+ title="Alternative text"
165
+ name="alt"
166
+ fieldType="TextField"
167
+ value={value.alt || ""}
168
+ onChange={handleAltChange}
169
+ />
170
+ </S.FieldsWrapper>
171
+ )}
153
172
  <Modal isOpen={isOpen} hide={toggleModal} size="XL" title="Select image">
154
173
  <Gallery getImageSelected={getImageSelected} toggleModal={toggleModal} site={site} />
155
174
  </Modal>
@@ -158,6 +158,10 @@ const ImageData = styled.div`
158
158
  ${(p) => p.theme.textStyle.uiXS};
159
159
  `;
160
160
 
161
+ const FieldsWrapper = styled.div`
162
+ margin-top: ${(p) => p.theme.spacing.s};
163
+ `;
164
+
161
165
  export {
162
166
  FieldWrapper,
163
167
  Input,
@@ -173,4 +177,5 @@ export {
173
177
  PositionTitle,
174
178
  PositionGrid,
175
179
  Position,
180
+ FieldsWrapper,
176
181
  };
@@ -2,9 +2,8 @@ import React, { memo, useEffect, useState } from "react";
2
2
  import { connect } from "react-redux";
3
3
  import { IRootState, IFile } from "@ax/types";
4
4
  import { Button, FieldsBehavior, IconAction } from "@ax/components";
5
- import { formatBytes, getFormattedDateWithTimezone } from "@ax/helpers";
5
+ import { formatBytes, getFileIcon, getFormattedDateWithTimezone } from "@ax/helpers";
6
6
  import { fileDriveActions } from "@ax/containers/FileDrive";
7
- import { getFileIcon } from "../../utils";
8
7
 
9
8
  import * as S from "./style";
10
9
 
@@ -83,6 +83,10 @@ const IconWrapper = styled.div`
83
83
  width: 42px;
84
84
  height: 40px;
85
85
  margin-bottom: ${(p) => p.theme.spacing.xs};
86
+ img {
87
+ height: 40px;
88
+ width: auto;
89
+ }
86
90
  `;
87
91
 
88
92
  const Label = styled.div`
@@ -1,8 +1,7 @@
1
1
  import React from "react";
2
2
  import { IFile } from "@ax/types";
3
- import { getFormattedDateWithTimezone, trimText } from "@ax/helpers";
3
+ import { getFileIcon, getFormattedDateWithTimezone, trimText } from "@ax/helpers";
4
4
  import { Tooltip } from "@ax/components";
5
- import { getFileIcon } from "../utils";
6
5
 
7
6
  import * as S from "./style";
8
7
 
@@ -3,8 +3,8 @@ import styled from "styled-components";
3
3
  const Wrapper = styled.div<{ isSelected: boolean }>`
4
4
  position: relative;
5
5
  background-color: ${(p) => p.theme.color.uiBackground02};
6
- border: ${(p) => p.isSelected ? `2px solid ${p.theme.color.interactive01}` : `1px solid ${p.theme.color.uiLine}`};
7
- border-radius: ${p => p.theme.radii.s};
6
+ border: ${(p) => (p.isSelected ? `2px solid ${p.theme.color.interactive01}` : `1px solid ${p.theme.color.uiLine}`)};
7
+ border-radius: ${(p) => p.theme.radii.s};
8
8
  display: flex;
9
9
  flex-direction: column;
10
10
  padding: ${(p) => p.theme.spacing.s};
@@ -23,8 +23,10 @@ const Header = styled.div`
23
23
  `;
24
24
 
25
25
  const IconWrapper = styled.div`
26
- width: 42px;
27
26
  height: 40px;
27
+ img {
28
+ height: 40px;
29
+ }
28
30
  `;
29
31
 
30
32
  const Name = styled.div`
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ const SvgWorking = (props) => (
3
+ <svg xmlns="http://www.w3.org/2000/svg" width={24} height={24} fill="none" {...props}>
4
+ <path
5
+ fill="#5057FF"
6
+ d="m19.166 21-5.229-5.42 1.512-1.559 5.254 5.42L19.166 21ZM6.032 21l-1.536-1.56 6.591-6.8-2.081-2.147-.595.614-1.09-1.125v1.943l-.595.639L4 9.752l.595-.64h1.908L5.388 8.015l2.75-2.812c.265-.273.554-.478.868-.614.314-.136.644-.205.991-.205s.677.069.991.205c.314.136.603.34.868.614L9.972 7.144l1.165 1.176-.62.614L12.6 11.08l2.454-2.53a2.048 2.048 0 0 1-.236-.64 3.734 3.734 0 0 1-.062-.69c0-.903.301-1.666.904-2.288C16.262 4.31 17.002 4 17.878 4a2.717 2.717 0 0 1 1.14.23l-2.23 2.3 1.734 1.816 2.23-2.3c.083.187.145.378.187.574.04.196.061.397.061.601 0 .903-.306 1.666-.917 2.288-.611.622-1.346.933-2.205.933a3.59 3.59 0 0 1-.694-.063 1.457 1.457 0 0 1-.595-.27L6.032 21Z"
7
+ />
8
+ </svg>
9
+ );
10
+ export default SvgWorking;
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M19.1662 21L13.9373 15.5805L15.449 14.0211L20.7026 19.4406L19.1662 21ZM6.03207 21L4.49563 19.4406L11.0875 12.6406L9.00583 10.4932L8.41108 11.1068L7.3207 9.98196V11.9248L6.72595 12.5639L4 9.75188L4.59475 9.11278H6.50292L5.38775 8.01353L8.13848 5.2015C8.40282 4.92882 8.69193 4.72431 9.00583 4.58797C9.31973 4.45163 9.65015 4.38346 9.99708 4.38346C10.344 4.38346 10.6744 4.45163 10.9883 4.58797C11.3022 4.72431 11.5914 4.92882 11.8557 5.2015L9.9723 7.14436L11.137 8.3203L10.5175 8.93383L12.5991 11.0812L15.0525 8.55038C14.9368 8.34586 14.8585 8.13283 14.8175 7.91128C14.7759 7.68972 14.7551 7.45965 14.7551 7.22105C14.7551 6.31779 15.0564 5.55497 15.6591 4.93257C16.2625 4.31086 17.0019 4 17.8775 4C18.0758 4 18.2658 4.01704 18.4475 4.05113C18.6293 4.08521 18.8192 4.14486 19.0175 4.23008L16.7872 6.53083L18.5219 8.34586L20.7522 6.04511C20.8348 6.23258 20.8969 6.42414 20.9385 6.61979C20.9795 6.81612 21 7.01654 21 7.22105C21 8.12431 20.6944 8.8868 20.0831 9.50851C19.4718 10.1309 18.7366 10.4421 17.8775 10.4421C17.6297 10.4421 17.3984 10.421 17.1837 10.3787C16.9689 10.3358 16.7706 10.2461 16.5889 10.1098L6.03207 21Z" fill="#5057FF"/>
3
+ </svg>
@@ -2,9 +2,8 @@ import React, { useEffect, useRef, useState } from "react";
2
2
 
3
3
  import { IGlobalSettings } from "@ax/containers/App/reducer";
4
4
  import { useModal } from "@ax/hooks";
5
- import { Button, FieldsBehavior, ErrorToast } from "@ax/components";
5
+ import { Button, FieldsBehavior, ErrorToast, Circle } from "@ax/components";
6
6
  import RecoveryModal from "./RecoveryModal";
7
- import Circle from "./Circle";
8
7
 
9
8
  import * as S from "./style";
10
9
 
@@ -113,6 +112,7 @@ const Login = (props: ILoginProps): JSX.Element => {
113
112
  <S.Password>
114
113
  <span
115
114
  onClick={toggleModal}
115
+ onKeyDown={toggleModal}
116
116
  role="checkbox"
117
117
  aria-checked="false"
118
118
  tabIndex={0}
@@ -39,7 +39,7 @@ const LeftWrapper = styled.div`
39
39
  `;
40
40
 
41
41
  const LoginWrapper = styled.div<{ width: number }>`
42
- width: ${(p) => p.width > 0 ? `${p.width}px` : "100%"};
42
+ width: ${(p) => (p.width > 0 ? `${p.width}px` : "100%")};
43
43
  display: flex;
44
44
  align-items: center;
45
45
  justify-content: center;
@@ -53,7 +53,7 @@ const LoginWrapper = styled.div<{ width: number }>`
53
53
  `;
54
54
 
55
55
  const RightWrapper = styled.div`
56
- background-color: #001B3C;
56
+ background-color: #001b3c;
57
57
  position: relative;
58
58
  width: 55%;
59
59
  height: 100%;
@@ -126,7 +126,7 @@ const Secuoyas = styled.div<{ width: number }>`
126
126
  position: absolute;
127
127
  display: flex;
128
128
  color: ${(p) => p.theme.color.textMediumEmphasisInverse};
129
- width: ${(p) => p.width > 0 ? `${p.width}px` : "100%"};
129
+ width: ${(p) => (p.width > 0 ? `${p.width}px` : "100%")};
130
130
  justify-content: center;
131
131
  align-items: center;
132
132
  left: 0;
@@ -62,11 +62,13 @@ import BrowserContent from "./BrowserContent";
62
62
  import BulkSelectionOptions from "./BulkSelectionOptions";
63
63
  import Button from "./Button";
64
64
  import CategoryCell from "./CategoryCell";
65
+ import Circle from "./Circle";
65
66
  import ConfigPanel from "./ConfigPanel";
66
67
  import DragAndDrop from "./DragAndDrop";
67
68
  import ElementsTooltip from "./ElementsTooltip";
68
69
  import EmptyState from "./EmptyState";
69
70
  import ErrorCenter from "./ErrorCenter";
71
+ import ErrorPage from "./ErrorPage";
70
72
  import ErrorToast from "./ErrorToast";
71
73
  import FieldContainer from "./FieldContainer";
72
74
  import FieldsBehavior from "./FieldsBehavior";
@@ -171,11 +173,13 @@ export {
171
173
  BulkSelectionOptions,
172
174
  Button,
173
175
  CategoryCell,
176
+ Circle,
174
177
  ConfigPanel,
175
178
  DragAndDrop,
176
179
  ElementsTooltip,
177
180
  EmptyState,
178
181
  ErrorCenter,
182
+ ErrorPage,
179
183
  ErrorToast,
180
184
  FieldContainer,
181
185
  FieldsBehavior,
@@ -9,7 +9,6 @@ import history from "../../routes/history";
9
9
 
10
10
  import {
11
11
  SET_ERROR,
12
- RESET_ERROR,
13
12
  SET_IS_LOADING,
14
13
  SET_IS_SAVING,
15
14
  IS_LOGGING_IN,
@@ -107,7 +106,7 @@ function setError(error: IError): ISetErrorAction {
107
106
 
108
107
  function resetError(): ISetErrorAction {
109
108
  (window as any).handleErrorClick = undefined;
110
- return { type: RESET_ERROR, payload: { code: undefined, text: "" } };
109
+ return { type: SET_ERROR, payload: { code: undefined, text: "" } };
111
110
  }
112
111
 
113
112
  function setSessionStartedAt(sessionStartedAt: Date): ISetSessionStartedAtAction {
@@ -129,18 +128,22 @@ function handleError(response: any, isMultiple = false, msg?: string): (dispatch
129
128
  btnAction,
130
129
  } = response;
131
130
 
132
- const firstMsg = Array.isArray(message) && message[0] ? message[0].error : message || text;
133
-
134
- const error = {
135
- code,
136
- text: msg ? msg : firstMsg,
137
- btnText,
138
- actionsBelow,
139
- btnAction,
140
- subErrors: isMultiple ? message : [],
141
- };
142
-
143
- dispatch(setError(error));
131
+ if (code === 500) {
132
+ setHistoryPush("/500")(dispatch);
133
+ } else {
134
+ const firstMsg = Array.isArray(message) && message[0] ? message[0].error : message || text;
135
+
136
+ const error = {
137
+ code,
138
+ text: msg ? msg : firstMsg,
139
+ btnText,
140
+ actionsBelow,
141
+ btnAction,
142
+ subErrors: isMultiple ? message : [],
143
+ };
144
+
145
+ dispatch(setError(error));
146
+ }
144
147
  };
145
148
  }
146
149
 
@@ -177,9 +180,9 @@ function login(email: string, password: string, rememberMe: boolean): (dispatch:
177
180
  case undefined: {
178
181
  const error = {
179
182
  data: {
180
- code: 500,
183
+ code: 503,
181
184
  message: "An error has occurred. Please contact your system administrator.",
182
- }
185
+ },
183
186
  };
184
187
  handleError(error)(dispatch);
185
188
  return false;
@@ -1,7 +1,6 @@
1
1
  const NAME = "app";
2
2
 
3
3
  const SET_ERROR = `${NAME}/SET_ERROR`;
4
- const RESET_ERROR = `${NAME}/RESET_ERROR`;
5
4
  const SET_IS_LOADING = `${NAME}/SET_IS_LOADING`;
6
5
  const SET_IS_SAVING = `${NAME}/SET_IS_SAVING`;
7
6
  const SET_TOKEN = `${NAME}/SET_TOKEN`;
@@ -16,7 +15,6 @@ const SET_HAS_ANIMATION = `${NAME}/SET_HAS_ANIMATION`;
16
15
 
17
16
  export {
18
17
  SET_ERROR,
19
- RESET_ERROR,
20
18
  SET_IS_LOADING,
21
19
  SET_IS_SAVING,
22
20
  SET_TOKEN,
@@ -1,7 +1,6 @@
1
1
  import { REHYDRATE } from "redux-persist/lib/constants";
2
2
  import {
3
3
  SET_ERROR,
4
- RESET_ERROR,
5
4
  SET_IS_LOADING,
6
5
  SET_IS_SAVING,
7
6
  SET_TOKEN,
@@ -105,7 +104,6 @@ export function reducer(state = initialState, action: any): IAppState {
105
104
  case SET_HAS_ANIMATION:
106
105
  return { ...state, ...action.payload };
107
106
  case SET_ERROR:
108
- case RESET_ERROR:
109
107
  return { ...state, error: { ...action.payload } };
110
108
  default:
111
109
  return state;
@@ -52,6 +52,7 @@ import {
52
52
  SET_SELECTED_PARENT,
53
53
  SET_COPY_MODULE,
54
54
  SET_NAV_PAGES,
55
+ RESET_DEFAULTS_STORE,
55
56
  } from "./constants";
56
57
 
57
58
  import {
@@ -67,6 +68,7 @@ import {
67
68
  ISetSelectedParent,
68
69
  ISetCopyModule,
69
70
  ISetNavPages,
71
+ IResetDefaultsStore,
70
72
  } from "./interfaces";
71
73
 
72
74
  const { setIsLoading } = appActions;
@@ -135,6 +137,10 @@ function setNavPages(navigationPages: INavPages): ISetNavPages {
135
137
  return { type: SET_NAV_PAGES, payload: { navigationPages } };
136
138
  }
137
139
 
140
+ function resetDefaultsStore(): IResetDefaultsStore {
141
+ return { type: RESET_DEFAULTS_STORE };
142
+ }
143
+
138
144
  // API RELATED FUNCTIONS
139
145
 
140
146
  function getHeaders(params: any): (dispatch: Dispatch, getState: any) => Promise<void> {
@@ -827,19 +833,9 @@ function setSelectedTab(tab: string): (dispatch: Dispatch) => Promise<void> {
827
833
  function resetDefaultsValues(): (dispatch: Dispatch) => Promise<void> {
828
834
  return async (dispatch) => {
829
835
  try {
830
- dispatch(setEditorContent(null));
831
- dispatch(setBreadcrumb([]));
832
- dispatch(setSchema({}));
833
- dispatch(setSelectedDefaultContent({}));
834
- dispatch(setSelectedEditorID(0));
835
- dispatch(setTab("content"));
836
- dispatch(setHeader(null));
837
- dispatch(setFooter(null));
838
- dispatch(setCurrentNavigationLanguages([]));
839
- dispatch(setIsNewTranslation(false));
840
- dispatch(setCurrentDefaultsContent([]));
836
+ dispatch(resetDefaultsStore());
841
837
  } catch (e) {
842
- console.log("Error", e); //TODO
838
+ console.log("Error", e);
843
839
  }
844
840
  };
845
841
  }