@truedat/core 7.2.1 → 7.2.3

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/core",
3
- "version": "7.2.1",
3
+ "version": "7.2.3",
4
4
  "description": "Truedat Web Core",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -36,7 +36,7 @@
36
36
  "@testing-library/react": "^12.0.0",
37
37
  "@testing-library/react-hooks": "^8.0.1",
38
38
  "@testing-library/user-event": "^13.2.1",
39
- "@truedat/test": "7.2.1",
39
+ "@truedat/test": "7.2.3",
40
40
  "babel-jest": "^28.1.0",
41
41
  "babel-plugin-dynamic-import-node": "^2.3.3",
42
42
  "babel-plugin-lodash": "^3.3.4",
@@ -118,5 +118,5 @@
118
118
  "react-dom": ">= 16.8.6 < 17",
119
119
  "semantic-ui-react": ">= 2.0.3 < 2.2"
120
120
  },
121
- "gitHead": "10ba779646ef549e6db1235b3acd6d430526f487"
121
+ "gitHead": "1f8b6f4d6fbd6e278493c35885e540c14f9c551b"
122
122
  }
@@ -27,25 +27,30 @@ export const DropdownMenuItem = ({
27
27
  onClick(e, id);
28
28
  };
29
29
 
30
+ const itemStyle = {
31
+ marginLeft: `${20 * level}px`,
32
+ paddingLeft: !canOpen ? "25px" : "5px",
33
+ };
34
+
30
35
  return (
31
36
  <Dropdown.Item
32
37
  onClick={handleClick}
33
38
  selected={!check && selected}
34
39
  className={className}
35
40
  >
36
- <div style={{ marginLeft: `${8 * level}px` }}>
41
+ <div className="item-content" style={itemStyle}>
37
42
  {canOpen ? (
38
43
  <Icon
39
- name={open ? "chevron circle right" : "chevron circle down"}
44
+ name={open ? "chevron down" : "chevron right"}
40
45
  onClick={handleOpen}
41
46
  />
42
- ) : (
43
- <Icon name="circle" />
44
- )}
47
+ ) : null}
45
48
  {check && (
46
49
  <Icon name={selected ? "check square outline" : "square outline"} />
47
50
  )}
48
- <span style={{ opacity: disabled ? 0.45 : 1 }}>{name}</span>
51
+ <span style={{ opacity: disabled ? 0.45 : 1 }} title={name}>
52
+ {name}
53
+ </span>
49
54
  </div>
50
55
  </Dropdown.Item>
51
56
  );
@@ -25,7 +25,7 @@ export const FiltersLoader = ({
25
25
  }
26
26
  : _.omit([selectedFilter])({ ...defaultFilters, ...filters });
27
27
  fetchFilters({ filters: mergedFilters });
28
- }, [fetchFilters, filters, selectedFilter, defaultFilters]);
28
+ }, [fetchFilters, filters, selectedFilter]);
29
29
  return null;
30
30
  };
31
31
 
@@ -18,7 +18,7 @@ const HierarchyNodeFinder = ({ nodes = [], idSelectedNode }) => {
18
18
  };
19
19
 
20
20
  const handleNodeClick = (e, { value }) => {
21
- if (value) history.push(linkTo.DOMAIN_CONCEPTS({ id: value }));
21
+ if (value) history.push(linkTo.DOMAIN({ id: value }));
22
22
  };
23
23
 
