@griddo/ax 11.15.5 → 11.15.6

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.5",
4
+ "version": "11.15.6",
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": "bd040f49a71fc8eb3ced92dd17cd3e27bb885b36"
222
+ "gitHead": "61ee7ebf3bc204d702e0bdb132ffc96819cc82a6"
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(response.status === 404 ? "404" : response.status === 410 ? "linkExpired" : "wrong");
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 langs = state?.site ? state.siteInfo.siteLanguages : [];
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 { useModal, useShouldBeSaved, useURLSearchParam } from "@ax/hooks";
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 } = useModal();
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
- <LinkDeviceModal isOpen={isOpen} toggleModal={toggleModal} token={token} />
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
  };
@@ -41,6 +41,7 @@ export default {
41
41
  title: "Slug",
42
42
  type: "TextField",
43
43
  key: "slug",
44
+ humanReadable: true,
44
45
  },
45
46
  {
46
47
  title: "Template",
@@ -53,6 +53,7 @@ export default {
53
53
  title: "Slug",
54
54
  type: "TextField",
55
55
  key: "slug",
56
+ humanReadable: true,
56
57
  },
57
58
  {
58
59
  title: "Template",