cozy-ui 131.2.0 → 132.1.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,28 @@
1
+ # [132.1.0](https://github.com/cozy/cozy-ui/compare/v132.0.0...v132.1.0) (2025-10-30)
2
+
3
+
4
+ ### Features
5
+
6
+ * Add shared drive icons :sparkles: ([2eaee77](https://github.com/cozy/cozy-ui/commit/2eaee77))
7
+
8
+ # [132.0.0](https://github.com/cozy/cozy-ui/compare/v131.2.0...v132.0.0) (2025-10-27)
9
+
10
+
11
+ ### Features
12
+
13
+ * **AppSections:** Replace cozy-flags by `config` prop ([6ecdad0](https://github.com/cozy/cozy-ui/commit/6ecdad0))
14
+ * **Paywall:** Replace cozy-flags by `isIapEnabled` prop ([953f28a](https://github.com/cozy/cozy-ui/commit/953f28a))
15
+ * **QualificationGrid:** Replace cozy-flags by `noHealth` prop ([68f14dc](https://github.com/cozy/cozy-ui/commit/68f14dc))
16
+ * Remove cozy-flags from peerDeps ([5131237](https://github.com/cozy/cozy-ui/commit/5131237))
17
+
18
+
19
+ ### BREAKING CHANGES
20
+
21
+ * **AppSections:** You must use `config={flag('store.alternative-source')}` prop
22
+ * **QualificationGrid:** You must use `noHealth={flag('hide.healthTheme.enabled')}` prop
23
+ * **Paywall:** You must use `isIapEnabled={flag('flagship.iap.enabled')}` prop
24
+ * You no longer need to install `cozy-flags` package
25
+
1
26
  # [131.2.0](https://github.com/cozy/cozy-ui/compare/v131.1.0...v131.2.0) (2025-10-27)
2
27
 
3
28
 
@@ -0,0 +1 @@
1
+ <svg width="16" height="13" viewBox="0 0 16 13" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_13717_2258)"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4 1.62H8L6.4 0H1.6C.72 0 0 .73 0 1.62v9.75c0 .89.71 1.62 1.59 1.62h12.8c.88 0 1.6-.73 1.6-1.62V3.25c0-.89-.72-1.62-1.6-1.62l.01-.01ZM11.09 8.9c0 .93-.77 1.7-1.7 1.7H6c-.93 0-1.7-.77-1.7-1.7V5.51c0-.93.77-1.7 1.7-1.7h.77c.19 0 .31.12.31.31s-.12.31-.31.31H6c-.59 0-1.08.49-1.08 1.08V8.9c0 .59.49 1.08 1.08 1.08h3.39c.59 0 1.08-.49 1.08-1.08v-.46c0-.19.12-.31.31-.31s.31.12.31.31v.46Zm.52-2.71L9.76 8.04c-.09.09-.22.12-.34.06-.12-.03-.19-.15-.19-.28v-.93h-.62c-.83 0-1.54.52-1.79 1.33a.3.3 0 0 1-.28.22c-.13 0-.25-.09-.31-.22-.06-.22-.09-.46-.09-.71 0-1.36 1.11-2.47 2.47-2.47h.62v-.93c0-.12.06-.25.19-.28.12-.06.25-.03.34.06l1.85 1.85c.12.12.12.31 0 .43v.02Z" fill="#A6A6A6"/></g><defs><clipPath id="clip0_13717_2258"><path fill="#fff" d="M0 0h16v13H0z"/></clipPath></defs></svg>
@@ -0,0 +1 @@
1
+ <svg width="96" height="78" viewBox="0 0 96 78" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M48 9.75h38.4c5.28 0 9.6 4.386 9.6 9.75v48.75c0 5.364-4.32 9.75-9.6 9.75H9.6C4.32 78 0 73.614 0 68.25l.048-58.5C.048 4.386 4.32 0 9.6 0h28.8L48 9.75Z" fill="url(#paint0_linear_13714_2236)"/><path d="M56.673 62.55H39.176c-4.772 0-8.749-3.976-8.749-8.748V36.305c0-4.772 3.977-8.748 8.749-8.748h3.976c.955 0 1.591.636 1.591 1.59 0 .955-.636 1.59-1.59 1.59h-3.977c-3.022 0-5.567 2.546-5.567 5.568v17.497c0 3.022 2.545 5.567 5.567 5.567h17.497c3.022 0 5.567-2.545 5.567-5.567v-2.386c0-.955.636-1.59 1.59-1.59.955 0 1.591.635 1.591 1.59v2.386c0 4.772-3.977 8.748-8.748 8.748ZM42.039 51.416c-.636 0-1.273-.477-1.59-1.114-.319-1.113-.478-2.386-.478-3.658 0-6.999 5.726-12.725 12.725-12.725h3.181v-4.772c0-.636.319-1.272.955-1.431.636-.319 1.272-.16 1.75.318l9.543 9.543c.636.637.636 1.591 0 2.227l-9.544 9.544c-.477.477-1.113.636-1.75.318-.636-.159-.954-.795-.954-1.431v-4.772h-3.18c-4.296 0-7.954 2.704-9.227 6.84-.158.636-.795 1.113-1.431 1.113Z" fill="#8DBCFF"/><path d="M56.673 61.55H39.176c-4.772 0-8.749-3.976-8.749-8.748V35.305c0-4.772 3.977-8.748 8.749-8.748h3.976c.955 0 1.591.636 1.591 1.59 0 .955-.636 1.59-1.59 1.59h-3.977c-3.022 0-5.567 2.546-5.567 5.568v17.497c0 3.022 2.545 5.567 5.567 5.567h17.497c3.022 0 5.567-2.545 5.567-5.567v-2.386c0-.955.636-1.59 1.59-1.59.955 0 1.591.635 1.591 1.59v2.386c0 4.772-3.977 8.748-8.748 8.748ZM42.039 50.416c-.636 0-1.273-.477-1.59-1.114-.319-1.113-.478-2.386-.478-3.658 0-6.999 5.726-12.725 12.725-12.725h3.181v-4.772c0-.636.319-1.272.955-1.431.636-.319 1.272-.16 1.75.318l9.543 9.543c.636.637.636 1.591 0 2.227l-9.544 9.544c-.477.477-1.113.636-1.75.318-.636-.159-.954-.795-.954-1.431v-4.772h-3.18c-4.296 0-7.954 2.704-9.227 6.84-.158.636-.795 1.113-1.431 1.113Z" fill="url(#paint1_linear_13714_2236)"/><defs><linearGradient id="paint0_linear_13714_2236" x1="48" y1="0" x2="48" y2="94.5" gradientUnits="userSpaceOnUse"><stop offset=".044" stop-color="#1D7AFF"/><stop offset=".13" stop-color="#7CB2FF"/><stop offset=".617" stop-color="#76AFFF"/><stop offset="1" stop-color="#4290FF"/></linearGradient><linearGradient id="paint1_linear_13714_2236" x1="49.092" y1="11.943" x2="49.447" y2="68.954" gradientUnits="userSpaceOnUse"><stop stop-color="#76AFFF"/><stop offset=".781" stop-color="#1D7AFF"/></linearGradient></defs></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "131.2.0",
3
+ "version": "132.1.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -194,7 +194,6 @@
194
194
  "peerDependencies": {
195
195
  "cozy-client": ">=60.5.0",
196
196
  "cozy-device-helper": ">=2.0.0",
197
- "cozy-flags": ">=2.10.1",
198
197
  "cozy-intent": ">=2.29.1",
199
198
  "react": "^16 || ^17 || ^18",
200
199
  "react-dnd": "^16.0.1",
@@ -213,5 +212,6 @@
213
212
  },
214
213
  "browserslist": [
215
214
  "extends browserslist-config-cozy"
216
- ]
215
+ ],
216
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
217
217
  }
@@ -2,8 +2,6 @@ import cx from 'classnames'
2
2
  import PropTypes from 'prop-types'
3
3
  import React, { Component } from 'react'
4
4
 
5
- import flag from 'cozy-flags'
6
-
7
5
  import styles from './Sections.styl'
8
6
  import * as catUtils from './categories'
9
7
  import AppsSection from './components/AppsSection'
@@ -228,8 +226,7 @@ export class Sections extends Component {
228
226
  }
229
227
  }
230
228
 
231
- const SectionsWrapper = props => {
232
- const config = flag('store.alternative-source')
229
+ const SectionsWrapper = ({ config, ...props }) => {
233
230
  const i18nConfig = generateI18nConfig(config?.categories)
234
231
  useExtendI18n(i18nConfig)
235
232
 
@@ -246,6 +243,7 @@ Sections.propTypes = {
246
243
  apps: PropTypes.array.isRequired,
247
244
  error: PropTypes.object,
248
245
 
246
+ config: PropTypes.object,
249
247
  onAppClick: PropTypes.func.isRequired,
250
248
 
251
249
  /** Whether to display the category selector */
@@ -730,6 +730,8 @@ import FileTypeServerIcon from 'cozy-ui/transpiled/react/Icons/FileTypeServer'
730
730
  import FileTypeImageIcon from 'cozy-ui/transpiled/react/Icons/FileTypeImage'
731
731
  import FileTypeNoteIcon from 'cozy-ui/transpiled/react/Icons/FileTypeNote'
732
732
  import FileTypePdfIcon from 'cozy-ui/transpiled/react/Icons/FileTypePdf'
733
+ import FileTypeSharedDriveIcon from 'cozy-ui/transpiled/react/Icons/FileTypeSharedDrive'
734
+ import FileTypeSharedDriveGreyIcon from 'cozy-ui/transpiled/react/Icons/FileTypeSharedDriveGrey'
733
735
  import FileTypeSheetIcon from 'cozy-ui/transpiled/react/Icons/FileTypeSheet'
734
736
  import FileTypeSlideIcon from 'cozy-ui/transpiled/react/Icons/FileTypeSlide'
735
737
  import FileTypeTextIcon from 'cozy-ui/transpiled/react/Icons/FileTypeText'
@@ -782,6 +784,8 @@ const icons = [
782
784
  FileTypeImageIcon,
783
785
  FileTypeNoteIcon,
784
786
  FileTypePdfIcon,
787
+ FileTypeSharedDriveIcon,
788
+ FileTypeSharedDriveGreyIcon,
785
789
  FileTypeSheetIcon,
786
790
  FileTypeSlideIcon,
787
791
  FileTypeTextIcon,
@@ -801,7 +805,7 @@ const icons = [
801
805
  PhotosIcon,
802
806
  TopSelectIcon,
803
807
  TrashDuotoneIcon,
804
- TwakeWorkplace,
808
+ TwakeWorkplace
805
809
  ]
806
810
 
807
811
  initialState = { size: 16 }
@@ -1026,9 +1030,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
1026
1030
  import Grid from 'cozy-ui/transpiled/react/Grid'
1027
1031
  import Sprite from 'cozy-ui/transpiled/react/Icon/Sprite'
1028
1032
 
1029
- const availableIcons = ['account', 'bottom-select', 'check-white', 'cloud-broken', 'contacts', 'cozy-authentification', 'cozy-logo', 'cozy-upgrade', 'credit-card-large', 'dash-white', 'device-browser', 'device-laptop', 'device-phone', 'device-tablet', 'file-type-audio', 'file-type-banking-account' , 'file-type-bin', 'file-type-code', 'file-type-files', 'file-type-folder', 'file-type-server', 'file-type-image', 'file-type-note', 'file-type-pdf', 'file-type-sheet', 'file-type-slide', 'file-type-text', 'file-type-video', 'file-type-zip', 'forbidden-sign', 'google', 'keychain', 'logout-large', 'papers', 'only-office', 'store', 'top-select', 'trash-duotone', 'cozy']
1030
-
1031
- ;
1033
+ const availableIcons = ['account', 'bottom-select', 'check-white', 'cloud-broken', 'contacts', 'cozy-authentification', 'cozy-logo', 'cozy-upgrade', 'credit-card-large', 'dash-white', 'device-browser', 'device-laptop', 'device-phone', 'device-tablet', 'file-type-audio', 'file-type-banking-account' , 'file-type-bin', 'file-type-code', 'file-type-files', 'file-type-folder', 'file-type-server', 'file-type-shared-drive', 'file-type-shared-drive-grey', 'file-type-image', 'file-type-note', 'file-type-pdf', 'file-type-sheet', 'file-type-slide', 'file-type-text', 'file-type-video', 'file-type-zip', 'forbidden-sign', 'google', 'keychain', 'logout-large', 'papers', 'only-office', 'store', 'top-select', 'trash-duotone', 'cozy'];
1032
1034
 
1033
1035
  <Grid container spacing={2}>
1034
1036
  <Sprite />
@@ -0,0 +1,51 @@
1
+ // Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/file-type-shared-drive.svg` to regenerate;
2
+ import React from 'react'
3
+
4
+ function SvgFileTypeSharedDrive(props) {
5
+ return (
6
+ <svg viewBox="0 0 96 78" fill="none" {...props}>
7
+ <path
8
+ fillRule="evenodd"
9
+ clipRule="evenodd"
10
+ d="M48 9.75h38.4c5.28 0 9.6 4.386 9.6 9.75v48.75c0 5.364-4.32 9.75-9.6 9.75H9.6C4.32 78 0 73.614 0 68.25l.048-58.5C.048 4.386 4.32 0 9.6 0h28.8L48 9.75z"
11
+ fill="url(#file-type-shared-drive_svg__paint0_linear_13714_2236)"
12
+ />
13
+ <path
14
+ d="M56.673 62.55H39.176c-4.772 0-8.749-3.976-8.749-8.748V36.305c0-4.772 3.977-8.748 8.749-8.748h3.976c.955 0 1.591.636 1.591 1.59 0 .955-.636 1.59-1.59 1.59h-3.977c-3.022 0-5.567 2.546-5.567 5.568v17.497c0 3.022 2.545 5.567 5.567 5.567h17.497c3.022 0 5.567-2.545 5.567-5.567v-2.386c0-.955.636-1.59 1.59-1.59.955 0 1.591.635 1.591 1.59v2.386c0 4.772-3.977 8.748-8.748 8.748zM42.039 51.416c-.636 0-1.273-.477-1.59-1.114-.319-1.113-.478-2.386-.478-3.658 0-6.999 5.726-12.725 12.725-12.725h3.181v-4.772c0-.636.319-1.272.955-1.431.636-.319 1.272-.16 1.75.318l9.543 9.543c.636.637.636 1.591 0 2.227l-9.544 9.544c-.477.477-1.113.636-1.75.318-.636-.159-.954-.795-.954-1.431v-4.772h-3.18c-4.296 0-7.954 2.704-9.227 6.84-.158.636-.795 1.113-1.431 1.113z"
15
+ fill="#8DBCFF"
16
+ />
17
+ <path
18
+ d="M56.673 61.55H39.176c-4.772 0-8.749-3.976-8.749-8.748V35.305c0-4.772 3.977-8.748 8.749-8.748h3.976c.955 0 1.591.636 1.591 1.59 0 .955-.636 1.59-1.59 1.59h-3.977c-3.022 0-5.567 2.546-5.567 5.568v17.497c0 3.022 2.545 5.567 5.567 5.567h17.497c3.022 0 5.567-2.545 5.567-5.567v-2.386c0-.955.636-1.59 1.59-1.59.955 0 1.591.635 1.591 1.59v2.386c0 4.772-3.977 8.748-8.748 8.748zM42.039 50.416c-.636 0-1.273-.477-1.59-1.114-.319-1.113-.478-2.386-.478-3.658 0-6.999 5.726-12.725 12.725-12.725h3.181v-4.772c0-.636.319-1.272.955-1.431.636-.319 1.272-.16 1.75.318l9.543 9.543c.636.637.636 1.591 0 2.227l-9.544 9.544c-.477.477-1.113.636-1.75.318-.636-.159-.954-.795-.954-1.431v-4.772h-3.18c-4.296 0-7.954 2.704-9.227 6.84-.158.636-.795 1.113-1.431 1.113z"
19
+ fill="url(#file-type-shared-drive_svg__paint1_linear_13714_2236)"
20
+ />
21
+ <defs>
22
+ <linearGradient
23
+ id="file-type-shared-drive_svg__paint0_linear_13714_2236"
24
+ x1={48}
25
+ y1={0}
26
+ x2={48}
27
+ y2={94.5}
28
+ gradientUnits="userSpaceOnUse"
29
+ >
30
+ <stop offset={0.044} stopColor="#1D7AFF" />
31
+ <stop offset={0.13} stopColor="#7CB2FF" />
32
+ <stop offset={0.617} stopColor="#76AFFF" />
33
+ <stop offset={1} stopColor="#4290FF" />
34
+ </linearGradient>
35
+ <linearGradient
36
+ id="file-type-shared-drive_svg__paint1_linear_13714_2236"
37
+ x1={49.092}
38
+ y1={11.943}
39
+ x2={49.447}
40
+ y2={68.954}
41
+ gradientUnits="userSpaceOnUse"
42
+ >
43
+ <stop stopColor="#76AFFF" />
44
+ <stop offset={0.781} stopColor="#1D7AFF" />
45
+ </linearGradient>
46
+ </defs>
47
+ </svg>
48
+ )
49
+ }
50
+
51
+ export default SvgFileTypeSharedDrive
@@ -0,0 +1,24 @@
1
+ // Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/file-type-shared-drive-grey.svg` to regenerate;
2
+ import React from 'react'
3
+
4
+ function SvgFileTypeSharedDriveGrey(props) {
5
+ return (
6
+ <svg viewBox="0 0 16 13" fill="none" {...props}>
7
+ <g clipPath="url(#file-type-shared-drive-grey_svg__clip0_13717_2258)">
8
+ <path
9
+ fillRule="evenodd"
10
+ clipRule="evenodd"
11
+ d="M14.4 1.62H8L6.4 0H1.6C.72 0 0 .73 0 1.62v9.75c0 .89.71 1.62 1.59 1.62h12.8c.88 0 1.6-.73 1.6-1.62V3.25c0-.89-.72-1.62-1.6-1.62l.01-.01zM11.09 8.9c0 .93-.77 1.7-1.7 1.7H6c-.93 0-1.7-.77-1.7-1.7V5.51c0-.93.77-1.7 1.7-1.7h.77c.19 0 .31.12.31.31s-.12.31-.31.31H6c-.59 0-1.08.49-1.08 1.08V8.9c0 .59.49 1.08 1.08 1.08h3.39c.59 0 1.08-.49 1.08-1.08v-.46c0-.19.12-.31.31-.31s.31.12.31.31v.46zm.52-2.71L9.76 8.04c-.09.09-.22.12-.34.06-.12-.03-.19-.15-.19-.28v-.93h-.62c-.83 0-1.54.52-1.79 1.33a.3.3 0 01-.28.22c-.13 0-.25-.09-.31-.22-.06-.22-.09-.46-.09-.71 0-1.36 1.11-2.47 2.47-2.47h.62v-.93c0-.12.06-.25.19-.28.12-.06.25-.03.34.06l1.85 1.85c.12.12.12.31 0 .43v.02z"
12
+ fill="#A6A6A6"
13
+ />
14
+ </g>
15
+ <defs>
16
+ <clipPath id="file-type-shared-drive-grey_svg__clip0_13717_2258">
17
+ <path fill="#fff" d="M0 0h16v13H0z" />
18
+ </clipPath>
19
+ </defs>
20
+ </svg>
21
+ )
22
+ }
23
+
24
+ export default SvgFileTypeSharedDriveGrey
@@ -4,7 +4,6 @@ import React, { useEffect, useState } from 'react'
4
4
  import { useInstanceInfo } from 'cozy-client'
5
5
  import { buildPremiumLink } from 'cozy-client/dist/models/instance'
6
6
  import { isFlagshipApp } from 'cozy-device-helper'
7
- import flag from 'cozy-flags'
8
7
  import { useWebviewIntent } from 'cozy-intent'
9
8
 
10
9
  import { makeType } from './helpers'
@@ -21,7 +20,13 @@ import { useI18n } from '../providers/I18n'
21
20
  /**
22
21
  * Component with the core logic of the paywall, which is then declined in several variants to adapt to the user case
23
22
  */
24
- const Paywall = ({ variant, onClose, isPublic, contentInterpolation }) => {
23
+ const Paywall = ({
24
+ variant,
25
+ onClose,
26
+ isPublic,
27
+ isIapEnabled,
28
+ contentInterpolation
29
+ }) => {
25
30
  const instanceInfo = useInstanceInfo()
26
31
  const { t } = useI18n()
27
32
 
@@ -54,9 +59,7 @@ const Paywall = ({ variant, onClose, isPublic, contentInterpolation }) => {
54
59
 
55
60
  const canOpenPremiumLink =
56
61
  !isFlagshipApp() ||
57
- (isFlagshipApp() &&
58
- !!flag('flagship.iap.enabled') &&
59
- isFlagshipAppIapAvailable)
62
+ (isFlagshipApp() && isIapEnabled && isFlagshipAppIapAvailable)
60
63
 
61
64
  const link = buildPremiumLink(instanceInfo)
62
65
  const type = makeType(instanceInfo, isPublic, link)
@@ -112,12 +115,15 @@ Paywall.propTypes = {
112
115
  onClose: PropTypes.func.isRequired,
113
116
  /** Whether paywall is display in a public context */
114
117
  isPublic: PropTypes.bool,
118
+ /** Whether the IAP is enabled */
119
+ isIapEnabled: PropTypes.bool,
115
120
  /** Translation interpolation for the content of the paywall */
116
121
  contentInterpolation: PropTypes.object
117
122
  }
118
123
 
119
124
  Paywall.defaultProps = {
120
125
  isPublic: false,
126
+ isIapEnabled: false,
121
127
  contentInterpolation: {}
122
128
  }
123
129
 
@@ -3,7 +3,6 @@ import React from 'react'
3
3
 
4
4
  import { createMockClient, useInstanceInfo } from 'cozy-client'
5
5
  import { isFlagshipApp } from 'cozy-device-helper'
6
- import flag from 'cozy-flags'
7
6
  import { useWebviewIntent } from 'cozy-intent'
8
7
 
9
8
  import Paywall from './Paywall'
@@ -21,7 +20,6 @@ jest.mock('cozy-intent', () => ({
21
20
  ...jest.requireActual('cozy-intent'),
22
21
  useWebviewIntent: jest.fn()
23
22
  }))
24
- jest.mock('cozy-flags')
25
23
 
26
24
  describe('Paywall', () => {
27
25
  const onCloseSpy = jest.fn()
@@ -36,7 +34,7 @@ describe('Paywall', () => {
36
34
  enablePremiumLinks = false,
37
35
  hasUuid = false,
38
36
  isFlagshipApp: isFlagshipAppReturnValue = false,
39
- isIapEnabled = null,
37
+ isIapEnabled = false,
40
38
  isIapAvailable = false
41
39
  } = {}) => {
42
40
  useInstanceInfo.mockReturnValue({
@@ -55,7 +53,6 @@ describe('Paywall', () => {
55
53
  })
56
54
 
57
55
  isFlagshipApp.mockReturnValue(isFlagshipAppReturnValue)
58
- flag.mockReturnValue(isIapEnabled)
59
56
  const mockCall = jest.fn().mockResolvedValue(isIapAvailable)
60
57
  useWebviewIntent.mockReturnValue({
61
58
  call: mockCall
@@ -68,6 +65,7 @@ describe('Paywall', () => {
68
65
  variant="onlyOffice"
69
66
  onClose={onCloseSpy}
70
67
  isPublic={isPublic}
68
+ isIapEnabled={isIapEnabled}
71
69
  />
72
70
  </DemoProvider>
73
71
  )
@@ -31,6 +31,7 @@ import Button from 'cozy-ui/transpiled/react/Buttons'
31
31
  const initialVariants = [
32
32
  {
33
33
  isPublic: false,
34
+ isIapEnabled: false,
34
35
  premiumLink: false
35
36
  }
36
37
  ]
@@ -124,6 +125,7 @@ const makeClient = premiumLink => ({
124
125
  {state.modalOpened && (
125
126
  <PaywallComponent
126
127
  isPublic={variant.isPublic}
128
+ isIapEnabled={variant.isIapEnabled}
127
129
  max={4}
128
130
  days={30}
129
131
  konnectorName="EDF"
@@ -3,7 +3,7 @@ import DemoProvider from 'cozy-ui/docs/components/DemoProvider'
3
3
  import QualificationGrid from 'cozy-ui/transpiled/react/QualificationGrid'
4
4
  import Variants from 'cozy-ui/docs/components/Variants'
5
5
 
6
- const initialVariants = [{ noUndefined: false, noOthers: false }]
6
+ const initialVariants = [{ noUndefined: false, noOthers: false, noHealth: false }]
7
7
  initialState = { selectedQualification: undefined }
8
8
 
9
9
  ;
@@ -16,6 +16,7 @@ initialState = { selectedQualification: undefined }
16
16
  <QualificationGrid
17
17
  noUndefined={variant.noUndefined}
18
18
  noOthers={variant.noOthers}
19
+ noHealth={variant.noHealth}
19
20
  onClick={qualification => setState({ selectedQualification: qualification })}
20
21
  />
21
22
  </>
@@ -1,7 +1,4 @@
1
1
  import { themesList } from 'cozy-client/dist/models/document/documentTypeData'
2
- import flag from 'cozy-flags'
3
2
 
4
- export const getThemesList = () =>
5
- flag('hide.healthTheme.enabled')
6
- ? themesList.filter(theme => theme.label !== 'health')
7
- : themesList
3
+ export const getThemesList = noHealth =>
4
+ noHealth ? themesList.filter(theme => theme.label !== 'health') : themesList
@@ -10,10 +10,10 @@ import CarIcon from '../Icons/Car'
10
10
  import ChessIcon from '../Icons/Chess'
11
11
  import DotsIcon from '../Icons/Dots'
12
12
  import HeartIcon from '../Icons/Heart'
13
+ import HomeIcon from '../Icons/Home'
13
14
  import PeopleIcon from '../Icons/People'
14
15
  import TeamIcon from '../Icons/Team'
15
16
  import WorkIcon from '../Icons/Work'
16
- import HomeIcon from '../Icons/Home'
17
17
  import QualificationItem from '../QualificationItem'
18
18
  import { useI18n } from '../providers/I18n'
19
19
 
@@ -30,8 +30,8 @@ const IconByName = {
30
30
  dots: DotsIcon
31
31
  }
32
32
 
33
- const QualificationGrid = ({ noUndefined, noOthers, onClick }) => {
34
- const themesList = getThemesList()
33
+ const QualificationGrid = ({ noUndefined, noOthers, noHealth, onClick }) => {
34
+ const themesList = getThemesList(noHealth)
35
35
  const { t } = useI18n()
36
36
  const [selectedQualification, setSelectedQualification] = useState()
37
37
 
@@ -72,6 +72,7 @@ const QualificationGrid = ({ noUndefined, noOthers, onClick }) => {
72
72
  QualificationGrid.defaultProps = {
73
73
  noUndefined: false,
74
74
  noOthers: false,
75
+ noHealth: false,
75
76
  onClick: () => {}
76
77
  }
77
78
 
@@ -80,6 +81,8 @@ QualificationGrid.propTypes = {
80
81
  noUndefined: PropTypes.bool,
81
82
  /** Remove `others` theme */
82
83
  noOthers: PropTypes.bool,
84
+ /** Remove `health` theme */
85
+ noHealth: PropTypes.bool,
83
86
  /** Triggered when an item is clicked */
84
87
  onClick: PropTypes.func
85
88
  }
@@ -19,6 +19,7 @@ export namespace Sections {
19
19
  const t: PropTypes.Validator<(...args: any[]) => any>;
20
20
  const apps: PropTypes.Validator<any[]>;
21
21
  const error: PropTypes.Requireable<object>;
22
+ const config: PropTypes.Requireable<object>;
22
23
  const onAppClick: PropTypes.Validator<(...args: any[]) => any>;
23
24
  const hasNav: PropTypes.Requireable<boolean>;
24
25
  const initialSearch: PropTypes.Requireable<object>;
@@ -1,3 +1,4 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
4
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -5,6 +6,7 @@ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized
5
6
  import _inherits from "@babel/runtime/helpers/inherits";
6
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
+ var _excluded = ["config"];
8
10
 
9
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
12
 
@@ -13,7 +15,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
13
15
  import cx from 'classnames';
14
16
  import PropTypes from 'prop-types';
15
17
  import React, { Component } from 'react';
16
- import flag from 'cozy-flags';
17
18
  var styles = {
18
19
  "Sections__section": "Sections__Sections__section___2onYy"
19
20
  };
@@ -362,8 +363,10 @@ export var Sections = /*#__PURE__*/function (_Component) {
362
363
  return Sections;
363
364
  }(Component);
364
365
 
365
- var SectionsWrapper = function SectionsWrapper(props) {
366
- var config = flag('store.alternative-source');
366
+ var SectionsWrapper = function SectionsWrapper(_ref5) {
367
+ var config = _ref5.config,
368
+ props = _objectWithoutProperties(_ref5, _excluded);
369
+
367
370
  var i18nConfig = generateI18nConfig(config === null || config === void 0 ? void 0 : config.categories);
368
371
  useExtendI18n(i18nConfig);
369
372
 
@@ -383,6 +386,7 @@ Sections.propTypes = {
383
386
  /** List of apps that will be displayed into categories */
384
387
  apps: PropTypes.array.isRequired,
385
388
  error: PropTypes.object,
389
+ config: PropTypes.object,
386
390
  onAppClick: PropTypes.func.isRequired,
387
391
 
388
392
  /** Whether to display the category selector */