@griddo/ax 11.15.5 → 11.15.6-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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "11.15.
|
|
4
|
+
"version": "11.15.6-rc.0",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Diego M. Béjar <diego.bejar@secuoyas.com>",
|
|
@@ -219,5 +219,5 @@
|
|
|
219
219
|
"publishConfig": {
|
|
220
220
|
"access": "public"
|
|
221
221
|
},
|
|
222
|
-
"gitHead": "
|
|
222
|
+
"gitHead": "9f4379b06a1656e5e1d2762a87d06e5b9ce53a65"
|
|
223
223
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import { useParams } from "react-router-dom";
|
|
3
|
-
|
|
4
1
|
import { pages, shareToken as shareTokenApi } from "@ax/api";
|
|
5
2
|
import { BrowserContent, ErrorPage, Loading } from "@ax/components";
|
|
6
3
|
import { getDefaultTheme, isReqOk } from "@ax/helpers";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { useParams } from "react-router-dom";
|
|
7
6
|
|
|
8
7
|
import * as S from "./style";
|
|
9
8
|
|
|
@@ -39,7 +38,13 @@ const PublicPreview = () => {
|
|
|
39
38
|
setShareEndDate(shareResponse.data.endDate);
|
|
40
39
|
}
|
|
41
40
|
} else {
|
|
42
|
-
setTokenError(
|
|
41
|
+
setTokenError(
|
|
42
|
+
response.status === 404
|
|
43
|
+
? "404"
|
|
44
|
+
: response.status === 410
|
|
45
|
+
? "linkExpired"
|
|
46
|
+
: "wrong",
|
|
47
|
+
);
|
|
43
48
|
}
|
|
44
49
|
|
|
45
50
|
setIsLoading(false);
|
|
@@ -59,7 +64,13 @@ const PublicPreview = () => {
|
|
|
59
64
|
const globalTheme = getDefaultTheme();
|
|
60
65
|
const theme = state?.site ? state.siteInfo.theme : globalTheme;
|
|
61
66
|
const socials = state?.site ? state.siteInfo.socials : [];
|
|
62
|
-
const
|
|
67
|
+
const derivedLangs = (state?.pageLanguages ?? []).map(
|
|
68
|
+
(pl: { languageId: number; locale: string }) => ({
|
|
69
|
+
id: pl.languageId,
|
|
70
|
+
locale: pl.locale,
|
|
71
|
+
}),
|
|
72
|
+
);
|
|
73
|
+
const langs = state?.site ? state.siteInfo.siteLanguages : derivedLangs;
|
|
63
74
|
const siteID = state?.siteInfo ? state.siteInfo.siteId : undefined;
|
|
64
75
|
|
|
65
76
|
if (tokenError) {
|
|
@@ -15,10 +15,11 @@ import { appActions } from "@ax/containers/App";
|
|
|
15
15
|
import { sitesActions } from "@ax/containers/Sites";
|
|
16
16
|
import { usersActions } from "@ax/containers/Users";
|
|
17
17
|
import { RouteLeavingGuard } from "@ax/guards";
|
|
18
|
-
import {
|
|
18
|
+
import { useModals, useShouldBeSaved, useURLSearchParam } from "@ax/hooks";
|
|
19
19
|
import type { IImage, IRole, IRootState, ISite, IUser } from "@ax/types";
|
|
20
20
|
|
|
21
21
|
import { timezones } from "../../Settings/Globals/constants";
|
|
22
|
+
import { PasswordModal } from "../UserForm/atoms";
|
|
22
23
|
import { LinkDeviceModal } from "./atoms";
|
|
23
24
|
|
|
24
25
|
import * as S from "./style";
|
|
@@ -45,7 +46,7 @@ const Profile = (props: IProps) => {
|
|
|
45
46
|
|
|
46
47
|
const [form, setForm] = useState<IUser>(initForm);
|
|
47
48
|
const [activeTab, setActiveTab] = useState<(typeof PROFILE_TABS)[keyof typeof PROFILE_TABS]>(PROFILE_TABS.PROFILE);
|
|
48
|
-
const { isOpen, toggleModal } =
|
|
49
|
+
const { isOpen, toggleModal } = useModals(["linkDevice", "password"]);
|
|
49
50
|
const { isDirty, setIsDirty } = useShouldBeSaved(form);
|
|
50
51
|
|
|
51
52
|
useEffect(() => {
|
|
@@ -78,7 +79,7 @@ const Profile = (props: IProps) => {
|
|
|
78
79
|
const lineButtonProps = user.isSuperAdmin
|
|
79
80
|
? {
|
|
80
81
|
label: "Link Device",
|
|
81
|
-
action: toggleModal,
|
|
82
|
+
action: () => toggleModal("linkDevice"),
|
|
82
83
|
icon: "QrCode",
|
|
83
84
|
}
|
|
84
85
|
: undefined;
|
|
@@ -156,7 +157,7 @@ const Profile = (props: IProps) => {
|
|
|
156
157
|
readonly
|
|
157
158
|
value="********"
|
|
158
159
|
icon="edit"
|
|
159
|
-
onClickIcon={toggleModal}
|
|
160
|
+
onClickIcon={() => toggleModal("password")}
|
|
160
161
|
/>
|
|
161
162
|
</S.FormColumn>
|
|
162
163
|
<S.FormColumn>
|
|
@@ -206,7 +207,8 @@ const Profile = (props: IProps) => {
|
|
|
206
207
|
)}
|
|
207
208
|
</S.Content>
|
|
208
209
|
</S.ProfileWrapper>
|
|
209
|
-
<
|
|
210
|
+
<PasswordModal isOpen={isOpen("password")} toggleModal={() => toggleModal("password")} id={user.id} />
|
|
211
|
+
<LinkDeviceModal isOpen={isOpen("linkDevice")} toggleModal={() => toggleModal("linkDevice")} token={token} />
|
|
210
212
|
</MainWrapper>
|
|
211
213
|
);
|
|
212
214
|
};
|