mirror of https://github.com/nextcloud/contacts
Fix files-actions script name
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
b0e1808b1b
commit
fb9fe6da2b
|
@ -21,12 +21,15 @@
|
|||
*/
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
|
||||
const mime = 'text/vcard'
|
||||
const name = 'contacts-import'
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
if (OCA.Files && OCA.Files.fileActions) {
|
||||
OCA.Files.fileActions.registerAction({
|
||||
name: 'contacts_import',
|
||||
name,
|
||||
displayName: t('contacts', 'Import'),
|
||||
mime: 'text/vcard',
|
||||
mime,
|
||||
permissions: OC.PERMISSION_READ,
|
||||
iconClass: 'icon-contacts',
|
||||
actionHandler(fileName, context) {
|
||||
|
@ -34,6 +37,8 @@ window.addEventListener('DOMContentLoaded', () => {
|
|||
window.location = generateUrl(`/apps/contacts/import?file=${absPath}`)
|
||||
},
|
||||
})
|
||||
OCA.Files.fileActions.setDefault('text/vcard', 'contacts_import')
|
||||
OCA.Files.fileActions.setDefault(mime, name)
|
||||
return
|
||||
}
|
||||
console.error('Unable to register vcf import action')
|
||||
})
|
|
@ -2,7 +2,7 @@ const path = require('path')
|
|||
const webpack = require('webpack')
|
||||
const webpackConfig = require('@nextcloud/webpack-vue-config')
|
||||
|
||||
webpackConfig.entry['files-action'] = path.join(__dirname, 'src', 'files_action.js')
|
||||
webpackConfig.entry['files-action'] = path.join(__dirname, 'src', 'files-action.js')
|
||||
webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/))
|
||||
|
||||
module.exports = webpackConfig
|
||||
|
|
Loading…
Reference in New Issue