Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"babel-plugin-module-resolver": "^4.0.0",
"babel-plugin-transform-define": "^2.0.0",
"babel-preset-cozy-app": "^2.8.1",
"cozy-client": "^60.12.1",
"cozy-client": "^60.14.0",
"cozy-dataproxy-lib": "^4.1.0",
"cozy-device-helper": "2.6.0",
"cozy-flags": "^4.6.1",
Expand Down Expand Up @@ -76,7 +76,7 @@
},
"peerDependencies": {
"@cozy/minilog": ">=1.0.0",
"cozy-client": ">=60.12.1",
"cozy-client": ">=60.14.0",
"cozy-dataproxy-lib": ">=4.1.0",
"cozy-device-helper": ">=2.6.0",
"cozy-flags": ">=4.6.1",
Expand Down
4 changes: 2 additions & 2 deletions src/components/AppsMenu/AppsMenuContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import AppItemPlaceholder from 'components/AppsMenu/components/AppItemPlaceholde
import useI18n from 'components/useI18n'
import { getApps, getHomeApp, isFetchingApps } from 'lib/reducers'
import styles from 'styles/apps-menu.styl'
import { buildEntrypoints } from 'components/AppsMenu/helper'
import { getEntrypoints } from 'components/AppsMenu/helper'

const AppsMenuContent = ({
isFetchingApps,
Expand Down Expand Up @@ -50,7 +50,7 @@ const AppsMenuContent = ({
? sortApplicationsList(displayedApps, flag('apps.sort'))
: displayedApps

const entrypoints = buildEntrypoints(apps)
const entrypoints = getEntrypoints(apps)

return (
<div className={styles['apps-menu-grid']}>
Expand Down
33 changes: 24 additions & 9 deletions src/components/AppsMenu/helper.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
export const buildEntrypoints = apps => {
return apps.flatMap(app => {
if (!app.entrypoints) return []

return app.entrypoints.map(entrypoint => ({
...entrypoint,
slug: app.slug
}))
})
import { models } from 'cozy-client'

const {
applications: { selectEntrypoints, filterEntrypoints }
} = models

// We get only the entrypoints we want:
// - Drive onlyoffice
export const getEntrypoints = apps => {
const driveApp = apps.find(app => app.slug === 'drive') || {}

const driveEntrypoints = driveApp.entrypoints || []

const selectedEntrypoints = selectEntrypoints(driveEntrypoints, [
'new-file-type-text',
'new-file-type-sheet',
'new-file-type-slide'
])
const filteredEntrypoints = filterEntrypoints(selectedEntrypoints)

return filteredEntrypoints.map(entrypoint => ({
...entrypoint,
slug: driveApp.slug
}))
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3388,10 +3388,10 @@ cosmiconfig@^5.0.1:
js-yaml "^3.13.1"
parse-json "^4.0.0"

cozy-client@^60.12.1:
version "60.12.1"
resolved "https://registry.yarnpkg.com/cozy-client/-/cozy-client-60.12.1.tgz#30bbd442ed1493fa7d1b8ccf279bc937da34b4e8"
integrity sha512-2lS+cwcfZU7ZmcwvWjQ+4K6HG6pyW+hSbIDJyI+PRt9XJicZaQjVqHgNgczrSMVRK5XDI6hQWRxcQhiSv0auKA==
cozy-client@^60.14.0:
version "60.14.0"
resolved "https://registry.yarnpkg.com/cozy-client/-/cozy-client-60.14.0.tgz#0befadcbed6956c68460785bdc6734e4ab9968ff"
integrity sha512-fn/ymAm1W0NqtV+YQt0/k/huRVyslacgfx/TVfU1vjRUNyOvxui9jRgWuxAWENj4+PSrmhvM6OzCSylDDHvtaw==
dependencies:
"@cozy/minilog" "1.0.0"
"@fastify/deepmerge" "^2.0.2"
Expand Down
Loading