@eeacms/volto-clms-theme 1.0.44 → 1.0.48
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 +104 -0
- package/Jenkinsfile +32 -24
- package/package.json +5 -1
- package/src/actions/geonetwork/import_geonetwork.js +21 -0
- package/src/actions/index.js +14 -0
- package/src/actions/userschema/userschema.js +17 -0
- package/src/components/Blocks/CclTextLinkCarouselBlock/CclTextLinkCarouselEdit.jsx +38 -0
- package/src/components/Blocks/CclTextLinkCarouselBlock/CclTextLinkCarouselView.jsx +41 -0
- package/src/components/Blocks/CclTextLinkCarouselBlock/TextLinkCarouselSchema.js +18 -0
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclCarouselView.jsx +32 -11
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclProductTabsView.jsx +1 -1
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/CclVerticalTabsView.jsx +21 -7
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/TabsWidget.jsx +78 -15
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/custom.less +60 -1
- package/src/components/Blocks/CustomTemplates/VoltoTabsBlock/subTabSchema.js +19 -0
- package/src/components/Blocks/customBlocks.js +19 -0
- package/src/components/CLMSDatasetDetailView/BoundingBoxComponent.jsx +20 -0
- package/src/components/CLMSDatasetDetailView/CLMSDatasetDetailView.jsx +169 -15
- package/src/components/CLMSDatasetDetailView/ContactComponent.jsx +44 -0
- package/src/components/CLMSDatasetDetailView/DataSetInfoContent.jsx +14 -6
- package/src/components/CLMSDatasetDetailView/DistributionInfoComponent.jsx +20 -0
- package/src/components/CLMSDatasetDetailView/MetadataContent.jsx +182 -72
- package/src/components/CLMSDownloadCartView/CLMSDownloadCartView.jsx +5 -1
- package/src/components/CLMSEventView/CLMSEventView.jsx +15 -13
- package/src/components/CLMSNewsItemView/CLMSNewsItemView.jsx +13 -11
- package/src/components/CLMSProfileView/CLMSApiTokensView.jsx +55 -33
- package/src/components/CLMSProfileView/CLMSProfileView.jsx +28 -15
- package/src/components/CLMSProfileView/CLMSUserProfileView.jsx +37 -64
- package/src/components/CclCard/CclCard.jsx +8 -5
- package/src/components/CclCard/cards.less +1 -1
- package/src/components/CclInfoDescription/CclInfoDescription.jsx +9 -8
- package/src/components/CclLoginModal/CclLoginModal.jsx +1 -7
- package/src/components/CclLoginModal/ccl-login-modal.css +0 -4
- package/src/components/CclModal/CclModal.jsx +6 -1
- package/src/components/CclTab/CclTab.jsx +8 -11
- package/src/components/CclTab/CclTabs.jsx +23 -8
- package/src/components/Widgets/ContactWidget.jsx +91 -0
- package/src/components/Widgets/DistributionInfoWidget.jsx +40 -0
- package/src/components/Widgets/GeonetworkIdentifiersWidget.jsx +48 -0
- package/src/components/Widgets/TextLinkWidget.jsx +41 -0
- package/src/constants/ActionTypes.js +1 -0
- package/src/customizations/volto/components/theme/Header/Header.jsx +30 -21
- package/src/index.js +8 -3
- package/src/reducers/geonetwork/import_geonetwork_reducer.js +45 -0
- package/src/reducers/index.js +7 -3
- package/src/reducers/tokens/tokens.js +14 -10
- package/src/reducers/userschema/userschema.js +48 -0
- package/theme/clms/css/block-form.less +62 -0
- package/theme/clms/css/carousel.css +64 -11
- package/theme/clms/css/home.css +18 -4
- package/theme/clms/css/maps.css +4 -0
- package/theme/clms/css/maps.less +4 -0
- package/theme/clms/css/menu.css +4 -0
- package/theme/clms/css/styles.less +15 -3
|
@@ -1,104 +1,214 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { CclInfoContainer, CclInfoDescription } from '../CclInfoDescription';
|
|
2
|
+
|
|
3
|
+
import BoundingBoxComponent from './BoundingBoxComponent';
|
|
3
4
|
import CclButton from '@eeacms/volto-clms-theme/components/CclButton/CclButton';
|
|
5
|
+
import ContactComponent from './ContactComponent';
|
|
6
|
+
import DistributionInfoComponent from './DistributionInfoComponent';
|
|
7
|
+
import { Label } from 'semantic-ui-react';
|
|
8
|
+
import React from 'react';
|
|
4
9
|
import { StringToHTML } from '@eeacms/volto-clms-theme/components/CclUtils';
|
|
5
10
|
|
|
6
11
|
const MetadataContent = (data) => {
|
|
7
12
|
return (
|
|
8
13
|
<>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
{data?.geonetwork_identifiers?.items.map((item, key) => {
|
|
15
|
+
return (
|
|
16
|
+
<CclButton
|
|
17
|
+
key={key}
|
|
18
|
+
className="ccl-button ccl-button--default download-dataset-metadata"
|
|
19
|
+
url={
|
|
20
|
+
item.type === 'EEA'
|
|
21
|
+
? 'https://sdi.eea.europa.eu/catalogue/srv/eng/catalog.search#/metadata/' +
|
|
22
|
+
item.id
|
|
23
|
+
: 'https://land.copernicus.vgt.vito.be/geonetwork/srv/eng/catalog.search#/metadata/' +
|
|
24
|
+
item.id
|
|
25
|
+
}
|
|
26
|
+
download={true}
|
|
27
|
+
>
|
|
28
|
+
Download metadata: {item.title}
|
|
29
|
+
</CclButton>
|
|
30
|
+
);
|
|
31
|
+
})}
|
|
32
|
+
|
|
16
33
|
<CclInfoContainer>
|
|
17
34
|
<h2>Data identification</h2>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
{data?.dataResourceTitle && (
|
|
36
|
+
<CclInfoDescription
|
|
37
|
+
title="Resource title"
|
|
38
|
+
tooltip="Name by which the cited resource is known"
|
|
39
|
+
description={data?.dataResourceTitle}
|
|
40
|
+
/>
|
|
41
|
+
)}
|
|
42
|
+
{data?.resourceEffective && (
|
|
43
|
+
<CclInfoDescription
|
|
44
|
+
title="Date of publication"
|
|
45
|
+
tooltip=""
|
|
46
|
+
description={new Date(data?.resourceEffective).toLocaleDateString()}
|
|
47
|
+
/>
|
|
48
|
+
)}
|
|
49
|
+
{data?.resourceModified && (
|
|
50
|
+
<CclInfoDescription
|
|
51
|
+
title="Revision date"
|
|
52
|
+
tooltip=""
|
|
53
|
+
description={new Date(data?.resourceModified).toLocaleDateString()}
|
|
54
|
+
/>
|
|
55
|
+
)}
|
|
23
56
|
<CclInfoDescription
|
|
24
57
|
title="Resource abstract"
|
|
25
58
|
tooltip="Brief narrative summary of the content of the resource(s) with coverage, main attributes, data sources, important of the work, etc."
|
|
26
59
|
description={
|
|
27
|
-
<StringToHTML string={data
|
|
60
|
+
<StringToHTML string={data?.dataResourceAbstract?.data || ''} />
|
|
28
61
|
}
|
|
29
62
|
/>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
63
|
+
{data?.keywords && data?.keywords?.length > 0 && (
|
|
64
|
+
<CclInfoDescription
|
|
65
|
+
title="Keywords"
|
|
66
|
+
tooltip=""
|
|
67
|
+
description={data?.keywords.map((keyword) => {
|
|
68
|
+
return <Label color="olive">{keyword}</Label>;
|
|
69
|
+
})}
|
|
70
|
+
/>
|
|
71
|
+
)}
|
|
72
|
+
{data?.geographicCoverage && (
|
|
73
|
+
<CclInfoDescription
|
|
74
|
+
title="Geographic coverage"
|
|
75
|
+
tooltip=""
|
|
76
|
+
description={JSON.stringify(data?.geographicCoverage)}
|
|
77
|
+
/>
|
|
78
|
+
)}
|
|
79
|
+
{data?.accessAndUseLimitationPublic_line && (
|
|
80
|
+
<CclInfoDescription
|
|
81
|
+
title="Limitation of public access"
|
|
82
|
+
tooltip=""
|
|
83
|
+
description={data?.accessAndUseLimitationPublic_line}
|
|
84
|
+
/>
|
|
85
|
+
)}
|
|
36
86
|
<CclInfoDescription
|
|
37
|
-
title="
|
|
38
|
-
tooltip="
|
|
39
|
-
description={data.coordinateReferenceSystem}
|
|
40
|
-
/>
|
|
41
|
-
</CclInfoContainer>
|
|
42
|
-
<CclInfoContainer>
|
|
43
|
-
<h2>Temporal reference</h2>
|
|
44
|
-
</CclInfoContainer>
|
|
45
|
-
<CclInfoContainer>
|
|
46
|
-
<h2>Quality and validity</h2>
|
|
47
|
-
<CclInfoDescription
|
|
48
|
-
title="Lineage"
|
|
49
|
-
tooltip="General explanation of the data produce knowledge's about the lineage of a dataset"
|
|
50
|
-
description={<StringToHTML string={data.qualityLineage?.data} />}
|
|
51
|
-
/>
|
|
52
|
-
<CclInfoDescription
|
|
53
|
-
title="Spatial resolution"
|
|
54
|
-
tooltip="A set of zero to many resolution distances (typically for gridded data and imagery-derived products) or equivalent scales (typically for maps or map-derived products)"
|
|
87
|
+
title="Conditions applying to access and use"
|
|
88
|
+
tooltip=""
|
|
55
89
|
description={
|
|
56
|
-
<StringToHTML string={data
|
|
90
|
+
<StringToHTML string={data?.accessAndUseConstraints?.data || ''} />
|
|
57
91
|
}
|
|
58
92
|
/>
|
|
59
|
-
</CclInfoContainer>
|
|
60
|
-
<CclInfoContainer>
|
|
61
|
-
<h2>Conformity</h2>
|
|
62
93
|
<CclInfoDescription
|
|
63
|
-
title="
|
|
64
|
-
tooltip="
|
|
65
|
-
description={
|
|
66
|
-
<StringToHTML string={data.conformitySpecification?.data} />
|
|
67
|
-
}
|
|
94
|
+
title="Spatial Resolution"
|
|
95
|
+
tooltip=""
|
|
96
|
+
description={data?.qualitySpatialResolution_line}
|
|
68
97
|
/>
|
|
98
|
+
{data?.classificationTopicCategory && (
|
|
99
|
+
<CclInfoDescription
|
|
100
|
+
title="Topic of Category"
|
|
101
|
+
tooltip=""
|
|
102
|
+
description={
|
|
103
|
+
data?.classificationTopicCategory &&
|
|
104
|
+
data?.classificationTopicCategory.map((topic) => {
|
|
105
|
+
return <Label color="olive">{topic.title}</Label>;
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
/>
|
|
109
|
+
)}
|
|
110
|
+
{data?.geographicBoundingBox?.items?.length > 0 && (
|
|
111
|
+
<CclInfoDescription
|
|
112
|
+
title="Bounding Boxes"
|
|
113
|
+
tooltip=""
|
|
114
|
+
description={data?.geographicBoundingBox?.items.map((bbox, key) => {
|
|
115
|
+
return <BoundingBoxComponent key={key} bbox={bbox} />;
|
|
116
|
+
})}
|
|
117
|
+
/>
|
|
118
|
+
)}
|
|
119
|
+
{data?.temporalCoverage && (
|
|
120
|
+
<CclInfoDescription
|
|
121
|
+
title="Temporal Extent"
|
|
122
|
+
tooltip=""
|
|
123
|
+
description={
|
|
124
|
+
data?.temporalCoverage &&
|
|
125
|
+
data?.temporalCoverage.map((year) => {
|
|
126
|
+
return <Label color="olive">{year}</Label>;
|
|
127
|
+
})
|
|
128
|
+
}
|
|
129
|
+
/>
|
|
130
|
+
)}
|
|
69
131
|
</CclInfoContainer>
|
|
132
|
+
{data?.dataResourceType && (
|
|
133
|
+
<CclInfoContainer>
|
|
134
|
+
<h2>Hierarchy Level</h2>
|
|
135
|
+
<CclInfoDescription
|
|
136
|
+
title="Resource Type"
|
|
137
|
+
tooltip=""
|
|
138
|
+
description={data?.dataResourceType}
|
|
139
|
+
/>
|
|
140
|
+
</CclInfoContainer>
|
|
141
|
+
)}
|
|
142
|
+
{data?.responsiblePartyWithRole?.items &&
|
|
143
|
+
data?.responsiblePartyWithRole?.items?.length > 0 && (
|
|
144
|
+
<CclInfoContainer>
|
|
145
|
+
<h2>Contacts</h2>
|
|
146
|
+
<CclInfoDescription
|
|
147
|
+
title="Responsible Party with Role"
|
|
148
|
+
tooltip=""
|
|
149
|
+
description={data?.responsiblePartyWithRole?.items.map(
|
|
150
|
+
(item, key) => {
|
|
151
|
+
return <ContactComponent key={key} contact={item} />;
|
|
152
|
+
},
|
|
153
|
+
)}
|
|
154
|
+
/>
|
|
155
|
+
</CclInfoContainer>
|
|
156
|
+
)}
|
|
157
|
+
{data?.coordinateReferenceSystemList &&
|
|
158
|
+
data?.coordinateReferenceSystemList.length > 0 && (
|
|
159
|
+
<CclInfoContainer>
|
|
160
|
+
<h2>Reference system info</h2>
|
|
161
|
+
<CclInfoDescription
|
|
162
|
+
title="Coordinate Reference System"
|
|
163
|
+
tooltip="CRS of the resource"
|
|
164
|
+
description={
|
|
165
|
+
data?.coordinateReferenceSystemList &&
|
|
166
|
+
data?.coordinateReferenceSystemList.map((reference) => {
|
|
167
|
+
return <Label color="olive">{reference}</Label>;
|
|
168
|
+
})
|
|
169
|
+
}
|
|
170
|
+
/>
|
|
171
|
+
</CclInfoContainer>
|
|
172
|
+
)}
|
|
70
173
|
<CclInfoContainer>
|
|
71
|
-
<h2>
|
|
72
|
-
<CclInfoDescription
|
|
73
|
-
title="Conditions applying to access and use"
|
|
74
|
-
tooltip="Restriction on the access and use of a resource or metadata"
|
|
75
|
-
description={
|
|
76
|
-
<StringToHTML string={data.accessAndUseConstraints?.data} />
|
|
77
|
-
}
|
|
78
|
-
/>
|
|
174
|
+
<h2>Data quality info</h2>
|
|
79
175
|
<CclInfoDescription
|
|
80
|
-
title="
|
|
81
|
-
tooltip="
|
|
176
|
+
title="Specification"
|
|
177
|
+
tooltip="A citation of the implementing rules adopted under Article 7(1) of Directive 2007/2/EC or other specification to which a particular resource conforms"
|
|
82
178
|
description={
|
|
83
|
-
<StringToHTML string={data
|
|
179
|
+
<StringToHTML string={data?.conformitySpecification?.data} />
|
|
84
180
|
}
|
|
85
181
|
/>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
/>
|
|
182
|
+
{data?.conformityPass && (
|
|
183
|
+
<CclInfoDescription
|
|
184
|
+
title="Pass"
|
|
185
|
+
tooltip=""
|
|
186
|
+
description={data?.conformityPass}
|
|
187
|
+
/>
|
|
188
|
+
)}
|
|
94
189
|
<CclInfoDescription
|
|
95
|
-
title="
|
|
96
|
-
tooltip="
|
|
97
|
-
description={
|
|
98
|
-
<StringToHTML string={data.responsiblePartyRole?.data} />
|
|
99
|
-
}
|
|
190
|
+
title="Lineage"
|
|
191
|
+
tooltip="General explanation of the data produce knowledge's about the lineage of a dataset"
|
|
192
|
+
description={<StringToHTML string={data?.qualityLineage?.data} />}
|
|
100
193
|
/>
|
|
101
194
|
</CclInfoContainer>
|
|
195
|
+
{data?.distributionInfo?.items &&
|
|
196
|
+
data?.distributionInfo?.items?.length > 0 && (
|
|
197
|
+
<CclInfoContainer>
|
|
198
|
+
<h2>Distribution info</h2>
|
|
199
|
+
<CclInfoDescription
|
|
200
|
+
title="Resource Locator and Services"
|
|
201
|
+
tooltip=""
|
|
202
|
+
description={data?.distributionInfo?.items.map(
|
|
203
|
+
(resource, key) => {
|
|
204
|
+
return (
|
|
205
|
+
<DistributionInfoComponent key={key} resource={resource} />
|
|
206
|
+
);
|
|
207
|
+
},
|
|
208
|
+
)}
|
|
209
|
+
/>
|
|
210
|
+
</CclInfoContainer>
|
|
211
|
+
)}
|
|
102
212
|
</>
|
|
103
213
|
);
|
|
104
214
|
};
|
|
@@ -275,7 +275,11 @@ const CLMSDownloadCartView = (props) => {
|
|
|
275
275
|
<tr>
|
|
276
276
|
<td
|
|
277
277
|
colSpan={11}
|
|
278
|
-
style={{
|
|
278
|
+
style={{
|
|
279
|
+
textAlign: 'center',
|
|
280
|
+
color: '#adb0b8',
|
|
281
|
+
opacity: 0.5,
|
|
282
|
+
}}
|
|
279
283
|
>
|
|
280
284
|
Empty cart
|
|
281
285
|
</td>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import CclButton from '@eeacms/volto-clms-theme/components/CclButton/CclButton';
|
|
3
|
-
import { StringToHTML } from '@eeacms/volto-clms-theme/components/CclUtils';
|
|
4
2
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { StringToHTML } from '@eeacms/volto-clms-theme/components/CclUtils';
|
|
5
5
|
|
|
6
6
|
export const CLMSEventView = (props) => {
|
|
7
7
|
const { content } = props;
|
|
@@ -12,17 +12,19 @@ export const CLMSEventView = (props) => {
|
|
|
12
12
|
<div className="event-detail-date">
|
|
13
13
|
{new Date(content?.effective).toLocaleDateString()}
|
|
14
14
|
</div>
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
{content?.image && (
|
|
16
|
+
<figure className="news-detail-image">
|
|
17
|
+
<img
|
|
18
|
+
src={
|
|
19
|
+
content?.image
|
|
20
|
+
? content?.image?.download
|
|
21
|
+
: 'https://eu-copernicus.github.io/copernicus-component-library/assets/images/image_placeholder.jpg'
|
|
22
|
+
}
|
|
23
|
+
alt={content?.image ? content?.image?.filename : 'Placeholder'}
|
|
24
|
+
/>
|
|
25
|
+
<figcaption>{content?.image_caption}</figcaption>
|
|
26
|
+
</figure>
|
|
27
|
+
)}
|
|
26
28
|
<div className="event-detail-when">
|
|
27
29
|
<FontAwesomeIcon icon={['far', 'calendar-alt']} />
|
|
28
30
|
<div className="event-detail-when-text">
|
|
@@ -10,17 +10,19 @@ const CLMSNewsItemView = (props) => {
|
|
|
10
10
|
<div className="news-detail-date">
|
|
11
11
|
{new Date(content?.effective).toLocaleDateString()}
|
|
12
12
|
</div>
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
{content?.image && (
|
|
14
|
+
<figure className="news-detail-image">
|
|
15
|
+
<img
|
|
16
|
+
src={
|
|
17
|
+
content?.image
|
|
18
|
+
? content?.image?.download
|
|
19
|
+
: 'https://eu-copernicus.github.io/copernicus-component-library/assets/images/image_placeholder.jpg'
|
|
20
|
+
}
|
|
21
|
+
alt={content?.image ? content?.image?.filename : 'Placeholder'}
|
|
22
|
+
/>
|
|
23
|
+
<figcaption>{content?.image_caption}</figcaption>
|
|
24
|
+
</figure>
|
|
25
|
+
)}
|
|
24
26
|
<div className="news-detail-content">
|
|
25
27
|
<StringToHTML string={content.text?.data || ''} />
|
|
26
28
|
</div>
|
|
@@ -67,7 +67,7 @@ const messages = defineMessages({
|
|
|
67
67
|
},
|
|
68
68
|
createdToken: {
|
|
69
69
|
id: 'Created token name',
|
|
70
|
-
defaultMessage: '
|
|
70
|
+
defaultMessage: 'The token has been created successfuly',
|
|
71
71
|
},
|
|
72
72
|
copyButton: {
|
|
73
73
|
id: 'Copy created token button',
|
|
@@ -144,11 +144,12 @@ class CLMSApiTokensView extends Component {
|
|
|
144
144
|
ip_range: PropTypes.string,
|
|
145
145
|
issued: PropTypes.string,
|
|
146
146
|
key_id: PropTypes.string,
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
public_key: PropTypes.string,
|
|
148
|
+
private_key: PropTypes.string,
|
|
149
149
|
}),
|
|
150
150
|
),
|
|
151
151
|
};
|
|
152
|
+
|
|
152
153
|
constructor(props) {
|
|
153
154
|
super(props);
|
|
154
155
|
this.handleChange = this.handleChange.bind(this);
|
|
@@ -184,12 +185,9 @@ class CLMSApiTokensView extends Component {
|
|
|
184
185
|
onClose() {
|
|
185
186
|
this.componentDidMount();
|
|
186
187
|
this.setState({
|
|
187
|
-
value: '',
|
|
188
|
-
createdToken: false,
|
|
189
|
-
modal: false,
|
|
190
|
-
tokenTitle: '',
|
|
191
|
-
textToCopy: '',
|
|
192
188
|
createNewToken: false,
|
|
189
|
+
public_key: undefined,
|
|
190
|
+
private_key: undefined,
|
|
193
191
|
});
|
|
194
192
|
}
|
|
195
193
|
|
|
@@ -203,10 +201,10 @@ class CLMSApiTokensView extends Component {
|
|
|
203
201
|
|
|
204
202
|
handleClick() {
|
|
205
203
|
this.setState({
|
|
206
|
-
createdToken: true,
|
|
207
204
|
modal: false,
|
|
208
|
-
button: false,
|
|
209
205
|
createNewToken: true,
|
|
206
|
+
public_key: undefined,
|
|
207
|
+
private_key: undefined,
|
|
210
208
|
});
|
|
211
209
|
}
|
|
212
210
|
|
|
@@ -225,14 +223,14 @@ class CLMSApiTokensView extends Component {
|
|
|
225
223
|
this.props.getUser(this.props.userId);
|
|
226
224
|
this.props.getTokens();
|
|
227
225
|
this.setState({
|
|
228
|
-
value:
|
|
229
|
-
tokenTitle:
|
|
226
|
+
value: undefined,
|
|
227
|
+
tokenTitle: undefined,
|
|
230
228
|
button: false,
|
|
231
|
-
createNewToken: true,
|
|
229
|
+
// createNewToken: true,
|
|
232
230
|
modal: false,
|
|
233
231
|
createdToken: false,
|
|
234
|
-
textToCopy:
|
|
235
|
-
key_id:
|
|
232
|
+
textToCopy: undefined,
|
|
233
|
+
key_id: undefined,
|
|
236
234
|
});
|
|
237
235
|
}
|
|
238
236
|
|
|
@@ -263,21 +261,36 @@ class CLMSApiTokensView extends Component {
|
|
|
263
261
|
{this.props.intl.formatMessage(messages.ApiTokens)}
|
|
264
262
|
</h1>
|
|
265
263
|
<div>
|
|
266
|
-
<
|
|
264
|
+
<h2>{this.props.intl.formatMessage(messages.title)}</h2>
|
|
267
265
|
<p>{this.props.intl.formatMessage(messages.description)}</p>
|
|
268
266
|
{this.props.createdTokens?.map((item) => (
|
|
269
267
|
<>
|
|
270
268
|
<div>
|
|
271
269
|
<p>{item.title}</p>
|
|
272
270
|
<p>{item.key_id}</p>
|
|
273
|
-
<
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
271
|
+
<CclModal
|
|
272
|
+
onClick={() => this.onClose}
|
|
273
|
+
trigger={
|
|
274
|
+
<CclButton mode={'filled'}>
|
|
275
|
+
{this.props.intl.formatMessage(messages.deleteButton)}
|
|
276
|
+
</CclButton>
|
|
277
|
+
}
|
|
278
|
+
size="small"
|
|
278
279
|
>
|
|
279
|
-
|
|
280
|
-
|
|
280
|
+
<h4>This token will be deleted forever</h4>
|
|
281
|
+
<p>
|
|
282
|
+
You will not be able to use this token again. Only
|
|
283
|
+
delete your tokens when you are absolutely sure of it
|
|
284
|
+
</p>
|
|
285
|
+
<CclButton
|
|
286
|
+
mode={'filled'}
|
|
287
|
+
onClick={() => {
|
|
288
|
+
this.deleteToken(item.key_id);
|
|
289
|
+
}}
|
|
290
|
+
>
|
|
291
|
+
{'I confirm that I want to delete this token'}
|
|
292
|
+
</CclButton>
|
|
293
|
+
</CclModal>
|
|
281
294
|
</div>
|
|
282
295
|
</>
|
|
283
296
|
))}
|
|
@@ -351,31 +364,40 @@ class CLMSApiTokensView extends Component {
|
|
|
351
364
|
<>
|
|
352
365
|
{(this.state.createdToken === true && (
|
|
353
366
|
<div>
|
|
354
|
-
<
|
|
367
|
+
<h3>
|
|
355
368
|
{this.props.intl.formatMessage(
|
|
356
369
|
messages.createdToken,
|
|
357
370
|
)}
|
|
358
|
-
</
|
|
371
|
+
</h3>
|
|
359
372
|
<form className="ccl-form search-form">
|
|
360
373
|
{this.props.newTokens?.map((item) => (
|
|
361
374
|
<>
|
|
362
|
-
{(item
|
|
375
|
+
{(item?.private_key && (
|
|
363
376
|
<>
|
|
364
|
-
<
|
|
365
|
-
|
|
377
|
+
<p>{'Download your service key.'}</p>
|
|
378
|
+
<p>
|
|
379
|
+
{
|
|
380
|
+
"This is the only time your private key will be displayed - it will not be stored on the server, and can't be recovered should you fail to save it."
|
|
381
|
+
}
|
|
382
|
+
</p>
|
|
383
|
+
<p>
|
|
384
|
+
{
|
|
385
|
+
'You should copy & paste this key into a .json file, and store this file in a location accessible only to your service application. This key grants anyone in possession of it full access to this account. You should therefore make sure to protect it with the least file system permissions possible.'
|
|
386
|
+
}
|
|
387
|
+
</p>
|
|
388
|
+
|
|
389
|
+
<textarea
|
|
366
390
|
disabled="disabled"
|
|
367
|
-
type="text"
|
|
368
|
-
className="ccl-text-input"
|
|
369
391
|
id="created_token"
|
|
370
392
|
name="createdToken"
|
|
371
|
-
|
|
372
|
-
|
|
393
|
+
class="ccl-text-input"
|
|
394
|
+
value={JSON.stringify(item)}
|
|
373
395
|
/>
|
|
374
396
|
<CclButton
|
|
375
397
|
mode={'filled'}
|
|
376
398
|
onClick={() => {
|
|
377
399
|
navigator.clipboard.writeText(
|
|
378
|
-
item
|
|
400
|
+
JSON.stringify(item),
|
|
379
401
|
);
|
|
380
402
|
}}
|
|
381
403
|
>
|
|
@@ -3,18 +3,20 @@
|
|
|
3
3
|
* @module components/CLMSProfileView/CLMSProfileView
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import {
|
|
7
|
+
CLMSApiTokensView,
|
|
8
|
+
CLMSUserProfileView,
|
|
9
|
+
} from '@eeacms/volto-clms-theme/components/CLMSProfileView';
|
|
6
10
|
import React, { Component } from 'react';
|
|
11
|
+
import { getUser, updateUser } from '@plone/volto/actions';
|
|
12
|
+
|
|
13
|
+
import CclTabs from '@eeacms/volto-clms-theme/components/CclTab/CclTabs';
|
|
7
14
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { connect } from 'react-redux';
|
|
9
15
|
import { compose } from 'redux';
|
|
10
|
-
import
|
|
11
|
-
import { getUser, updateUser } from '@plone/volto/actions';
|
|
16
|
+
import { connect } from 'react-redux';
|
|
12
17
|
import { getBaseUrl } from '@plone/volto/helpers';
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
CLMSUserProfileView,
|
|
16
|
-
CLMSApiTokensView,
|
|
17
|
-
} from '@eeacms/volto-clms-theme/components/CLMSProfileView';
|
|
18
|
+
import { getExtraBreadcrumbItems } from '../../actions';
|
|
19
|
+
import jwtDecode from 'jwt-decode';
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
22
|
* CLMSProfileView class.
|
|
@@ -32,13 +34,18 @@ class CLMSProfileView extends Component {
|
|
|
32
34
|
children: PropTypes.instanceOf(Array),
|
|
33
35
|
user: PropTypes.shape({
|
|
34
36
|
'@id': PropTypes.string,
|
|
35
|
-
|
|
37
|
+
are_you_registering_on_behalf_on_an_organisation_: PropTypes.bool,
|
|
38
|
+
country: PropTypes.string,
|
|
36
39
|
email: PropTypes.string,
|
|
37
40
|
fullname: PropTypes.string,
|
|
41
|
+
how_do_you_intend_to_use_the_products: PropTypes.arrayOf(
|
|
42
|
+
PropTypes.string,
|
|
43
|
+
),
|
|
38
44
|
id: PropTypes.string,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
organisation_institutional_domain: PropTypes.arrayOf(PropTypes.string),
|
|
46
|
+
organisation_name: PropTypes.string,
|
|
47
|
+
organisation_url: PropTypes.string,
|
|
48
|
+
professional_thematic_domain: PropTypes.arrayOf(PropTypes.string),
|
|
42
49
|
roles: PropTypes.array,
|
|
43
50
|
username: PropTypes.string,
|
|
44
51
|
return_url: PropTypes.string,
|
|
@@ -56,8 +63,14 @@ class CLMSProfileView extends Component {
|
|
|
56
63
|
*/
|
|
57
64
|
render() {
|
|
58
65
|
const loggedIn = !!this.props.userId;
|
|
66
|
+
this.props.getExtraBreadcrumbItems([
|
|
67
|
+
{
|
|
68
|
+
title: 'Profile',
|
|
69
|
+
pathname: this.props.location.pathname,
|
|
70
|
+
},
|
|
71
|
+
]);
|
|
59
72
|
return (
|
|
60
|
-
|
|
73
|
+
<div className="ccl-container ">
|
|
61
74
|
{loggedIn && (
|
|
62
75
|
<>
|
|
63
76
|
<CclTabs>
|
|
@@ -70,7 +83,7 @@ class CLMSProfileView extends Component {
|
|
|
70
83
|
</CclTabs>
|
|
71
84
|
</>
|
|
72
85
|
)}
|
|
73
|
-
|
|
86
|
+
</div>
|
|
74
87
|
);
|
|
75
88
|
}
|
|
76
89
|
}
|
|
@@ -83,6 +96,6 @@ export default compose(
|
|
|
83
96
|
? jwtDecode(state.userSession.token).sub
|
|
84
97
|
: '',
|
|
85
98
|
}),
|
|
86
|
-
{ getUser, updateUser, getBaseUrl },
|
|
99
|
+
{ getUser, updateUser, getBaseUrl, getExtraBreadcrumbItems },
|
|
87
100
|
),
|
|
88
101
|
)(CLMSProfileView);
|