@truedat/bg 8.5.6 → 8.5.8

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.
Files changed (33) hide show
  1. package/package.json +3 -3
  2. package/src/concepts/components/ConceptConfidentialButton.js +10 -16
  3. package/src/concepts/components/ConceptCreate.js +18 -15
  4. package/src/concepts/components/ConceptEdit.js +13 -15
  5. package/src/concepts/components/ConceptForm.js +13 -30
  6. package/src/concepts/components/ConceptSubscription.js +4 -0
  7. package/src/concepts/components/SharedToDomainsPopup.js +4 -0
  8. package/src/concepts/components/__tests__/ConceptCrumbs.spec.js +11 -1
  9. package/src/concepts/components/__tests__/ConceptForm.spec.js +1 -0
  10. package/src/concepts/components/__tests__/__snapshots__/Concept.spec.js.snap +6 -0
  11. package/src/concepts/components/__tests__/__snapshots__/ConceptConfidentialButton.spec.js.snap +10 -10
  12. package/src/concepts/components/__tests__/__snapshots__/ConceptCrumbs.spec.js.snap +1 -1
  13. package/src/concepts/components/__tests__/__snapshots__/ConceptEdit.spec.js.snap +1 -1
  14. package/src/concepts/components/__tests__/__snapshots__/ConceptForm.spec.js.snap +8 -129
  15. package/src/concepts/components/__tests__/__snapshots__/ConceptHeader.spec.js.snap +15 -10
  16. package/src/concepts/components/__tests__/__snapshots__/ConceptManageDomain.spec.js.snap +4 -2
  17. package/src/concepts/components/__tests__/__snapshots__/ConceptSubscription.spec.js.snap +2 -0
  18. package/src/concepts/components/__tests__/__snapshots__/ConceptsBulkUpdate.spec.js.snap +5 -3
  19. package/src/concepts/components/__tests__/__snapshots__/SharedToDomainsPopup.spec.js.snap +2 -0
  20. package/src/concepts/relations/components/ConceptLinksActions.js +11 -48
  21. package/src/concepts/relations/components/ConceptLinkstRequestGrantButton.js +1 -1
  22. package/src/concepts/relations/components/__tests__/ConceptLinksActions.spec.js +26 -0
  23. package/src/concepts/relations/components/__tests__/__snapshots__/ConceptLinksActions.spec.js.snap +12 -5
  24. package/src/concepts/relations/components/__tests__/__snapshots__/ConceptLinkstRequestGrantButton.spec.js.snap +1 -1
  25. package/src/concepts/relations/components/__tests__/__snapshots__/ConceptRelationForm.spec.js.snap +1 -1
  26. package/src/concepts/relations/styles/ConceptLinksActions.less +14 -0
  27. package/src/taxonomy/components/__tests__/__snapshots__/AddDomainMember.spec.js.snap +1 -1
  28. package/src/taxonomy/components/__tests__/__snapshots__/DomainActions.spec.js.snap +5 -1
  29. package/src/taxonomy/components/__tests__/__snapshots__/DomainDetail.spec.js.snap +5 -1
  30. package/src/taxonomy/components/__tests__/__snapshots__/DomainForm.spec.js.snap +1 -1
  31. package/src/taxonomy/components/__tests__/__snapshots__/DomainStructures.spec.js.snap +2 -2
  32. package/src/taxonomy/components/__tests__/__snapshots__/EditDomain.spec.js.snap +1 -1
  33. package/src/taxonomy/components/__tests__/__snapshots__/NewDomain.spec.js.snap +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/bg",
3
- "version": "8.5.6",
3
+ "version": "8.5.8",
4
4
  "description": "Truedat Web Business Glossary",
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -54,7 +54,7 @@
54
54
  "@testing-library/jest-dom": "^6.6.3",
55
55
  "@testing-library/react": "^16.3.0",
56
56
  "@testing-library/user-event": "^14.6.1",
57
- "@truedat/test": "8.5.6",
57
+ "@truedat/test": "8.5.8",
58
58
  "identity-obj-proxy": "^3.0.0",
59
59
  "jest": "^29.7.0",
60
60
  "redux-saga-test-plan": "^4.0.6"
@@ -87,5 +87,5 @@
87
87
  "semantic-ui-react": "^3.0.0-beta.2",
88
88
  "swr": "^2.3.3"
89
89
  },
90
- "gitHead": "41e5e6138f5622558bae4151e720c040c4581162"
90
+ "gitHead": "61ad9443b3d822d30dcfa977f5fad3494b3ed5b4"
91
91
  }
@@ -1,7 +1,7 @@
1
1
  import _ from "lodash/fp";
2
2
  import PropTypes from "prop-types";
3
3
  import { connect } from "react-redux";
4
- import { Button, Popup, Icon } from "semantic-ui-react";
4
+ import { Button, Icon } from "semantic-ui-react";
5
5
  import { useIntl } from "react-intl";
6
6
  import { setConfidentialConcept } from "../routines";
7
7
 
