cozy-ui 115.1.0 → 116.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,20 @@
1
+ # [116.0.0](https://github.com/cozy/cozy-ui/compare/v115.1.0...v116.0.0) (2025-01-07)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **QualificationModal:** Now select `none` for unsupported qualification ([cdaba35](https://github.com/cozy/cozy-ui/commit/cdaba35))
7
+
8
+
9
+ ### Features
10
+
11
+ * Upgrade cozy-client ([9dd4544](https://github.com/cozy/cozy-ui/commit/9dd4544))
12
+
13
+
14
+ ### BREAKING CHANGES
15
+
16
+ * You must have `cozy-client >= 52.1.0`
17
+
1
18
  # [115.1.0](https://github.com/cozy/cozy-ui/compare/v115.0.2...v115.1.0) (2025-01-02)
2
19
 
3
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "115.1.0",
3
+ "version": "116.0.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -92,12 +92,12 @@
92
92
  "browserslist-config-cozy": "0.4.0",
93
93
  "bundlemon": "3.1.0",
94
94
  "copyfiles": "2.4.1",
95
- "cozy-client": "^51.6.0",
95
+ "cozy-client": "^52.1.0",
96
96
  "cozy-device-helper": "2.0.0",
97
97
  "cozy-flags": "^2.10.1",
98
98
  "cozy-intent": "^2.29.1",
99
99
  "cozy-logger": "^1.9.0",
100
- "cozy-stack-client": "^51.6.0",
100
+ "cozy-stack-client": "^52.0.0",
101
101
  "css-loader": "0.28.11",
102
102
  "cssnano": "4.1.11",
103
103
  "cssnano-preset-advanced": "4.0.8",
@@ -183,7 +183,7 @@
183
183
  "rooks": "^5.11.2"
184
184
  },
185
185
  "peerDependencies": {
186
- "cozy-client": ">=51.6.0",
186
+ "cozy-client": ">=52.1.0",
187
187
  "cozy-device-helper": "^2.0.0",
188
188
  "cozy-intent": ">=2.29.1",
189
189
  "react": "^16.8.6",
@@ -1,4 +1,4 @@
1
- Use same actions as `<ActionsMenu />`
1
+ Use same actions as `<ActionsMenu />`.
2
2
 
3
3
  ```jsx
4
4
  import DemoProvider from 'cozy-ui/docs/components/DemoProvider'
@@ -202,7 +202,6 @@ ___
202
202
 
203
203
  |name|type|default|description|
204
204
  |----|----|-------|-----------|
205
- |isValid|() => boolean||Function that returns if the value of the input is a valid Date|
206
205
  |enableKeyboard|boolean||Enable the keyboard date picker|
207
206
  |mode|"date" \| "time" \| "dateTime"|"date"|Picker mode|
208
207
  ___
@@ -5,7 +5,7 @@ import { useClient } from 'cozy-client'
5
5
  import { themesList } from 'cozy-client/dist/models/document/documentTypeData'
6
6
  import { isQualificationNote } from 'cozy-client/dist/models/document/documentTypeDataHelpers'
7
7
  import { getBoundT } from 'cozy-client/dist/models/document/locales'
8
- import { getQualification } from 'cozy-client/dist/models/document/qualification'
8
+ import { isSupportedQualification } from 'cozy-client/dist/models/document/qualification'
9
9
 
10
10
  import { locales } from './locales'
11
11
  import Icon from '../Icon'
@@ -48,11 +48,11 @@ const QualificationModal = ({ file, title, onClose }) => {
48
48
  const client = useClient()
49
49
  const { t, lang } = useI18n()
50
50
 
51
- const qualificationLabel = getQualification(file)?.label
51
+ const qualificationLabel = file.metadata?.qualification?.label
52
52
  const options = useMemo(() => makeOptions(lang), [lang])
53
53
 
54
54
  const isSelected = ({ id, item }) => {
55
- return qualificationLabel
55
+ return isSupportedQualification(qualificationLabel)
56
56
  ? qualificationLabel === item?.label
57
57
  : id === 'none'
58
58
  }
@@ -7,7 +7,7 @@ import { useClient } from 'cozy-client';
7
7
  import { themesList } from 'cozy-client/dist/models/document/documentTypeData';
8
8
  import { isQualificationNote } from 'cozy-client/dist/models/document/documentTypeDataHelpers';
9
9
  import { getBoundT } from 'cozy-client/dist/models/document/locales';
10
- import { getQualification } from 'cozy-client/dist/models/document/qualification';
10
+ import { isSupportedQualification } from 'cozy-client/dist/models/document/qualification';
11
11
  import { locales } from "cozy-ui/transpiled/react/QualificationModal/locales";
12
12
  import Icon from "cozy-ui/transpiled/react/Icon";
13
13
  import FileTypeNoteIcon from "cozy-ui/transpiled/react/Icons/FileTypeNote";
@@ -48,7 +48,7 @@ var makeOptions = function makeOptions(lang) {
48
48
  };
49
49
 
50
50
  var QualificationModal = function QualificationModal(_ref) {
51
- var _getQualification;
51
+ var _file$metadata, _file$metadata$qualif;
52
52
 
53
53
  var file = _ref.file,
54
54
  title = _ref.title,
@@ -60,7 +60,7 @@ var QualificationModal = function QualificationModal(_ref) {
60
60
  t = _useI18n.t,
61
61
  lang = _useI18n.lang;
62
62
 
63
- var qualificationLabel = (_getQualification = getQualification(file)) === null || _getQualification === void 0 ? void 0 : _getQualification.label;
63
+ var qualificationLabel = (_file$metadata = file.metadata) === null || _file$metadata === void 0 ? void 0 : (_file$metadata$qualif = _file$metadata.qualification) === null || _file$metadata$qualif === void 0 ? void 0 : _file$metadata$qualif.label;
64
64
  var options = useMemo(function () {
65
65
  return makeOptions(lang);
66
66
  }, [lang]);
@@ -68,7 +68,7 @@ var QualificationModal = function QualificationModal(_ref) {
68
68
  var isSelected = function isSelected(_ref2) {
69
69
  var id = _ref2.id,
70
70
  item = _ref2.item;
71
- return qualificationLabel ? qualificationLabel === (item === null || item === void 0 ? void 0 : item.label) : id === 'none';
71
+ return isSupportedQualification(qualificationLabel) ? qualificationLabel === (item === null || item === void 0 ? void 0 : item.label) : id === 'none';
72
72
  };
73
73
 
74
74
  var handleClick = /*#__PURE__*/function () {