diff --git a/src/file-actions.js b/src/file-actions.js index 6bd2b24a7..24a185019 100644 --- a/src/file-actions.js +++ b/src/file-actions.js @@ -1,11 +1,7 @@ import { FileAction, registerFileAction } from '@nextcloud/files' import { spawnDialog } from '@nextcloud/dialogs' import FileActionImport from './modules/modals/FileActionImport.vue' - -const icon = ` - - -` +import tablesIcon from '@mdi/svg/svg/table-large.svg?raw' const validMimeTypes = [ 'text/csv', @@ -17,7 +13,7 @@ const validMimeTypes = [ const fileAction = new FileAction({ id: 'import-to-tables', displayName: () => t('tables', 'Import into Tables'), - iconSvgInline: () => icon, + iconSvgInline: () => tablesIcon, enabled: (files) => { const file = files[0] @@ -25,7 +21,7 @@ const fileAction = new FileAction({ return file.type === 'file' && validMimeTypes.includes(file.mime) }, - exec: async (file) => { + exec: (file) => { spawnDialog(FileActionImport, { file }) return null }, diff --git a/webpack.js b/webpack.js index 847147498..7daa253f6 100644 --- a/webpack.js +++ b/webpack.js @@ -7,4 +7,14 @@ webpackConfig.entry = { reference: path.join(__dirname, 'src', 'reference.js'), } +webpackConfig.module = { + rules: [ + ...webpackConfig.module.rules, + { + resourceQuery: /raw/, + type: 'asset/source', + } + ] +} + module.exports = webpackConfig