@griddo/ax 10.4.27 → 10.4.29

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": "10.4.27",
4
+ "version": "10.4.29",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Carlos Torres <carlos.torres@secuoyas.com>",
@@ -232,5 +232,5 @@
232
232
  "publishConfig": {
233
233
  "access": "public"
234
234
  },
235
- "gitHead": "6185dbf170ba4bbe1a1d63873b06e6fd9624fd75"
235
+ "gitHead": "8aed7094dba5aa9e183f5babadbc5590267cfb0b"
236
236
  }
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ const SvgCodeBody = (props) => (
3
+ <svg xmlns="http://www.w3.org/2000/svg" width={24} height={24} fill="none" {...props}>
4
+ <path
5
+ fill="#5057FF"
6
+ fillRule="evenodd"
7
+ d="M7.5 21c-.55 0-1.02-.196-1.412-.587A1.926 1.926 0 0 1 5.5 19v-1a1 1 0 1 1 2 0 1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-12a1 1 0 0 0-1 1v3a1 1 0 0 1-2 0V5c0-.55.196-1.02.588-1.413A1.926 1.926 0 0 1 7.5 3h14c.55 0 1.02.196 1.413.587.391.392.587.863.587 1.413v14c0 .55-.196 1.02-.587 1.413A1.926 1.926 0 0 1 21.5 21h-14Zm-4.6-7.825L4.375 11.7c.2-.2.3-.433.3-.7 0-.267-.1-.5-.3-.7-.2-.2-.438-.3-.712-.3-.275 0-.513.1-.713.3L.775 12.475c-.1.1-.17.208-.213.325a1.107 1.107 0 0 0-.062.375c0 .133.02.258.063.375a.877.877 0 0 0 .212.325L2.95 16.05c.2.2.438.3.712.3.276 0 .513-.1.713-.3.2-.2.3-.433.3-.7 0-.267-.1-.5-.3-.7L2.9 13.175Zm7.35 0L8.775 14.65c-.2.2-.3.433-.3.7 0 .267.1.5.3.7.2.2.438.3.713.3.274 0 .512-.1.712-.3l2.175-2.175c.1-.1.17-.208.213-.325.041-.117.062-.242.062-.375s-.02-.258-.063-.375a.877.877 0 0 0-.212-.325L10.2 10.3a.999.999 0 0 0-1.425 0c-.2.2-.3.433-.3.7 0 .267.1.5.3.7l1.475 1.475Z"
8
+ clipRule="evenodd"
9
+ />
10
+ </svg>
11
+ );
12
+ export default SvgCodeBody;
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ const SvgCodeHead = (props) => (
3
+ <svg xmlns="http://www.w3.org/2000/svg" width={24} height={24} fill="none" {...props}>
4
+ <path
5
+ fill="#5057FF"
6
+ fillRule="evenodd"
7
+ d="M2.9 5.175 4.375 3.7c.2-.2.3-.433.3-.7 0-.267-.1-.5-.3-.7-.2-.2-.438-.3-.712-.3-.275 0-.513.1-.713.3L.775 4.475c-.1.1-.17.208-.213.325a1.107 1.107 0 0 0-.062.375c0 .133.02.258.063.375a.877.877 0 0 0 .212.325L2.95 8.05c.2.2.438.3.712.3.276 0 .513-.1.713-.3.2-.2.3-.433.3-.7 0-.267-.1-.5-.3-.7L2.9 5.175Zm7.35 0L8.775 6.65c-.2.2-.3.433-.3.7 0 .267.1.5.3.7.2.2.438.3.713.3.274 0 .512-.1.712-.3l2.175-2.175c.1-.1.17-.208.213-.325.041-.117.062-.242.062-.375s-.02-.258-.063-.375a.878.878 0 0 0-.212-.325L10.2 2.3a.999.999 0 0 0-1.425 0c-.2.2-.3.433-.3.7 0 .267.1.5.3.7l1.475 1.475ZM5.5 11a1 1 0 1 1 2 0v8a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1h-6a1 1 0 1 1 0-2h7c.55 0 1.02.196 1.413.588.391.391.587.862.587 1.412v14c0 .55-.196 1.02-.587 1.413A1.926 1.926 0 0 1 21.5 22h-14c-.55 0-1.02-.196-1.412-.587A1.926 1.926 0 0 1 5.5 20v-9Z"
8
+ clipRule="evenodd"
9
+ />
10
+ </svg>
11
+ );
12
+ export default SvgCodeHead;
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ const SvgCodeHeadBody = (props) => (
3
+ <svg xmlns="http://www.w3.org/2000/svg" width={24} height={24} fill="none" {...props}>
4
+ <path
5
+ fill="#5057FF"
6
+ fillRule="evenodd"
7
+ d="M2.9 4.175 4.375 2.7c.2-.2.3-.433.3-.7 0-.267-.1-.5-.3-.7-.2-.2-.438-.3-.712-.3-.275 0-.513.1-.713.3L.775 3.475c-.1.1-.17.208-.213.325a1.107 1.107 0 0 0-.062.375c0 .133.02.258.063.375a.877.877 0 0 0 .212.325L2.95 7.05c.2.2.438.3.712.3.276 0 .513-.1.713-.3.2-.2.3-.433.3-.7 0-.267-.1-.5-.3-.7L2.9 4.175Zm7.35 0L8.775 5.65c-.2.2-.3.433-.3.7 0 .267.1.5.3.7.2.2.438.3.713.3.274 0 .512-.1.712-.3l2.175-2.175c.1-.1.17-.208.213-.325.041-.117.062-.242.062-.375s-.02-.258-.063-.375a.878.878 0 0 0-.212-.325L10.2 1.3a.999.999 0 0 0-1.425 0c-.2.2-.3.433-.3.7 0 .267.1.5.3.7l1.475 1.475ZM6.5 8a1 1 0 0 0-1 1v1a1 1 0 1 0 2 0V9a1 1 0 0 0-1-1Zm7-4a1 1 0 0 0 1 1h6a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1h-12a1 1 0 0 1-1-1 1 1 0 1 0-2 0v1c0 .55.196 1.02.588 1.413.391.391.862.587 1.412.587h14c.55 0 1.02-.196 1.413-.587.391-.392.587-.863.587-1.413V5c0-.55-.196-1.02-.587-1.413A1.926 1.926 0 0 0 21.5 3h-7a1 1 0 0 0-1 1Zm-9.125 8.7L2.9 14.175l1.475 1.475c.2.2.3.433.3.7 0 .267-.1.5-.3.7-.2.2-.438.3-.712.3a.973.973 0 0 1-.713-.3L.775 14.875a.877.877 0 0 1-.213-.325 1.107 1.107 0 0 1-.062-.375c0-.133.02-.258.063-.375a.877.877 0 0 1 .212-.325L2.95 11.3c.2-.2.438-.3.712-.3.276 0 .513.1.713.3.2.2.3.433.3.7 0 .267-.1.5-.3.7Zm4.4 2.95 1.475-1.475L8.775 12.7a.96.96 0 0 1-.3-.7c0-.267.1-.5.3-.7a.999.999 0 0 1 1.425 0l2.175 2.175c.1.1.17.208.213.325.041.117.062.242.062.375s-.02.258-.063.375a.877.877 0 0 1-.212.325L10.2 17.05c-.2.2-.438.3-.712.3a.973.973 0 0 1-.713-.3.96.96 0 0 1-.3-.7c0-.267.1-.5.3-.7Z"
8
+ clipRule="evenodd"
9
+ />
10
+ </svg>
11
+ );
12
+ export default SvgCodeHeadBody;
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 21C6.95 21 6.47917 20.8042 6.0875 20.4125C5.69583 20.0208 5.5 19.55 5.5 19V18C5.5 17.4477 5.94772 17 6.5 17C7.05228 17 7.5 17.4477 7.5 18C7.5 18.5523 7.94772 19 8.5 19H20.5C21.0523 19 21.5 18.5523 21.5 18V6C21.5 5.44772 21.0523 5 20.5 5H8.5C7.94772 5 7.5 5.44772 7.5 6V9C7.5 9.55228 7.05228 10 6.5 10C5.94772 10 5.5 9.55228 5.5 9V5C5.5 4.45 5.69583 3.97917 6.0875 3.5875C6.47917 3.19583 6.95 3 7.5 3H21.5C22.05 3 22.5208 3.19583 22.9125 3.5875C23.3042 3.97917 23.5 4.45 23.5 5V19C23.5 19.55 23.3042 20.0208 22.9125 20.4125C22.5208 20.8042 22.05 21 21.5 21H7.5ZM2.9 13.175L4.375 11.7C4.575 11.5 4.675 11.2667 4.675 11C4.675 10.7333 4.575 10.5 4.375 10.3C4.175 10.1 3.9375 10 3.6625 10C3.3875 10 3.15 10.1 2.95 10.3L0.775 12.475C0.675 12.575 0.604167 12.6833 0.5625 12.8C0.520833 12.9167 0.5 13.0417 0.5 13.175C0.5 13.3083 0.520833 13.4333 0.5625 13.55C0.604167 13.6667 0.675 13.775 0.775 13.875L2.95 16.05C3.15 16.25 3.3875 16.35 3.6625 16.35C3.9375 16.35 4.175 16.25 4.375 16.05C4.575 15.85 4.675 15.6167 4.675 15.35C4.675 15.0833 4.575 14.85 4.375 14.65L2.9 13.175ZM10.25 13.175L8.775 14.65C8.575 14.85 8.475 15.0833 8.475 15.35C8.475 15.6167 8.575 15.85 8.775 16.05C8.975 16.25 9.2125 16.35 9.4875 16.35C9.7625 16.35 10 16.25 10.2 16.05L12.375 13.875C12.475 13.775 12.5458 13.6667 12.5875 13.55C12.6292 13.4333 12.65 13.3083 12.65 13.175C12.65 13.0417 12.6292 12.9167 12.5875 12.8C12.5458 12.6833 12.475 12.575 12.375 12.475L10.2 10.3C10.1 10.2 9.9875 10.125 9.8625 10.075C9.7375 10.025 9.6125 10 9.4875 10C9.3625 10 9.2375 10.025 9.1125 10.075C8.9875 10.125 8.875 10.2 8.775 10.3C8.575 10.5 8.475 10.7333 8.475 11C8.475 11.2667 8.575 11.5 8.775 11.7L10.25 13.175Z" fill="#5057FF"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M2.9 4.175L4.375 2.7C4.575 2.5 4.675 2.26667 4.675 2C4.675 1.73333 4.575 1.5 4.375 1.3C4.175 1.1 3.9375 1 3.6625 1C3.3875 1 3.15 1.1 2.95 1.3L0.775 3.475C0.675 3.575 0.604167 3.68333 0.5625 3.8C0.520833 3.91667 0.5 4.04167 0.5 4.175C0.5 4.30833 0.520833 4.43333 0.5625 4.55C0.604167 4.66667 0.675 4.775 0.775 4.875L2.95 7.05C3.15 7.25 3.3875 7.35 3.6625 7.35C3.9375 7.35 4.175 7.25 4.375 7.05C4.575 6.85 4.675 6.61667 4.675 6.35C4.675 6.08333 4.575 5.85 4.375 5.65L2.9 4.175ZM10.25 4.175L8.775 5.65C8.575 5.85 8.475 6.08333 8.475 6.35C8.475 6.61667 8.575 6.85 8.775 7.05C8.975 7.25 9.2125 7.35 9.4875 7.35C9.7625 7.35 10 7.25 10.2 7.05L12.375 4.875C12.475 4.775 12.5458 4.66667 12.5875 4.55C12.6292 4.43333 12.65 4.30833 12.65 4.175C12.65 4.04167 12.6292 3.91667 12.5875 3.8C12.5458 3.68333 12.475 3.575 12.375 3.475L10.2 1.3C10.1 1.2 9.9875 1.125 9.8625 1.075C9.7375 1.025 9.6125 1 9.4875 1C9.3625 1 9.2375 1.025 9.1125 1.075C8.9875 1.125 8.875 1.2 8.775 1.3C8.575 1.5 8.475 1.73333 8.475 2C8.475 2.26667 8.575 2.5 8.775 2.7L10.25 4.175ZM6.5 8C5.94772 8 5.5 8.44772 5.5 9V10C5.5 10.5523 5.94772 11 6.5 11C7.05228 11 7.5 10.5523 7.5 10V9C7.5 8.44772 7.05228 8 6.5 8ZM13.5 4C13.5 4.55228 13.9477 5 14.5 5H20.5C21.0523 5 21.5 5.44772 21.5 6V18C21.5 18.5523 21.0523 19 20.5 19H8.5C7.94772 19 7.5 18.5523 7.5 18C7.5 17.4477 7.05228 17 6.5 17C5.94772 17 5.5 17.4477 5.5 18V19C5.5 19.55 5.69583 20.0208 6.0875 20.4125C6.47917 20.8042 6.95 21 7.5 21H21.5C22.05 21 22.5208 20.8042 22.9125 20.4125C23.3042 20.0208 23.5 19.55 23.5 19V5C23.5 4.45 23.3042 3.97917 22.9125 3.5875C22.5208 3.19583 22.05 3 21.5 3H14.5C13.9477 3 13.5 3.44772 13.5 4ZM4.375 12.7L2.9 14.175L4.375 15.65C4.575 15.85 4.675 16.0833 4.675 16.35C4.675 16.6167 4.575 16.85 4.375 17.05C4.175 17.25 3.9375 17.35 3.6625 17.35C3.3875 17.35 3.15 17.25 2.95 17.05L0.775 14.875C0.675 14.775 0.604167 14.6667 0.5625 14.55C0.520833 14.4333 0.5 14.3083 0.5 14.175C0.5 14.0417 0.520833 13.9167 0.5625 13.8C0.604167 13.6833 0.675 13.575 0.775 13.475L2.95 11.3C3.15 11.1 3.3875 11 3.6625 11C3.9375 11 4.175 11.1 4.375 11.3C4.575 11.5 4.675 11.7333 4.675 12C4.675 12.2667 4.575 12.5 4.375 12.7ZM8.775 15.65L10.25 14.175L8.775 12.7C8.575 12.5 8.475 12.2667 8.475 12C8.475 11.7333 8.575 11.5 8.775 11.3C8.875 11.2 8.9875 11.125 9.1125 11.075C9.2375 11.025 9.3625 11 9.4875 11C9.6125 11 9.7375 11.025 9.8625 11.075C9.9875 11.125 10.1 11.2 10.2 11.3L12.375 13.475C12.475 13.575 12.5458 13.6833 12.5875 13.8C12.6292 13.9167 12.65 14.0417 12.65 14.175C12.65 14.3083 12.6292 14.4333 12.5875 14.55C12.5458 14.6667 12.475 14.775 12.375 14.875L10.2 17.05C10 17.25 9.7625 17.35 9.4875 17.35C9.2125 17.35 8.975 17.25 8.775 17.05C8.575 16.85 8.475 16.6167 8.475 16.35C8.475 16.0833 8.575 15.85 8.775 15.65Z" fill="#5057FF"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M2.9 5.175L4.375 3.7C4.575 3.5 4.675 3.26667 4.675 3C4.675 2.73333 4.575 2.5 4.375 2.3C4.175 2.1 3.9375 2 3.6625 2C3.3875 2 3.15 2.1 2.95 2.3L0.775 4.475C0.675 4.575 0.604167 4.68333 0.5625 4.8C0.520833 4.91667 0.5 5.04167 0.5 5.175C0.5 5.30833 0.520833 5.43333 0.5625 5.55C0.604167 5.66667 0.675 5.775 0.775 5.875L2.95 8.05C3.15 8.25 3.3875 8.35 3.6625 8.35C3.9375 8.35 4.175 8.25 4.375 8.05C4.575 7.85 4.675 7.61667 4.675 7.35C4.675 7.08333 4.575 6.85 4.375 6.65L2.9 5.175ZM10.25 5.175L8.775 6.65C8.575 6.85 8.475 7.08333 8.475 7.35C8.475 7.61667 8.575 7.85 8.775 8.05C8.975 8.25 9.2125 8.35 9.4875 8.35C9.7625 8.35 10 8.25 10.2 8.05L12.375 5.875C12.475 5.775 12.5458 5.66667 12.5875 5.55C12.6292 5.43333 12.65 5.30833 12.65 5.175C12.65 5.04167 12.6292 4.91667 12.5875 4.8C12.5458 4.68333 12.475 4.575 12.375 4.475L10.2 2.3C10.1 2.2 9.9875 2.125 9.8625 2.075C9.7375 2.025 9.6125 2 9.4875 2C9.3625 2 9.2375 2.025 9.1125 2.075C8.9875 2.125 8.875 2.2 8.775 2.3C8.575 2.5 8.475 2.73333 8.475 3C8.475 3.26667 8.575 3.5 8.775 3.7L10.25 5.175ZM5.5 11C5.5 10.4477 5.94772 10 6.5 10C7.05228 10 7.5 10.4477 7.5 11V19C7.5 19.5523 7.94772 20 8.5 20H20.5C21.0523 20 21.5 19.5523 21.5 19V7C21.5 6.44772 21.0523 6 20.5 6H14.5C13.9477 6 13.5 5.55228 13.5 5C13.5 4.44772 13.9477 4 14.5 4H21.5C22.05 4 22.5208 4.19583 22.9125 4.5875C23.3042 4.97917 23.5 5.45 23.5 6V20C23.5 20.55 23.3042 21.0208 22.9125 21.4125C22.5208 21.8042 22.05 22 21.5 22H7.5C6.95 22 6.47917 21.8042 6.0875 21.4125C5.69583 21.0208 5.5 20.55 5.5 20V11Z" fill="#5057FF"/>
3
+ </svg>
@@ -3,7 +3,7 @@ import styled from "styled-components";
3
3
  import { Header } from "@ax/components/TableList/style";
