@eeacms/volto-clms-theme 1.0.167 → 1.0.168

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 CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [1.0.168](https://github.com/eea/volto-clms-theme/compare/1.0.167...1.0.168) - 7 February 2023
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: usecaseView visualization [ionlizarazu - [`4863f1c`](https://github.com/eea/volto-clms-theme/commit/4863f1c3379b3be77518cf3563fda6f5a4433bc5)]
12
+
13
+ #### :hammer_and_wrench: Others
14
+
15
+ - datasets download view button style change [Unai - [`c9019c2`](https://github.com/eea/volto-clms-theme/commit/c9019c27862074e4b59242ba056f2dff617735ba)]
16
+ - new util and size shown at techniccal libraries inside datasets [Unai - [`6fab93f`](https://github.com/eea/volto-clms-theme/commit/6fab93fcc4720f5c9731a3c7ae27829a5c3b439f)]
7
17
  ### [1.0.167](https://github.com/eea/volto-clms-theme/compare/1.0.166...1.0.167) - 2 February 2023
8
18
 
9
19
  #### :bug: Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.0.167",
3
+ "version": "1.0.168",
4
4
  "description": "volto-clms-theme: Volto theme for CLMS site",
5
5
  "main": "src/index.js",
6
6
  "author": "CodeSyntax for the European Environment Agency",
@@ -34,3 +34,12 @@ export const slugify = (string) => {
34
34
  .replace(/[^\w]+/g, '')
35
35
  : '';
36
36
  };
37
+
38
+ export function formatFileSize(bytes, decimalPoint) {
39
+ if (bytes === 0) return '0 Bytes';
40
+ var k = 1000,
41
+ dm = decimalPoint || 2,
42
+ sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
43
+ i = Math.floor(Math.log(bytes) / Math.log(k));
44
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
45
+ }
@@ -11,6 +11,7 @@ import { StringToHTML } from '@eeacms/volto-clms-theme/components/CclUtils';
11
11
  import config from '@plone/volto/registry';
12
12
  import { searchContent } from '@plone/volto/actions';
13
13
  import { useLocation } from 'react-router-dom';
14
+ import { formatFileSize } from '../Blocks/utils';
14
15
 
15
16
  const DataSetInfoContent = (props) => {
16
17
  const dispatch = useDispatch();
@@ -180,8 +181,13 @@ const DataSetInfoContent = (props) => {
180
181
  {libraries.map((item, index) => (
181
182
  <CclCard
182
183
  key={index}
184
+ Type="TechnicalLibrary"
183
185
  type="doc"
184
- card={{ Type: item['@type'], ...item }}
186
+ card={{
187
+ Type: item['@type'],
188
+ getObjSize: formatFileSize(item.file.size),
189
+ ...item,
190
+ }}
185
191
  showEditor={user?.roles?.includes('Manager')}
186
192
  />
187
193
  ))}
@@ -74,7 +74,7 @@ const CLMSUseCaseView = (props) => {
74
74
  ))}
75
75
  </List>
76
76
  )}
77
- <p>
77
+ <div className="usecase-other-values-list-container">
78
78
  {(content?.taxonomy_use_case_spatial_coverage?.length > 0 ||
79
79
  content?.responsibleOrganization ||
80
80
  content?.submittingProducionYear) && (
@@ -106,7 +106,7 @@ const CLMSUseCaseView = (props) => {
106
106
  )}
107
107
  </List>
108
108
  )}
109
- </p>
109
+ </div>
110
110
  <div className="usecase-body-text">
111
111
  {content?.text && <StringToHTML string={content?.text?.data} />}
112
112
  </div>
@@ -23,3 +23,10 @@ div.usecase-body-text {
23
23
  .usecase-list {
24
24
  margin-bottom: 1rem;
25
25
  }
26
+
27
+ div.usecase-other-values-list-container {
28
+ min-height: 1.6875rem;
29
+ margin-bottom: 1rem;
30
+ font-size: 1.125rem;
31
+ line-height: 1.6875rem;
32
+ }
@@ -251,11 +251,13 @@ function CclDownloadTable(props) {
251
251
  columns && (
252
252
  <div className="dataset-download-table">
253
253
  <h2>Download pre-packaged data collections</h2>
254
- <p>
255
- Please note that you can only download the latest version of our
256
- datasets from this website. If you are looking for older versions
257
- please contact us.
258
- </p>
254
+ {/* {prePackagedCollection.length === 0 && (
255
+ <p>
256
+ Please note that you can only download the latest version of our
257
+ datasets from this website. If you are looking for older versions
258
+ please contact us.
259
+ </p>
260
+ )} */}
259
261
 
260
262
  {dataset?.download_page_information?.data && (
261
263
  <StringToHTML string={dataset?.download_page_information?.data} />
@@ -292,7 +294,10 @@ function CclDownloadTable(props) {
292
294
  {props.dataset.show_legend_on_prepackages && (
293
295
  <CclModal
294
296
  trigger={
295
- <CclButton to="#download">
297
+ <CclButton
298
+ className="ccl-button ccl-button--default show_legend_on_prepackages"
299
+ to="#download"
300
+ >
296
301
  {intl.formatMessage(messages.prePackages_location_map)}
297
302
  </CclButton>
298
303
  }
@@ -57,3 +57,7 @@
57
57
  .image-modal img {
58
58
  width: 100%;
59
59
  }
60
+
61
+ .show_legend_on_prepackages {
62
+ margin-left: 1rem !important;
63
+ }