Skip to content

Commit

Permalink
Closes #206: Ensure locked, not toggled for import. Add Tab behaviour…
Browse files Browse the repository at this point in the history
… to lock. Separated logic from main's url to frictionless for easier re-use. Added submenu items for both file and url. Improved style to suit open. Allowed title to change. Closes #742. Closes #731. Added Import Column Properties to file disable/enable list. Closes #924: Enabled difference between case-insensitive (with diacritics) and case-sensitive (without diacritics).
  • Loading branch information
Matthew Mulholland committed Jun 30, 2019
1 parent bd2ff4f commit 15f8e2c
Show file tree
Hide file tree
Showing 18 changed files with 10,736 additions and 166 deletions.
20 changes: 10 additions & 10 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ global.tab = {
}
global.windows = {}

const isSecondInstance = app.makeSingleInstance((commandLine, workingDirectory) => {
// Someone tried to run a second instance, we should focus our window.
console.error('Attempted to open a second instance. Disallowing...')
focusMainWindow()
})

if (isSecondInstance) {
console.error('Data curator is already open. Quitting this application.')
app.quit()
}
// const isSecondInstance = app.makeSingleInstance((commandLine, workingDirectory) => {
// // Someone tried to run a second instance, we should focus our window.
// console.error('Attempted to open a second instance. Disallowing...')
// focusMainWindow()
// })
//
// if (isSecondInstance) {
// console.error('Data curator is already open. Quitting this application.')
// app.quit()
// }

app.on('ready', () => {
let appMenu = new AppMenu()
Expand Down
50 changes: 36 additions & 14 deletions src/renderer/partials/FindReplace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@
</div>
<span class="btn-group pull-right">
<button
:class="formprop.buttonTypeClass || 'btn-primary'"
class="btn btn-sm previous btn-primary"
type="button"
class="btn btn-sm"
@click="formprop.fn('previous')">
<span
v-if="formprop.buttonLeftClass"
Expand All @@ -44,24 +43,36 @@
</button>
<button
v-show="formprop.buttonRightClass"
:class="formprop.buttonTypeClass || 'btn-primary'"
class="btn btn-sm next btn-primary"
type="button"
class="btn btn-sm"
@click="formprop.fn('next')">
<span :class="formprop.buttonRightClass"/>
</button>
</span>
</div>
<div
v-if="formprop.buttonBelowText"
class="btn-group pull-right">
<button
:class="formprop.buttonTypeClass || 'btn-primary'"
type="button"
class="button-below btn btn-sm"
@click="formprop.belowFn('next')">
<span :class="formprop.buttonBelowClass">{{ formprop.buttonBelowText }}</span>
</button>
class="bottom-line">
<div class="input-group row checkbox input-sm">
<input
id="case-sensitive"
v-model="isCaseSensitive"
type="checkbox">
<label
id="case-sensitive-label"
for="case-sensitive">case sensitive</label>
</div>
<div
v-if="formprop.buttonBelowText"
class="btn-group pull-right">
<button
:class="formprop.buttonTypeClass || 'btn-primary'"
type="button"
class="button-below btn btn-sm"
@click="formprop.belowFn('next')">
<span :class="formprop.buttonBelowClass">{{ formprop.buttonBelowText }}</span>
</button>
</div>
</div>
</div>
<!-- <div class="pickrow">
Expand Down Expand Up @@ -105,6 +116,7 @@ let _previousSearchClear = true
let _findTextValue = ''
let _isCaseSensitive = true
// TODO: consider removing dependence on handsontable, for faster search by implementing own beforeRenderer to trigger on find results
// cannot access DEFAULT anymore - must copy (https://docs.handsontable.com/3.0.0/demo-searching.html#page-custom-callback)
const _defaultCallback = function (instance, row, col, data, testResult) {
let callbackQuery = _isCaseSensitive ? testResult && _.includes(data, _findTextValue) : testResult
Expand Down Expand Up @@ -144,6 +156,7 @@ export default {
hotParameters: {
callback: _searchCallback
},
isCaseSensitive: true,
formprops: [{
label: 'Find in column',
key: 'find',
Expand Down Expand Up @@ -179,6 +192,12 @@ export default {
computed: {
...mapGetters(['getHotSelection'])
},
watch: {
'isCaseSensitive': function(result) {
_isCaseSensitive = result
this.resetAfterUserInput()
}
},
mounted: async function () {
this.activeHotId = await this.currentHotId()
const vueUpdateActiveHotId = this.updateActiveHotId
Expand Down Expand Up @@ -259,14 +278,17 @@ export default {
} else {
this.replaceTextValue = value
}
this.resetAfterUserInput()
},
resetAfterUserInput: function() {
const self = this
this.foundCounter = -1
this.foundCount = -1
this.resetSearchResultWrapper()
// this.clickedFindOrReplace = null
// wait for the css to update from resetting counters then remove all
const vueInputFoundRemoveFeedback = this.inputFoundRemoveFeedback
_.delay(function () {
vueInputFoundRemoveFeedback()
self.inputFoundRemoveFeedback()
}, 10)
},
replaceText: function (direction) {
Expand Down
15 changes: 15 additions & 0 deletions static/css/findreplace.styl
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,18 @@ form#findAndReplace
pointer-events: none
opacity: 0.6
// text-align right

.checkbox
.bottom-line
display flex
flex-direction row
justify-content flex-end
.checkbox
width 40%
justify-content flex-end
margin-right 10px
padding-right 0
#case-sensitive
width 10%
#case-sensitive-label
width auto
Loading

0 comments on commit 15f8e2c

Please sign in to comment.