cozy-ui 110.8.2 → 111.0.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
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# [111.0.0](https://github.com/cozy/cozy-ui/compare/v110.8.2...v111.0.0) (2024-07-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **ExpirationAlert:** Do not display expiration link for foreign file ([dfeaa6e](https://github.com/cozy/cozy-ui/commit/dfeaa6e))
|
|
7
|
+
* Upgrade cozy-client to 48.8.0 ([03dbc6a](https://github.com/cozy/cozy-ui/commit/03dbc6a))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* you must have `cozy-client >= 48.8.0`
|
|
13
|
+
|
|
1
14
|
## [110.8.2](https://github.com/cozy/cozy-ui/compare/v110.8.1...v110.8.2) (2024-07-11)
|
|
2
15
|
|
|
3
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "111.0.0",
|
|
4
4
|
"description": "Cozy apps UI SDK",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"babel-preset-cozy-app": "2.0.2",
|
|
91
91
|
"browserslist-config-cozy": "0.4.0",
|
|
92
92
|
"copyfiles": "2.4.1",
|
|
93
|
-
"cozy-client": "^
|
|
93
|
+
"cozy-client": "^48.8.0",
|
|
94
94
|
"cozy-device-helper": "2.0.0",
|
|
95
95
|
"cozy-flags": "^2.10.1",
|
|
96
96
|
"cozy-harvest-lib": "^6.7.3",
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
"rooks": "^5.11.2"
|
|
181
181
|
},
|
|
182
182
|
"peerDependencies": {
|
|
183
|
-
"cozy-client": ">=
|
|
183
|
+
"cozy-client": ">=48.8.0",
|
|
184
184
|
"cozy-device-helper": "^2.0.0",
|
|
185
185
|
"cozy-harvest-lib": "^6.7.3",
|
|
186
186
|
"cozy-intent": ">=1.3.0",
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
|
|
4
|
-
import { useClient
|
|
4
|
+
import { useClient } from 'cozy-client'
|
|
5
|
+
import {
|
|
6
|
+
isForeignPaper,
|
|
7
|
+
computeExpirationDate,
|
|
8
|
+
computeExpirationNoticeLink,
|
|
9
|
+
makeExpirationDescription
|
|
10
|
+
} from 'cozy-client/dist/models/paper'
|
|
5
11
|
|
|
6
12
|
import Alert from '../../Alert'
|
|
7
13
|
import Button from '../../Buttons'
|
|
@@ -12,12 +18,6 @@ import { useI18n } from '../../providers/I18n'
|
|
|
12
18
|
|
|
13
19
|
const FILES_DOCTYPE = 'io.cozy.files'
|
|
14
20
|
|
|
15
|
-
const {
|
|
16
|
-
computeExpirationDate,
|
|
17
|
-
computeExpirationNoticeLink,
|
|
18
|
-
makeExpirationDescription
|
|
19
|
-
} = models.paper
|
|
20
|
-
|
|
21
21
|
const ExpirationAlert = ({ file }) => {
|
|
22
22
|
const { t, lang } = useI18n()
|
|
23
23
|
const client = useClient()
|
|
@@ -33,7 +33,9 @@ const ExpirationAlert = ({ file }) => {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
const expirationDate = computeExpirationDate(file)
|
|
36
|
-
const expirationNoticeLink =
|
|
36
|
+
const expirationNoticeLink = !isForeignPaper(file)
|
|
37
|
+
? computeExpirationNoticeLink(file)
|
|
38
|
+
: null
|
|
37
39
|
|
|
38
40
|
return (
|
|
39
41
|
<Alert
|
|
@@ -9,7 +9,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
9
9
|
|
|
10
10
|
import React, { useState } from 'react';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
|
-
import { useClient
|
|
12
|
+
import { useClient } from 'cozy-client';
|
|
13
|
+
import { isForeignPaper, computeExpirationDate, computeExpirationNoticeLink, makeExpirationDescription } from 'cozy-client/dist/models/paper';
|
|
13
14
|
import Alert from "cozy-ui/transpiled/react/Alert";
|
|
14
15
|
import Button from "cozy-ui/transpiled/react/Buttons";
|
|
15
16
|
import Link from "cozy-ui/transpiled/react/Link";
|
|
@@ -17,10 +18,6 @@ import Typography from "cozy-ui/transpiled/react/Typography";
|
|
|
17
18
|
import { withViewerLocales } from "cozy-ui/transpiled/react/Viewer/hoc/withViewerLocales";
|
|
18
19
|
import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
|
|
19
20
|
var FILES_DOCTYPE = 'io.cozy.files';
|
|
20
|
-
var _models$paper = models.paper,
|
|
21
|
-
computeExpirationDate = _models$paper.computeExpirationDate,
|
|
22
|
-
computeExpirationNoticeLink = _models$paper.computeExpirationNoticeLink,
|
|
23
|
-
makeExpirationDescription = _models$paper.makeExpirationDescription;
|
|
24
21
|
|
|
25
22
|
var ExpirationAlert = function ExpirationAlert(_ref) {
|
|
26
23
|
var file = _ref.file;
|
|
@@ -65,7 +62,7 @@ var ExpirationAlert = function ExpirationAlert(_ref) {
|
|
|
65
62
|
}();
|
|
66
63
|
|
|
67
64
|
var expirationDate = computeExpirationDate(file);
|
|
68
|
-
var expirationNoticeLink = computeExpirationNoticeLink(file);
|
|
65
|
+
var expirationNoticeLink = !isForeignPaper(file) ? computeExpirationNoticeLink(file) : null;
|
|
69
66
|
return /*#__PURE__*/React.createElement(Alert, {
|
|
70
67
|
severity: "warning",
|
|
71
68
|
block: true,
|