@truedat/dd 4.48.13 → 4.49.0
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/CHANGELOG.md +6 -0
- package/package.json +5 -5
- package/src/api/fragments.js +2 -2
- package/src/api/mutations.js +33 -11
- package/src/api/queries.js +37 -10
- package/src/api.js +0 -4
- package/src/components/DictionaryRoutes.js +4 -4
- package/src/components/StructureSummary.js +12 -22
- package/src/components/StructureTag.js +83 -54
- package/src/components/StructureTagForm.js +149 -89
- package/src/components/StructureTags.js +57 -27
- package/src/components/Tag.js +62 -0
- package/src/components/TagCards.js +85 -0
- package/src/components/TagCrumbs.js +25 -0
- package/src/components/TagForm.js +101 -0
- package/src/components/TagStructureButton.js +58 -0
- package/src/components/Tags.js +33 -0
- package/src/components/TagsRoutes.js +39 -0
- package/src/components/__tests__/StructureSummary.spec.js +0 -7
- package/src/components/__tests__/StructureTag.spec.js +79 -5
- package/src/components/__tests__/StructureTagForm.spec.js +99 -50
- package/src/components/__tests__/Tag.spec.js +11 -0
- package/src/components/__tests__/{StructureTagsCards.spec.js → TagCards.spec.js} +10 -10
- package/src/components/__tests__/TagCrumbs.spec.js +10 -0
- package/src/components/__tests__/TagForm.spec.js +72 -0
- package/src/components/__tests__/Tags.spec.js +10 -0
- package/src/components/__tests__/__snapshots__/StructureSummary.spec.js.snap +18 -42
- package/src/components/__tests__/__snapshots__/StructureTag.spec.js.snap +10 -30
- package/src/components/__tests__/__snapshots__/StructureTagForm.spec.js.snap +255 -51
- package/src/components/__tests__/__snapshots__/Tag.spec.js.snap +36 -0
- package/src/components/__tests__/__snapshots__/{StructureTagsCards.spec.js.snap → TagCards.spec.js.snap} +1 -1
- package/src/components/__tests__/__snapshots__/TagCrumbs.spec.js.snap +102 -0
- package/src/components/__tests__/__snapshots__/TagForm.spec.js.snap +70 -0
- package/src/components/__tests__/__snapshots__/{StructureTags.spec.js.snap → Tags.spec.js.snap} +1 -1
- package/src/messages/en.js +25 -30
- package/src/messages/es.js +25 -30
- package/src/reducers/__tests__/{editableStructureTags.spec.js → availableTags.spec.js} +7 -11
- package/src/reducers/__tests__/structureTagSaving.spec.js +36 -0
- package/src/reducers/__tests__/tagSaving.spec.js +32 -0
- package/src/reducers/{editableStructureTags.js → availableTags.js} +2 -2
- package/src/reducers/index.js +6 -12
- package/src/reducers/structureRedirect.js +7 -7
- package/src/reducers/structureTagSaving.js +12 -10
- package/src/reducers/tagSaving.js +18 -0
- package/src/routines.js +5 -6
- package/src/sagas/__tests__/createTag.spec.js +81 -0
- package/src/sagas/__tests__/deleteStructureTag.spec.js +11 -12
- package/src/sagas/__tests__/deleteTag.spec.js +76 -0
- package/src/sagas/__tests__/tagStructure.spec.js +86 -0
- package/src/sagas/__tests__/updateTag.spec.js +81 -0
- package/src/sagas/createTag.js +29 -0
- package/src/sagas/deleteStructureTag.js +12 -9
- package/src/sagas/deleteTag.js +34 -0
- package/src/sagas/index.js +15 -18
- package/src/sagas/tagStructure.js +37 -0
- package/src/sagas/updateTag.js +23 -0
- package/src/components/LinkStructureTagForm.js +0 -163
- package/src/components/LinkedStructureTag.js +0 -124
- package/src/components/StructureLinkTagButton.js +0 -47
- package/src/components/StructureTagsCards.js +0 -92
- package/src/components/StructureTagsCrumbs.js +0 -44
- package/src/components/StructureTagsRoutes.js +0 -45
- package/src/components/TagsHeader.js +0 -32
- package/src/components/__tests__/LinkStructureTagForm.spec.js +0 -184
- package/src/components/__tests__/LinkedStructureTag.spec.js +0 -133
- package/src/components/__tests__/StructureTags.spec.js +0 -14
- package/src/components/__tests__/StructureTagsCrumbs.spec.js +0 -13
- package/src/components/__tests__/__snapshots__/LinkStructureTagForm.spec.js.snap +0 -456
- package/src/components/__tests__/__snapshots__/LinkedStructureTag.spec.js.snap +0 -16
- package/src/components/__tests__/__snapshots__/StructureTagsCrumbs.spec.js.snap +0 -36
- package/src/reducers/__tests__/deletingStructureTags.spec.js +0 -30
- package/src/reducers/__tests__/linkedStructureTags.spec.js +0 -69
- package/src/reducers/__tests__/linkedStructureTagsLoading.spec.js +0 -32
- package/src/reducers/__tests__/linkingStructureTags.spec.js +0 -30
- package/src/reducers/__tests__/structureTagsSaving.spec.js +0 -40
- package/src/reducers/deletingStructureTags.js +0 -16
- package/src/reducers/linkedStructureTags.js +0 -28
- package/src/reducers/linkedStructureTagsLoading.js +0 -16
- package/src/reducers/linkingStructureTags.js +0 -16
- package/src/sagas/__tests__/createStructureTag.spec.js +0 -85
- package/src/sagas/__tests__/deleteLinkStructureTag.spec.js +0 -96
- package/src/sagas/__tests__/fetchLinksStructureTags.spec.js +0 -105
- package/src/sagas/__tests__/linkStructureTag.spec.js +0 -102
- package/src/sagas/__tests__/updateStructureTag.spec.js +0 -84
- package/src/sagas/createStructureTag.js +0 -29
- package/src/sagas/deleteLinkStructureTag.js +0 -29
- package/src/sagas/fetchLinksStructureTags.js +0 -31
- package/src/sagas/linkStructureTag.js +0 -30
- package/src/sagas/updateStructureTag.js +0 -23
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.49.0",
|
|
4
4
|
"description": "Truedat Web Data Dictionary",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@apollo/client": "^3.6.4",
|
|
91
|
-
"@truedat/auth": "4.
|
|
92
|
-
"@truedat/core": "4.
|
|
93
|
-
"@truedat/df": "4.
|
|
91
|
+
"@truedat/auth": "4.49.0",
|
|
92
|
+
"@truedat/core": "4.49.0",
|
|
93
|
+
"@truedat/df": "4.49.0",
|
|
94
94
|
"lodash": "^4.17.21",
|
|
95
95
|
"path-to-regexp": "^1.7.0",
|
|
96
96
|
"prop-types": "^15.8.1",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"react-dom": ">= 16.8.6 < 17",
|
|
113
113
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "7260126df6067fe59b11c5dc2b94dbdd881fed7b"
|
|
116
116
|
}
|
package/src/api/fragments.js
CHANGED
package/src/api/mutations.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { gql } from "@apollo/client";
|
|
2
|
-
import {
|
|
2
|
+
import { TAG_DETAIL } from "./fragments";
|
|
3
3
|
|
|
4
4
|
export const CREATE_REFERENCE_DATASET = gql`
|
|
5
5
|
mutation CreateReferenceDataset($dataset: CreateReferenceDatasetInput!) {
|
|
@@ -28,28 +28,50 @@ export const DELETE_REFERENCE_DATASET = gql`
|
|
|
28
28
|
}
|
|
29
29
|
`;
|
|
30
30
|
|
|
31
|
-
export const
|
|
32
|
-
mutation
|
|
33
|
-
|
|
34
|
-
...
|
|
31
|
+
export const CREATE_TAG = gql`
|
|
32
|
+
mutation CreateTag($tag: TagInput!) {
|
|
33
|
+
createTag(tag: $tag) {
|
|
34
|
+
...TagDetail
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
${
|
|
37
|
+
${TAG_DETAIL}
|
|
38
38
|
`;
|
|
39
39
|
|
|
40
|
-
export const
|
|
41
|
-
mutation
|
|
42
|
-
|
|
43
|
-
...
|
|
40
|
+
export const UPDATE_TAG = gql`
|
|
41
|
+
mutation UpdateTag($tag: TagInput!) {
|
|
42
|
+
updateTag(tag: $tag) {
|
|
43
|
+
...TagDetail
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
${TAG_DETAIL}
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
export const DELETE_TAG = gql`
|
|
50
|
+
mutation DeleteTag($id: ID!) {
|
|
51
|
+
deleteTag(id: $id) {
|
|
52
|
+
id
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
export const TAG_STRUCTURE = gql`
|
|
58
|
+
mutation TagStructure($structureTag: StructureTagInput!) {
|
|
59
|
+
tagStructure(structureTag: $structureTag) {
|
|
60
|
+
id
|
|
61
|
+
dataStructure {
|
|
62
|
+
id
|
|
63
|
+
}
|
|
44
64
|
}
|
|
45
65
|
}
|
|
46
|
-
${STRUCTURE_TAG_DETAIL}
|
|
47
66
|
`;
|
|
48
67
|
|
|
49
68
|
export const DELETE_STRUCTURE_TAG = gql`
|
|
50
69
|
mutation DeleteStructureTag($id: ID!) {
|
|
51
70
|
deleteStructureTag(id: $id) {
|
|
52
71
|
id
|
|
72
|
+
dataStructure {
|
|
73
|
+
id
|
|
74
|
+
}
|
|
53
75
|
}
|
|
54
76
|
}
|
|
55
77
|
`;
|
package/src/api/queries.js
CHANGED
|
@@ -1,22 +1,49 @@
|
|
|
1
1
|
import { gql } from "@apollo/client";
|
|
2
|
-
import {
|
|
2
|
+
import { TAG_DETAIL } from "./fragments";
|
|
3
3
|
|
|
4
|
-
export const
|
|
5
|
-
query
|
|
6
|
-
|
|
7
|
-
...
|
|
4
|
+
export const TAG_QUERY = gql`
|
|
5
|
+
query Tag($id: ID!) {
|
|
6
|
+
tag(id: $id) {
|
|
7
|
+
...TagDetail
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
${
|
|
10
|
+
${TAG_DETAIL}
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export const TAGS_QUERY = gql`
|
|
14
|
+
query Tags {
|
|
15
|
+
tags {
|
|
16
|
+
...TagDetail
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
${TAG_DETAIL}
|
|
11
20
|
`;
|
|
12
21
|
|
|
13
22
|
export const STRUCTURE_TAGS_QUERY = gql`
|
|
14
|
-
query StructureTags {
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
query StructureTags($id: ID!) {
|
|
24
|
+
dataStructure(id: $id) {
|
|
25
|
+
id
|
|
26
|
+
availableTags {
|
|
27
|
+
id
|
|
28
|
+
name
|
|
29
|
+
description
|
|
30
|
+
}
|
|
31
|
+
structureTags {
|
|
32
|
+
id
|
|
33
|
+
comment
|
|
34
|
+
inherit
|
|
35
|
+
inherited
|
|
36
|
+
insertedAt
|
|
37
|
+
dataStructureId
|
|
38
|
+
tagId
|
|
39
|
+
tag {
|
|
40
|
+
id
|
|
41
|
+
name
|
|
42
|
+
description
|
|
43
|
+
}
|
|
44
|
+
}
|
|
17
45
|
}
|
|
18
46
|
}
|
|
19
|
-
${STRUCTURE_TAG_DETAIL}
|
|
20
47
|
`;
|
|
21
48
|
|
|
22
49
|
export const REFERENCE_DATASETS_QUERY = gql`
|
package/src/api.js
CHANGED
|
@@ -33,8 +33,6 @@ const API_STRUCTURE_TYPE = "/api/data_structure_types/:id";
|
|
|
33
33
|
const API_STRUCTURE_TYPES = "/api/data_structure_types";
|
|
34
34
|
const API_STRUCTURES_DOMAINS_UPLOAD =
|
|
35
35
|
"/api/data_structures/bulk_upload_domains";
|
|
36
|
-
const API_STRUCTURES_TAG = "/api/data_structures/:data_structure_id/tags/:id";
|
|
37
|
-
const API_STRUCTURES_TAGS = "/api/data_structures/:data_structure_id/tags";
|
|
38
36
|
const API_USER_SEARCH_FILTERS = "/api/user_search_filters";
|
|
39
37
|
const API_USER_SEARCH_FILTER = "/api/user_search_filters/:id";
|
|
40
38
|
const API_GET_USER_SEARCH_FILTERS = "/api/user_search_filters/me";
|
|
@@ -84,8 +82,6 @@ export {
|
|
|
84
82
|
API_USER_SEARCH_FILTER,
|
|
85
83
|
API_GET_USER_SEARCH_FILTERS,
|
|
86
84
|
API_STRUCTURES_DOMAINS_UPLOAD,
|
|
87
|
-
API_STRUCTURES_TAG,
|
|
88
|
-
API_STRUCTURES_TAGS,
|
|
89
85
|
API_STRUCTURES_UPLOAD,
|
|
90
86
|
API_STRUCTURES_UPLOAD_EVENTS,
|
|
91
87
|
API_STRUCTURE_NOTE,
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
PROFILE_EXECUTION,
|
|
7
7
|
PROFILE_GROUP,
|
|
8
8
|
REFERENCE_DATASETS,
|
|
9
|
-
STRUCTURE_TAGS,
|
|
10
|
-
STRUCTURE_TYPES,
|
|
11
9
|
STRUCTURES,
|
|
12
10
|
STRUCTURES_UPLOAD_EVENTS,
|
|
11
|
+
STRUCTURE_TAGS,
|
|
12
|
+
STRUCTURE_TYPES,
|
|
13
13
|
SYSTEMS,
|
|
14
14
|
} from "@truedat/core/routes";
|
|
15
15
|
import PendingStructureNotes from "./PendingStructureNotes";
|
|
@@ -24,10 +24,10 @@ import StructuresLoader from "./StructuresLoader";
|
|
|
24
24
|
import StructuresRoutes from "./StructuresRoutes";
|
|
25
25
|
import StructuresUploadEvents from "./StructuresUploadEvents";
|
|
26
26
|
import StructureTypesLoader from "./StructureTypesLoader";
|
|
27
|
-
import StructureTagsRoutes from "./StructureTagsRoutes";
|
|
28
27
|
import StructureTypesRoutes from "./StructureTypesRoutes";
|
|
29
28
|
import SystemsRoutes from "./SystemsRoutes";
|
|
30
29
|
import SystemsLoader from "./SystemsLoader";
|
|
30
|
+
import TagsRoutes from "./TagsRoutes";
|
|
31
31
|
|
|
32
32
|
const TemplatesLoader = React.lazy(() =>
|
|
33
33
|
import("@truedat/df/templates/components/TemplatesLoader")
|
|
@@ -74,7 +74,7 @@ export const DictionaryRoutes = () => {
|
|
|
74
74
|
</>
|
|
75
75
|
)}
|
|
76
76
|
/>
|
|
77
|
-
<Route path={STRUCTURE_TAGS} render={() => <
|
|
77
|
+
<Route path={STRUCTURE_TAGS} render={() => <TagsRoutes />} />
|
|
78
78
|
<Route
|
|
79
79
|
path={STRUCTURE_TYPES}
|
|
80
80
|
render={() => (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import {
|
|
4
|
+
import { Header, Icon, Label, Grid } from "semantic-ui-react";
|
|
5
5
|
import Moment from "react-moment";
|
|
6
6
|
import { connect } from "react-redux";
|
|
7
7
|
import { useIntl } from "react-intl";
|
|
@@ -13,7 +13,7 @@ import StructureDeleteButton from "./StructureDeleteButton";
|
|
|
13
13
|
import StructureGrantButton from "./StructureGrantButton";
|
|
14
14
|
import StructureProfileButton from "./StructureProfileButton";
|
|
15
15
|
import StructuresProfileButton from "./StructuresProfileButton";
|
|
16
|
-
import
|
|
16
|
+
import StructureTags from "./StructureTags";
|
|
17
17
|
|
|
18
18
|
const Date = ({ className, icon, label, date }) => {
|
|
19
19
|
const { formatMessage } = useIntl();
|
|
@@ -60,7 +60,6 @@ export const StructureSummary = ({
|
|
|
60
60
|
userPermissions,
|
|
61
61
|
updatedAt,
|
|
62
62
|
deleted_at,
|
|
63
|
-
linkedStructureTagsLoading,
|
|
64
63
|
isAdmin,
|
|
65
64
|
}) => {
|
|
66
65
|
const { formatMessage } = useIntl();
|
|
@@ -72,22 +71,15 @@ export const StructureSummary = ({
|
|
|
72
71
|
<Grid>
|
|
73
72
|
<Grid.Row>
|
|
74
73
|
<Grid.Column width={10}>
|
|
75
|
-
<
|
|
76
|
-
<Header
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
)}
|
|
85
|
-
</Header.Content>
|
|
86
|
-
</Header>
|
|
87
|
-
<Dimmer active={linkedStructureTagsLoading} inverted>
|
|
88
|
-
<Loader />
|
|
89
|
-
</Dimmer>
|
|
90
|
-
</Dimmer.Dimmable>
|
|
74
|
+
<Header as="h2">
|
|
75
|
+
<Header.Content>
|
|
76
|
+
{_.defaultTo(name)(alias)}
|
|
77
|
+
{structureClasses?._grantable ? <StructureGrantButton /> : null}
|
|
78
|
+
{_.isEmpty(alias) ? null : (
|
|
79
|
+
<Header.Subheader>{name}</Header.Subheader>
|
|
80
|
+
)}
|
|
81
|
+
</Header.Content>
|
|
82
|
+
</Header>
|
|
91
83
|
</Grid.Column>
|
|
92
84
|
<Grid.Column width={6} textAlign="right">
|
|
93
85
|
{(deleted_at || updatedAt) && (
|
|
@@ -108,7 +100,7 @@ export const StructureSummary = ({
|
|
|
108
100
|
</Grid.Column>
|
|
109
101
|
</Grid.Row>
|
|
110
102
|
</Grid>
|
|
111
|
-
<
|
|
103
|
+
<StructureTags />
|
|
112
104
|
<StructureProperties />
|
|
113
105
|
</>
|
|
114
106
|
);
|
|
@@ -123,13 +115,11 @@ StructureSummary.propTypes = {
|
|
|
123
115
|
userPermissions: PropTypes.object,
|
|
124
116
|
updatedAt: PropTypes.string,
|
|
125
117
|
deleted_at: PropTypes.string,
|
|
126
|
-
linkedStructureTagsLoading: PropTypes.bool,
|
|
127
118
|
isAdmin: PropTypes.bool,
|
|
128
119
|
};
|
|
129
120
|
|
|
130
121
|
const mapStateToProps = (state) => ({
|
|
131
122
|
userPermissions: state.userPermissions,
|
|
132
|
-
linkedStructureTagsLoading: state.linkedStructureTagsLoading,
|
|
133
123
|
updatedAt: getStructureUpdatedAt(state),
|
|
134
124
|
...state.structure,
|
|
135
125
|
isAdmin: state.authentication.role === "admin",
|
|
@@ -1,70 +1,99 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _ from "lodash/fp";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
2
3
|
import PropTypes from "prop-types";
|
|
3
|
-
import { Header, Icon, Container, Segment } from "semantic-ui-react";
|
|
4
4
|
import { FormattedMessage } from "react-intl";
|
|
5
5
|
import { connect } from "react-redux";
|
|
6
|
-
import {
|
|
7
|
-
import { createStructureTag, updateStructureTag } from "../routines";
|
|
8
|
-
import StructureTagsCrumbs from "./StructureTagsCrumbs";
|
|
6
|
+
import { Icon, Label, Popup, Header } from "semantic-ui-react";
|
|
9
7
|
import StructureTagForm from "./StructureTagForm";
|
|
10
8
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
export const ToolTip = ({ description, comment }) => (
|
|
10
|
+
<>
|
|
11
|
+
{_.isEmpty(description) ? null : <Header as="h2" subheader={description} />}
|
|
12
|
+
{_.isEmpty(comment) ? null : (
|
|
13
|
+
<>
|
|
14
|
+
<Header as="h5">
|
|
15
|
+
<FormattedMessage id="structureTag.comment" />
|
|
16
|
+
</Header>
|
|
17
|
+
<p>{comment}</p>
|
|
18
|
+
</>
|
|
19
|
+
)}
|
|
20
|
+
</>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
ToolTip.propTypes = {
|
|
24
|
+
description: PropTypes.string,
|
|
25
|
+
comment: PropTypes.string,
|
|
14
26
|
};
|
|
15
27
|
|
|
16
|
-
export const StructureTag = ({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
? (data) => updateStructureTag({ ...data, id })
|
|
29
|
-
: createStructureTag;
|
|
28
|
+
export const StructureTag = ({ editable, savingId, structureTag }) => {
|
|
29
|
+
const [formActive, setFormActive] = useState(false);
|
|
30
|
+
const [tooltipActive, setTooltipActive] = useState(false);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
setFormActive(savingId === structureTag.id);
|
|
33
|
+
}, [savingId, structureTag]);
|
|
34
|
+
const name = structureTag.tag.name;
|
|
35
|
+
const description = structureTag.tag.description;
|
|
36
|
+
const comment = structureTag.comment;
|
|
37
|
+
const inherited = structureTag.inherited;
|
|
38
|
+
const trigger = editable ? <Icon link name="edit" /> : null;
|
|
39
|
+
|
|
30
40
|
return (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
<Popup
|
|
42
|
+
basic
|
|
43
|
+
open={tooltipActive}
|
|
44
|
+
onOpen={
|
|
45
|
+
formActive ? null : () => setTooltipActive(!!comment || !!description)
|
|
46
|
+
}
|
|
47
|
+
onClose={() => setTooltipActive(false)}
|
|
48
|
+
positionFixed
|
|
49
|
+
className="popup-tag"
|
|
50
|
+
trigger={
|
|
51
|
+
<Label tag style={{ marginLeft: "1.5em" }}>
|
|
52
|
+
{editable ? (
|
|
53
|
+
<Popup
|
|
54
|
+
on="click"
|
|
55
|
+
basic
|
|
56
|
+
onOpen={() => {
|
|
57
|
+
setTooltipActive(false);
|
|
58
|
+
setFormActive(true);
|
|
59
|
+
}}
|
|
60
|
+
onClose={() => setFormActive(false)}
|
|
61
|
+
open={formActive}
|
|
62
|
+
flowing
|
|
63
|
+
content={
|
|
64
|
+
<StructureTagForm
|
|
65
|
+
structureTag={structureTag}
|
|
66
|
+
saving={!!savingId}
|
|
67
|
+
/>
|
|
68
|
+
}
|
|
69
|
+
position="bottom center"
|
|
70
|
+
size="large"
|
|
71
|
+
positionFixed
|
|
72
|
+
trigger={trigger}
|
|
73
|
+
/>
|
|
74
|
+
) : null}
|
|
75
|
+
{name}
|
|
76
|
+
{inherited ? (
|
|
77
|
+
<Label.Detail>
|
|
78
|
+
<Icon name="linkify" />
|
|
79
|
+
</Label.Detail>
|
|
80
|
+
) : null}
|
|
81
|
+
</Label>
|
|
82
|
+
}
|
|
83
|
+
>
|
|
84
|
+
<ToolTip description={description} comment={comment} />
|
|
85
|
+
</Popup>
|
|
51
86
|
);
|
|
52
87
|
};
|
|
53
88
|
|
|
54
89
|
StructureTag.propTypes = {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
loading: PropTypes.bool,
|
|
59
|
-
saving: PropTypes.bool,
|
|
60
|
-
id: PropTypes.string,
|
|
90
|
+
editable: PropTypes.bool,
|
|
91
|
+
savingId: PropTypes.string,
|
|
92
|
+
structureTag: PropTypes.object.isRequired,
|
|
61
93
|
};
|
|
62
94
|
|
|
63
|
-
const mapStateToProps = ({ structureTagSaving }) => ({
|
|
64
|
-
|
|
95
|
+
export const mapStateToProps = ({ structureTagSaving }) => ({
|
|
96
|
+
savingId: structureTagSaving,
|
|
65
97
|
});
|
|
66
98
|
|
|
67
|
-
export default connect(mapStateToProps
|
|
68
|
-
createStructureTag,
|
|
69
|
-
updateStructureTag,
|
|
70
|
-
})(StructureTag);
|
|
99
|
+
export default connect(mapStateToProps)(StructureTag);
|