cozy-ui 111.14.0 → 111.15.1

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,17 @@
1
+ ## [111.15.1](https://github.com/cozy/cozy-ui/compare/v111.15.0...v111.15.1) (2024-10-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Show additional apps only when there ones ([64c6c5e](https://github.com/cozy/cozy-ui/commit/64c6c5e))
7
+
8
+ # [111.15.0](https://github.com/cozy/cozy-ui/compare/v111.14.0...v111.15.0) (2024-10-09)
9
+
10
+
11
+ ### Features
12
+
13
+ * **Icon:** Add `stop` ([f975a5d](https://github.com/cozy/cozy-ui/commit/f975a5d))
14
+
1
15
  # [111.14.0](https://github.com/cozy/cozy-ui/compare/v111.13.0...v111.14.0) (2024-10-03)
2
16
 
3
17
 
@@ -0,0 +1 @@
1
+ <svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="M.75 1.5A.75.75 0 0 1 1.5.75h9a.75.75 0 0 1 .75.75v9a.75.75 0 0 1-.75.75h-9a.75.75 0 0 1-.75-.75v-9Z"/></svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "111.14.0",
3
+ "version": "111.15.1",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -1075,11 +1075,6 @@ exports[`AppsSection component should render dropdown filter on mobile if no nav
1075
1075
  "type": "webapp",
1076
1076
  "value": "partners",
1077
1077
  },
1078
- Object {
1079
- "label": "Additional apps",
1080
- "secondary": false,
1081
- "value": "shortcuts",
1082
- },
1083
1078
  Object {
1084
1079
  "label": "Services",
1085
1080
  "secondary": false,
@@ -1481,11 +1476,6 @@ exports[`AppsSection component should render dropdown filter on tablet if no nav
1481
1476
  "type": "webapp",
1482
1477
  "value": "partners",
1483
1478
  },
1484
- Object {
1485
- "label": "Additional apps",
1486
- "secondary": false,
1487
- "value": "shortcuts",
1488
- },
1489
1479
  Object {
1490
1480
  "label": "Services",
1491
1481
  "secondary": false,
@@ -109,7 +109,9 @@ export const generateOptionsFromApps = (apps, options = {}) => {
109
109
  })
110
110
  )
111
111
  }
