@eeacms/volto-slate-metadata-mentions 8.1.0 → 8.2.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 CHANGED
@@ -4,7 +4,23 @@ 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
- ### [8.1.0](https://github.com/eea/volto-slate-metadata-mentions/compare/8.0.0...8.1.0) - 16 May 2024
7
+ ### [8.2.0](https://github.com/eea/volto-slate-metadata-mentions/compare/8.1.1...8.2.0) - 13 September 2024
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat: Add option in effective metadata, to display only date - refs #259256 [Teodor Voicu - [`16d6866`](https://github.com/eea/volto-slate-metadata-mentions/commit/16d6866912aeff3315e3e8b7ddbd11e5c4849559)]
12
+
13
+ #### :hammer_and_wrench: Others
14
+
15
+ - Release 8.2.0 [alin - [`9e46688`](https://github.com/eea/volto-slate-metadata-mentions/commit/9e46688385bdd1b11fd53bc35c210f006892d846)]
16
+ ### [8.1.1](https://github.com/eea/volto-slate-metadata-mentions/compare/8.1.0...8.1.1) - 31 July 2024
17
+
18
+ #### :bug: Bug Fixes
19
+
20
+ - fix(slate-metadata): link to image download showing up due to data.addLinkToDownload being undefined #47 from eea/259256-link_bug [ichim-david - [`231c7aa`](https://github.com/eea/volto-slate-metadata-mentions/commit/231c7aa5b640d2265e1524406b5a70b4db776279)]
21
+ - fix(slate-metadata): link to image download showing up due to data.addLinkToDownload being undefined [David Ichim - [`df097fa`](https://github.com/eea/volto-slate-metadata-mentions/commit/df097fa0e2ee032871cbf059c8f74d8003cc0066)]
22
+
23
+ ### [8.1.0](https://github.com/eea/volto-slate-metadata-mentions/compare/8.0.0...8.1.0) - 17 May 2024
8
24
 
9
25
  #### :rocket: New Features
10
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-slate-metadata-mentions",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "description": "Volto Slate Metadata Mentions Plugin",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -42,7 +42,7 @@ export const MentionElement = ({
42
42
  metadata = blockProps.metadata || blockProps.properties || {};
43
43
  }
44
44
  let output = metadata[id];
45
- let Widget = views.getWidget(data);
45
+ let Widget = data?.dateOnly ? views.widget.date : views.getWidget(data);
46
46
  let className = 'metadata mention ' + id;
47
47
 
48
48
  // If edit mode and output is empty render its id
@@ -51,7 +51,6 @@ export const MentionElement = ({
51
51
  output = id;
52
52
  Widget = views.getWidget({ widget: 'default' });
53
53
  }
54
-
55
54
  return (
56
55
  <>
57
56
  {mode === 'view' ? (
@@ -63,7 +62,7 @@ export const MentionElement = ({
63
62
  to={`${flattenToAppURL(metadata['@id'])}/@@download/image/${
64
63
  metadata.id
65
64
  }`}
66
- condition={data.addLinkToDownload !== false}
65
+ condition={!!data.addLinkToDownload}
67
66
  >
68
67
  <Widget value={output} className={className}>
69
68
  {(child) => wrapInlineMarkupText(children, (_c) => child)}
@@ -21,6 +21,14 @@ const messages = defineMessages({
21
21
  id: 'Display',
22
22
  defaultMessage: 'Display',
23
23
  },
24
+ dateOnly: {
25
+ id: 'Show only date',
26
+ defaultMessage: 'Show only date',
27
+ },
28
+ dateOnlyDescription: {
29
+ id: 'Display only date without time',
30
+ defaultMessage: 'Display only date without time',
31
+ },
24
32
  addLinkToDownload: {
25
33
  id: 'Add link to download',
26
34
  defaultMessage: 'Add link to download',
@@ -42,6 +50,7 @@ export const MentionSchema = function ({ metadata, intl }) {
42
50
  'metadata',
43
51
  'widget',
44
52
  ...(metadata === 'image' ? ['addLinkToDownload'] : []),
53
+ ...(metadata === 'effective' ? ['dateOnly'] : []),
45
54
  ],
46
55
  },
47
56
  ],
@@ -69,6 +78,15 @@ export const MentionSchema = function ({ metadata, intl }) {
69
78
  },
70
79
  }
71
80
  : {}),
81
+ ...(metadata === 'effective'
82
+ ? {
83
+ dateOnly: {
84
+ title: intl.formatMessage(messages.dateOnly),
85
+ description: intl.formatMessage(messages.dateOnlyDescription),
86
+ type: 'boolean',
87
+ },
88
+ }
89
+ : {}),
72
90
  },
73
91
  required: ['metadata'],
74
92
  };