@griddo/ax 12.15.0-beta.1 → 12.15.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/README.md +0 -1
- package/package.json +4 -7
- package/src/GlobalStore.tsx +25 -32
- package/src/__tests__/components/Fields/FileField/FileField.test.tsx +6 -33
- package/src/__tests__/components/FieldsBehavior/FieldsBehavior.test.tsx +3 -5
- package/src/__tests__/modules/GlobalSettings/Llms/Llms.uc.test.tsx +2861 -0
- package/src/__tests__/modules/Redirects/Redirects/Redirects.create.test.tsx +0 -19
- package/src/__tests__/modules/Redirects/Redirects/Redirects.edit.test.tsx +0 -19
- package/src/__tests__/modules/Redirects/Redirects/Redirects.filter.test.tsx +0 -19
- package/src/api/domains.tsx +98 -2
- package/src/api/global.tsx +1 -24
- package/src/api/utils.tsx +12 -22
- package/src/components/FieldsBehavior/index.tsx +1 -3
- package/src/components/Login/LoginForm/index.tsx +2 -7
- package/src/components/Login/index.tsx +1 -13
- package/src/components/index.tsx +7 -11
- package/src/containers/App/actions.tsx +5 -110
- package/src/containers/App/interfaces.tsx +2 -2
- package/src/containers/App/reducer.tsx +0 -9
- package/src/containers/Users/actions.tsx +24 -28
- package/src/{components/CategoryCell/buildCategoryColumns.tsx → helpers/categoryColumns.tsx} +2 -3
- package/src/{components/FieldsBehavior/getFieldByPath.tsx → helpers/fields.tsx} +1 -1
- package/src/helpers/index.tsx +5 -4
- package/src/locales/en-US.ts +0 -7
- package/src/locales/es-ES.ts +0 -7
- package/src/locales/index.ts +0 -10
- package/src/modules/App/Routing/NavMenu/index.tsx +4 -4
- package/src/modules/Content/PageItem/index.tsx +8 -6
- package/src/modules/GlobalSettings/Llms/AutomaticSelection/index.tsx +317 -0
- package/src/modules/GlobalSettings/Llms/DomainList/index.tsx +65 -0
- package/src/modules/GlobalSettings/Llms/IndexModelEditor/index.tsx +325 -0
- package/src/modules/GlobalSettings/Llms/MirrorExample/index.tsx +61 -0
- package/src/modules/GlobalSettings/Llms/MirrorOptions/index.tsx +82 -0
- package/src/modules/GlobalSettings/Llms/Outline/index.tsx +183 -0
- package/src/modules/GlobalSettings/Llms/PagePicker/index.tsx +105 -0
- package/src/modules/GlobalSettings/Llms/Preview/index.tsx +65 -0
- package/src/modules/GlobalSettings/Llms/ResolvedPages/index.tsx +191 -0
- package/src/modules/GlobalSettings/Llms/SectionEditor/index.tsx +262 -0
- package/src/modules/GlobalSettings/Llms/atoms.tsx +37 -0
- package/src/modules/GlobalSettings/Llms/index.tsx +383 -0
- package/src/modules/GlobalSettings/Llms/style.tsx +541 -0
- package/src/modules/GlobalSettings/Llms/utils.tsx +307 -0
- package/src/modules/GlobalSettings/index.tsx +7 -0
- package/src/modules/Login/index.tsx +2 -12
- package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/index.tsx +8 -6
- package/src/modules/StructuredData/StructuredDataList/StructuredDataItem/index.tsx +11 -9
- package/src/routes/multisite.tsx +8 -1
- package/src/routes/publicRoutes.tsx +0 -3
- package/src/schemas/pages/GlobalPage.ts +2 -2
- package/src/schemas/pages/Page.ts +2 -2
- package/src/types/index.tsx +80 -12
- package/src/types/llms.tsx +315 -0
- package/src/__tests__/GlobalStore.session.test.tsx +0 -98
- package/src/__tests__/api/global.test.ts +0 -64
- package/src/__tests__/api/session.test.ts +0 -311
- package/src/__tests__/api/sessionRenewal.test.ts +0 -705
- package/src/__tests__/api/utils.test.ts +0 -373
- package/src/__tests__/components/Login/LoginGriddoId.test.tsx +0 -195
- package/src/__tests__/components/SsoDenied/SsoDenied.test.tsx +0 -86
- package/src/__tests__/containers/App/reducer.griddoId.test.ts +0 -18
- package/src/__tests__/containers/App/session.test.ts +0 -397
- package/src/__tests__/helpers/griddoId.test.ts +0 -56
- package/src/__tests__/locales/loginLocale.test.ts +0 -52
- package/src/__tests__/modules/App/Routing/NavMenu.test.tsx +0 -54
- package/src/__tests__/modules/Login/Login.test.tsx +0 -151
- package/src/__tests__/modules/SsoDenied/SsoDenied.test.tsx +0 -30
- package/src/__tests__/routes/publicRoutes.test.ts +0 -36
- package/src/api/session.tsx +0 -197
- package/src/api/sessionRenewal.tsx +0 -114
- package/src/components/Login/LoginGriddoId/index.tsx +0 -46
- package/src/components/Login/LoginGriddoId/style.tsx +0 -35
- package/src/components/SsoDenied/index.tsx +0 -46
- package/src/components/SsoDenied/style.tsx +0 -37
- package/src/helpers/griddoId.ts +0 -28
- package/src/modules/SsoDenied/index.tsx +0 -9
|
@@ -14,25 +14,6 @@ vi.mock("@ax/containers/Redirects", () => ({
|
|
|
14
14
|
},
|
|
15
15
|
}));
|
|
16
16
|
|
|
17
|
-
// RedirectPanel monta UrlField → PageFinder, que pide páginas y tipos de contenido
|
|
18
|
-
// al montarse y hace setState al resolver. Con la API real esa petición acababa
|
|
19
|
-
// después de que vitest desmontara jsdom y reventaba con "window is not defined".
|
|
20
|
-
vi.mock("@ax/api", async (importOriginal) => {
|
|
21
|
-
const actual = (await importOriginal()) as any;
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
...actual,
|
|
25
|
-
sites: {
|
|
26
|
-
...actual.sites,
|
|
27
|
-
getSitePages: () => Promise.resolve({ status: 200, data: { items: [], totalItems: 0 } }),
|
|
28
|
-
},
|
|
29
|
-
structuredData: {
|
|
30
|
-
...actual.structuredData,
|
|
31
|
-
getData: () => Promise.resolve({ status: 200, data: { items: [] } }),
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
|
|
36
17
|
import { MemoryRouter } from "react-router-dom";
|
|
37
18
|
|
|
38
19
|
import { parseTheme } from "@ax/helpers";
|
|
@@ -10,25 +10,6 @@ vi.mock("@ax/containers/Redirects", () => ({
|
|
|
10
10
|
},
|
|
11
11
|
}));
|
|
12
12
|
|
|
13
|
-
// RedirectPanel monta UrlField → PageFinder, que pide páginas y tipos de contenido
|
|
14
|
-
// al montarse y hace setState al resolver. Con la API real esa petición acababa
|
|
15
|
-
// después de que vitest desmontara jsdom y reventaba con "window is not defined".
|
|
16
|
-
vi.mock("@ax/api", async (importOriginal) => {
|
|
17
|
-
const actual = (await importOriginal()) as any;
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
...actual,
|
|
21
|
-
sites: {
|
|
22
|
-
...actual.sites,
|
|
23
|
-
getSitePages: () => Promise.resolve({ status: 200, data: { items: [], totalItems: 0 } }),
|
|
24
|
-
},
|
|
25
|
-
structuredData: {
|
|
26
|
-
...actual.structuredData,
|
|
27
|
-
getData: () => Promise.resolve({ status: 200, data: { items: [] } }),
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
|
|
32
13
|
import { MemoryRouter } from "react-router-dom";
|
|
33
14
|
|
|
34
15
|
import { parseTheme } from "@ax/helpers";
|
|
@@ -14,25 +14,6 @@ vi.mock("@ax/containers/Redirects", () => ({
|
|
|
14
14
|
},
|
|
15
15
|
}));
|
|
16
16
|
|
|
17
|
-
// RedirectPanel monta UrlField → PageFinder, que pide páginas y tipos de contenido
|
|
18
|
-
// al montarse y hace setState al resolver. Con la API real esa petición acababa
|
|
19
|
-
// después de que vitest desmontara jsdom y reventaba con "window is not defined".
|
|
20
|
-
vi.mock("@ax/api", async (importOriginal) => {
|
|
21
|
-
const actual = (await importOriginal()) as any;
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
...actual,
|
|
25
|
-
sites: {
|
|
26
|
-
...actual.sites,
|
|
27
|
-
getSitePages: () => Promise.resolve({ status: 200, data: { items: [], totalItems: 0 } }),
|
|
28
|
-
},
|
|
29
|
-
structuredData: {
|
|
30
|
-
...actual.structuredData,
|
|
31
|
-
getData: () => Promise.resolve({ status: 200, data: { items: [] } }),
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
|
|
36
17
|
import { MemoryRouter } from "react-router-dom";
|
|
37
18
|
|
|
38
19
|
import { parseTheme } from "@ax/helpers";
|
package/src/api/domains.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { IDomainRobot } from "@ax/types";
|
|
1
|
+
import type { IDomainRobot, LlmsPagesQuery, LlmsSectionPagesQuery, LlmsSettings } from "@ax/types";
|
|
2
|
+
|
|
2
3
|
import { template } from "./config";
|
|
3
4
|
import { type IServiceConfig, sendRequest } from "./utils";
|
|
4
5
|
|
|
@@ -13,8 +14,48 @@ const SERVICES: { [key: string]: IServiceConfig } = {
|
|
|
13
14
|
endpoint: "/domains/robots/bulk",
|
|
14
15
|
method: "PUT",
|
|
15
16
|
},
|
|
17
|
+
GET_DOMAINS: {
|
|
18
|
+
...template,
|
|
19
|
+
endpoint: "/domains",
|
|
20
|
+
method: "GET",
|
|
21
|
+
},
|
|
22
|
+
GET_LLMS_SETTINGS: {
|
|
23
|
+
...template,
|
|
24
|
+
endpoint: "/domains/",
|
|
25
|
+
method: "GET",
|
|
26
|
+
},
|
|
27
|
+
UPDATE_LLMS_SETTINGS: {
|
|
28
|
+
...template,
|
|
29
|
+
endpoint: "/domains/",
|
|
30
|
+
method: "PUT",
|
|
31
|
+
},
|
|
32
|
+
GET_LLMS_PAGES: {
|
|
33
|
+
...template,
|
|
34
|
+
endpoint: "/domains/",
|
|
35
|
+
method: "GET",
|
|
36
|
+
},
|
|
37
|
+
RESOLVE_LLMS_INDEX: {
|
|
38
|
+
...template,
|
|
39
|
+
endpoint: "/domains/",
|
|
40
|
+
method: "POST",
|
|
41
|
+
},
|
|
42
|
+
LIST_LLMS_SECTION_PAGES: {
|
|
43
|
+
...template,
|
|
44
|
+
endpoint: "/domains/",
|
|
45
|
+
method: "POST",
|
|
46
|
+
},
|
|
16
47
|
};
|
|
17
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Una copia del servicio con su URL completa. No se escribe en `SERVICES`, como
|
|
51
|
+
* hacen otros módulos, porque la pantalla del llms.txt lanza varias peticiones a
|
|
52
|
+
* la vez y se pisarían el `dynamicUrl`.
|
|
53
|
+
*/
|
|
54
|
+
const withPath = (service: IServiceConfig, path: string): IServiceConfig => ({
|
|
55
|
+
...service,
|
|
56
|
+
dynamicUrl: `${service.host}${service.endpoint}${path}`,
|
|
57
|
+
});
|
|
58
|
+
|
|
18
59
|
const getDomainsRobots = async () => {
|
|
19
60
|
return sendRequest(SERVICES.GET_ROBOTS);
|
|
20
61
|
};
|
|
@@ -23,4 +64,59 @@ const updateDomainsRobots = async (robots: IDomainRobot[]) => {
|
|
|
23
64
|
return sendRequest(SERVICES.UPDATE_ROBOTS, { robots });
|
|
24
65
|
};
|
|
25
66
|
|
|
26
|
-
|
|
67
|
+
/** Los dominios de la instancia, para elegir de cuál se modelan los ajustes LLM. */
|
|
68
|
+
const getDomains = async () => {
|
|
69
|
+
return sendRequest(SERVICES.GET_DOMAINS);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/** Los ajustes LLM guardados del dominio, o los de Griddo si nunca ha guardado. */
|
|
73
|
+
const getLlmsSettings = async (domainId: number) => {
|
|
74
|
+
return sendRequest(withPath(SERVICES.GET_LLMS_SETTINGS, `${domainId}/llms-settings`));
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/** Guarda el documento entero: la API sustituye el guardado, sin fusionarlo. */
|
|
78
|
+
const updateLlmsSettings = async (domainId: number, settings: LlmsSettings) => {
|
|
79
|
+
return sendRequest(withPath(SERVICES.UPDATE_LLMS_SETTINGS, `${domainId}/llms-settings`), { ...settings });
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/** Las páginas del dominio con su elegibilidad, acotadas al texto y a los ids pedidos. */
|
|
83
|
+
const getLlmsPages = async (domainId: number, query: LlmsPagesQuery) => {
|
|
84
|
+
const params = new URLSearchParams();
|
|
85
|
+
if (query.search) params.set("search", query.search);
|
|
86
|
+
if (query.ids?.length) params.set("ids", query.ids.join(","));
|
|
87
|
+
if (query.page) params.set("page", String(query.page));
|
|
88
|
+
if (query.itemsPerPage) params.set("itemsPerPage", String(query.itemsPerPage));
|
|
89
|
+
const queryString = params.toString();
|
|
90
|
+
|
|
91
|
+
return sendRequest(
|
|
92
|
+
withPath(SERVICES.GET_LLMS_PAGES, `${domainId}/llms-pages${queryString ? `?${queryString}` : ""}`),
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* El `llms.txt` de cada prefijo de URL del dominio, resuelto con los ajustes que
|
|
98
|
+
* se mandan —los que el editor tiene en pantalla, guardados o no—. No guarda nada.
|
|
99
|
+
*/
|
|
100
|
+
const resolveLlmsIndex = async (domainId: number, settings: LlmsSettings) => {
|
|
101
|
+
return sendRequest(withPath(SERVICES.RESOLVE_LLMS_INDEX, `${domainId}/llms-index`), { ...settings });
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Un tramo de las páginas que coge una sección del `llms.txt` del dominio, con cuántas
|
|
106
|
+
* coge en total y los sites que cuentan, resuelto con los ajustes que se mandan —los que
|
|
107
|
+
* el editor tiene en pantalla, guardados o no—. No guarda nada.
|
|
108
|
+
*/
|
|
109
|
+
const listLlmsSectionPages = async (domainId: number, query: LlmsSectionPagesQuery) => {
|
|
110
|
+
return sendRequest(withPath(SERVICES.LIST_LLMS_SECTION_PAGES, `${domainId}/llms-section-pages`), { ...query });
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export default {
|
|
114
|
+
getDomainsRobots,
|
|
115
|
+
updateDomainsRobots,
|
|
116
|
+
getDomains,
|
|
117
|
+
getLlmsSettings,
|
|
118
|
+
updateLlmsSettings,
|
|
119
|
+
getLlmsPages,
|
|
120
|
+
resolveLlmsIndex,
|
|
121
|
+
listLlmsSectionPages,
|
|
122
|
+
};
|
package/src/api/global.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ICreatePasswordParams } from "@ax/types";
|
|
2
|
-
|
|
3
2
|
import { template } from "./config";
|
|
4
|
-
import { type IServiceConfig,
|
|
3
|
+
import { type IServiceConfig, sendRequest } from "./utils";
|
|
5
4
|
|
|
6
5
|
const SERVICES: { [key: string]: IServiceConfig } = {
|
|
7
6
|
LOGIN: {
|
|
@@ -9,14 +8,6 @@ const SERVICES: { [key: string]: IServiceConfig } = {
|
|
|
9
8
|
endpoint: "/login_check",
|
|
10
9
|
method: "POST",
|
|
11
10
|
hasToken: false,
|
|
12
|
-
skipAuthRenewal: true,
|
|
13
|
-
},
|
|
14
|
-
LOGOUT: {
|
|
15
|
-
...template,
|
|
16
|
-
endpoint: "/logout",
|
|
17
|
-
method: "POST",
|
|
18
|
-
hasToken: true,
|
|
19
|
-
skipAuthRenewal: true,
|
|
20
11
|
},
|
|
21
12
|
GET_SETTINGS: {
|
|
22
13
|
...template,
|
|
@@ -41,7 +32,6 @@ const SERVICES: { [key: string]: IServiceConfig } = {
|
|
|
41
32
|
endpoint: ["/user/", "/password/init"],
|
|
42
33
|
method: "POST",
|
|
43
34
|
hasToken: true,
|
|
44
|
-
skipAuthRenewal: true,
|
|
45
35
|
},
|
|
46
36
|
};
|
|
47
37
|
|
|
@@ -86,21 +76,8 @@ const createPassword = async (userID: number, data: ICreatePasswordParams) => {
|
|
|
86
76
|
return sendRequest(SERVICES.CREATE_PASSWORD, { ...data });
|
|
87
77
|
};
|
|
88
78
|
|
|
89
|
-
/**
|
|
90
|
-
* Cierra la sesión en la API (idempotente, 204). Acepta el acceso aunque esté caducado y/o el refresh del
|
|
91
|
-
* cuerpo; no dispara renovación (`skipAuthRenewal`) para no entrar en bucle si responde 401.
|
|
92
|
-
*/
|
|
93
|
-
const logout = async (session: { token: string; refreshToken: string | null }) => {
|
|
94
|
-
return sendInitialRequest(
|
|
95
|
-
SERVICES.LOGOUT,
|
|
96
|
-
session.token,
|
|
97
|
-
session.refreshToken ? { refreshToken: session.refreshToken } : {},
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
79
|
export default {
|
|
102
80
|
login,
|
|
103
|
-
logout,
|
|
104
81
|
getSettings,
|
|
105
82
|
forgotPassword,
|
|
106
83
|
resetPassword,
|
package/src/api/utils.tsx
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import axios, { type AxiosRequestConfig, type AxiosResponse, type Method, type ResponseType } from "axios";
|
|
2
|
-
|
|
3
2
|
import { SET_ERROR } from "./../containers/App/constants";
|
|
4
3
|
import { getStore } from "../storeRegistry";
|
|
5
|
-
import { getSession } from "./session";
|
|
6
|
-
import { requestWithRenewal } from "./sessionRenewal";
|
|
7
4
|
|
|
8
5
|
export interface IServiceConfig {
|
|
9
6
|
host: string | undefined;
|
|
@@ -14,23 +11,18 @@ export interface IServiceConfig {
|
|
|
14
11
|
dynamicUrl?: string;
|
|
15
12
|
responseType?: ResponseType;
|
|
16
13
|
onUploadProgress?: any;
|
|
17
|
-
/**
|
|
18
|
-
* El 401 de este servicio es un error normal: no renueva ni cierra la sesión (login, SSO,
|
|
19
|
-
* `password/init`, logout y la propia renovación).
|
|
20
|
-
*/
|
|
21
|
-
skipAuthRenewal?: boolean;
|
|
22
14
|
}
|
|
23
15
|
|
|
24
16
|
const getToken = (): Record<string, unknown> | null => {
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
17
|
+
const app = localStorage.getItem("persist:app");
|
|
18
|
+
if (!app) return null;
|
|
27
19
|
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
let { token } = JSON.parse(app);
|
|
21
|
+
token = JSON.parse(token);
|
|
22
|
+
const authorization = { Authorization: `bearer ${token}` };
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
serviceConfig.skipAuthRenewal ? axios(config) : requestWithRenewal(config);
|
|
24
|
+
return authorization;
|
|
25
|
+
};
|
|
34
26
|
|
|
35
27
|
const getLang = (): Record<string, unknown> => {
|
|
36
28
|
const store = getStore();
|
|
@@ -122,7 +114,7 @@ export const sendInitialRequest = async (
|
|
|
122
114
|
method,
|
|
123
115
|
headers: {
|
|
124
116
|
...configHeaders,
|
|
125
|
-
Authorization:
|
|
117
|
+
Authorization: "bearer " + token,
|
|
126
118
|
},
|
|
127
119
|
};
|
|
128
120
|
|
|
@@ -130,10 +122,10 @@ export const sendInitialRequest = async (
|
|
|
130
122
|
const isPost = method === "PUT" || method === "POST";
|
|
131
123
|
if (isPost) {
|
|
132
124
|
const postConfig = { ...config, data };
|
|
133
|
-
const postResponse = await
|
|
125
|
+
const postResponse = await axios(postConfig);
|
|
134
126
|
return postResponse;
|
|
135
127
|
}
|
|
136
|
-
const response = await
|
|
128
|
+
const response = await axios(config);
|
|
137
129
|
return response;
|
|
138
130
|
} catch (e) {
|
|
139
131
|
if (e.message !== "Network Error") {
|
|
@@ -177,7 +169,7 @@ export const sendRequest = async (
|
|
|
177
169
|
// requestCache.save(requestConfig, response);
|
|
178
170
|
|
|
179
171
|
// return response;
|
|
180
|
-
return await
|
|
172
|
+
return await axios(requestConfig);
|
|
181
173
|
} catch (e) {
|
|
182
174
|
if (e.message !== "Network Error") {
|
|
183
175
|
return (
|
|
@@ -210,7 +202,7 @@ export const sendUploadRequest = async (
|
|
|
210
202
|
};
|
|
211
203
|
}
|
|
212
204
|
|
|
213
|
-
return await
|
|
205
|
+
return await axios(requestConfig);
|
|
214
206
|
} catch (e) {
|
|
215
207
|
if (e.message !== "Network Error") {
|
|
216
208
|
return (
|
|
@@ -243,8 +235,6 @@ export function handleResponse(
|
|
|
243
235
|
}
|
|
244
236
|
}
|
|
245
237
|
|
|
246
|
-
export { getToken };
|
|
247
|
-
|
|
248
238
|
export default {
|
|
249
239
|
getToken,
|
|
250
240
|
getHeaders,
|
|
@@ -2,11 +2,9 @@ import { useCallback, useEffect, useState } from "react";
|
|
|
2
2
|
|
|
3
3
|
import { IconAction, Tooltip } from "@ax/components";
|
|
4
4
|
import { getValidity } from "@ax/forms";
|
|
5
|
-
import { isEmptyContainer, slugify } from "@ax/helpers";
|
|
5
|
+
import { getFieldByPath, isEmptyContainer, slugify } from "@ax/helpers";
|
|
6
6
|
import type { IErrorItem } from "@ax/types";
|
|
7
7
|
|
|
8
|
-
import { getFieldByPath } from "./getFieldByPath";
|
|
9
|
-
|
|
10
8
|
import * as S from "./style";
|
|
11
9
|
|
|
12
10
|
const FieldsBehavior = (props: IFieldsBehaviorProps): JSX.Element => {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
2
|
|
|
3
|
-
import { Button, ErrorToast, FieldsBehavior } from "@ax/components";
|
|
4
3
|
import type { IGlobalSettings } from "@ax/containers/App/reducer";
|
|
5
4
|
import { useModal } from "@ax/hooks";
|
|
6
|
-
|
|
5
|
+
import { Button, FieldsBehavior, ErrorToast } from "@ax/components";
|
|
7
6
|
import RecoveryModal from "./RecoveryModal";
|
|
8
7
|
|
|
9
8
|
import * as S from "./style";
|
|
@@ -25,7 +24,6 @@ const LoginForm = (props: ILoginFormProps): JSX.Element => {
|
|
|
25
24
|
settings,
|
|
26
25
|
rememberMe,
|
|
27
26
|
handleRememberMe,
|
|
28
|
-
footer,
|
|
29
27
|
} = props;
|
|
30
28
|
|
|
31
29
|
const [viewPass, setViewPass] = useState(false);
|
|
@@ -116,7 +114,6 @@ const LoginForm = (props: ILoginFormProps): JSX.Element => {
|
|
|
116
114
|
</Button>
|
|
117
115
|
<RecoveryModal isOpen={isOpen} toggleModal={toggleModal} />
|
|
118
116
|
</S.Form>
|
|
119
|
-
{footer}
|
|
120
117
|
</S.Main>
|
|
121
118
|
<S.Secuoyas>
|
|
122
119
|
Made with care at{" "}
|
|
@@ -138,8 +135,6 @@ export interface ILoginFormProps {
|
|
|
138
135
|
settings: IGlobalSettings;
|
|
139
136
|
rememberMe: boolean;
|
|
140
137
|
handleRememberMe: () => void;
|
|
141
|
-
/** Alternativas de acceso bajo el formulario (p. ej. SSO de Griddo). */
|
|
142
|
-
footer?: ReactNode;
|
|
143
138
|
}
|
|
144
139
|
|
|
145
140
|
export default LoginForm;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from "react";
|
|
2
2
|
|
|
3
|
-
import { Circle } from "@ax/components";
|
|
4
3
|
import type { IGlobalSettings } from "@ax/containers/App/reducer";
|
|
5
|
-
|
|
4
|
+
import { Circle } from "@ax/components";
|
|
6
5
|
import LoginForm from "./LoginForm";
|
|
7
|
-
import LoginGriddoId from "./LoginGriddoId";
|
|
8
6
|
import LoginSSO from "./LoginSSO";
|
|
9
7
|
|
|
10
8
|
import * as S from "./style";
|
|
@@ -23,7 +21,6 @@ const Login = (props: ILoginProps): JSX.Element => {
|
|
|
23
21
|
isLoginSuccess,
|
|
24
22
|
handleLoginSuccess,
|
|
25
23
|
handleSSO,
|
|
26
|
-
handleGriddoId,
|
|
27
24
|
errorSSO,
|
|
28
25
|
} = props;
|
|
29
26
|
|
|
@@ -52,8 +49,6 @@ const Login = (props: ILoginProps): JSX.Element => {
|
|
|
52
49
|
<S.LeftWrapper className={isLoginSuccess ? "animate" : ""} onAnimationEnd={_handleAnimationEnd} ref={wrapperRef}>
|
|
53
50
|
<S.LoginWrapper className={isLoginSuccess ? "animate" : ""} width={wrapperWidth}>
|
|
54
51
|
{settings.SSOActivated ? (
|
|
55
|
-
// SSO de Comillas: la pantalla de siempre, sin formulario y sin «Entrar con Griddo» (ese botón
|
|
56
|
-
// solo existe junto al login normal), con o sin `GriddoIdEnabled`.
|
|
57
52
|
<LoginSSO handleSSO={handleSSO} errorSSO={errorSSO} settings={settings} />
|
|
58
53
|
) : (
|
|
59
54
|
<LoginForm
|
|
@@ -66,11 +61,6 @@ const Login = (props: ILoginProps): JSX.Element => {
|
|
|
66
61
|
settings={settings}
|
|
67
62
|
rememberMe={rememberMe}
|
|
68
63
|
handleRememberMe={handleRememberMe}
|
|
69
|
-
footer={
|
|
70
|
-
settings.GriddoIdEnabled && (
|
|
71
|
-
<LoginGriddoId handleGriddoId={handleGriddoId ?? (() => undefined)} errorSSO={errorSSO} />
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
64
|
/>
|
|
75
65
|
)}
|
|
76
66
|
</S.LoginWrapper>
|
|
@@ -97,8 +87,6 @@ export interface ILoginProps {
|
|
|
97
87
|
isLoginSuccess: boolean;
|
|
98
88
|
handleLoginSuccess: () => void;
|
|
99
89
|
handleSSO: () => void;
|
|
100
|
-
/** Navega a `/sso/start` de la API (login con auth.griddo.io). */
|
|
101
|
-
handleGriddoId?: () => void;
|
|
102
90
|
errorSSO: string | null;
|
|
103
91
|
}
|
|
104
92
|
|
package/src/components/index.tsx
CHANGED
|
@@ -7,10 +7,9 @@ import BrowserContent from "./BrowserContent";
|
|
|
7
7
|
import BulkSelectionOptions from "./BulkSelectionOptions";
|
|
8
8
|
import Button from "./Button";
|
|
9
9
|
import CategoryCell from "./CategoryCell";
|
|
10
|
-
import { buildCategoryColumns } from "./CategoryCell/buildCategoryColumns";
|
|
11
10
|
import Circle from "./Circle";
|
|
12
|
-
import ConfigPanel from "./ConfigPanel";
|
|
13
11
|
import ContentItem from "./ContentItem";
|
|
12
|
+
import ConfigPanel from "./ConfigPanel";
|
|
14
13
|
import ContextMenu from "./ContextMenu";
|
|
15
14
|
import DragAndDrop from "./DragAndDrop";
|
|
16
15
|
import ElementsTooltip from "./ElementsTooltip";
|
|
@@ -105,7 +104,6 @@ import SearchTagsBar from "./SearchTagsBar";
|
|
|
105
104
|
import SelectionComponent from "./SelectionComponent";
|
|
106
105
|
import SharePageModal from "./SharePageModal";
|
|
107
106
|
import SideModal from "./SideModal";
|
|
108
|
-
import SsoDenied from "./SsoDenied";
|
|
109
107
|
import StatusTile from "./StatusTile";
|
|
110
108
|
import SubNav from "./SubNav";
|
|
111
109
|
import TableCounter from "./TableCounter";
|
|
@@ -148,7 +146,6 @@ export {
|
|
|
148
146
|
BrowserContent,
|
|
149
147
|
BulkSelectionOptions,
|
|
150
148
|
Button,
|
|
151
|
-
buildCategoryColumns,
|
|
152
149
|
CancelScheduleModal,
|
|
153
150
|
CategoryCell,
|
|
154
151
|
CategoryFilter,
|
|
@@ -158,9 +155,9 @@ export {
|
|
|
158
155
|
Circle,
|
|
159
156
|
ComponentArray,
|
|
160
157
|
ComponentContainer,
|
|
158
|
+
ContentItem,
|
|
161
159
|
ConditionalField,
|
|
162
160
|
ConfigPanel,
|
|
163
|
-
ContentItem,
|
|
164
161
|
ContextMenu,
|
|
165
162
|
CustomizeFilters,
|
|
166
163
|
DateField,
|
|
@@ -189,8 +186,8 @@ export {
|
|
|
189
186
|
FormFieldArray,
|
|
190
187
|
Gallery,
|
|
191
188
|
GuardModal,
|
|
192
|
-
HeadingField,
|
|
193
189
|
HeadingsPreviewModal,
|
|
190
|
+
HeadingField,
|
|
194
191
|
HiddenField,
|
|
195
192
|
Icon,
|
|
196
193
|
IconAction,
|
|
@@ -198,8 +195,8 @@ export {
|
|
|
198
195
|
ImageDragAndDrop,
|
|
199
196
|
ImageField,
|
|
200
197
|
InformativeMenu,
|
|
201
|
-
IntegrationsField,
|
|
202
198
|
KeywordsPreviewModal,
|
|
199
|
+
IntegrationsField,
|
|
203
200
|
LanguageMenu,
|
|
204
201
|
LastAccessFilter,
|
|
205
202
|
LinkField,
|
|
@@ -221,8 +218,8 @@ export {
|
|
|
221
218
|
OcassionalToast,
|
|
222
219
|
PageFinder,
|
|
223
220
|
Pagination,
|
|
224
|
-
PermissionsFilter,
|
|
225
221
|
ProfileImage,
|
|
222
|
+
PermissionsFilter,
|
|
226
223
|
ProgressBar,
|
|
227
224
|
RadioField,
|
|
228
225
|
RadioGroup,
|
|
@@ -234,15 +231,14 @@ export {
|
|
|
234
231
|
RichText,
|
|
235
232
|
RoleFilter,
|
|
236
233
|
ScheduleModal,
|
|
237
|
-
SEOPreview,
|
|
238
234
|
SearchField,
|
|
239
235
|
SearchTagsBar,
|
|
240
236
|
Select,
|
|
241
237
|
SelectionComponent,
|
|
238
|
+
SEOPreview,
|
|
242
239
|
SharePageModal,
|
|
243
240
|
SideModal,
|
|
244
241
|
SiteFilter,
|
|
245
|
-
SsoDenied,
|
|
246
242
|
StateFilter,
|
|
247
243
|
StatusFilter,
|
|
248
244
|
StatusTile,
|
|
@@ -264,8 +260,8 @@ export {
|
|
|
264
260
|
TypeFilter,
|
|
265
261
|
UniqueCheck,
|
|
266
262
|
UrlField,
|
|
267
|
-
UserRolesAndSites,
|
|
268
263
|
UsersFilter,
|
|
264
|
+
UserRolesAndSites,
|
|
269
265
|
VisualOption,
|
|
270
266
|
VisualUniqueSelection,
|
|
271
267
|
Wysiwyg,
|