contentoh-components-library 21.2.65 → 21.2.67
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/dist/assets/images/chatPopup/Spinner.gif +0 -0
- package/dist/assets/images/chatPopup/close.svg +3 -0
- package/dist/assets/images/chatPopup/defaultImage.png +0 -0
- package/dist/assets/images/chatPopup/defaultProfile.png +0 -0
- package/dist/assets/images/chatPopup/doc.svg +1 -0
- package/dist/assets/images/chatPopup/document.svg +1 -0
- package/dist/assets/images/chatPopup/iconChat.svg +19 -0
- package/dist/assets/images/chatPopup/iconPlus.svg +3 -0
- package/dist/assets/images/chatPopup/pdf.svg +75 -0
- package/dist/assets/images/chatPopup/remove.svg +4 -0
- package/dist/assets/images/chatPopup/send.svg +3 -0
- package/dist/assets/images/chatPopup/svgIcon.svg +109 -0
- package/dist/assets/images/chatPopup/upload_file.svg +3 -0
- package/dist/assets/images/chatPopup/xls.svg +53 -0
- package/dist/components/atoms/ChatPopUp/ChatPopUp.stories.js +28 -0
- package/dist/components/atoms/ChatPopUp/index.js +841 -0
- package/dist/components/atoms/ChatPopUp/styles.js +27 -0
- package/dist/components/atoms/ChatPopUp/utils/handlersChat.js +182 -0
- package/dist/components/atoms/CustomSelectItem/CustomSelectItem.stories.js +323 -0
- package/dist/components/atoms/CustomSelectItem/index.js +174 -0
- package/dist/components/atoms/CustomSelectItem/styles.js +20 -0
- package/dist/components/atoms/StatusTag/StatusTag.stories.js +48 -0
- package/dist/components/atoms/StatusTag/index.js +58 -0
- package/dist/components/atoms/StatusTag/styles.js +20 -0
- package/dist/components/atoms/Tooltip/Tooltip.stories.js +36 -0
- package/dist/components/atoms/Tooltip/index.js +55 -0
- package/dist/components/atoms/Tooltip/styles.js +18 -0
- package/dist/components/molecules/CustomSelect/index.js +35 -14
- package/dist/components/molecules/CustomSelect/styles.js +1 -1
- package/dist/components/organisms/DashboardMetric/dashboardMetricUtils.js +17 -11
- package/dist/components/organisms/DashboardMetric/index.js +2 -2
- package/dist/components/organisms/DashboardMetric/styles.js +1 -1
- package/dist/components/pages/Dashboard/Dashboard.stories.js +26 -26
- package/dist/components/pages/Dashboard/dashboardUtils.js +25 -32
- package/dist/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +37 -0
- package/dist/components/pages/RegistrationLoginFirstStep/index.js +269 -0
- package/dist/components/pages/RegistrationLoginFirstStep/styles.js +20 -0
- package/package.json +1 -1
- package/src/components/atoms/CustomSelectItem/CustomSelectItem.stories.js +410 -0
- package/src/components/atoms/CustomSelectItem/index.js +144 -0
- package/src/components/atoms/CustomSelectItem/styles.js +32 -0
- package/src/components/molecules/CustomSelect/index.js +8 -3
- package/src/components/molecules/CustomSelect/styles.js +0 -2
- package/src/components/organisms/DashboardMetric/dashboardMetricUtils.js +15 -11
- package/src/components/organisms/DashboardMetric/index.js +4 -2
- package/src/components/organisms/DashboardMetric/styles.js +1 -1
- package/src/components/pages/Dashboard/Dashboard.stories.js +26 -26
- package/src/components/pages/Dashboard/dashboardUtils.js +18 -22
|
@@ -22,14 +22,16 @@ export const DashboardMetric = ({
|
|
|
22
22
|
}) => {
|
|
23
23
|
const labels =
|
|
24
24
|
type === "doughnut"
|
|
25
|
-
? Object.keys(dataObject).map((key) => getFullStatus(key))
|
|
25
|
+
? Object.keys(dataObject).map((key) => key !== "NS" && getFullStatus(key))
|
|
26
26
|
: Object.keys(dataObject);
|
|
27
27
|
const newObject =
|
|
28
28
|
type === "doughnut" ? removeOldStatus(dataObject) : dataObject;
|
|
29
29
|
const values = Object.values(newObject)?.length
|
|
30
30
|
? Object.values(newObject)
|
|
31
31
|
: [0];
|
|
32
|
-
const colorsArray = Object.keys(newObject).map(
|
|
32
|
+
const colorsArray = Object.keys(newObject).map(
|
|
33
|
+
(key) => key !== "NS" && getStatusColor(key)
|
|
34
|
+
);
|
|
33
35
|
|
|
34
36
|
const data = {
|
|
35
37
|
labels,
|
|
@@ -9,37 +9,37 @@ const Template = (args) => <Dashboard {...args} />;
|
|
|
9
9
|
export const DashboardDeafult = Template.bind({});
|
|
10
10
|
DashboardDeafult.args = {
|
|
11
11
|
user: {
|
|
12
|
-
id_user:
|
|
13
|
-
name: "
|
|
14
|
-
last_name: "
|
|
15
|
-
email: "
|
|
16
|
-
position: "
|
|
17
|
-
telephone:
|
|
18
|
-
country:
|
|
19
|
-
id_company:
|
|
20
|
-
id_cognito: "
|
|
12
|
+
id_user: 425,
|
|
13
|
+
name: "Auditor QA",
|
|
14
|
+
last_name: " ",
|
|
15
|
+
email: "ladiboh785@mi166.com",
|
|
16
|
+
position: "Tester",
|
|
17
|
+
telephone: null,
|
|
18
|
+
country: null,
|
|
19
|
+
id_company: 254,
|
|
20
|
+
id_cognito: "23a3f496-4e38-4e12-9bf5-7f90b77a2f35",
|
|
21
21
|
birth_Date: null,
|
|
22
|
-
about_me:
|
|
23
|
-
zip_code:
|
|
24
|
-
address:
|
|
25
|
-
job:
|
|
26
|
-
id_stripe:
|
|
22
|
+
about_me: null,
|
|
23
|
+
zip_code: null,
|
|
24
|
+
address: null,
|
|
25
|
+
job: null,
|
|
26
|
+
id_stripe: null,
|
|
27
27
|
id_role: 6,
|
|
28
28
|
active: 1,
|
|
29
29
|
is_retailer: 0,
|
|
30
|
-
email_notify:
|
|
30
|
+
email_notify: null,
|
|
31
31
|
membership: {
|
|
32
|
-
id:
|
|
33
|
-
start_date: "
|
|
34
|
-
end_date: "
|
|
35
|
-
planID:
|
|
36
|
-
plan: "
|
|
37
|
-
name: "Plan
|
|
38
|
-
user_limit: "
|
|
39
|
-
products_limit: "
|
|
40
|
-
type: "
|
|
32
|
+
id: 750,
|
|
33
|
+
start_date: "2022-01-07T21:32:54.000Z",
|
|
34
|
+
end_date: "2023-01-07T21:32:54.000Z",
|
|
35
|
+
planID: 6,
|
|
36
|
+
plan: "prod_KvGd6YSTJyR3AP",
|
|
37
|
+
name: "Plan Small",
|
|
38
|
+
user_limit: "10",
|
|
39
|
+
products_limit: "1000",
|
|
40
|
+
type: "Enterprise",
|
|
41
41
|
},
|
|
42
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
42
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-425/425.png?1666639556174",
|
|
43
43
|
},
|
|
44
|
-
jwt: "
|
|
44
|
+
jwt: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIyM2EzZjQ5Ni00ZTM4LTRlMTItOWJmNS03ZjkwYjc3YTJmMzUiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjIzYTNmNDk2LTRlMzgtNGUxMi05YmY1LTdmOTBiNzdhMmYzNSIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiJiMTRhODNhNS05NDhjLTQyMDgtOTUzNi02NTBiZWFhYjI2MmYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2NjYzOTU1NiwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2NjY0MzE1NiwiaWF0IjoxNjY2NjM5NTU2LCJlbWFpbCI6ImxhZGlib2g3ODVAbWkxNjYuY29tIn0.orGhdg1rhoD52Y5hOfr1H2ZWcfx57O_xSu-i8rZaWqQG2FrdeaoNNZ4r207uhaZF-gyuQevMkb02b4GkpMX1WaPRoS6f0OR0zNrOMXiag262G6kog6YuwiAiRasgfpGOhvOMRpwnm9zV3avqaqEI7S1B4VUl688NmwiVd0Zv6U3yuU2uyOc8Sb0wFKaQAcREydK-xNEwDTXzbsAewl3dXMA6lROQDn5ZOumVbAcZVRw1_z8DwGlsLdho_WwXHiDR_fcnFKZAXm1Jf8wJmQgT6EnmRrOIBROLv0e1uaW78nnvLKL7aWUyLr_VUlOb66AiHw0WnDUbVsDKn1nemMF2_Q",
|
|
45
45
|
};
|
|
@@ -39,28 +39,8 @@ export const getCategories = async (user, company) => {
|
|
|
39
39
|
const response = await axios.get(
|
|
40
40
|
`${process.env.REACT_APP_CATEGORY_ENDPOINT}${query}`
|
|
41
41
|
);
|
|
42
|
-
const categories = JSON.parse(response.data.body)?.data;
|
|
43
|
-
const
|
|
44
|
-
const subCategories = categoriesKeys?.map(
|
|
45
|
-
(key) => categories[key].sub_category
|
|
46
|
-
);
|
|
47
|
-
const finalArray = [];
|
|
48
|
-
let index = 0;
|
|
49
|
-
subCategories?.forEach((element) => {
|
|
50
|
-
element &&
|
|
51
|
-
Object.keys(element || {}).forEach((key) => {
|
|
52
|
-
const subCategory = element[key]?.sub_category || {};
|
|
53
|
-
const subOptions = [];
|
|
54
|
-
Object.keys(subCategory)?.forEach((subKey) => {
|
|
55
|
-
subOptions.push({
|
|
56
|
-
id: subCategory[subKey].id_category,
|
|
57
|
-
name: subKey,
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
finalArray.push({ id: index++, name: key, subOptions });
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
finalArray.sort((a, b) => a.name.localeCompare(b.name));
|
|
42
|
+
const categories = JSON.parse(response.data.body)?.data || {};
|
|
43
|
+
const finalArray = getCategoriesRecursive(categories);
|
|
64
44
|
return finalArray;
|
|
65
45
|
};
|
|
66
46
|
|
|
@@ -71,3 +51,19 @@ export const formatDate = (date) => {
|
|
|
71
51
|
const day = newDate.getDate();
|
|
72
52
|
return `${year}/${month}/${day}`;
|
|
73
53
|
};
|
|
54
|
+
|
|
55
|
+
const getCategoriesRecursive = (object) => {
|
|
56
|
+
const keys = Object.keys(object);
|
|
57
|
+
return keys.map((key, index) => {
|
|
58
|
+
const { sub_category } = object[key];
|
|
59
|
+
if (sub_category) {
|
|
60
|
+
return {
|
|
61
|
+
id: index,
|
|
62
|
+
name: key,
|
|
63
|
+
subOptions: getCategoriesRecursive(sub_category),
|
|
64
|
+
};
|
|
65
|
+
} else {
|
|
66
|
+
return { id: object[key].id_category, name: key };
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
};
|