Skip to content

Commit

Permalink
#393: Added style and text setup for errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Mulholland committed Mar 28, 2018
1 parent 5625d93 commit a0f1ec1
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 9 deletions.
10 changes: 8 additions & 2 deletions src/renderer/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</li>
<component is="tooltipOpenErrorsWindow" />
<li>
<a href="#" v-tooltip.top="tooltip('tooltip-write-errors-provenance')">
<a href="#" v-tooltip.top="tooltip('tooltip-write-errors-provenance')" @click="writeErrorsToProvenance()">
<object data="static/img/validation-results.svg" type="image/svg+xml" />
<!-- <span class="btn-default fas fa-file-alt" /> -->
</a>
Expand Down Expand Up @@ -367,7 +367,8 @@ export default {
'resetColumnPropertiesToObject',
'pushTableProperty',
'pushPackageProperty',
'pushHotSelection'
'pushHotSelection',
'pushProvenanceErrors'
]),
saveHotPanelDimensions: function() {
this.widthInner1 = document.querySelector('.ht_master .wtHolder').offsetWidth
Expand Down Expand Up @@ -869,6 +870,11 @@ export default {
if (selection) {
hot.selectCell(selection[0], selection[1], selection[2], selection[3])
}
},
writeErrorsToProvenance: function() {
this.pushProvenanceErrors(this.messages)
this.updateToolbarMenu(3)
document.querySelector('#provenance-errors').focus()
}
},
components: {
Expand Down
26 changes: 23 additions & 3 deletions src/renderer/partials/ProvenanceProperties.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</template>
<template v-else>
<textarea v-model="provenance" :placeholder="placeholder" rows="25" cols="55" class="form-control input-sm col-sm-9" id="provenance-description" />
<textarea v-model="provenanceErrors" rows="10" cols="55" class="form-control input-sm col-sm-9" id="provenance-errors" />
<textarea readonly="readonly" v-model="provenanceErrors" rows="10" cols="55" class="form-control input-sm col-sm-9" id="provenance-errors" />
</template>
</div>
</div>
Expand All @@ -35,6 +35,7 @@ import {
mapState,
mapGetters
} from 'vuex'
import os from 'os'
export default {
extends: SideNav,
name: 'provenance',
Expand Down Expand Up @@ -63,9 +64,26 @@ export default {
togglePreview: function() {
this.isPreview = !this.isPreview
},
resetProvenanceErrors: function() {
this.provenanceErrors = ''
},
addErrorsToProvenance: function() {
// this.pushProvenanceErrors(errors)
this.provenanceErrors = this.getProvenance.errors
this.resetProvenanceErrors()
this.provenanceErrors = this.compileErrors()
},
compileErrors: function() {
let compiled = _.template(`### Known Data Errors
This data is published with the following data errors:
<%= errorsList %>`
)
return compiled({ 'errorsList': this.errorsListToString() })
},
errorsListToString: function() {
return _.map(this.getProvenance.errors, function(error) {
return `${error.message}${os.EOL}`
})
}
},
watch: {
Expand All @@ -75,6 +93,8 @@ export default {
},
mounted: function() {
this.provenance = this.getProvenance.markdown
this.addErrorsToProvenance()
document.querySelector('#provenance-errors').focus()
},
data() {
return {
Expand Down
5 changes: 2 additions & 3 deletions src/renderer/rxSubject.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let allTablesAllColumnsFromSchema$ = new Subject()
let activeTab$ = new Subject()
let hotIdFromTab$ = new Subject()
let allTabsTitles$ = new Subject()
let selectedForeignTable$ = new Subject()
// let selectedForeignTable$ = new Subject()
// let getSelectedLocalKeys$ = new Subject()

export function onNextHotIdFromTabRx(asyncFunction) {
Expand All @@ -34,6 +34,5 @@ export {
activeTab$,
allTablesAllColumnNames$,
allTablesAllColumnsFromSchema$,
allTabsTitles$,
selectedForeignTable$
allTabsTitles$
}
5 changes: 4 additions & 1 deletion static/css/provenanceprops.styl
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#provenanceProperties
#provenance-description
#provenance-errors
background-color #fff
width 100%
border 1px solid #ccc
#provenance-errors
@extend #provenanceProperties #provenance-description
cursor not-allowed

#provenance-preview
#provenance-errors-preview
@extend #provenanceProperties #provenance-description
Expand Down

0 comments on commit a0f1ec1

Please sign in to comment.