4
4
 
5
5
  const State = styled((props) => <Header {...props} />)<{ isActive: boolean }>`
6
- width: 170px;
6
+ width: 85px;
7
7
  &:hover {
8
8
  color: ${(p) => p.theme.color.interactive01};
9
9
  }
@@ -31,6 +31,29 @@ const TableHeader = (props: IProps): JSX.Element => {
31
31
  },
32
32
  ];
33
33
 
34
+ const filtersCode = [
35
+ {
36
+ name: "all",
37
+ value: "all",
38
+ title: "ALL",
39
+ },
40
+ {
41
+ name: "head",
42
+ value: "head",
43
+ title: "Head",
44
+ },
45
+ {
46
+ name: "body",
47
+ value: "body",
48
+ title: "Body",
49
+ },
50
+ {
51
+ name: "headBody",
52
+ value: "headBody",
53
+ title: "Head&Body",
54
+ },
55
+ ];
56
+
34
57
  return (
35
58
  <S.TableHeader isScrolling={isScrolling}>
36
59
  <S.CheckHeader>
@@ -58,7 +81,21 @@ const TableHeader = (props: IProps): JSX.Element => {
58
81
  filters={filters}
59
82
  />
60
83
  </S.AppliedOnHeader>
61
- <StateFilter filterItems={filterItems} value={filterValues.filterState} />
84
+ <S.CodeHeader>
85
+ <CheckGroupFilter
86
+ filterItems={filterItems}
87
+ value={filterValues.filterCode}
88
+ pointer="filterCode"
89
+ label="Code"
90
+ description="Filter by code"
91
+ initialState={["all"]}
92
+ selectAllOption="all"
93
+ filters={filtersCode}
94
+ />
95
+ </S.CodeHeader>
96
+ <S.StateHeader>
97
+ <StateFilter filterItems={filterItems} value={filterValues.filterState} />
98
+ </S.StateHeader>
62
99
  <S.ActionsHeader>
63
100
  <TableCounter totalItems={totalItems} />
64
101
  </S.ActionsHeader>
@@ -15,7 +15,7 @@ const CheckHeader = styled(Header)`
15
15
  `;
16
16
 
17
17
  const NameHeader = styled(Header)`