@@ -25,20 +25,14 @@ export const ConceptConfidentialButton = ({
25
25
  };
26
26
 
27
27
  return (
28
- <Popup
29
- content={buttonText}
30
- position="top center"
31
- trigger={
32
- <span>
33
- <Button
34
- icon={<Icon name={buttonIcon} className={className} />}
35
- basic
36
- className="structureButton"
37
- onClick={handleSubmit}
38
- loading={conceptUpdating}
39
- />
40
- </span>
41
- }
28
+ <Button
29
+ icon={<Icon name={buttonIcon} className={className} />}
30
+ basic
31
+ className="structureButton"
32
+ onClick={handleSubmit}
33
+ loading={conceptUpdating}
34
+ data-tooltip={buttonText}
35
+ data-position="top center"
42
36
  />
43
37
  );
44
38
  };
@@ -54,5 +48,5 @@ export const mapStateToProps = ({ conceptUpdating }) => ({
54
48
  });
55
49
 
56
50
  export default connect(mapStateToProps, { setConfidentialConcept })(
57
- ConceptConfidentialButton
51
+ ConceptConfidentialButton,
58
52
  );
@@ -1,5 +1,6 @@
1
1
  import _ from "lodash/fp";
2
2
  import { useState, useEffect } from "react";
3
+ import { Segment } from "semantic-ui-react";
3
4
  import PropTypes from "prop-types";
4
5
  import { connect } from "react-redux";
5
6
  import { useLanguage } from "@truedat/core/i18n";
@@ -25,9 +26,9 @@ const ConceptCreate = ({ conceptActionLoading, conceptAction }) => {
25
26
  ...langContent,
26
27
  content: langContent.is_default
27
28
  ? { ...langContent.content }
28
- : { ..._.remove(_.isEmpty)(templateFields.translatable) },
29
+ : { ..._.omitBy(_.isEmpty)(templateFields.translatable) },
29
30
  })),
30
- _.keyBy("lang")
31
+ _.keyBy("lang"),
31
32
  )(i18nConcept);
32
33
 
33
34
  if (!_.isEqual(i18nConcept, updateI18nConcept)) {
@@ -42,7 +43,7 @@ const ConceptCreate = ({ conceptActionLoading, conceptAction }) => {
42
43
  _.map(({ id, lang, is_default, is_required }) => {
43
44
  return { id, lang, is_default, is_required, name: "", content: {} };
44
45
  }),
45
- _.keyBy("lang")
46
+ _.keyBy("lang"),
46
47
  )(locales);
47
48
  setI18nConcept(i18nConceptInit);
48
49
  }
@@ -64,7 +65,7 @@ const ConceptCreate = ({ conceptActionLoading, conceptAction }) => {
64
65
  _.mapValues((langConcept) => ({
65
66
  name: langConcept.name,
66
67
  content: _.pick(translatableKeys, langConcept.content),
67
- }))
68
+ })),
68
69
  )(i18nConcept);
69
70
 
70
71
  const business_concept_version = {
@@ -83,17 +84,19 @@ const ConceptCreate = ({ conceptActionLoading, conceptAction }) => {
83
84
  };
84
85
 
85
86
  return (
86
- <ConceptForm
87
- actionKey={actionKey}
88
- domainId={domainId}
89
- template={template}
90
- i18nConcept={i18nConcept}
91
- loading={conceptActionLoading}
92
- setI18nConcept={setI18nConcept}
93
- setDomainId={setDomainId}
94
- setTemplate={setTemplate}
95
- onSubmit={handleSubmit}
96
- />
87
+ <Segment>
88
+ <ConceptForm
89
+ actionKey={actionKey}
90
+ domainId={domainId}
91
+ template={template}
92
+ i18nConcept={i18nConcept}
93
+ loading={conceptActionLoading}
94
+ setI18nConcept={setI18nConcept}
95
+ setDomainId={setDomainId}
96
+ setTemplate={setTemplate}
97
+ onSubmit={handleSubmit}
98
+ />
99
+ </Segment>
97
100
  );
98
101
  };
99
102
 
@@ -39,7 +39,7 @@ export const ConceptEdit = ({
39
39
  _.mapValues((langConcept) => ({
40
40
  name: langConcept.name,
41
41
  content: _.pick(translatableKeys, langConcept.content),
42
- }))
42
+ })),
43
43
  )(i18nConcept);
44
44
 
45
45
  const newContent = processedContent(defaultContent.content, domain?.id);
@@ -60,18 +60,16 @@ export const ConceptEdit = ({
60
60
  };
61
61
 
62
62
  return (
63
- <>
64
- <ConceptForm
65
- actionKey={actionKey}
66
- domainId={domain?.id}
67
- template={template}
68
- i18nConcept={i18nConcept}
69
- loading={templateLoading || localesLoading}
70
- setI18nConcept={setI18nConcept}
71
- onSubmit={handleSubmit}
72
- setTemplate={() => null} // In ConceptEdit, the template is already selected and cannot be changed
73
- />
74
- </>
63
+ <ConceptForm
64
+ actionKey={actionKey}
65
+ domainId={domain?.id}
66
+ template={template}
67
+ i18nConcept={i18nConcept}
68
+ loading={templateLoading || localesLoading}
69
+ setI18nConcept={setI18nConcept}
70
+ onSubmit={handleSubmit}
71
+ setTemplate={() => null} // In ConceptEdit, the template is already selected and cannot be changed
72
+ />
75
73
  );
76
74
  };
