@eeacms/volto-clms-theme 1.0.191 → 1.0.192

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,7 +4,17 @@ 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.191](https://github.com/eea/volto-clms-theme/compare/1.0.190...1.0.191) - 24 March 2023
7
+ ### [1.0.192](https://github.com/eea/volto-clms-theme/compare/1.0.191...1.0.192) - 27 March 2023
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat: CLMS-1940 add new fields in TechnicalLibrary listings [Mikel Larreategi - [`424cf0c`](https://github.com/eea/volto-clms-theme/commit/424cf0c551c5de9267c8179c52230ad0a096d898)]
12
+
13
+ #### :hammer_and_wrench: Others
14
+
15
+ - add comment [ionlizarazu - [`23c49b8`](https://github.com/eea/volto-clms-theme/commit/23c49b822339f0cca582dd03c339e9bc10b8b86a)]
16
+ - delete not existing columns data from the table [ionlizarazu - [`5b227a6`](https://github.com/eea/volto-clms-theme/commit/5b227a6c6f5e354e711dbbde370d09806cd7167b)]
17
+ ### [1.0.191](https://github.com/eea/volto-clms-theme/compare/1.0.190...1.0.191) - 27 March 2023
8
18
 
9
19
  #### :rocket: New Features
10
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.0.191",
3
+ "version": "1.0.192",
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",
@@ -73,6 +73,23 @@ const DocCard = ({ card, url, showEditor, children }) => {
73
73
  <div className="card-doc-size">{card.getObjSize || ''}</div>
74
74
  )}
75
75
  </div>
76
+ {card?.Type === 'TechnicalLibrary' &&
77
+ (card.publication_date || card.version) && (
78
+ <div className="card-doc-extrametadata">
79
+ {card?.Type === 'TechnicalLibrary' && card.publication_date && (
80
+ <>
81
+ <strong>Publication date: </strong>
82
+ <span>{cclDateFormat(card.publication_date)}</span>
83
+ </>
84
+ )}{' '}
85
+ &nbsp;
86
+ {card?.Type === 'TechnicalLibrary' && card.version && (
87
+ <>
88
+ <strong>Version: </strong> <span>{card.version}</span>
89
+ </>
90
+ )}
91
+ </div>
92
+ )}
76
93
  <div className="card-doc-description">{card?.description}</div>
77
94
  {children}
78
95
  </>
@@ -22,6 +22,23 @@ const DownloadableFilesTableWidget = (props) => {
22
22
  schema.fieldsets[0].fields = schema.fieldsets[0].fields.filter((f) => f);
23
23
  };
24
24
 
25
+ const deleteNotExistingColumnsData = (props, schema) => {
26
+ const { id, value } = props;
27
+ const validFields = ['@id', ...Object.keys(schema?.properties)];
28
+ for (let i in value?.items) {
29
+ Object.keys(value?.items[i]).forEach((k) => {
30
+ if (!validFields.includes(k)) {
31
+ delete value?.items[i][k];
32
+ }
33
+ });
34
+ }
35
+ props.onChange(id, {
36
+ items: value.items,
37
+ ...props.schema,
38
+ ...props.uiSchema,
39
+ });
40
+ };
41
+
25
42
  return (
26
43
  <>
27
44
  <div className="ui container">
@@ -84,6 +101,7 @@ const DownloadableFilesTableWidget = (props) => {
84
101
  }),
85
102
  props.id,
86
103
  );
104
+ deleteNotExistingColumnsData(props, schema);
87
105
  }}
88
106
  >
89
107
  APPLY MODIFIED SCHEMA
@@ -95,6 +95,7 @@ export const useSchema = (baseSchema, baseUISchema) => {
95
95
  setReady(false);
96
96
  // console.log('schema', schema);
97
97
  Object.keys(schema.properties).forEach((pr) => {
98
+ //modify the Dropdown field type to make it compatible with Volto select
98
99
  if (schema.properties[pr].enum) {
99
100
  schema.properties[pr].choices = schema.properties[pr].enum.map((en) => [
100
101
  en,