Skip to content

Commit

Permalink
#388: Added basic errors table from vue-good-tables.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Mulholland committed Mar 23, 2018
1 parent 9464576 commit 9e37022
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 5 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"vue-async-computed": "^3.3.1",
"vue-directive-tooltip": "^1.4.1",
"vue-electron": "^1.0.6",
"vue-good-table": "^1.20.3",
"vue-router": "^3.0.1",
"vue-rx": "^5.0.0",
"vue-template-compiler": "^2.5.2",
Expand Down
46 changes: 41 additions & 5 deletions src/renderer/components/Errors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
<h1>Validation Errors</h1>

<h2>Errors</h2>
<div>
<vue-good-table
title="Demo Table"
:columns="columns"
:rows="rows"
:paginate="true"
:defaultSortBy="{field: 'row', type: 'asc'}"
:lineNumbers="false"/>
</div>
<table class="table table-striped">
<thead>
<tr>
Expand All @@ -27,13 +36,37 @@
</div>
</template>
<script>
import Vue from 'vue'
import VueGoodTable from 'vue-good-table'
import {ipcRenderer as ipc} from 'electron'
import {getWindow} from '../index.js'
Vue.use(VueGoodTable)
export default {
name: 'errors',
data() {
return {
messages: false
messages: false,
columns: [
{
label: 'Row number',
field: 'rowNumber',
filterable: true,
type: 'number'
},
{
label: 'Column number',
field: 'columnNumber',
filterable: true,
type: 'number'
},
{
label: 'Error message',
field: 'message',
filterable: true
}
],
rows: [
]
}
},
computed: {
Expand Down Expand Up @@ -66,14 +99,17 @@ export default {
ipc.on('errorMessages', function(event, arg) {
console.log('message returned')
if (_.isArray(arg)) {
vueSetErrorMessages(arg[0])
vueSetErrorMessages(arg)
}
})
},
watch: {
messages: function(value) {
console.log('message watch triggered.')
console.log(value)
messages: function(messages) {
this.rows = []
for (let next of messages) {
console.log(next)
this.rows.push({rowNumber: next.rowNumber, columnNumber: next.columnNumber, message: next.message})
}
}
}
}
Expand Down
26 changes: 26 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2894,6 +2894,10 @@ datapackage@^1.0.5:
tv4 "^1.2.7"
url-join "^2.0.1"

date-fns@^2.0.0-alpha.7:
version "2.0.0-alpha.7"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.0.0-alpha.7.tgz#245ad16f95764eababfb2c0a41fd5d033c20e57a"

date-now@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
Expand Down Expand Up @@ -3089,6 +3093,10 @@ di@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c"

[email protected]:
version "1.0.1"
resolved "https://registry.yarnpkg.com/diacriticless/-/diacriticless-1.0.1.tgz#e7dda978c2919609bb48aee1efc5de6a337bd4c3"

[email protected]:
version "3.2.0"
resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9"
Expand Down Expand Up @@ -5898,6 +5906,10 @@ lodash.camelcase@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"

lodash.clone@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6"

lodash.clonedeep@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-3.0.2.tgz#a0a1e40d82a5ea89ff5b147b8444ed63d92827db"
Expand All @@ -5917,6 +5929,10 @@ [email protected]:
lodash._basecreate "^3.0.0"
lodash._isiterateecall "^3.0.0"

lodash.foreach@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.foreach/-/lodash.foreach-4.5.0.tgz#1a6a35eace401280c7f06dddec35165ab27e3e53"

lodash.get@^4.4.2, lodash.get@~4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
Expand Down Expand Up @@ -9527,6 +9543,16 @@ vue-electron@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/vue-electron/-/vue-electron-1.0.6.tgz#e798e03180b8933539defe31f92e53b9242b9406"

vue-good-table@^1.20.3:
version "1.20.3"
resolved "https://registry.yarnpkg.com/vue-good-table/-/vue-good-table-1.20.3.tgz#a756fe29fa953dd8eddc1956e1a6fcc19f961ff8"
dependencies:
babel-runtime "^6.26.0"
date-fns "^2.0.0-alpha.7"
diacriticless "1.0.1"
lodash.clone "^4.5.0"
lodash.foreach "^4.5.0"

vue-hot-reload-api@^2.1.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.0.tgz#97976142405d13d8efae154749e88c4e358cf926"
Expand Down

0 comments on commit 9e37022

Please sign in to comment.