@griddo/ax 1.65.15 → 1.65.16
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": "1.65.
|
|
4
|
+
"version": "1.65.16",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -221,5 +221,5 @@
|
|
|
221
221
|
"publishConfig": {
|
|
222
222
|
"access": "public"
|
|
223
223
|
},
|
|
224
|
-
"gitHead": "
|
|
224
|
+
"gitHead": "1425d79db504f7495ce54455cd12822815f64ab4"
|
|
225
225
|
}
|
|
@@ -2,8 +2,8 @@ import { IDimensionsGroup } from "@ax/types";
|
|
|
2
2
|
import { splitAndTrim } from "@ax/helpers";
|
|
3
3
|
|
|
4
4
|
const getTemplateDimensions = (groups: IDimensionsGroup[], template: string): string[] => {
|
|
5
|
-
const templateDimensionsGroups = groups
|
|
6
|
-
const templateDimensions = templateDimensionsGroups
|
|
5
|
+
const templateDimensionsGroups = groups?.filter((group) => group.templates?.includes(template));
|
|
6
|
+
const templateDimensions = templateDimensionsGroups?.reduce((dimensions: string[], group: IDimensionsGroup) => {
|
|
7
7
|
return [...dimensions, ...splitAndTrim(group.dimensions, ";")];
|
|
8
8
|
}, []);
|
|
9
9
|
const uniqueTemplateDimensions = [...new Set(templateDimensions)];
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
|
|
3
3
|
import { IDimension } from "@ax/types";
|
|
4
4
|
import { useModal } from "@ax/hooks";
|
|
5
|
-
import { splitAndJoin,
|
|
5
|
+
import { splitAndJoin, trimText } from "@ax/helpers";
|
|
6
6
|
import { Modal } from "@ax/components";
|
|
7
7
|
|
|
8
8
|
import DimensionPanel from "../DimensionPanel";
|
|
@@ -38,7 +38,8 @@ const Item = (props: IProps): JSX.Element => {
|
|
|
38
38
|
return (
|
|
39
39
|
<>
|
|
40
40
|
<S.Component onClick={handleClick}>
|
|
41
|
-
<S.Name>{
|
|
41
|
+
<S.Name>{item.name}</S.Name>
|
|
42
|
+
<S.Values>{trimText(valuesText, 70)}</S.Values>
|
|
42
43
|
<S.StyledActionMenu icon="more" options={dimensionOptions} tooltip="Dimension actions" />
|
|
43
44
|
</S.Component>
|
|
44
45
|
<DimensionPanel item={item} isOpen={isOpen} toggleModal={toggleModal} setDimensionItem={setDimensionItem} />
|
|
@@ -52,7 +53,8 @@ const Item = (props: IProps): JSX.Element => {
|
|
|
52
53
|
>
|
|
53
54
|
<S.ModalContent>
|
|
54
55
|
<p>
|
|
55
|
-
Are you sure you want to delete <strong>{item.name} dimension</strong>? If you delete it, this dimension
|
|
56
|
+
Are you sure you want to delete <strong>{item.name} dimension</strong>? If you delete it, this dimension
|
|
57
|
+
will no longer be measurable.
|
|
56
58
|
<br />
|
|
57
59
|
This action <strong>cannot be undone</strong>.
|
|
58
60
|
</p>
|
|
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
|
|
|
2
2
|
|
|
3
3
|
import { IDimension } from "@ax/types";
|
|
4
4
|
import { FloatingPanel, Button, FieldsBehavior, NoteField } from "@ax/components";
|
|
5
|
-
import {
|
|
5
|
+
import { splitAndJoin } from "@ax/helpers";
|
|
6
6
|
|
|
7
7
|
import * as S from "./style";
|
|
8
8
|
|
|
@@ -18,13 +18,13 @@ const DimensionPanel = (props: IProps): JSX.Element => {
|
|
|
18
18
|
|
|
19
19
|
const resetState = () => {
|
|
20
20
|
setType(typeInitialState);
|
|
21
|
-
setName(item ?
|
|
21
|
+
setName(item ? item.name : "");
|
|
22
22
|
setErrors({ name: false, values: false });
|
|
23
23
|
|
|
24
24
|
const values = splitAndJoin(item?.values, ";", ";");
|
|
25
25
|
const _values = values === "null" ? "" : values;
|
|
26
26
|
setValues(_values || "");
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
28
|
|
|
29
29
|
useEffect(() => {
|
|
30
30
|
isOpen && resetState();
|
|
@@ -32,14 +32,14 @@ const DimensionPanel = (props: IProps): JSX.Element => {
|
|
|
32
32
|
}, [isOpen]);
|
|
33
33
|
|
|
34
34
|
useEffect(() => {
|
|
35
|
-
type === "onlyDimensions" && setValues("")
|
|
35
|
+
type === "onlyDimensions" && setValues("");
|
|
36
36
|
}, [type]);
|
|
37
37
|
|
|
38
38
|
const editItemAction = () => {
|
|
39
39
|
setDimensionItem({
|
|
40
40
|
...item,
|
|
41
|
-
name:
|
|
42
|
-
values
|
|
41
|
+
name: name.replace(/\s/g, ""),
|
|
42
|
+
values,
|
|
43
43
|
});
|
|
44
44
|
toggleModal();
|
|
45
45
|
};
|
|
@@ -47,12 +47,12 @@ const DimensionPanel = (props: IProps): JSX.Element => {
|
|
|
47
47
|
const validateFields = () => {
|
|
48
48
|
const errorFields = {
|
|
49
49
|
name: !name.length,
|
|
50
|
-
values: type === "dimensionsAndValues" && !values.length
|
|
51
|
-
}
|
|
50
|
+
values: type === "dimensionsAndValues" && !values.length,
|
|
51
|
+
};
|
|
52
52
|
setErrors(errorFields);
|
|
53
53
|
const isFieldsValid = Object.values(errorFields).every((error) => !error);
|
|
54
54
|
isFieldsValid && editItemAction();
|
|
55
|
-
}
|
|
55
|
+
};
|
|
56
56
|
|
|
57
57
|
const title = item ? "Update Dimension" : "Add Dimension";
|
|
58
58
|
|
|
@@ -74,8 +74,9 @@ const DimensionPanel = (props: IProps): JSX.Element => {
|
|
|
74
74
|
},
|
|
75
75
|
];
|
|
76
76
|
|
|
77
|
-
const noteTitle = "Dimensions & Values"
|
|
78
|
-
const noteText =
|
|
77
|
+
const noteTitle = "Dimensions & Values";
|
|
78
|
+
const noteText =
|
|
79
|
+
"Create a dimension and its values. You define the values now and select them on any page later. Your analytics data will be homogeneous avoiding duplicates that might cause inaccurate data results.";
|
|
79
80
|
|
|
80
81
|
return (
|
|
81
82
|
<FloatingPanel title={title} toggleModal={toggleModal} isOpen={isOpen}>
|
|
@@ -116,7 +117,9 @@ const DimensionPanel = (props: IProps): JSX.Element => {
|
|
|
116
117
|
placeholder="Type any value that you need. Separate them with ;  Example: English; Spanish; German; French"
|
|
117
118
|
rows={4}
|
|
118
119
|
/>
|
|
119
|
-
) :
|
|
120
|
+
) : (
|
|
121
|
+
<></>
|
|
122
|
+
)}
|
|
120
123
|
</S.ContentWrapper>
|
|
121
124
|
<S.Footer>
|
|
122
125
|
<Button className="button" type="button" onClick={editButton.action}>
|
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react";
|
|
|
2
2
|
|
|
3
3
|
import { IDimension, IDimensionsGroup } from "@ax/types";
|
|
4
4
|
import { FloatingPanel, Button, FieldsBehavior, CheckGroup, RadioGroup } from "@ax/components";
|
|
5
|
-
import { splitAndTrim
|
|
5
|
+
import { splitAndTrim } from "@ax/helpers";
|
|
6
6
|
|
|
7
7
|
import * as S from "./style";
|
|
8
8
|
import { getTemplateOptions } from "./utils";
|
|
@@ -89,7 +89,7 @@ const GroupPanel = (props: IProps): JSX.Element => {
|
|
|
89
89
|
const option = {
|
|
90
90
|
name: name,
|
|
91
91
|
value: name,
|
|
92
|
-
title:
|
|
92
|
+
title: name,
|
|
93
93
|
};
|
|
94
94
|
return dimensionOptions.push(option);
|
|
95
95
|
});
|