Skip to content

Commit

Permalink
Set import as default action & update webpack config
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Aug 21, 2020
1 parent aaa23c1 commit 6c6f29f
Show file tree
Hide file tree
Showing 9 changed files with 1,038 additions and 1,151 deletions.
2,056 changes: 1,013 additions & 1,043 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"license": "agpl",
"private": true,
"scripts": {
"build": "NODE_ENV=production webpack --progress --hide-modules --config webpack.prod.js",
"dev": "NODE_ENV=development webpack --progress --config webpack.dev.js",
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.dev.js",
"build": "NODE_ENV=production webpack --progress --hide-modules --config webpack.js",
"dev": "NODE_ENV=development webpack --progress --config webpack.js",
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.js",
"lint": "eslint --ext .js,.vue src",
"lint:fix": "eslint --ext .js,.vue src --fix",
"stylelint": "stylelint src",
Expand All @@ -50,15 +50,15 @@
"ical.js": "^1.4.0",
"moment": "^2.27.0",
"p-limit": "^3.0.2",
"p-queue": "^6.6.0",
"p-queue": "^6.6.1",
"qr-image": "^3.2.0",
"regenerator-runtime": "^0.13.7",
"uuid": "^8.3.0",
"vue": "^2.6.11",
"vue": "^2.6.12",
"vue-click-outside": "^1.1.0",
"vue-clipboard2": "^0.3.1",
"vue-router": "^3.4.3",
"vue-virtual-scroll-list": "^2.3.0",
"vue-virtual-scroll-list": "^2.3.1",
"vue-virtual-scroller": "^1.0.10",
"vuex": "^3.4.0",
"vuex-router-sync": "^5.0.0"
Expand All @@ -67,13 +67,14 @@
"node": ">=10.0.0"
},
"devDependencies": {
"@babel/core": "^7.11.1",
"@babel/core": "^7.11.4",
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.11.0",
"@nextcloud/browserslist-config": "^1.0.0",
"@nextcloud/eslint-config": "^2.2.0",
"@nextcloud/eslint-plugin": "^1.4.0",
"@nextcloud/webpack-vue-config": "^1.1.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"css-loader": "^3.6.0",
Expand All @@ -87,17 +88,16 @@
"eslint-plugin-vue": "^6.2.2",
"file-loader": "^6.0.0",
"node-sass": "^4.14.1",
"sass-loader": "^9.0.3",
"stylelint": "^8.4.0",
"stylelint-config-recommended-scss": "^3.3.0",
"sass-loader": "^8.0.2",
"stylelint": "^13.6.1",
"stylelint-config-recommended-scss": "^4.2.0",
"stylelint-scss": "^3.18.0",
"stylelint-webpack-plugin": "^0.10.5",
"stylelint-webpack-plugin": "^2.1.0",
"url-loader": "^4.1.0",
"vue-loader": "^15.9.3",
"vue-template-compiler": "^2.6.11",
"vue-template-compiler": "^2.6.12",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
"webpack-merge": "^4.2.2",
"webpack-node-externals": "^2.5.1"
},
"browserslist": [
Expand Down
2 changes: 2 additions & 0 deletions src/components/Settings/SettingsImportContacts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ export default {

async processLocalFile(path) {
try {
this.cancelRequest()

// prepare cancel token for axios request
const source = CancelToken.source()
this.cancelRequest = source.cancel
Expand Down
3 changes: 2 additions & 1 deletion src/files_action.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ window.addEventListener('DOMContentLoaded', () => {
mime: 'text/vcard',
permissions: OC.PERMISSION_READ,
iconClass: 'icon-contacts',
actionHandler: function(fileName, context) {
actionHandler(fileName, context) {
const absPath = `${context.dir === '/' ? '' : context.dir}/${fileName}`
window.location = generateUrl(`/apps/contacts/import?file=${absPath}`)
},
})
OCA.Files.fileActions.setDefault('text/vcard', 'contacts_import')
}
})
66 changes: 0 additions & 66 deletions webpack.common.js

This file was deleted.

12 changes: 0 additions & 12 deletions webpack.dev.js

This file was deleted.

8 changes: 8 additions & 0 deletions webpack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/))

module.exports = webpackConfig
7 changes: 0 additions & 7 deletions webpack.prod.js

This file was deleted.

9 changes: 0 additions & 9 deletions webpack.test.js

This file was deleted.

0 comments on commit 6c6f29f

Please sign in to comment.