@truedat/bg 8.4.8 → 8.4.9
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/bg",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.9",
|
|
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.4.
|
|
57
|
+
"@truedat/test": "8.4.9",
|
|
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": "
|
|
90
|
+
"gitHead": "9fd4bd2126a33342009194c8ae1829cd3c617a48"
|
|
91
91
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import { Fragment } from "react";
|
|
2
|
+
import { Fragment, useState } 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 } from "semantic-ui-react";
|
|
7
|
-
import { Link, useParams } from "react-router";
|
|
6
|
+
import { Button, Form, Popup } from "semantic-ui-react";
|
|
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
10
|
|
|
@@ -19,6 +19,36 @@ export const ConceptLinksActions = ({
|
|
|
19
19
|
}) => {
|
|
20
20
|
const { formatMessage } = useIntl();
|
|
21
21
|
const params = useParams();
|
|
22
|
+
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
|
+
);
|
|
22
52
|
|
|
23
53
|
return createLinkUrl ? (
|
|
24
54
|
<div style={{ float: "right" }}>
|
|
@@ -36,12 +66,21 @@ export const ConceptLinksActions = ({
|
|
|
36
66
|
</Fragment>
|
|
37
67
|
) : null}
|
|
38
68
|
{canSuggestLinks && (
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
+
/>
|
|
83
|
+
}
|
|
45
84
|
/>
|
|
46
85
|
)}
|
|
47
86
|
<Button
|