Skip to content

Commit

Permalink
Enforce prettier-recommended and vue-recommended
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Apr 15, 2020
1 parent 0d478a0 commit 942439e
Show file tree
Hide file tree
Showing 160 changed files with 6,790 additions and 5,015 deletions.
44 changes: 23 additions & 21 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
{
"env": {
"browser": true,
"es6": true,
"amd": true
},
"extends": [
"standard",
"plugin:vue/essential"
],
"parserOptions": {
"parser": "babel-eslint",
"sourceType": "module"
},
"rules": {
"require-await": "warn",
"vue/order-in-components": "error"
},
"globals": {
"require": false,
"requirejs": false
}
"env": {
"browser": true,
"es6": true,
"amd": true
},
"extends": [
"standard",
"plugin:vue/recommended",
"plugin:prettier/recommended",
"prettier/standard",
"prettier/vue"
],
"parserOptions": {
"parser": "babel-eslint",
"sourceType": "module"
},
"rules": {
"require-await": "warn"
},
"globals": {
"require": false,
"requirejs": false
}
}
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 100,
"semi": false,
"singleQuote": true
}
46 changes: 26 additions & 20 deletions apps/draw-io/src/DrawIoEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export default {
}),
computed: {
...mapGetters(['getToken']),
loading () {
loading() {
return this.content === ''
},
iframeSource () {
iframeSource() {
const query = queryString.stringify({
embed: 1,
picker: 0,
Expand All @@ -29,7 +29,7 @@ export default {
return 'https://www.draw.io?' + query
}
},
created () {
created() {
this.filePath = this.$route.params.filePath
window.addEventListener('message', event => {
Expand All @@ -48,37 +48,44 @@ export default {
},
methods: {
...mapActions(['showMessage']),
error (error) {
error(error) {
this.showMessage({
title: this.$gettext('PDF could not be loaded…'),
desc: error,
status: 'danger'
})
},
load () {
this.$client.files.getFileContents(this.filePath, { resolveWithResponseObject: true })
load() {
this.$client.files
.getFileContents(this.filePath, { resolveWithResponseObject: true })
.then(resp => {
this.currentETag = resp.headers.ETag
this.$refs.drawIoEditor.contentWindow.postMessage(JSON.stringify({
action: 'load',
xml: resp.body
}), '*')
this.$refs.drawIoEditor.contentWindow.postMessage(
JSON.stringify({
action: 'load',
xml: resp.body
}),
'*'
)
})
.catch(error => {
this.error(error)
})
},
save (payload) {
this.$client.files.putFileContents(this.filePath, payload.xml, {
previousEntityTag: this.currentETag
}).then((resp) => {
this.currentETag = resp.ETag
}).catch(error => {
this.error(error)
})
save(payload) {
this.$client.files
.putFileContents(this.filePath, payload.xml, {
previousEntityTag: this.currentETag
})
.then(resp => {
this.currentETag = resp.ETag
})
.catch(error => {
this.error(error)
})
},
exit () {
exit() {
window.close()
}
}
Expand All @@ -99,5 +106,4 @@ export default {
overflow: hidden;
z-index: 999999;
}
</style>
35 changes: 19 additions & 16 deletions apps/draw-io/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,32 @@ import 'regenerator-runtime/runtime'
import translationsJson from '../l10n/translations'
import DrawIoEditor from './DrawIoEditor.vue'

const routes = [{
name: 'draw-io-edit',
path: '/edit/:filePath',
components: {
fullscreen: DrawIoEditor
},
meta: { hideHeadbar: true }
}]
const routes = [
{
name: 'draw-io-edit',
path: '/edit/:filePath',
components: {
fullscreen: DrawIoEditor
},
meta: { hideHeadbar: true }
}
]

const appInfo = {
name: 'Draw.io',
id: 'draw-io',
icon: 'grid_on',
extensions: [{
extension: 'drawio',
newTab: true,
routeName: 'draw-io-edit',
newFileMenu: {
menuTitle ($gettext) {
return $gettext('New draw.io document…')
extensions: [
{
extension: 'drawio',
newTab: true,
routeName: 'draw-io-edit',
newFileMenu: {
menuTitle($gettext) {
return $gettext('New draw.io document…')
}
}
}
}
]
}

Expand Down
Loading

0 comments on commit 942439e

Please sign in to comment.