18
- width: 350px;
18
+ flex: 0 0 350px;
19
19
  `;
20
20
 
21
21
  const DescriptionHeader = styled(Header)`
@@ -23,13 +23,33 @@ const DescriptionHeader = styled(Header)`
23
23
  `;
24
24
 
25
25
  const AppliedOnHeader = styled(Header)`
26
- flex: 1;
26
+ flex: 0 0 200px;
27
+ `;
28
+
29
+ const StateHeader = styled(Header)`
30
+ flex: 0 0 100px;
31
+ padding: 0;
32
+ justify-content: center;
33
+ `;
34
+
35
+ const CodeHeader = styled(Header)`
36
+ flex: 0 0 130px;
37
+ justify-content: center;
27
38
  `;
28
39
 
29
40
  const ActionsHeader = styled(Header)`
30
- width: 125px;
41
+ flex: 0 0 85px;
31
42
  padding-right: 0;
32
43
  justify-content: flex-end;
33
44
  `;
34
45
 
35
- export { TableHeader, CheckHeader, NameHeader, DescriptionHeader, AppliedOnHeader, ActionsHeader };
46
+ export {
47
+ TableHeader,
48
+ CheckHeader,
49
+ NameHeader,
50
+ DescriptionHeader,
51
+ AppliedOnHeader,
52
+ ActionsHeader,
53
+ CodeHeader,
54
+ StateHeader,
55
+ };
@@ -35,6 +35,8 @@ const IntegrationForm = (props: IProps) => {
35
35
  active: true,
36
36
  variables: [],
37
37
  scriptOrder: 0,
38
+ type: "addon",
39
+ editable: true,
38
40
  };