24
24
  return (
@@ -33,9 +33,7 @@ describe("<DropdownMenuItem />", () => {
33
33
  messages: {},
34
34
  });
35
35
 
36
- userEvent.click(
37
- container.querySelector('[class="chevron circle down icon"]')
38
- );
36
+ userEvent.click(container.querySelector('[class="chevron right icon"]'));
39
37
  await waitFor(() => {
40
38
  expect(onOpen).toHaveBeenCalledWith(id);
41
39
  });
@@ -43,7 +41,7 @@ describe("<DropdownMenuItem />", () => {
43
41
 
44
42
  await waitFor(() => {
45
43
  expect(
46
- container.querySelector('[class="chevron circle right icon"]')
44
+ container.querySelector('[class="chevron down icon"]')
47
45
  ).toBeTruthy();
48
46
  });
49
47
  });
@@ -66,21 +66,15 @@ describe("<FilterMultilevelDropdown />", () => {
66
66
 
67
67
  userEvent.click(getByRole("listbox"));
68
68
 
69
- userEvent.click(
70
- container.querySelector('[class="chevron circle down icon"]')
71
- );
69
+ userEvent.click(container.querySelector('[class="chevron right icon"]'));
72
70
  await waitFor(() => {
73
71
  expect(getByRole("option", { name: /Domain 2/i })).toBeTruthy();
74
72
  });
75
- userEvent.click(
76
- container.querySelector('[class="chevron circle right icon"]')
77
- );
73
+ userEvent.click(container.querySelector('[class="chevron down icon"]'));
78
74
  await waitFor(() => {
79
75
  expect(queryByText(/Domain 2/)).toBeFalsy();
80
76
  });
81
- userEvent.click(
82
- container.querySelector('[class="chevron circle down icon"]')
83
- );
77
+ userEvent.click(container.querySelector('[class="chevron right icon"]'));
84
78
  // Select value
85
79
  userEvent.click(getByRole("option", { name: /Domain 2/i }));
86
80
  await waitFor(() => {
@@ -126,9 +120,7 @@ describe("<FilterMultilevelDropdown />", () => {
126
120
  expect(getByRole("option", { name: /Domain 3/i })).toBeTruthy();
127
121
  });
128
122
 
129
- userEvent.click(
130
- container.querySelector('[class="chevron circle down icon"]')
131
- );
123
+ userEvent.click(container.querySelector('[class="chevron right icon"]'));
132
124
 
133
125
  await waitFor(() => {
134
126
  expect(getByRole("option", { name: /Domain 1/i })).toBeTruthy();
@@ -98,21 +98,15 @@ describe("<HierarchyFilterDropdown />", () => {
98
98
 
99
99
  userEvent.click(getByRole("listbox"));
100
100
 
101
- userEvent.click(
102
- container.querySelector('[class="chevron circle down icon"]')
103
- );
101
+ userEvent.click(container.querySelector('[class="chevron right icon"]'));
104
102
  await waitFor(() => {
105
103
  expect(getByRole("option", { name: /bar/i })).toBeTruthy();
106
104
  });
107
- userEvent.click(
108
- container.querySelector('[class="chevron circle right icon"]')
109
- );
105
+ userEvent.click(container.querySelector('[class="chevron down icon"]'));
110
106
  await waitFor(() => {
111
107
  expect(queryByText(/bar/)).toBeFalsy();
112
108
  });
113
- userEvent.click(
114
- container.querySelector('[class="chevron circle down icon"]')
115
- );
109
+ userEvent.click(container.querySelector('[class="chevron right icon"]'));
116
110
  // Select value
117
111
  userEvent.click(getByRole("option", { name: /bar/i }));
118
112
  await waitFor(() => {
@@ -101,7 +101,7 @@ describe("<TreeSelector />", () => {
101
101
 
102
102
  userEvent.click(
103
103
  getByRole("option", { name: /foo/i }).querySelector(
104
- 'i[class="chevron circle down icon"]'
104
+ 'i[class="chevron right icon"]'
105
105
  )
106
106
  );
107
107
 
@@ -111,7 +111,7 @@ describe("<TreeSelector />", () => {
111
111
 
112
112
  userEvent.click(
113
113
  getByRole("option", { name: /bar/i }).querySelector(
114
- 'i[class="chevron circle down icon"]'
114
+ 'i[class="chevron right icon"]'
115
115
  )
116
116
  );
117
117
 
@@ -148,7 +148,7 @@ describe("<TreeSelector />", () => {
148
148
 
149
149
  userEvent.click(
150
150
  getByRole("option", { name: /foo/i }).querySelector(
151
- 'i[class="chevron circle down icon"]'
151
+ 'i[class="chevron right icon"]'
152
152
  )
153
153
  );
154
154
 
@@ -183,7 +183,7 @@ describe("<TreeSelector />", () => {
183
183
 
184
184
  userEvent.click(
185
185
  getByRole("option", { name: /foo/i }).querySelector(
186
- 'i[class="chevron circle down icon"]'
186
+ 'i[class="chevron right icon"]'
187
187
  )
188
188
  );
189
189
 
@@ -193,7 +193,7 @@ describe("<TreeSelector />", () => {
193
193
 
194
194
  userEvent.click(
195
195
  getByRole("option", { name: /bar/i }).querySelector(
196
- 'i[class="chevron circle down icon"]'
196
+ 'i[class="chevron right icon"]'
197
197
  )
198
198
  );
199
199
 
@@ -229,7 +229,7 @@ describe("<TreeSelector />", () => {
229
229
 
230
230
  userEvent.click(
231
231
  getByRole("option", { name: /foo/i }).querySelector(
232
- 'i[class="chevron circle down icon"]'
232
+ 'i[class="chevron right icon"]'
233
233
  )
234
234
  );
235
235
 
@@ -43,14 +43,16 @@ exports[`<DomainSelector /> matches latest snapshot 1`] = `
43
43
  role="option"
44
44
  >
45
45
  <div
46
- style="margin-left: 0px;"
46
+ class="item-content"
47
+ style="margin-left: 0px; padding-left: 5px;"
47
48
  >
48
49
  <i
49
50
  aria-hidden="true"
50
- class="chevron circle down icon"
51
+ class="chevron right icon"
51
52
  />
52
53
  <span
53
54
  style="opacity: 1;"
55
+ title="barDomain"
54
56
  >
55
57
  barDomain
56
58
  </span>
@@ -62,14 +64,12 @@ exports[`<DomainSelector /> matches latest snapshot 1`] = `
62
64
  role="option"
63
65
  >
64
66
  <div
65
- style="margin-left: 0px;"
67
+ class="item-content"
68
+ style="margin-left: 0px; padding-left: 25px;"
66
69
  >
67
- <i
68
- aria-hidden="true"
69
- class="circle icon"
70
- />
71
70
  <span
72
71
  style="opacity: 1;"
72
+ title="bazDomain"
73
73
  >
74
74
  bazDomain
75
75
  </span>
@@ -81,14 +81,12 @@ exports[`<DomainSelector /> matches latest snapshot 1`] = `
81
81
  role="option"
82
82
  >
83
83
  <div
84
- style="margin-left: 0px;"
84
+ class="item-content"
85
+ style="margin-left: 0px; padding-left: 25px;"
85
86
  >
86
- <i
87
- aria-hidden="true"
88
- class="circle icon"
89
- />
90
87
  <span
91
88
  style="opacity: 1;"
89
+ title="fooDomain"
92
90
  >
93
91
  fooDomain
94
92
  </span>
@@ -126,14 +124,16 @@ exports[`<DomainSelector /> matches latest snapshot with notDropdow parameter 1`
126
124
  role="option"
127
125
  >
128
126
  <div
129
- style="margin-left: 0px;"
127
+ class="item-content"
128
+ style="margin-left: 0px; padding-left: 5px;"
130
129
  >
131
130
  <i
132
131
  aria-hidden="true"
133
- class="chevron circle down icon"
132
+ class="chevron right icon"
134
133
  />
135
134
  <span
136
135
  style="opacity: 1;"
136
+ title="barDomain"
137
137
  >
138
138
  barDomain
139
139
  </span>
@@ -145,14 +145,12 @@ exports[`<DomainSelector /> matches latest snapshot with notDropdow parameter 1`
145
145
  role="option"
146
146
  >
147
147
  <div
148
- style="margin-left: 0px;"
148
+ class="item-content"
149
+ style="margin-left: 0px; padding-left: 25px;"
149
150
  >
150
- <i
151
- aria-hidden="true"
152
- class="circle icon"
153
- />
154
151
  <span
155
152
  style="opacity: 1;"
153
+ title="bazDomain"
156
154
  >
157
155
  bazDomain
158
156
  </span>
@@ -164,14 +162,12 @@ exports[`<DomainSelector /> matches latest snapshot with notDropdow parameter 1`
164
162
  role="option"
165
163
  >
166
164
  <div
167
- style="margin-left: 0px;"
165
+ class="item-content"
166
+ style="margin-left: 0px; padding-left: 25px;"
168
167
  >
169
- <i
170
- aria-hidden="true"
171
- class="circle icon"
172
- />
173
168
  <span
174
169
  style="opacity: 1;"
170
+ title="fooDomain"
175
171
  >
176
172
  fooDomain
177
173
  </span>
@@ -7,10 +7,13 @@ exports[`<DropdownMenuItem /> matches the latest snapshot 1`] = `
7
7
  class="item"
8
8
  role="option"
9
9
  >
10
- <div>
10
+ <div
11
+ class="item-content"
12
+ style="padding-left: 5px;"
13
+ >
11
14
  <i
12
15
  aria-hidden="true"
13
- class="chevron circle down icon"
16
+ class="chevron right icon"
14
17
  />
15
18
  <i
16
19
  aria-hidden="true"
@@ -18,6 +21,7 @@ exports[`<DropdownMenuItem /> matches the latest snapshot 1`] = `
18
21
  />
19
22
  <span
20
23
  style="opacity: 1;"
24
+ title="foo"
21
25
  >
22
26
  foo
23
27
  </span>
@@ -41,11 +41,12 @@ exports[`<FilterMultilevelDropdown /> matches the latest snapshot 1`] = `
41
41
  role="option"
42
42
  >
43
43
  <div
44
- style="margin-left: 0px;"
44
+ class="item-content"
45
+ style="margin-left: 0px; padding-left: 5px;"
45
46
  >
46
47
  <i
47
48
  aria-hidden="true"
48
- class="chevron circle down icon"
49
+ class="chevron right icon"
49
50
  />
50
51
  <i
51
52
  aria-hidden="true"
@@ -53,6 +54,7 @@ exports[`<FilterMultilevelDropdown /> matches the latest snapshot 1`] = `
53
54
  />
54
55
  <span
55
56
  style="opacity: 1;"
57
+ title="Domain 1"
56
58
  >
57
59
  Domain 1
58
60
  </span>
@@ -64,18 +66,16 @@ exports[`<FilterMultilevelDropdown /> matches the latest snapshot 1`] = `
64
66
  role="option"
65
67
  >
66
68
  <div
67
- style="margin-left: 0px;"
69
+ class="item-content"
70
+ style="margin-left: 0px; padding-left: 25px;"
68
71
  >
69
- <i
70
- aria-hidden="true"
71
- class="circle icon"
72
- />
73
72
  <i
74
73
  aria-hidden="true"
75
74
  class="square outline icon"
76
75
  />
77
76
  <span
78
77
  style="opacity: 1;"
78
+ title="Domain 3"
79
79
  >
80
80
  Domain 3
81
81
  </span>
@@ -41,11 +41,12 @@ exports[`<HierarchyFilterDropdown /> matches the latest snapshot 1`] = `
41
41
  role="option"
42
42
  >
43
43
  <div
44
- style="margin-left: 0px;"
44
+ class="item-content"
45
+ style="margin-left: 0px; padding-left: 5px;"
45
46
  >
46
47
  <i
47
48
  aria-hidden="true"
48
- class="chevron circle down icon"
49
+ class="chevron right icon"
49
50
  />
50
51
  <i
51
52
  aria-hidden="true"
@@ -53,6 +54,7 @@ exports[`<HierarchyFilterDropdown /> matches the latest snapshot 1`] = `
53
54
  />
54
55
  <span
55
56
  style="opacity: 1;"
57
+ title="foo"
56
58
  >
57
59
  foo
58
60
  </span>
@@ -47,14 +47,12 @@ exports[`HierarchyNodeFinder matches the latest snapshot 1`] = `
47
47
  role="option"
48
48
  >
49
49
  <div
50
- style="margin-left: 0px;"
50
+ class="item-content"
51
+ style="margin-left: 0px; padding-left: 25px;"
51
52
  >
52
- <i
53
- aria-hidden="true"
54
- class="circle icon"
55
- />
56
53
  <span
57
54
  style="opacity: 1;"
55
+ title="element_1"
58
56
  >
59
57
  element_1
60
58
  </span>
@@ -66,14 +64,16 @@ exports[`HierarchyNodeFinder matches the latest snapshot 1`] = `
66
64
  role="option"
67
65
  >
68
66
  <div
69
- style="margin-left: 0px;"
67
+ class="item-content"
68
+ style="margin-left: 0px; padding-left: 5px;"
70
69
  >
71
70
  <i
72
71
  aria-hidden="true"
73
- class="chevron circle down icon"
72
+ class="chevron right icon"
74
73
  />
75
74
  <span
76
75
  style="opacity: 1;"
76
+ title="element_2"
77
77
  >
78
78
  element_2
79
79
  </span>
@@ -85,14 +85,16 @@ exports[`HierarchyNodeFinder matches the latest snapshot 1`] = `
85
85
  role="option"
86
86
  >
87
87
  <div
88
- style="margin-left: 0px;"
88
+ class="item-content"
89
+ style="margin-left: 0px; padding-left: 5px;"
89
90
  >
90
91
  <i
91
92
  aria-hidden="true"
92
- class="chevron circle right icon"
93
+ class="chevron down icon"
93
94
  />
94
95
  <span
95
96
  style="opacity: 1;"
97
+ title="element_5"
96
98
  >
97
99
  element_5
98
100
  </span>
@@ -104,14 +106,16 @@ exports[`HierarchyNodeFinder matches the latest snapshot 1`] = `
104
106
  role="option"
105
107
  >
106
108
  <div
107
- style="margin-left: 8px;"
109
+ class="item-content"
110
+ style="margin-left: 20px; padding-left: 5px;"
108
111
  >
109
112
  <i
110
113
  aria-hidden="true"
111
- class="chevron circle right icon"
114
+ class="chevron down icon"
112
115
  />
113
116
  <span
114
117
  style="opacity: 1;"
118
+ title="element_6"
115
119
  >
116
120
  element_6
117
121
  </span>
@@ -123,14 +127,12 @@ exports[`HierarchyNodeFinder matches the latest snapshot 1`] = `
123
127
  role="option"
124
128
  >
125
129
  <div
126
- style="margin-left: 16px;"
130
+ class="item-content"
131
+ style="margin-left: 40px; padding-left: 25px;"
127
132
  >
128
- <i
129
- aria-hidden="true"
130
- class="circle icon"
131
- />
132
133
  <span
133
134
  style="opacity: 1;"
135
+ title="element_7"
134
136
  >
135
137
  element_7
136
138
  </span>
@@ -43,14 +43,16 @@ exports[`<HierarchySelector /> matches latest snapshot 1`] = `
43
43
  role="option"
44
44
  >
45
45
  <div
46
- style="margin-left: 0px;"
46
+ class="item-content"
47
+ style="margin-left: 0px; padding-left: 5px;"
47
48
  >
48
49
  <i
49
50
  aria-hidden="true"
50
- class="chevron circle down icon"
51
+ class="chevron right icon"
51
52
  />
52
53
  <span
53
54
  style="opacity: 1;"
55
+ title="foo"
54
56
  >
55
57
  foo
56
58
  </span>
@@ -43,14 +43,16 @@ exports[`<TreeSelector /> matches latest snapshot 1`] = `
43
43
  role="option"
44
44
  >
45
45
  <div
46
- style="margin-left: 0px;"
46
+ class="item-content"
47
+ style="margin-left: 0px; padding-left: 5px;"
47
48
  >
48
49
  <i
49
50
  aria-hidden="true"
50
- class="chevron circle down icon"
51
+ class="chevron right icon"
51
52
  />
52
53
  <span
53
54
  style="opacity: 1;"
55
+ title="foo"
54
56
  >
55
57
  foo
56
58
  </span>
@@ -88,14 +90,16 @@ exports[`<TreeSelector /> matches latest snapshot with notDropdown parameter 1`]
88
90
  role="option"
89
91
  >
90
92
  <div
91
- style="margin-left: 0px;"
93
+ class="item-content"
94
+ style="margin-left: 0px; padding-left: 5px;"
92
95
  >
93
96
  <i
94
97
  aria-hidden="true"
95
- class="chevron circle down icon"
98
+ class="chevron right icon"
96
99
  />
97
100
  <span
98
101
  style="opacity: 1;"
102
+ title="foo"
99
103
  >
100
104
  foo
101
105
  </span>
@@ -8,7 +8,9 @@ const toApiLocalesPath = compile(API_LOCALES);
8
8
 
9
9
  export const useLocales = (includeMessages = true) => {
10
10
  const url = toApiLocalesPath() + "?includeMessages=" + includeMessages;
11
- const { data, error, mutate, isValidating } = useSWR(url, apiJson);
11
+ const { data, error, mutate, isValidating } = useSWR(url, apiJson, {
12
+ revalidateOnFocus: false,
13
+ });
12
14
 
13
15
  const locales = data?.data?.data;
14
16
  return { locales, error, loading: !error && !data, mutate, isValidating };
package/src/routes.js CHANGED
@@ -67,6 +67,7 @@ export const DOMAIN_MEMBERS = "/domains/:id/members";
67
67
  export const DOMAIN_MEMBERS_NEW = "/domains/:id/members/new";
68
68
  export const DOMAIN_NEW = "/domains/:id/new";
69
69
  export const DOMAIN_STRUCTURES = "/domains/:id/structures";
70
+ export const DOMAIN_SUBDOMAINS = "/domains/:id/subdomains";
70
71
  export const ELASTICINDEXES = "/search/elasticIndexes";
71
72
  export const EXECUTION_GROUP = "/executionGroups/:id";
72
73
  export const EXECUTION_GROUPS = "/executionGroups";
@@ -322,6 +323,7 @@ const routes = {
322
323
  DOMAIN_MEMBERS_NEW,
323
324
  DOMAIN_NEW,
324
325
  DOMAIN_STRUCTURES,
326
+ DOMAIN_SUBDOMAINS,
325
327
  ELASTICINDEXES,
326
328
  EXECUTION_GROUP,
327
329
  EXECUTION_GROUPS,