112
- if (type === APP_TYPE.FILE) {
112
+
113
+ const categories = Object.keys(catApps)
114
+ if (type === APP_TYPE.FILE && categories.length > 0) {
113
115
  allCategoryOptions.push(
114
116
  addLabel({
115
117
  value: 'shortcuts',
@@ -117,7 +119,8 @@ export const generateOptionsFromApps = (apps, options = {}) => {
117
119
  })
118
120
  )
119
121
  }
120
- const categoryOptions = Object.keys(catApps).map(cat => {
122
+
123
+ const categoryOptions = categories.map(cat => {
121
124
  return addLabel({
122
125
  value: cat,
123
126
  type: type,
@@ -10,7 +10,14 @@ import { I18nContext } from '../jestLib/I18n'
10
10
  import mockApps from '../mocks/apps'
11
11
 
12
12
  const i18nContext = I18nContext({
13
- locale: en
13
+ locale: {
14
+ ...en,
15
+ app_categories: {
16
+ ...en.app_categories,
17
+ foo: 'Foo',
18
+ bar: 'Bar'
19
+ }
20
+ }
14
21
  })
15
22
  const tMock = i18nContext.t
16
23
 
@@ -104,7 +111,6 @@ describe('generateOptionsFromApps', () => {
104
111
  type: 'webapp',
105
112
  value: 'others'
106
113
  },
107
- { label: 'Additional apps', secondary: false, value: 'shortcuts' },
108
114
  {
109
115
  label: 'Services',
110
116
  secondary: false,
@@ -157,11 +163,6 @@ describe('generateOptionsFromApps', () => {
157
163
  type: 'webapp',
158
164
  value: 'others'
159
165
  },
160
- {
161
- label: 'Additional apps',
162
- secondary: false,
163
- value: 'shortcuts'
164
- },
165
166
  {
166
167
  label: 'Services',
167
168
  secondary: false,
@@ -199,4 +200,90 @@ describe('generateOptionsFromApps', () => {
199
200
  catUtils.generateOptionsFromApps(null, { includeAll: false, addLabel })
200
201
  ).toEqual([])
201
202
  })
203
+
204
+ it('should return additional apps categories when there more than one', () => {
205
+ const appsWithAdditionlOnes = [
206
+ ...mockApps,
207
+ {
208
+ _id: 'shortcutA',
209
+ name: 'Shortcut A',
210
+ categories: ['foo'],
211
+ type: 'file',
212
+ _type: 'io.cozy.files'
213
+ },
214
+ {
215
+ _id: 'shortcutB',
216
+ name: 'Shortcut B',
217
+ categories: ['bar'],
218
+ type: 'file',
219
+ _type: 'io.cozy.files'
220
+ }
221
+ ]
222
+
223
+ expect(
224
+ catUtils.generateOptionsFromApps(appsWithAdditionlOnes, {
225
+ includeAll: false,
226
+ addLabel
227
+ })
228
+ ).toEqual([
229
+ {
230
+ label: 'The essentials',
231
+ secondary: false,
232
+ type: 'webapp',
233
+ value: 'cozy'
234
+ },
235
+ {
236
+ label: 'Partners',
237
+ secondary: false,
238
+ type: 'webapp',
239
+ value: 'partners'
240
+ },
241
+ {
242
+ label: 'Others',
243
+ secondary: false,
244
+ type: 'webapp',
245
+ value: 'others'
246
+ },
247
+ {
248
+ label: 'Additional apps',
249
+ secondary: false,
250
+ value: 'shortcuts'
251
+ },
252
+ {
253
+ label: 'Bar',
254
+ secondary: true,
255
+ type: 'file',
256
+ value: 'bar'
257
+ },
258
+ {
259
+ label: 'Foo',
260
+ secondary: true,
261
+ type: 'file',
262
+ value: 'foo'
263
+ },
264
+ {
265
+ label: 'Services',
266
+ secondary: false,
267
+ value: 'konnectors'
268
+ },
269
+ {
270
+ label: 'Mobile and Internet',
271
+ secondary: true,
272
+ type: 'konnector',
273
+ value: 'isp'
274
+ },
275
+ {
276
+ label: 'Telecom',
277
+ secondary: true,
278
+ type: 'konnector',
279
+ value: 'telecom'
280
+ },
281
+ {
282
+ label: 'Transportation',
283
+ secondary: true,
284
+ type: 'konnector',
285
+ value: 'transport'
286
+ }
287
+ ])
288
+ })
202
289
  })
@@ -288,6 +288,7 @@ import Stack from 'cozy-ui/transpiled/react/Icons/Stack'
288
288
  import Star from 'cozy-ui/transpiled/react/Icons/Star'
289
289
  import StarOutline from 'cozy-ui/transpiled/react/Icons/StarOutline'
290
290
  import Stats from 'cozy-ui/transpiled/react/Icons/Stats'
291
+ import Stop from 'cozy-ui/transpiled/react/Icons/Stop'
291
292
  import Subway from 'cozy-ui/transpiled/react/Icons/Subway'
292
293
  import Support from 'cozy-ui/transpiled/react/Icons/Support'
293
294
  import Swap from 'cozy-ui/transpiled/react/Icons/Swap'
@@ -550,6 +551,7 @@ const icons = [
550
551
  Star,
551
552
  StarOutline,
552
553
  Stats,
554
+ Stop,
553
555
  Subway,
554
556
  Support,
555
557
  Swap,
@@ -923,7 +925,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
923
925
 
924
926
  const colors = ['#297EF2', '#08b442', '#B449E7', '#F52D2D', '#FF962F']
925
927
  let i = 0
926
- const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp','attachment','attention','bank-check','bank','banking-add','banking','bell','benefit','bike','bill','bottom','browser-brave','browser-chrome','browser-duckduckgo','browser-edge','browser-edge-chromium','browser-firefox','browser-ie','browser-opera','browser-safari','burger','bus','calendar','camera','car','carbonCopy','carpooling','categories','certified','check-circle','check-list','check-square','check','checkbox','chess','child','circle-filled','clock','clock-outline','cloud-happy','cloud','collect','cocktail','comment','company','compare','compass','connector','contract','contrast','copy','cozy-circle','cozy-laugh', 'cozy-lock', 'cozy-text', 'cozy-release', 'credit-card-add','credit-card','credit','crop','cross-circle-outline','cross-circle','cross-medium','cross-small','cross','cube','dash','dashboard','data-control','debit','devices','dots','down','download','drawing-arrow-up','dropdown-close','dropdown-open','dropdown','dropup','electric-bike','electric-car','electric-scooter','email-notification','email','eu','euro','exchange','eye-closed','eye','face-id','file-add','file-duotone','file-new','file-none','file-outline','file','filter','fingerprint','fitness','flag-outlined','flag','flash-auto','flashlight','folder-add','folder-moveto','folder','forbidden','from-user','gear','globe','gouv','graph-circle','grid','group-list','groups','growth','hand','heart','help','help-outlined','history','home','hourglass','image','info-outlined','info','justice','key','label-outlined','laudry','laptop','left','library','lightbulb','lightning','link-out','link','list','list-min','location','lock', 'lock-screen', 'logout','magic-trick','magnet','magnifier','merge','moped','mosaic-min','motorcycle','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','offline','online', 'openapp', 'openwith','palette','paper','paperplane','password','pen','people','percent-circle','percent','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','plus-small','plus', 'pop-inside', 'previous','printer','qualify','radio-checked','radio-unchecked','refresh','relationship','remboursement','rename','repare','reply','restaurant','restore-straight','restore','right','rise','rotate-left','rotate-right','sad-cozy','safe','school','scooter','select-all','setting','share-circle','share','shield','shop','sound','spinner','sport-bag','stack','star','star-outline','stats','subway', 'support', 'swap', 'sync-cozy','sync','tag','target','task','team','telecom','telephone','text-info','to-the-cloud','top','train','tram','trash','trophy', 'uncloud', 'unknow','unlink','unlock','up','upload','videos','walk','wallet-add','wallet-new','wallet','warn','warning-circle','warning','water','wrench-circle','work']
928
+ const availableIcons = ['album-add','album-remove','album','answer','apple','archive','arrowUp','attachment','attention','bank-check','bank','banking-add','banking','bell','benefit','bike','bill','bottom','browser-brave','browser-chrome','browser-duckduckgo','browser-edge','browser-edge-chromium','browser-firefox','browser-ie','browser-opera','browser-safari','burger','bus','calendar','camera','car','carbonCopy','carpooling','categories','certified','check-circle','check-list','check-square','check','checkbox','chess','child','circle-filled','clock','clock-outline','cloud-happy','cloud','collect','cocktail','comment','company','compare','compass','connector','contract','contrast','copy','cozy-circle','cozy-laugh', 'cozy-lock', 'cozy-text', 'cozy-release', 'credit-card-add','credit-card','credit','crop','cross-circle-outline','cross-circle','cross-medium','cross-small','cross','cube','dash','dashboard','data-control','debit','devices','dots','down','download','drawing-arrow-up','dropdown-close','dropdown-open','dropdown','dropup','electric-bike','electric-car','electric-scooter','email-notification','email','eu','euro','exchange','eye-closed','eye','face-id','file-add','file-duotone','file-new','file-none','file-outline','file','filter','fingerprint','fitness','flag-outlined','flag','flash-auto','flashlight','folder-add','folder-moveto','folder','forbidden','from-user','gear','globe','gouv','graph-circle','grid','group-list','groups','growth','hand','heart','help','help-outlined','history','home','hourglass','image','info-outlined','info','justice','key','label-outlined','laudry','laptop','left','library','lightbulb','lightning','link-out','link','list','list-min','location','lock', 'lock-screen', 'logout','magic-trick','magnet','magnifier','merge','moped','mosaic-min','motorcycle','mountain','movement-in','movement-out','mouvement','moveto','multi-files','music','new','next','note','notification-email','offline','online', 'openapp', 'openwith','palette','paper','paperplane','password','pen','people','percent-circle','percent','personal-data','phone-download','phone-upload','phone','pie-chart','pin','plane','plus-small','plus', 'pop-inside', 'previous','printer','qualify','radio-checked','radio-unchecked','refresh','relationship','remboursement','rename','repare','reply','restaurant','restore-straight','restore','right','rise','rotate-left','rotate-right','sad-cozy','safe','school','scooter','select-all','setting','share-circle','share','shield','shop','sound','spinner','sport-bag','stack','star','star-outline','stats','stop', 'subway', 'support', 'swap', 'sync-cozy','sync','tag','target','task','team','telecom','telephone','text-info','to-the-cloud','top','train','tram','trash','trophy', 'uncloud', 'unknow','unlink','unlock','up','upload','videos','walk','wallet-add','wallet-new','wallet','warn','warning-circle','warning','water','wrench-circle','work']
927
929
  ;
928
930
  <div style={{ fontSize: '2rem', display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)' }}>
929
931
  <Sprite />
@@ -0,0 +1,12 @@
1
+ // Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/stop.svg` to regenerate;
2
+ import React from 'react'
3
+
4
+ function SvgStop(props) {
5
+ return (
6
+ <svg viewBox="0 0 12 12" {...props}>
7
+ <path d="M.75 1.5A.75.75 0 011.5.75h9a.75.75 0 01.75.75v9a.75.75 0 01-.75.75h-9a.75.75 0 01-.75-.75v-9z" />
8
+ </svg>
9
+ )
10
+ }
11
+
12
+ export default SvgStop
@@ -141,14 +141,16 @@ export var generateOptionsFromApps = function generateOptionsFromApps(apps) {
141
141
  }));
142
142
  }
143
143
 
144
- if (type === APP_TYPE.FILE) {
144
+ var categories = Object.keys(catApps);
145
+
146
+ if (type === APP_TYPE.FILE && categories.length > 0) {
145
147
  allCategoryOptions.push(addLabel({
146
148
  value: 'shortcuts',
147
149
  secondary: false
148
150
  }));
149
151
  }
150
152
 
151
- var categoryOptions = Object.keys(catApps).map(function (cat) {
153
+ var categoryOptions = categories.map(function (cat) {
152
154
  return addLabel({
153
155
  value: cat,
154
156
  type: type,