39
41
 
40
42
  const [form, setForm] = useState<IIntegration>(initState);
@@ -1,10 +1,11 @@
1
1
  import React from "react";
2
2
  import { connect } from "react-redux";
3
3
  import { DraggableProvided } from "react-beautiful-dnd";
4
+ import { Link } from "react-router-dom";
4
5
 
5
6
  import { useModal, usePermission, useToast } from "@ax/hooks";
6
7
  import { ICheck, IIntegration } from "@ax/types";
7
- import { CheckField, Icon, Modal, Toast, ToggleField } from "@ax/components";
8
+ import { CheckField, Icon, Modal, Toast, ToggleField, Tooltip } from "@ax/components";
8
9
  import { integrations } from "@ax/api";
9
10
  import { integrationsActions } from "@ax/containers/Integrations";
10
11
  import { appActions } from "@ax/containers/App";
@@ -119,11 +120,71 @@ const IntegrationItem = (props: IIntegrationItemProps): JSX.Element => {
119
120
 
120
121
  const handleClick = () => {
121
122
  const { setCurrentIntegration, setHistoryPush } = props;
122
- setCurrentIntegration(integration);
123
- setHistoryPush("addons/edit");
123
+ if (integration.editable) {
124
+ setCurrentIntegration(integration);
125
+ setHistoryPush("addons/edit");
126
+ }
127
+ };
128
+
129
+ const isToggleDisabled =
130
+ (integration.active && !isAllowedToDeactivateIntegrations) ||
131
+ (!integration.active && !isAllowedToActivateIntegrations);
132
+
133
+ const getIntegrationDescription = () => {
134
+ switch (integration.type) {
135
+ case "analytics":
136
+ return (
137
+ <div>
138
+ This row is dedicated to reordering GTM with other add-ons. For any changes, please visit the{" "}
139
+ <Link to="/sites/settings/analytics">Analytics section</Link>
140
+ </div>
141
+ );
142
+ case "datalayer":
143
+ return (
144
+ <div>
145
+ This row is dedicated to reordering Datalayer with other add-ons. For any changes, please visit the{" "}
146
+ <Link to="/sites/settings/analytics">Analytics section</Link>
147
+ </div>
148
+ );
149
+ default:
150
+ return integration.description;
151
+ }
152
+ };
153
+
154
+ const getIntegrationTag = () => {
155
+ const { contentBody, contentHead } = integration;
156
+
157
+ let tagProps = null;
158
+
159
+ if (contentHead && contentBody && contentBody.trim() !== "" && contentHead.trim() !== "") {
160
+ tagProps = { text: "Head&Body", color: "#DFCAFA", icon: "CodeHeadBody" };
161
+ } else if (contentBody && contentBody.trim() !== "") {
162
+ tagProps = { text: "Body", color: "#DAFE9F", icon: "CodeBody" };
163
+ } else if (contentHead && contentHead.trim() !== "") {
164
+ tagProps = { text: "Head", color: "#BEEEFD", icon: "CodeHead" };
165
+ }
166
+
167
+ if (tagProps) {
168
+ return (
169
+ <S.Tag color={tagProps.color}>
170
+ <S.IconTag>
171
+ <Icon name={tagProps.icon} size="16" />
172
+ </S.IconTag>
173
+ <div>{tagProps.text}</div>
174
+ </S.Tag>
175
+ );
176
+ }
124
177
  };
125
178
 
126
- const isToggleDisabled = (integration.active && !isAllowedToDeactivateIntegrations) || (!integration.active && !isAllowedToActivateIntegrations);
179
+ const checkBox = (
180
+ <CheckField
181
+ name="check"
182
+ value={integration.id ?? ""}
183
+ checked={isSelected}
184
+ onChange={handleOnChange}
185
+ disabled={!integration.editable}
186
+ />
187
+ );
127
188
 
128
189
  return (
129
190
  <>
@@ -132,6 +193,7 @@ const IntegrationItem = (props: IIntegrationItemProps): JSX.Element => {
132
193
  selected={isSelected}
133
194
  ref={innerRef}
134
195
  data-testid="integration-item-row"
196
+ disabled={!integration.editable}
135
197
  {...provided?.draggableProps}
136
198
  >
137
199
  <S.HandleWrapper {...provided?.dragHandleProps} hidden={listLength < 2} data-testid="handle-wrapper">
@@ -140,24 +202,45 @@ const IntegrationItem = (props: IIntegrationItemProps): JSX.Element => {
140
202
  </S.IconHandleWrapper>
141
203
  </S.HandleWrapper>
142
204
  <S.CheckCell role="cell" hasHandle={listLength >= 2}>
143
- <CheckField name="check" value={integration.id ?? ""} checked={isSelected} onChange={handleOnChange} />
205
+ {!integration.editable ? (
206
+ <Tooltip content="This cannot be selected. You can only reorder it" left={60}>
207
+ {checkBox}
208
+ </Tooltip>
209
+ ) : (
210
+ <>{checkBox}</>
211
+ )}
144
212
  </S.CheckCell>
145
- <S.NameCell role="cell" onClick={handleClick} clickable={isAllowedToManageIntegrations} >
213
+ <S.NameCell role="cell" onClick={handleClick} clickable={isAllowedToManageIntegrations}>
146
214
  <S.Order>#{integration.correlativeScriptOrder}</S.Order>
147
215
  <div>{integration.name}</div>
148
216
  </S.NameCell>
149
- <S.DescriptionCell role="cell" onClick={handleClick} clickable={isAllowedToManageIntegrations} >
150
- {integration.description}
217
+ <S.DescriptionCell role="cell" onClick={handleClick} clickable={isAllowedToManageIntegrations}>
218
+ {getIntegrationDescription()}
151
219
  </S.DescriptionCell>
152
- <S.AppliedOnCell role="cell" onClick={handleClick} clickable={isAllowedToManageIntegrations} >
153
- Applied on: <S.ContentPresence>{getContentPresence(integration.contentPresence)}</S.ContentPresence>
154
- </S.AppliedOnCell>
155
- <S.StateCell role="cell">
156
- <ToggleField name="state" value={integration.active} onChange={toggleModalChangeState} disabled={isToggleDisabled} />
157
- </S.StateCell>
158
- <S.ActionsCell role="cell">
159
- <S.StyledActionMenu icon="more" options={menuOptions} tooltip="Actions" />
160
- </S.ActionsCell>
220
+ {integration.type === "addon" && (
221
+ <>
222
+ <S.AppliedOnCell role="cell" onClick={handleClick} clickable={isAllowedToManageIntegrations}>
223
+ <div>
224
+ Applied on: <S.ContentPresence>{getContentPresence(integration.contentPresence)}</S.ContentPresence>
225
+ </div>
226
+ </S.AppliedOnCell>
227
+ <S.CodeCell role="cell" onClick={handleClick} clickable={isAllowedToManageIntegrations}>
228
+ {getIntegrationTag()}
229
+ </S.CodeCell>
230
+ <S.StateCell role="cell">
231
+ <ToggleField
232
+ name="state"
233
+ value={integration.active}
234
+ onChange={toggleModalChangeState}
235
+ disabled={isToggleDisabled}
236
+ size="s"
237
+ />
238
+ </S.StateCell>
239
+ <S.ActionsCell role="cell">
240
+ <S.StyledActionMenu icon="more" options={menuOptions} tooltip="Actions" />
241
+ </S.ActionsCell>
242
+ </>
243
+ )}
161
244
  </S.ItemRow>
162
245
  <Modal
163
246
  isOpen={isOpenDelete}
@@ -5,7 +5,8 @@ import { ActionMenu } from "@ax/components";
5
5
 
6
6
  const CheckCell = styled(Cell)<{ hasHandle: boolean }>`
7
7
  width: 24px;
8
- padding: ${(p) => p.hasHandle ? `${p.theme.spacing.s} ${p.theme.spacing.xs}`: `0 ${p.theme.spacing.s} 0 ${p.theme.spacing.m}`};
8
+ padding: ${(p) =>
9
+ p.hasHandle ? `${p.theme.spacing.s} ${p.theme.spacing.xs}` : `0 ${p.theme.spacing.s} 0 ${p.theme.spacing.m}`};
9
10
  label {
10
11
  margin-bottom: 18px;
11
12
  }
@@ -15,7 +16,7 @@ const NameCell = styled(Cell)<{ clickable: boolean }>`
15
16
  ${(p) => p.theme.textStyle.uiM};
16
17
  pointer-events: ${(p) => (p.clickable ? "auto" : "none")};
17
18
  color: ${(p) => p.theme.color.textHighEmphasis};
18
- width: 350px;
19
+ flex: 0 0 350px;
19
20
  flex-flow: row wrap;
20
21
  justify-content: flex-start;
21
22
  align-items: center;
@@ -31,15 +32,23 @@ const DescriptionCell = styled(Cell)<{ clickable: boolean }>`
31
32
  pointer-events: ${(p) => (p.clickable ? "auto" : "none")};
32
33
  color: ${(p) => p.theme.color.textMediumEmphasis};
33
34
  flex: 1;
35
+ a {
36
+ color: ${(p) => p.theme.color.interactive01};
37
+ font-weight: 600;
38
+ }
34
39
  `;
35
40
 
36
41
  const AppliedOnCell = styled(Cell)<{ clickable: boolean }>`
37
42
  ${(p) => p.theme.textStyle.uiXS};
38
43
  pointer-events: ${(p) => (p.clickable ? "auto" : "none")};
39
44
  color: ${(p) => p.theme.color.textMediumEmphasis};
40
- flex: 1;
41
- display: inline;
42
- align-self: center;
45
+ flex: 0 0 200px;
46
+ `;
47
+
48
+ const CodeCell = styled(Cell)<{ clickable: boolean }>`
49
+ pointer-events: ${(p) => (p.clickable ? "auto" : "none")};
50
+ flex: 0 0 130px;
51
+ align-items: center;
43
52
  `;
44
53
 
45
54
  const ContentPresence = styled.span`
@@ -48,11 +57,12 @@ const ContentPresence = styled.span`
48
57
  `;
49
58
 
50
59
  const StateCell = styled(Cell)`
51
- width: 170px;
60
+ flex: 0 0 100px;
61
+ align-items: center;
52
62
  `;
53
63
 
54
64
  const ActionsCell = styled(Cell)`
55
- width: 125px;
65
+ flex: 0 0 85px;
56
66
  `;
57
67
 
58
68
  const ModalContent = styled.div`
@@ -70,7 +80,8 @@ const StyledActionMenu = styled(ActionMenu)`
70
80
  margin-left: auto;
71
81
  `;
72
82
 
73
- const ItemRow = styled(Row)`
83
+ const ItemRow = styled(Row)<{ disabled: boolean }>`
84
+ cursor: ${(p) => (p.disabled ? "default" : "pointer")};
74
85
  &:hover {
75
86
  ${StyledActionMenu} {
76
87
  opacity: 1;
@@ -94,6 +105,29 @@ const IconHandleWrapper = styled.div`
94
105
  }
95
106
  `;
96
107
 
108
+ const Tag = styled.div<{ color: string }>`
109
+ ${(p) => p.theme.textStyle.uiXS};
110
+ display: flex;
111
+ background-color: ${(p) => p.color};
112
+ box-sizing: border-box;
113
+ border-radius: ${(p) => p.theme.radii.s};
114
+ color: ${(p) => p.theme.color.textHighEmphasis};
115
+ white-space: nowrap;
116
+ padding: 3px 8px;
117
+ text-transform: capitalize;
118
+ `;
119
+
120
+ const IconTag = styled.div`
121
+ height: ${(p) => p.theme.spacing.s};
122
+ width: ${(p) => p.theme.spacing.s};
123
+ margin-right: ${(p) => p.theme.spacing.xxs};
124
+ svg {
125
+ path {
126
+ fill: ${(p) => p.theme.color.textHighEmphasis};
127
+ }
128
+ }
129
+ `;
130
+
97
131
  export {
98
132
  CheckCell,
99
133
  NameCell,
@@ -108,4 +142,7 @@ export {
108
142
  HandleWrapper,
109
143
  IconHandleWrapper,
110
144
  Order,
145
+ CodeCell,
146
+ Tag,
147
+ IconTag,
111
148
  };
@@ -19,13 +19,14 @@ const useFilterQuery = () => {
19
19
  const initialQueryValues: Record<string, IQueryValue[]> = {
20
20
  filterApplication: [{ value: "all", label: "All" }],
21
21
  filterState: [{ value: "all", label: "All" }],
22
+ filterCode: [{ value: "all", label: "All" }],
22
23
  };
23
24
 
24
25
  const [query, setQuery] = useState(initialQueryValues);
25
26
  const [currentFilterQuery, setCurrentFilterQuery] = useState("");
26
27
 
27
28
  const setFilterQuery = (filterValues: Record<string, IQueryValue[]>) => {
28
- const { filterApplication, filterState } = filterValues;
29
+ const { filterApplication, filterState, filterCode } = filterValues;
29
30
  let filterQuery = "";
30
31
 
31
32
  const currentQuery = (pointer: string, values: IQueryValue[]): string => {
@@ -36,21 +37,23 @@ const useFilterQuery = () => {
36
37
  return !stringValues.length ? filterQuery : filterQuery.concat(`&${pointer}=${stringValues}`);
37
38
  };
38
39
 
39
- const isNotInitialValue = (pointer: "filterApplication" | "filterState") => {
40
+ const isNotInitialValue = (pointer: "filterApplication" | "filterState" | "filterCode") => {
40
41
  return filterValues[pointer] && initialQueryValues[pointer] !== filterValues[pointer];
41
42
  };
42
43
 
43
44
  if (isNotInitialValue("filterApplication")) filterQuery = currentQuery("filterApplication", filterApplication);
44
45
  if (isNotInitialValue("filterState")) filterQuery = currentQuery("filterState", filterState);
46
+ if (isNotInitialValue("filterCode")) filterQuery = currentQuery("filterCode", filterCode);
45
47
 
46
48
  setCurrentFilterQuery(filterQuery);
47
49
  };
48
50
 
49
51
  const setFiltersSelection = (pointer: string, filter: IQueryValue[]) => {
50
- const { filterApplication, filterState } = query;
52
+ const { filterApplication, filterState, filterCode } = query;
51
53
  const filterValues = {
52
54
  filterApplication: pointer === "filterApplication" ? filter : filterApplication,
53
55
  filterState: pointer === "filterState" ? filter : filterState,
56
+ filterCode: pointer === "filterCode" ? filter : filterCode,
54
57
  };
55
58
 
56
59
  setQuery(filterValues);
@@ -60,7 +63,7 @@ const useFilterQuery = () => {
60
63
  const resetFilterQuery = () => {
61
64
  setQuery(initialQueryValues);
62
65
  setCurrentFilterQuery("");
63
- }
66
+ };
64
67
 
65
68
  const isFiltered = Object.keys(query).some((key: any) => query[key as never] !== initialQueryValues[key as never]);
66
69
 
@@ -65,7 +65,11 @@ const Integrations = (props: IIntegrationsProps): JSX.Element => {
65
65
  const fetchState = { isLoading, isFiltered };
66
66
  const { isEmpty, emptyStateProps } = useEmptyState(integrations, fetchState, { noElementsProps });
67
67
 
68
- const integrationsIds = integrations && integrations.map((integration: IIntegration) => integration.id);
68
+ const integrationsIds =
69
+ integrations &&
70
+ integrations
71
+ .filter((integration: IIntegration) => integration.editable)
72
+ .map((integration: IIntegration) => integration.id);
69
73
 
70
74
  const getParams = useCallback(() => {
71
75
  const params = {
@@ -239,6 +243,7 @@ const Integrations = (props: IIntegrationsProps): JSX.Element => {
239
243
  const filterLabels: Record<string, string> = {
240
244
  filterApplication: "Applied on",
241
245
  filterState: "State",
246
+ filterCode: "Code",
242
247
  };
243
248
 
244
249
  return (
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { Link } from "react-router-dom";
2
3
 
3
4
  import { Button } from "@ax/components";
4
5
  import { FieldsBehavior } from "@ax/components";
@@ -7,15 +8,20 @@ import { splitAndTrim, splitAndJoin } from "@ax/helpers";
7
8
 
8
9
  import * as S from "./style";
9
10
 
10
-
11
11
  const Warning = (props: IWarning): JSX.Element => {
12
12
  const { setShowWarning } = props;
13
13
 
14
- const warningText = "Analytics has Global settings. If you need, you can change the Analytics ID for this site. If you have already defined a project for this site in GTM, you don't need to define it here. You cannot edit the Dimensions and Values here, only view them.";
14
+ const warningText = (
15
+ <div>
16
+ Analytics has <Link to="/settings/analytics">Global settings</Link>. If you need, you can change the Analytics ID
17
+ for this site. If you have already defined a project for this site in GTM, you don&apos;t need to define it here.
18
+ You cannot edit the Dimensions and Values here, only view them.
19
+ </div>
20
+ );
15
21
 
16
22
  const handleButtonClick = () => {
17
23
  setShowWarning(false);
18
- }
24
+ };
19
25
 
20
26
  return (
21
27
  <>
@@ -42,8 +48,8 @@ const ScriptCode = (props: IScriptCode): JSX.Element => {
42
48
  placeholder="Type the Google Analytics or Google Tag Manager code."
43
49
  />
44
50
  </S.ScriptCodeWrapper>
45
- )
46
- }
51
+ );
52
+ };
47
53
 
48
54
  const Dimensions = (props: IDimensions): JSX.Element => {
49
55
  const { dimensions } = props;
@@ -51,7 +57,8 @@ const Dimensions = (props: IDimensions): JSX.Element => {
51
57
  const heading = "Data Layer configuration";
52
58
  const description = (
53
59
  <>
54
- You cannot edit the Dimensions and Values here, only view them. To edit them, you have to go to <strong>Global Settings</strong>.
60
+ You cannot edit the Dimensions and Values here, only view them. To edit them, you have to go to{" "}
61
+ <Link to="/settings/analytics">Global Settings</Link>.
55
62
  </>
56
63
  );
57
64
 
@@ -64,25 +71,28 @@ const Dimensions = (props: IDimensions): JSX.Element => {
64
71
  <S.ComponentName>{name}</S.ComponentName>
65
72
  <S.ComponentValues>{hasValues ? getValues() : "The value is defined on page"}</S.ComponentValues>
66
73
  </S.Component>
67
- )
68
- }
69
-
70
- return <>
71
- <S.Heading>{heading}</S.Heading>
72
- <S.Description>{description}</S.Description>
73
- <S.ComponentsWrapper itemsSize={1 / 2}>
74
- {dimensions.map((dimension, idx) => (
75
- <Dimension key={idx} {...dimension} />
76
- ))}
77
- </S.ComponentsWrapper>
78
- </>
79
- }
74
+ );
75
+ };
76
+
77
+ return (
78
+ <>
79
+ <S.Heading>{heading}</S.Heading>
80
+ <S.Description>{description}</S.Description>
81
+ <S.ComponentsWrapper itemsSize={1 / 2}>
82
+ {dimensions.map((dimension, idx) => (
83
+ <Dimension key={idx} {...dimension} />
84
+ ))}
85
+ </S.ComponentsWrapper>
86
+ </>
87
+ );
88
+ };
80
89
 
81
90
  const Groups = (props: IGroups): JSX.Element => {
82
91
  const { groups } = props;
83
92
 
84
93
  const heading = "Dimensions group by content";
85
- const description = "In global, you can create groups with the dimensions to measure on a page based on its content. You can not edit them here. Only view them.";
94
+ const description =
95
+ "In global, you can create groups with the dimensions to measure on a page based on its content. You can not edit them here. Only view them.";
86
96
 
87
97
  const Group = (props: IDimensionsGroup) => {
88
98
  const { name, dimensions, templates } = props;
@@ -98,19 +108,21 @@ const Groups = (props: IGroups): JSX.Element => {
98
108
  </div>
99
109
  <S.ContentType>Content type: {contentTypeText}</S.ContentType>
100
110
  </S.Component>
101
- )
102
- }
103
-
104
- return <>
105
- <S.Heading>{heading}</S.Heading>
106
- <S.Description>{description}</S.Description>
107
- <S.ComponentsWrapper itemsSize={1 / 3}>
108
- {groups.map((group, idx) => (
109
- <Group key={idx} {...group} />
110
- ))}
111
- </S.ComponentsWrapper>
112
- </>
113
- }
111
+ );
112
+ };
113
+
114
+ return (
115
+ <>
116
+ <S.Heading>{heading}</S.Heading>
117
+ <S.Description>{description}</S.Description>
118
+ <S.ComponentsWrapper itemsSize={1 / 3}>
119
+ {groups.map((group, idx) => (
120
+ <Group key={idx} {...group} />
121
+ ))}
122
+ </S.ComponentsWrapper>
123
+ </>
124
+ );
125
+ };
114
126
 
115
127
  interface IWarning {
116
128
  setShowWarning: React.Dispatch<React.SetStateAction<boolean>>;
@@ -7,7 +7,7 @@ const Wrapper = styled.div`
7
7
 
8
8
  const Heading = styled.div`
9
9
  ${(p) => p.theme.textStyle.headingXS};
10
- color: ${p => p.theme.color.textHighEmphasis};
10
+ color: ${(p) => p.theme.color.textHighEmphasis};
11
11
  padding-bottom: ${(p) => p.theme.spacing.xs};
12
12
  `;
13
13
 
@@ -16,14 +16,15 @@ const Description = styled.div`
16
16
  color: ${(p) => p.theme.color.textMediumEmphasis};
17
17
  margin-bottom: ${(p) => p.theme.spacing.s};
18
18
 
19
- strong {
19
+ a {
20
20
  color: ${(p) => p.theme.color.interactive01};
21
+ font-weight: 600;
21
22
  }
22
23
  `;
23
24
 
24
25
  const WarningHeading = styled.div`
25
26
  ${(p) => p.theme.textStyle.headingXXS};
26
- color: ${p => p.theme.color.textMediumEmphasis};
27
+ color: ${(p) => p.theme.color.textMediumEmphasis};
27
28
  padding-bottom: ${(p) => p.theme.spacing.xs};
28
29
  `;
29
30
 
@@ -32,6 +33,10 @@ const WarningText = styled.div`
32
33
  color: ${(p) => p.theme.color.textHighEmphasis};
33
34
  width: calc(${(p) => p.theme.spacing.l} * 12);
34
35
  margin-bottom: ${(p) => p.theme.spacing.m};
36
+ a {
37
+ color: ${(p) => p.theme.color.interactive01};
38
+ font-weight: 600;
39
+ }
35
40
  `;
36
41
 
37
42
  const ContentWrapper = styled.div`
@@ -53,7 +58,7 @@ const ScriptCodeWrapper = styled.div`
53
58
  const ComponentsWrapper = styled.div<{ itemsSize: number }>`
54
59
  display: grid;
55
60
  grid-template-columns: repeat(2, calc(100% * ${(p) => p.itemsSize}));
56
- grid-gap: ${p => p.theme.spacing.xs} ${p => p.theme.spacing.xs};
61
+ grid-gap: ${(p) => p.theme.spacing.xs} ${(p) => p.theme.spacing.xs};
57
62
  border-bottom: 1px solid ${(p) => p.theme.color.uiLine};
58
63
  margin-bottom: ${(p) => p.theme.spacing.m};
59
64
  padding-bottom: ${(p) => p.theme.spacing.m};
@@ -73,26 +78,26 @@ const Component = styled.div`
73
78
 
74
79
  const ComponentName = styled.div`
75
80
  ${(p) => p.theme.textStyle.headingXXS};
76
- color: ${p => p.theme.color.textLowEmphasis};
81
+ color: ${(p) => p.theme.color.textLowEmphasis};
77
82
  text-transform: uppercase;
78
83
  margin-bottom: ${(p) => p.theme.spacing.xxs};
79
84
  word-break: break-all;
80
- `
85
+ `;
81
86
 
82
87
  const ComponentValues = styled.div`
83
88
  ${(p) => p.theme.textStyle.fieldContent};
84
- color: ${p => p.theme.color.textHighEmphasis};
89
+ color: ${(p) => p.theme.color.textHighEmphasis};
85
90
  padding-top: ${(p) => p.theme.spacing.xxs};
86
91
  padding-bottom: ${(p) => p.theme.spacing.xxs};
87
- `
92
+ `;
88
93
 
89
94
  const ContentType = styled.div`
90
95
  ${(p) => p.theme.textStyle.uiS};
91
- color: ${p => p.theme.color.textMediumEmphasis};
96
+ color: ${(p) => p.theme.color.textMediumEmphasis};
92
97
  margin-top: ${(p) => p.theme.spacing.xxs};
93
98
 
94
99
  span {
95
- color: ${p => p.theme.color.interactive01};
100
+ color: ${(p) => p.theme.color.interactive01};
96
101
  }
97
102
  `;
98
103
 
@@ -110,4 +115,4 @@ export {
110
115
  ComponentValues,
111
116
  AnalyticsWrapper,
112
117
  ContentType,
113
- }
118
+ };
@@ -867,6 +867,8 @@ export interface IIntegration {
867
867
  variables: undefined | IIntegrationVariable[];
868
868
  scriptOrder: number;
869
869
  correlativeScriptOrder?: number;
870
+ type: "analytics" | "datalayer" | "addon";
871
+ editable: boolean;
870
872
  }
871
873
 
872
874
  export interface IIntegrationVariable {