cozy-ui 113.2.0 → 113.4.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 +15 -0
- package/assets/icons/ui/folder-open.svg +1 -0
- package/package.json +1 -1
- package/react/ActionsMenu/Actions/index.js +1 -0
- package/react/ActionsMenu/Actions/locales/en.json +1 -0
- package/react/ActionsMenu/Actions/locales/fr.json +1 -0
- package/react/ActionsMenu/Actions/viewInDrive.js +52 -0
- package/react/ActionsMenu/Readme.md +2 -2
- package/react/Icon/Readme.md +3 -1
- package/react/Icons/FolderOpen.jsx +12 -0
- package/react/SquareAppIcon/Readme.md +53 -13
- package/react/SquareAppIcon/index.jsx +5 -2
- package/transpiled/react/ActionsMenu/Actions/index.js +1 -0
- package/transpiled/react/ActionsMenu/Actions/locales/withActionsLocales.js +2 -0
- package/transpiled/react/ActionsMenu/Actions/viewInDrive.js +49 -0
- package/transpiled/react/Icon/icons-sprite.js +1 -1
- package/transpiled/react/Icons/FolderOpen.js +13 -0
- package/transpiled/react/SquareAppIcon/index.js +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# [113.4.0](https://github.com/cozy/cozy-ui/compare/v113.3.0...v113.4.0) (2024-11-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **Actions:** Add viewInDrive ([36bd091](https://github.com/cozy/cozy-ui/commit/36bd091))
|
|
7
|
+
* **Icon:** Add folderOpen ([6d72a55](https://github.com/cozy/cozy-ui/commit/6d72a55))
|
|
8
|
+
|
|
9
|
+
# [113.3.0](https://github.com/cozy/cozy-ui/compare/v113.2.0...v113.3.0) (2024-11-18)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **SquareAppIcon:** Hide shortcut badges for a more app like feel ([49d8438](https://github.com/cozy/cozy-ui/commit/49d8438))
|
|
15
|
+
|
|
1
16
|
# [113.2.0](https://github.com/cozy/cozy-ui/compare/v113.1.0...v113.2.0) (2024-11-14)
|
|
2
17
|
|
|
3
18
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M0 13V3a2 2 0 0 1 2-2h3.172a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 8.828 3H12a2 2 0 0 1 2 2H3.5a.5.5 0 0 0-.474.342l-2 6a.5.5 0 1 0 .948.316L3.86 6h11.142a1 1 0 0 1 .952 1.304l-2.01 6.304A2 2 0 0 1 12.039 15H2a2 2 0 0 1-2-2Z"/></svg>
|
package/package.json
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react'
|
|
2
|
+
|
|
3
|
+
import { generateWebLink } from 'cozy-client'
|
|
4
|
+
|
|
5
|
+
import { getActionsI18n } from './locales/withActionsLocales'
|
|
6
|
+
import Icon from '../../Icon'
|
|
7
|
+
import FolderOpenIcon from '../../Icons/FolderOpen'
|
|
8
|
+
import ListItemIcon from '../../ListItemIcon'
|
|
9
|
+
import ListItemText from '../../ListItemText'
|
|
10
|
+
import ActionsMenuItem from '../ActionsMenuItem'
|
|
11
|
+
|
|
12
|
+
const makeComponent = (label, icon) => {
|
|
13
|
+
const Component = forwardRef((props, ref) => {
|
|
14
|
+
return (
|
|
15
|
+
<ActionsMenuItem {...props} ref={ref}>
|
|
16
|
+
<ListItemIcon>
|
|
17
|
+
<Icon icon={icon} />
|
|
18
|
+
</ListItemIcon>
|
|
19
|
+
<ListItemText primary={label} />
|
|
20
|
+
</ActionsMenuItem>
|
|
21
|
+
)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
Component.displayName = 'viewInDrive'
|
|
25
|
+
|
|
26
|
+
return Component
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const viewInDrive = () => {
|
|
30
|
+
const { t } = getActionsI18n()
|
|
31
|
+
const icon = FolderOpenIcon
|
|
32
|
+
const label = t('viewInDrive')
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
name: 'viewInDrive',
|
|
36
|
+
icon,
|
|
37
|
+
label,
|
|
38
|
+
Component: makeComponent(label, icon),
|
|
39
|
+
action: (docs, { client }) => {
|
|
40
|
+
const dirId = docs[0].dir_id
|
|
41
|
+
const webLink = generateWebLink({
|
|
42
|
+
slug: 'drive',
|
|
43
|
+
cozyUrl: client.getStackClient().uri,
|
|
44
|
+
subDomainType: client.getInstanceOptions().subdomain,
|
|
45
|
+
pathname: '/',
|
|
46
|
+
hash: `folder/${dirId}`
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
window.open(webLink, '_blank')
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -65,7 +65,7 @@ import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
|
65
65
|
import FileTypeText from 'cozy-ui/transpiled/react/Icons/FileTypeText'
|
|
66
66
|
import FileIcon from 'cozy-ui/transpiled/react/Icons/File'
|
|
67
67
|
|
|
68
|
-
import { makeActions, modify, emailTo, print, viewInContacts, divider, smsTo, call } from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
|
|
68
|
+
import { makeActions, modify, emailTo, print, viewInContacts, viewInDrive, divider, smsTo, call } from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
|
|
69
69
|
|
|
70
70
|
initialState = { showMenu: isTesting() }
|
|
71
71
|
|
|
@@ -100,7 +100,7 @@ const customAction = () => ({
|
|
|
100
100
|
})
|
|
101
101
|
})
|
|
102
102
|
|
|
103
|
-
const actions = makeActions([ modify, viewInContacts, divider, call, smsTo, emailTo, print, divider, customAction ])
|
|
103
|
+
const actions = makeActions([ modify, viewInContacts, viewInDrive, divider, call, smsTo, emailTo, print, divider, customAction ])
|
|
104
104
|
|
|
105
105
|
;
|
|
106
106
|
|
package/react/Icon/Readme.md
CHANGED
|
@@ -176,6 +176,7 @@ import Flashlight from 'cozy-ui/transpiled/react/Icons/Flashlight'
|
|
|
176
176
|
import Folder from 'cozy-ui/transpiled/react/Icons/Folder'
|
|
177
177
|
import FolderAdd from 'cozy-ui/transpiled/react/Icons/FolderAdd'
|
|
178
178
|
import FolderMoveto from 'cozy-ui/transpiled/react/Icons/FolderMoveto'
|
|
179
|
+
import FolderOpen from 'cozy-ui/transpiled/react/Icons/FolderOpen'
|
|
179
180
|
import Forbidden from 'cozy-ui/transpiled/react/Icons/Forbidden'
|
|
180
181
|
import FromUser from 'cozy-ui/transpiled/react/Icons/FromUser'
|
|
181
182
|
import Gear from 'cozy-ui/transpiled/react/Icons/Gear'
|
|
@@ -441,6 +442,7 @@ const icons = [
|
|
|
441
442
|
Folder,
|
|
442
443
|
FolderAdd,
|
|
443
444
|
FolderMoveto,
|
|
445
|
+
FolderOpen,
|
|
444
446
|
Forbidden,
|
|
445
447
|
FromUser,
|
|
446
448
|
Gear,
|
|
@@ -929,7 +931,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
|
929
931
|
|
|
930
932
|
const colors = ['#297EF2', '#08b442', '#B449E7', '#F52D2D', '#FF962F']
|
|
931
933
|
let i = 0
|
|
932
|
-
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','server','setting','share-circle','share','shield','shop','sound','spinner','sport-bag','stack','star','star-outline','stats','stop', 'subway', 'support', 'swap', 'sync-cozy','sync','tab','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']
|
|
934
|
+
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-open','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','server','setting','share-circle','share','shield','shop','sound','spinner','sport-bag','stack','star','star-outline','stats','stop', 'subway', 'support', 'swap', 'sync-cozy','sync','tab','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']
|
|
933
935
|
;
|
|
934
936
|
<div style={{ fontSize: '2rem', display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)' }}>
|
|
935
937
|
<Sprite />
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Automatically created, please run `scripts/generate-svgr-icon.sh assets/icons/ui/folder-open.svg` to regenerate;
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
function SvgFolderOpen(props) {
|
|
5
|
+
return (
|
|
6
|
+
<svg viewBox="0 0 16 16" {...props}>
|
|
7
|
+
<path d="M0 13V3a2 2 0 012-2h3.172a2 2 0 011.414.586l.828.828A2 2 0 008.828 3H12a2 2 0 012 2H3.5a.5.5 0 00-.474.342l-2 6a.5.5 0 10.948.316L3.86 6h11.142a1 1 0 01.952 1.304l-2.01 6.304A2 2 0 0112.039 15H2a2 2 0 01-2-2z" />
|
|
8
|
+
</svg>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default SvgFolderOpen
|
|
@@ -14,12 +14,14 @@ const { variant } = useCozyTheme()
|
|
|
14
14
|
const app = { name: "Test App", slug: "testapp", type: "app" }
|
|
15
15
|
const [isLoading, setLoading] = React.useState(false)
|
|
16
16
|
const [isError, setIsError] = React.useState(false)
|
|
17
|
+
const [isShortcutBadgeHide, setShortcutBadgeHide] = React.useState(false)
|
|
17
18
|
|
|
18
19
|
;
|
|
19
20
|
|
|
20
21
|
<>
|
|
21
22
|
<Button className="u-mb-1 u-mr-1" label="Toggle Loading" onClick={() => setLoading(!isLoading)} />
|
|
22
|
-
<Button className="u-mb-1" label="Toggle Loading Error" onClick={() => setIsError(!isError)} />
|
|
23
|
+
<Button className="u-mb-1 u-mr-1" label="Toggle Loading Error" onClick={() => setIsError(!isError)} />
|
|
24
|
+
<Button className="u-mb-1" label="Hide shortcut badge" onClick={() => setShortcutBadgeHide(!isShortcutBadgeHide)} />
|
|
23
25
|
|
|
24
26
|
<Grid container spacing={1} style={{ background: variant === 'inverted' ? `center / cover no-repeat url(${cloudWallpaper})` : 'white' }}
|
|
25
27
|
>
|
|
@@ -39,7 +41,7 @@ const [isError, setIsError] = React.useState(false)
|
|
|
39
41
|
<SquareAppIcon app="testapp" name="No Account long name very very very very long" variant="ghost" />
|
|
40
42
|
</Grid>
|
|
41
43
|
<Grid item>
|
|
42
|
-
<SquareAppIcon name="Shortcut" variant="shortcut" />
|
|
44
|
+
<SquareAppIcon name="Shortcut" variant="shortcut" hideShortcutBadge={isShortcutBadgeHide} />
|
|
43
45
|
</Grid>
|
|
44
46
|
<Grid item>
|
|
45
47
|
<SquareAppIcon IconContent={<Icon icon={CozyIcon} size="48" />} name="Loading" variant={isLoading ? 'loading' : 'default'} />
|
|
@@ -58,7 +60,7 @@ const [isError, setIsError] = React.useState(false)
|
|
|
58
60
|
width={32}
|
|
59
61
|
height={32}
|
|
60
62
|
alt={"Shortcut"}
|
|
61
|
-
/>}/>
|
|
63
|
+
/>} hideShortcutBadge={isShortcutBadgeHide} />
|
|
62
64
|
</Grid>
|
|
63
65
|
<Grid item>
|
|
64
66
|
<SquareAppIcon name="Custom Icon" IconContent={<Icon icon={CozyIcon} size="48" />} />
|
|
@@ -103,40 +105,78 @@ const { variant } = useCozyTheme()
|
|
|
103
105
|
const app = { name: "Test App", slug: "testapp", type: "app" }
|
|
104
106
|
const [isLoading, setLoading] = React.useState(false)
|
|
105
107
|
const [isError, setIsError] = React.useState(false)
|
|
108
|
+
const [isShortcutBadgeHide, setShortcutBadgeHide] = React.useState(false)
|
|
106
109
|
|
|
107
110
|
;
|
|
108
111
|
|
|
109
112
|
<>
|
|
110
113
|
<Button className="u-mb-1 u-mr-1" label="Toggle Loading" onClick={() => setLoading(!isLoading)} />
|
|
111
|
-
<Button className="u-mb-1" label="Toggle Loading Error" onClick={() => setIsError(!isError)} />
|
|
114
|
+
<Button className="u-mb-1 u-mr-1" label="Toggle Loading Error" onClick={() => setIsError(!isError)} />
|
|
115
|
+
<Button className="u-mb-1" label="Hide shortcut badge" onClick={() => setShortcutBadgeHide(!isShortcutBadgeHide)} />
|
|
112
116
|
|
|
113
117
|
<Grid container spacing={4}>
|
|
114
118
|
<Grid item xs={4}>
|
|
115
|
-
<SquareAppIcon
|
|
119
|
+
<SquareAppIcon
|
|
120
|
+
display="detailed"
|
|
121
|
+
name="Weather Wiz"
|
|
122
|
+
description="Get real-time weather updates and forecasts" />
|
|
116
123
|
</Grid>
|
|
117
124
|
<Grid item xs={4}>
|
|
118
|
-
<SquareAppIcon
|
|
125
|
+
<SquareAppIcon
|
|
126
|
+
display="detailed"
|
|
127
|
+
name="Meal Planner"
|
|
128
|
+
description="Plan your meals with nutrition tracking"
|
|
129
|
+
variant="maintenance" />
|
|
119
130
|
</Grid>
|
|
120
131
|
<Grid item xs={4}>
|
|
121
|
-
<SquareAppIcon
|
|
132
|
+
<SquareAppIcon
|
|
133
|
+
display="detailed"
|
|
134
|
+
name="Travel Tracker"
|
|
135
|
+
description="Explore and document your travel adventures"
|
|
136
|
+
variant="error" />
|
|
122
137
|
</Grid>
|
|
123
138
|
<Grid item xs={4}>
|
|
124
|
-
<SquareAppIcon
|
|
139
|
+
<SquareAppIcon
|
|
140
|
+
display="detailed"
|
|
141
|
+
name="Fitness Friend"
|
|
142
|
+
variant="add" />
|
|
125
143
|
</Grid>
|
|
126
144
|
<Grid item xs={4}>
|
|
127
|
-
<SquareAppIcon
|
|
145
|
+
<SquareAppIcon
|
|
146
|
+
display="detailed"
|
|
147
|
+
name="Mindful Moments"
|
|
148
|
+
description="Guided meditations for daily mindfulness"
|
|
149
|
+
variant="ghost" />
|
|
128
150
|
</Grid>
|
|
129
151
|
<Grid item xs={4}>
|
|
130
|
-
<SquareAppIcon
|
|
152
|
+
<SquareAppIcon
|
|
153
|
+
display="detailed"
|
|
154
|
+
name="Study Space"
|
|
155
|
+
description="Organize your study schedule and resources"
|
|
156
|
+
variant="shortcut"
|
|
157
|
+
hideShortcutBadge={isShortcutBadgeHide} />
|
|
131
158
|
</Grid>
|
|
132
159
|
<Grid item xs={4}>
|
|
133
|
-
<SquareAppIcon
|
|
160
|
+
<SquareAppIcon
|
|
161
|
+
display="detailed"
|
|
162
|
+
name="Quick Notes"
|
|
163
|
+
IconContent={<Icon icon={CozyIcon} size="48" />}
|
|
164
|
+
variant={isLoading ? 'loading' : 'default'} />
|
|
134
165
|
</Grid>
|
|
135
166
|
<Grid item xs={4}>
|
|
136
|
-
<SquareAppIcon
|
|
167
|
+
<SquareAppIcon
|
|
168
|
+
display="detailed"
|
|
169
|
+
name="Daily Budget"
|
|
170
|
+
description="Manage your daily expenses and budgets"
|
|
171
|
+
IconContent={<Icon icon={CozyIcon} size="48" />}
|
|
172
|
+
variant={isError ? 'error' : 'loading'} />
|
|
137
173
|
</Grid>
|
|
138
174
|
<Grid item xs={4}>
|
|
139
|
-
<SquareAppIcon
|
|
175
|
+
<SquareAppIcon
|
|
176
|
+
display="detailed"
|
|
177
|
+
name="Event Planner"
|
|
178
|
+
description="Plan and schedule your events effectively"
|
|
179
|
+
IconContent={<Icon icon={CozyIcon} size="48" />} />
|
|
140
180
|
</Grid>
|
|
141
181
|
</Grid>
|
|
142
182
|
</>
|
|
@@ -100,6 +100,7 @@ export const SquareAppIcon = ({
|
|
|
100
100
|
variant,
|
|
101
101
|
IconContent,
|
|
102
102
|
description,
|
|
103
|
+
hideShortcutBadge = false,
|
|
103
104
|
...appIconProps
|
|
104
105
|
}) => {
|
|
105
106
|
const { variant: themeVariant } = useCozyTheme()
|
|
@@ -139,11 +140,13 @@ export const SquareAppIcon = ({
|
|
|
139
140
|
<CozyTheme variant={squareTheme}>
|
|
140
141
|
<InfosBadge
|
|
141
142
|
badgeContent={
|
|
142
|
-
variant === 'shortcut'
|
|
143
|
+
variant === 'shortcut' && !hideShortcutBadge ? (
|
|
144
|
+
<Icon size="10" icon={iconOut} />
|
|
145
|
+
) : null
|
|
143
146
|
}
|
|
144
147
|
className={cx({ ['u-mr-1']: display === 'detailed' })}
|
|
145
148
|
overlap="rectangular"
|
|
146
|
-
invisible={variant !== 'shortcut'}
|
|
149
|
+
invisible={variant !== 'shortcut' || hideShortcutBadge}
|
|
147
150
|
>
|
|
148
151
|
<SquareAppIconSpinner
|
|
149
152
|
variant={variant}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
var en = {
|
|
2
2
|
viewInContacts: "View in Cozy Contacts",
|
|
3
|
+
viewInDrive: "Open",
|
|
3
4
|
modify: "Modify",
|
|
4
5
|
emailTo: "Send an email",
|
|
5
6
|
smsTo: "Send a message",
|
|
@@ -9,6 +10,7 @@ var en = {
|
|
|
9
10
|
};
|
|
10
11
|
var fr = {
|
|
11
12
|
viewInContacts: "Voir dans Cozy Contacts",
|
|
13
|
+
viewInDrive: "Ouvrir",
|
|
12
14
|
modify: "Modifier",
|
|
13
15
|
emailTo: "Envoyer un e-mail",
|
|
14
16
|
smsTo: "Envoyer un message",
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import { generateWebLink } from 'cozy-client';
|
|
4
|
+
import { getActionsI18n } from "cozy-ui/transpiled/react/ActionsMenu/Actions/locales/withActionsLocales";
|
|
5
|
+
import Icon from "cozy-ui/transpiled/react/Icon";
|
|
6
|
+
import FolderOpenIcon from "cozy-ui/transpiled/react/Icons/FolderOpen";
|
|
7
|
+
import ListItemIcon from "cozy-ui/transpiled/react/ListItemIcon";
|
|
8
|
+
import ListItemText from "cozy-ui/transpiled/react/ListItemText";
|
|
9
|
+
import ActionsMenuItem from "cozy-ui/transpiled/react/ActionsMenu/ActionsMenuItem";
|
|
10
|
+
|
|
11
|
+
var makeComponent = function makeComponent(label, icon) {
|
|
12
|
+
var Component = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
13
|
+
return /*#__PURE__*/React.createElement(ActionsMenuItem, _extends({}, props, {
|
|
14
|
+
ref: ref
|
|
15
|
+
}), /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(Icon, {
|
|
16
|
+
icon: icon
|
|
17
|
+
})), /*#__PURE__*/React.createElement(ListItemText, {
|
|
18
|
+
primary: label
|
|
19
|
+
}));
|
|
20
|
+
});
|
|
21
|
+
Component.displayName = 'viewInDrive';
|
|
22
|
+
return Component;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export var viewInDrive = function viewInDrive() {
|
|
26
|
+
var _getActionsI18n = getActionsI18n(),
|
|
27
|
+
t = _getActionsI18n.t;
|
|
28
|
+
|
|
29
|
+
var icon = FolderOpenIcon;
|
|
30
|
+
var label = t('viewInDrive');
|
|
31
|
+
return {
|
|
32
|
+
name: 'viewInDrive',
|
|
33
|
+
icon: icon,
|
|
34
|
+
label: label,
|
|
35
|
+
Component: makeComponent(label, icon),
|
|
36
|
+
action: function action(docs, _ref) {
|
|
37
|
+
var client = _ref.client;
|
|
38
|
+
var dirId = docs[0].dir_id;
|
|
39
|
+
var webLink = generateWebLink({
|
|
40
|
+
slug: 'drive',
|
|
41
|
+
cozyUrl: client.getStackClient().uri,
|
|
42
|
+
subDomainType: client.getInstanceOptions().subdomain,
|
|
43
|
+
pathname: '/',
|
|
44
|
+
hash: "folder/".concat(dirId)
|
|
45
|
+
});
|
|
46
|
+
window.open(webLink, '_blank');
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|