77
75
 
@@ -122,7 +120,7 @@ export const ConceptEditLoader = (props) => {
122
120
  content: langContent,
123
121
  };
124
122
  }),
125
- _.keyBy("lang")
123
+ _.keyBy("lang"),
126
124
  )(locales);
127
125
 
128
126
  return (
@@ -151,5 +149,5 @@ const mapStateToProps = ({ concept, conceptActionLoading, conceptActions }) => {
151
149
  };
152
150
 
153
151
  export default compose(connect(mapStateToProps, { conceptAction }))(
154
- ConceptEditLoader
152
+ ConceptEditLoader,
155
153
  );
@@ -210,6 +210,7 @@ const ConceptForm = ({
210
210
  defaultLang,
211
211
  i18nConcept[defaultLang]?.name,
212
212
  handleI18nNameChange,
213
+ true,
213
214
  )}
214
215
  </Grid.Column>
215
216
  <Grid.Column>
@@ -257,24 +258,7 @@ const ConceptForm = ({
257
258
  const isInvalid = !validDomain() || !validNames() || !validTemplate();
258
259
 
259
260
  const renderDomainSelector = () =>
260
- actionKey === "create" &&
261
- (isMultilingual ? (
262
- <Grid.Row columns={2}>
263
- <Grid.Column>
264
- <DomainSelector
265
- action="createBusinessConcept"
266
- label={formatMessage({ id: "domain.selector.label" })}
267
- labels
268
- required
269
- disabled={!(i18nConcept[defaultLang]?.is_default ?? true)}
270
- onChange={handleDomainChange}
271
- onLoad={handleDomainsLoaded}
272
- value={domainId}
273
- />
274
- </Grid.Column>
275
- <Grid.Column />
276
- </Grid.Row>
277
- ) : (
261
+ actionKey === "create" ? (
278
262
  <DomainSelector
279
263
  action="createBusinessConcept"
280
264
  label={formatMessage({ id: "domain.selector.label" })}
@@ -285,7 +269,7 @@ const ConceptForm = ({
285
269
  onLoad={handleDomainsLoaded}
286
270
  value={domainId}
287
271
  />
288
- ));
272
+ ) : null;
289
273
 
290
274
  const isThereAnyTranslatableField =
291
275
  _.flow(
@@ -298,14 +282,10 @@ const ConceptForm = ({
298
282
 
299
283
  const commonForm = (
300
284
  <>
301
- {isMultilingual ? (
302
- <Grid>{renderDomainSelector()}</Grid>
303
- ) : (
304
- renderDomainSelector()
305
- )}
306
285
  <SelectDynamicFormWithTranslations
307
286
  scope="bg"
308
287
  domainIds={domainId ? [domainId] : null}
288
+ beforeSelector={renderDomainSelector()}
309
289
  required
310
290
  header={renderFormHeader()}
311
291
  i18nContent={_.mapValues("content", i18nConcept)}
@@ -314,6 +294,7 @@ const ConceptForm = ({
314
294
  onChangeContent={handleI18nConceptContentChange}
315
295
  onChangeTemplate={handleTemplateChange}
316
296
  selectedTemplate={template}
297
+ showTemplateSectionTitle={actionKey === "create"}
317
298
  />
318
299
  <div className="concept-forms-actions actions">
319
300
  <HistoryBackButton content={formatMessage({ id: "actions.cancel" })} />
@@ -364,20 +345,22 @@ const ConceptForm = ({
364
345
  />
365
346
  );
366
347
 
348
+ const renderForm = () => (
349
+ <Form loading={Boolean(loading) || Boolean(domainsLoading)}>
350
+ {commonForm}
351
+ </Form>
352
+ );
353
+
367
354
  return isMultilingual ? (
368
355
  <>
369
356
  {renderHeader()}
370
- <Form loading={Boolean(loading) || Boolean(domainsLoading)}>
371
- {commonForm}
372
- </Form>
357
+ {renderForm()}
373
358
  {canTranslate ? renderTranslationModal : null}
374
359
  </>
375
360
  ) : (
376
361
  <Container as={Segment} text>
377
362
  {renderHeader()}
378
- <Form loading={Boolean(loading) || Boolean(domainsLoading)}>
379
- {commonForm}
380
- </Form>
363
+ {renderForm()}
381
364
  </Container>
382
365
  );
383
366
  };
@@ -3,6 +3,7 @@ import { lazy, useState, useEffect, Suspense } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { connect } from "react-redux";
5
5
  import { Button, Popup } from "semantic-ui-react";
6
+ import { useIntl } from "react-intl";
6
7
  import {
7
8
  createSubscription,
8
9
  deleteSubscription,
@@ -21,6 +22,7 @@ export const ConceptSubscription = ({
21
22
  updateSubscription,
22
23
  deleteSubscription,
23
24
  }) => {
25
+ const { formatMessage } = useIntl();
24
26
  const [subscriptionField, setSubscription] = useState(searchSubscription);
25
27
  const [isOpen, setIsOpen] = useState(false);
26
28
 
@@ -95,6 +97,8 @@ export const ConceptSubscription = ({
95
97
  basic
96
98
  icon={{ name: "eye", className }}
97
99
  className="button icon group-actions structureButton"
100
+ data-tooltip={formatMessage({ id: "concept.subscription.tooltip" })}
101
+ data-position="top center"
98
102
  />
99
103
  }
100
104
  >
@@ -2,9 +2,11 @@ import { useEffect, useState } from "react";
2
2
  import { connect } from "react-redux";
3
3
  import { Button, Icon, Popup } from "semantic-ui-react";
4
4
  import PropTypes from "prop-types";
5
+ import { useIntl } from "react-intl";
5
6
  import SharedToForm from "./SharedToForm";
6
7
 
7
8
  export const SharedToDomainsPopup = ({ saving }) => {
9
+ const { formatMessage } = useIntl();
8
10
  const [open, setOpen] = useState(false);
9
11
  useEffect(() => {
10
12
  if (saving === false) {
@@ -29,6 +31,8 @@ export const SharedToDomainsPopup = ({ saving }) => {
29
31
  basic
30
32
  className="structureButton"
31
33
  icon={<Icon name="sitemap" />}
34
+ data-tooltip={formatMessage({ id: "shared_to_domains.tooltip" })}
35
+ data-position="top center"
32
36
  />
33
37
  }
34
38
  />
@@ -142,7 +142,17 @@ describe("<ConceptCrumbs />", () => {
142
142
  },
143
143
  };
144
144
  const props = {
145
- conceptAction: "concepts.actions.new",
145
+ baseCrumbs: [
146
+ {
147
+ id: "concepts.crumbs.top",
148
+ path: "/concepts",
149
+ },
150
+ {
151
+ id: "concepts.crumbs.pending",
152
+ path: "/concepts/pending",
153
+ },
154
+ ],
155
+ conceptAction: "concepts.actions.create",
146
156
  };
147
157
  const { container } = render(<ConceptCrumbs {...props} />, renderOpts);
148
158
  expect(container).toMatchSnapshot();
@@ -65,6 +65,7 @@ const props = {
65
65
  onChangeTemplate: jest.fn(),
66
66
  onChangeConceptContent: jest.fn(),
67
67
  setAltLang: jest.fn(),
68
+ setTemplate: jest.fn(),
68
69
  };
69
70
 
70
71
  const templateVariables = { scope: "bg", domainIds: [1] };
@@ -77,6 +77,7 @@ exports[`<Concept /> matches the latest snapshot 1`] = `
77
77
  >
78
78
  <button
79
79
  class="ui basic icon button button icon group-actions"
80
+ data-position="top center"
80
81
  data-tooltip="Sharing"
81
82
  >
82
83
  <i
@@ -86,6 +87,8 @@ exports[`<Concept /> matches the latest snapshot 1`] = `
86
87
  </button>
87
88
  <button
88
89
  class="ui basic icon button button icon group-actions structureButton"
90
+ data-position="top center"
91
+ data-tooltip="concept.subscription.tooltip"
89
92
  >
90
93
  <i
91
94
  aria-hidden="true"
@@ -460,6 +463,7 @@ exports[`<Concept /> matches the latest snapshot with grantView activated 1`] =
460
463
  >
461
464
  <button
462
465
  class="ui basic icon button button icon group-actions"
466
+ data-position="top center"
463
467
  data-tooltip="Sharing"
464
468
  >
465
469
  <i
@@ -469,6 +473,8 @@ exports[`<Concept /> matches the latest snapshot with grantView activated 1`] =
469
473
  </button>
470
474
  <button
471
475
  class="ui basic icon button button icon group-actions structureButton"
476
+ data-position="top center"
477
+ data-tooltip="concept.subscription.tooltip"
472
478
  >
473
479
  <i
474
480
  aria-hidden="true"
@@ -2,15 +2,15 @@
2
2
 
3
3
  exports[`<ConceptConfidentialButton /> matches the latest snapshot 1`] = `
4
4
  <div>
5
- <span>
6
- <button
7
- class="ui basic icon button structureButton"
8
- >
9
- <i
10
- aria-hidden="true"
11
- class="lock open icon"
12
- />
13
- </button>
14
- </span>
5
+ <button
6
+ class="ui basic icon button structureButton"
7
+ data-position="top center"
8
+ data-tooltip="concept.mark_as_confidential"
9
+ >
10
+ <i
11
+ aria-hidden="true"
12
+ class="lock open icon"
13
+ />
14
+ </button>
15
15
  </div>
16
16
  `;
@@ -142,7 +142,7 @@ exports[`<ConceptCrumbs /> matches the latest snapshot for new concept 1`] = `
142
142
  class="active section"
143
143
  style="cursor: default;"
144
144
  >
145
- concepts.actions.new
145
+ concepts.actions.create
146
146
  </span>
147
147
  </div>
148
148
  </div>
@@ -149,7 +149,7 @@ exports[`<ConceptEdit /> matches the latest snapshot 1`] = `
149
149
  class="concept-forms-actions actions"
150
150
  >
151
151
  <a
152
- class="ui secondary button"
152
+ class="ui secondary button td-icon-text-control"
153
153
  data-discover="true"
154
154
  href="/"
155
155
  role="button"
@@ -19,10 +19,10 @@ exports[`<ConceptForm /> with multiple templates matches the latest snapshot 1`]
19
19
  class="ui form"
20
20
  >
21
21
  <div
22
- class="ui grid"
22
+ class="ui stackable grid"
23
23
  >
24
24
  <div
25
- class="two column row"
25
+ class="bottom aligned two column row"
26
26
  >
27
27
  <div
28
28
  class="column"
@@ -43,13 +43,9 @@ exports[`<ConceptForm /> with multiple templates matches the latest snapshot 1`]
43
43
  tabindex="0"
44
44
  >
45
45
  <div
46
- class="ui label"
46
+ class="text"
47
47
  >
48
48
  fooDomain
49
- <i
50
- aria-hidden="true"
51
- class="delete icon"
52
- />
53
49
  </div>
54
50
  <i
55
51
  aria-hidden="true"
@@ -132,28 +128,18 @@ exports[`<ConceptForm /> with multiple templates matches the latest snapshot 1`]
132
128
  </div>
133
129
  </div>
134
130
  </div>
135
- <div
136
- class="column"
137
- />
138
- </div>
139
- </div>
140
- <div
141
- class="ui grid"
142
- style="display: block;"
143
- >
144
- <div
145
- class="two column row"
146
- >
147
131
  <div
148
132
  class="column"
149
133
  >
150
134
  <div
151
135
  class="required field"
152
136
  >
153
- <label>
137
+ <label
138
+ class="template-selector-label template-selector-label-lifted"
139
+ >
154
140
  template.selector.label
155
141
  <div
156
- class="ui left pointing label"
142
+ class="ui left pointing label template-selector-required-label"
157
143
  >
158
144
  template.form.validation.empty_required
159
145
  </div>
@@ -223,120 +209,13 @@ exports[`<ConceptForm /> with multiple templates matches the latest snapshot 1`]
223
209
  </div>
224
210
  </div>
225
211
  </div>
226
- <div
227
- class="column"
228
- />
229
- </div>
230
- </div>
231
- <div
232
- class="ui grid"
233
- style="background: white;"
234
- >
235
- <div
236
- class="two column row"
237
- >
238
- <div
239
- class="column"
240
- >
241
- <div
242
- attached="top"
243
- >
244
- <div
245
- class="ui attached tabular menu"
246
- >
247
- <a
248
- class="active item"
249
- >
250
- en
251
- </a>
252
- </div>
253
- </div>
254
- </div>
255
- <div
256
- class="column"
257
- >
258
- <div
259
- attached="top"
260
- class="attached-tab"
261
- >
262
- <div
263
- class="ui attached tabular menu"
264
- >
265
- <a
266
- class="item"
267
- >
268
- es
269
- </a>
270
- </div>
271
- </div>
272
- </div>
273
- </div>
274
- </div>
275
- <div
276
- class="ui bottom attached segment attached-segment"
277
- >
278
- <div
279
- class="ui grid translation-tabs-grid"
280
- >
281
- <div
282
- class="two column row"
283
- >
284
- <div
285
- class="column"
286
- >
287
- <div
288
- class="required field"
289
- >
290
- <label>
291
- concepts.props.name
292
- </label>
293
- <div
294
- class="field"
295
- >
296
- <div
297
- class="ui input"
298
- >
299
- <input
300
- name="name"
301
- type="text"
302
- value=""
303
- />
304
- </div>
305
- </div>
306
- </div>
307
- </div>
308
- <div
309
- class="column"
310
- >
311
- <div
312
- class="field"
313
- >
314
- <label>
315
- concepts.props.name
316
- </label>
317
- <div
318
- class="field"
319
- >
320
- <div
321
- class="ui input"
322
- >
323
- <input
324
- name="name"
325
- type="text"
326
- value=""
327
- />
328
- </div>
329
- </div>
330
- </div>
331
- </div>
332
- </div>
333
212
  </div>
334
213
  </div>
335
214
  <div
336
215
  class="concept-forms-actions actions"
337
216
  >
338
217
  <a
339
- class="ui secondary button"
218
+ class="ui secondary button td-icon-text-control"
340
219
  data-discover="true"
341
220
  href="/"
342
221
  role="button"
@@ -35,6 +35,7 @@ exports[`<ConceptHeader /> matches the latest snapshot 1`] = `
35
35
  >
36
36
  <button
37
37
  class="ui basic icon button button icon group-actions"
38
+ data-position="top center"
38
39
  data-tooltip="Sharing"
39
40
  >
40
41
  <i
@@ -44,6 +45,8 @@ exports[`<ConceptHeader /> matches the latest snapshot 1`] = `
44
45
  </button>
45
46
  <button
46
47
  class="ui basic icon button structureButton"
48
+ data-position="top center"
49
+ data-tooltip="shared_to_domains.tooltip"
47
50
  >
48
51
  <i
49
52
  aria-hidden="true"
@@ -52,22 +55,24 @@ exports[`<ConceptHeader /> matches the latest snapshot 1`] = `
52
55
  </button>
53
56
  <button
54
57
  class="ui basic icon button button icon group-actions structureButton"
58
+ data-position="top center"
59
+ data-tooltip="concept.subscription.tooltip"
55
60
  >
56
61
  <i
57
62
  aria-hidden="true"
58
63
  class="eye icon"
59
64
  />
60
65
  </button>
61
- <span>
62
- <button
63
- class="ui basic icon button structureButton"
64
- >
65
- <i
66
- aria-hidden="true"
67
- class="lock open icon"
68
- />
69
- </button>
70
- </span>
66
+ <button
67
+ class="ui basic icon button structureButton"
68
+ data-position="top center"
69
+ data-tooltip="concept.mark_as_confidential"
70
+ >
71
+ <i
72
+ aria-hidden="true"
73
+ class="lock open icon"
74
+ />
75
+ </button>
71
76
  </div>
72
77
  </div>
73
78
  <div
@@ -26,9 +26,11 @@ exports[`<ConceptManageDomain /> matches the latest snapshot 1`] = `
26
26
  role="listbox"
27
27
  tabindex="0"
28
28
  >
29
- <label>
29
+ <div
30
+ class="default text"
31
+ >
30
32
  domain.selector.placeholder
31
- </label>
33
+ </div>
32
34
  <i
33
35
  aria-hidden="true"
34
36
  class="dropdown icon"
@@ -4,6 +4,8 @@ exports[`<ConceptSubscription /> matches the latest snapshot 1`] = `
4
4
  <div>
5
5
  <button
6
6
  class="ui basic icon button button icon group-actions structureButton"
7
+ data-position="top center"
8
+ data-tooltip="concept.subscription.tooltip"
7
9
  >
8
10
  <i
9
11
  aria-hidden="true"
@@ -51,9 +51,11 @@ exports[`<ConceptsBulkUpdate /> matches the latest snapshot 1`] = `
51
51
  role="listbox"
52
52
  tabindex="0"
53
53
  >
54
- <label>
54
+ <div
55
+ class="default text"
56
+ >
55
57
  domain.selector.placeholder
56
- </label>
58
+ </div>
57
59
  <i
58
60
  aria-hidden="true"
59
61
  class="dropdown icon"
@@ -142,7 +144,7 @@ exports[`<ConceptsBulkUpdate /> matches the latest snapshot 1`] = `
142
144
  actions.save
143
145
  </button>
144
146
  <a
145
- class="ui secondary button"
147
+ class="ui secondary button td-icon-text-control"
146
148
  data-discover="true"
147
149
  href="/"
148
150
  role="button"
@@ -4,6 +4,8 @@ exports[`<SharedToDomainsPopup /> matches the latest snapshot 1`] = `
4
4
  <div>
5
5
  <button
6
6
  class="ui basic icon button structureButton"
7
+ data-position="top center"
8
+ data-tooltip="shared_to_domains.tooltip"
7
9
  >
8
10
  <i
9
11
  aria-hidden="true"
@@ -1,12 +1,13 @@
1
1
  import _ from "lodash/fp";
2
- import { Fragment, useState } from "react";
2
+ import { Fragment } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { useIntl } from "react-intl";
5
5
  import { connect } from "react-redux";
6
- import { Button, Form, Popup } from "semantic-ui-react";
6
+ import { Button } from "semantic-ui-react";
7
7
  import { Link, useParams, useNavigate } from "react-router";
8
8
  import { linkTo } from "@truedat/core/routes";
9
9
  import { Checkbox } from "semantic-ui-react";
10
+ import SuggestLinkButton from "@truedat/ai/components/SuggestLinkButton";
10
11
 
11
12
  import ConceptLinkstRequestGrantButton from "./ConceptLinkstRequestGrantButton";
12
13
 
@@ -20,66 +21,27 @@ export const ConceptLinksActions = ({
20
21
  const { formatMessage } = useIntl();
21
22
  const params = useParams();
22
23
  const navigate = useNavigate();
23
- const [suggestOpen, setSuggestOpen] = useState(false);
24
- const [prompt, setPrompt] = useState("");
25
-
26
- const handleSuggestSubmit = () => {
27
- setSuggestOpen(false);
28
- navigate(linkTo.CONCEPT_LINKS_STRUCTURES_SUGGEST(params), {
29
- state: { prompt },
30
- });
31
- };
32
-
33
- const suggestPopupContent = (
34
- <Form style={{ minWidth: "300px" }}>
35
- <Form.Field>
36
- <label>{formatMessage({ id: "links.suggest.prompt.label" })}</label>
37
- <Form.Input
38
- value={prompt}
39
- onChange={(_, { value }) => setPrompt(value)}
40
- placeholder={formatMessage({
41
- id: "links.suggest.prompt.placeholder",
42
- })}
43
- />
44
- </Form.Field>
45
- <Button
46
- primary
47
- content={formatMessage({ id: "links.suggest.submit" })}
48
- onClick={handleSuggestSubmit}
49
- />
50
- </Form>
51
- );
52
24
 
53
25
  return createLinkUrl ? (
54
- <div style={{ float: "right" }}>
26
+ <div className="concept-links-actions">
55
27
  {canManageGrantRequests ? (
56
28
  <Fragment>
57
29
  <Checkbox
58
30
  id="execute_checkbox"
59
- className="bgOrange"
31
+ className="bgOrange concept-links-actions-checkbox"
60
32
  toggle
61
33
  checked={grantView}
62
34
  onChange={() => onGrantViewChange(!grantView)}
63
- style={{ top: "6px", marginRight: "7.5px" }}
64
35
  />
65
36
  <ConceptLinkstRequestGrantButton disabled={!grantView} />
66
37
  </Fragment>
67
38
  ) : null}
68
39
  {canSuggestLinks && (
69
- <Popup
70
- on="click"
71
- open={suggestOpen}
72
- onOpen={() => setSuggestOpen(true)}
73
- onClose={() => setSuggestOpen(false)}
74
- content={suggestPopupContent}
75
- position="bottom center"
76
- trigger={
77
- <Button
78
- secondary
79
- active={suggestOpen}
80
- icon="lightbulb outline"
81
- content={formatMessage({ id: "links.actions.suggest" })}
82
- />
40
+ <SuggestLinkButton
41
+ onSubmit={(prompt) =>
42
+ navigate(linkTo.CONCEPT_LINKS_STRUCTURES_SUGGEST(params), {
43
+ state: { prompt },
44
+ })
83
45
  }
84
46
  />
85
47
  )}
@@ -87,6 +49,7 @@ export const ConceptLinksActions = ({
87
49
  primary
88
50
  as={Link}
89
51
  to={createLinkUrl}
52
+ icon="linkify"
90
53
  content={formatMessage({ id: "links.actions.create" })}
91
54
  />
92
55
  </div>
@@ -34,7 +34,7 @@ export const ConceptLinkstRequestGrantButton = ({
34
34
  return (
35
35
  <Button
36
36
  secondary
37
- icon="shield"
37
+ icon="key"
38
38
  title={formatMessage({ id: "links.actions.grant_request.tooltip" })}
39
39
  disabled={disabled}
40
40
  content={formatMessage({ id: "links.actions.grant_request" })}
@@ -2,6 +2,10 @@ import { useSearchContext } from "@truedat/core/search/SearchContext";
2
2
  import { render, waitForLoad } from "@truedat/test/render";
3
3
  import ConceptLinksActions from "../ConceptLinksActions";
4
4
 
5
+ jest.mock("@truedat/ai/components/SuggestLinkButton", () =>
6
+ jest.fn(() => <div>MockSuggestLinkButton</div>)
7
+ );
8
+
5
9
  jest.mock("@truedat/core/search/SearchContext", () => {
6
10
  const originalModule = jest.requireActual(
7
11
  "@truedat/core/search/SearchContext"
@@ -61,4 +65,26 @@ describe("<ConceptLinksActions />", () => {
61
65
  await waitForLoad(rendered);
62
66
  expect(rendered.container).toMatchSnapshot();
63
67
  });
68
+
69
+ it("renders SuggestLinkButton when suggest_structure_link action is present", async () => {
70
+ useSearchContext.mockReturnValue({ searchData: { data: [] } });
71
+
72
+ const suggestRenderOpts = {
73
+ ...renderOpts,
74
+ state: {
75
+ ...renderOpts.state,
76
+ conceptActions: {
77
+ create_structure_link: true,
78
+ suggest_structure_link: true,
79
+ },
80
+ },
81
+ };
82
+
83
+ const rendered = render(
84
+ <ConceptLinksActions onGrantViewChange={jest.fn()} />,
85
+ suggestRenderOpts
86
+ );
87
+ await waitForLoad(rendered);
88
+ expect(rendered.getByText("MockSuggestLinkButton")).toBeInTheDocument();
89
+ });
64
90
  });
@@ -3,11 +3,10 @@
3
3
  exports[`<ConceptLinksActions /> matches the latest snapshot with Grant Requests permission 1`] = `
4
4
  <div>
5
5
  <div
6
- style="float: right;"
6
+ class="concept-links-actions"
7
7
  >
8
8
  <div
9
- class="ui fitted toggle checkbox bgOrange"
10
- style="top: 6px; margin-right: 7.5px;"
9
+ class="ui fitted toggle checkbox bgOrange concept-links-actions-checkbox"
11
10
  >
12
11
  <input
13
12
  class="hidden"
@@ -28,7 +27,7 @@ exports[`<ConceptLinksActions /> matches the latest snapshot with Grant Requests
28
27
  >
29
28
  <i
30
29
  aria-hidden="true"
31
- class="shield icon"
30
+ class="key icon"
32
31
  />
33
32
  links.actions.grant_request
34
33
  </button>
@@ -38,6 +37,10 @@ exports[`<ConceptLinksActions /> matches the latest snapshot with Grant Requests
38
37
  href="/concepts/11/versions/1/links/structures/new"
39
38
  role="button"
40
39
  >
40
+ <i
41
+ aria-hidden="true"
42
+ class="linkify icon"
43
+ />
41
44
  links.actions.create
42
45
  </a>
43
46
  </div>
@@ -47,7 +50,7 @@ exports[`<ConceptLinksActions /> matches the latest snapshot with Grant Requests
47
50
  exports[`<ConceptLinksActions /> matches the latest snapshot without Grant Requests permission 1`] = `
48
51
  <div>
49
52
  <div
50
- style="float: right;"
53
+ class="concept-links-actions"
51
54
  >
52
55
  <a
53
56
  class="ui primary button"
@@ -55,6 +58,10 @@ exports[`<ConceptLinksActions /> matches the latest snapshot without Grant Reque
55
58
  href="/concepts/11/versions/1/links/structures/new"
56
59
  role="button"
57
60
  >
61
+ <i
62
+ aria-hidden="true"
63
+ class="linkify icon"
64
+ />
58
65
  links.actions.create
59
66
  </a>
60
67
  </div>
@@ -8,7 +8,7 @@ exports[`<ConceptLinkstRequestGrantButton /> matches the latest snapshot 1`] = `
8
8
  >
9
9
  <i
10
10
  aria-hidden="true"
11
- class="shield icon"
11
+ class="key icon"
12
12
  />
13
13
  links.actions.grant_request
14
14
  </button>
@@ -271,7 +271,7 @@ exports[`<ConceptRelationForm /> matches the latest snapshot 1`] = `
271
271
  actions.create
272
272
  </button>
273
273
  <a
274
- class="ui secondary button"
274
+ class="ui secondary button td-icon-text-control"
275
275
  data-discover="true"
276
276
  href="/"
277
277
  role="button"
@@ -0,0 +1,14 @@
1
+ .concept-links-actions {
2
+ display: flex;
3
+ flex-direction: row;
4
+ justify-content: flex-end;
5
+ align-items: center;
6
+ }
7
+
8
+ .concept-links-actions-checkbox {
9
+ margin-right: 7.5px;
10
+ }
11
+
12
+ .concept-links-suggest-form {
13
+ min-width: 300px;
14
+ }
@@ -147,7 +147,7 @@ exports[`<AddDomainMember /> matches the latest snapshot 1`] = `
147
147
  domain.actions.add_member
148
148
  </button>
149
149
  <a
150
- class="ui secondary button"
150
+ class="ui secondary button td-icon-text-control"
151
151
  data-discover="true"
152
152
  href="/"
153
153
  role="button"
@@ -29,13 +29,17 @@ exports[`<DomainActions /> matches the latest snapshot 1`] = `
29
29
  aria-hidden="true"
30
30
  class="ellipsis vertical icon"
31
31
  />
32
+ <i
33
+ aria-hidden="true"
34
+ class="dropdown icon"
35
+ />
32
36
  <div
33
37
  class="left menu transition"
34
38
  >
35
39
  <a
36
40
  aria-checked="false"
37
41
  aria-selected="true"
38
- class="selected item"
42
+ class="selected item td-icon-text-control"
39
43
  data-discover="true"
40
44
  href="/domains/3/new"
41
45
  id="3"
@@ -61,13 +61,17 @@ exports[`<DomainDetail /> matches the latest snapshot 1`] = `
61
61
  aria-hidden="true"
62
62
  class="ellipsis vertical icon"
63
63
  />
64
+ <i
65
+ aria-hidden="true"
66
+ class="dropdown icon"
67
+ />
64
68
  <div
65
69
  class="left menu transition"
66
70
  >
67
71
  <a
68
72
  aria-checked="false"
69
73
  aria-selected="true"
70
- class="selected item"
74
+ class="selected item td-icon-text-control"
71
75
  data-discover="true"
72
76
  href="/domains/7/edit"
73
77
  id="7"
@@ -170,7 +170,7 @@ exports[`<DomainForm /> matches the latest snapshot 1`] = `
170
170
  actions.save
171
171
  </button>
172
172
  <a
173
- class="ui secondary button"
173
+ class="ui secondary button td-icon-text-control"
174
174
  data-discover="true"
175
175
  href="/"
176
176
  role="button"
@@ -22,7 +22,7 @@ exports[`<DomainStructures /> matches the latest snapshot 1`] = `
22
22
  />
23
23
  <div
24
24
  aria-disabled="true"
25
- class="disabled item"
25
+ class="disabled item td-icon-text-control"
26
26
  role="option"
27
27
  >
28
28
  <i
@@ -40,7 +40,7 @@ exports[`<DomainStructures /> matches the latest snapshot 1`] = `
40
40
  </div>
41
41
  <div
42
42
  aria-disabled="true"
43
- class="disabled item"
43
+ class="disabled item td-icon-text-control"
44
44
  role="option"
45
45
  >
46
46
  <i
@@ -186,7 +186,7 @@ exports[`<EditDomain /> matches the latest snapshot 1`] = `
186
186
  actions.save
187
187
  </button>
188
188
  <a
189
- class="ui secondary button"
189
+ class="ui secondary button td-icon-text-control"
190
190
  data-discover="true"
191
191
  href="/"
192
192
  role="button"
@@ -204,7 +204,7 @@ exports[`<NewDomain /> matches the latest snapshot main domain 1`] = `
204
204
  actions.save
205
205
  </button>
206
206
  <a
207
- class="ui secondary button"
207
+ class="ui secondary button td-icon-text-control"
208
208
  data-discover="true"
209
209
  href="/"
210
210
  role="button"
@@ -401,7 +401,7 @@ exports[`<NewDomain /> matches the latest snapshot subdomain 1`] = `
401
401
  actions.save
402
402
  </button>
403
403
  <a
404
- class="ui secondary button"
404
+ class="ui secondary button td-icon-text-control"
405
405
  data-discover="true"
406
406
  href="/"
407
407
  role="button"