Skip to content

Commit

Permalink
Fix transform
Browse files Browse the repository at this point in the history
  • Loading branch information
piascikj committed Apr 20, 2018
1 parent 2cc6799 commit 6a25cbd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .imdone/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"lists": [
{
"name": "BACKLOG",
"hidden": true
"hidden": false
},
{
"name": "TODO",
"hidden": true
"hidden": false
},
{
"name": "DOING",
Expand Down
25 changes: 12 additions & 13 deletions lib/services/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,36 +69,35 @@ const getTransformers = function (config) {
}
}),
new Transformer({
config,
config: _.get(config, 'transformers.autocreate'),
name: "autocreate",
exec: function (task) {
if (task.meta.created || task.meta.completed) return task.text
const excludeLists = _.get(config, 'transformers.autocreate.exclude')
const filter = _.get(config, 'transformers.autocreate.filter')
if (!this.config || task.meta.created || task.meta.completed) return task.text
const excludeLists = this.config.exclude
const filter = this.config.filter
if (!excludeLists && !filter) return task.text
if (excludeLists && excludeLists.includes(task.list)) return task.text
debugger
if (filter && Repository.query([task], filter).length == 0 ) return task.text
task.addMetaData("created", this.parseDate('now').format())
return task.text
},
pattern: /^((?!\scompleted:).)*$/,
list: _.get(config, 'transformers.autocomplete.list')
pattern: /^((?!\scompleted:).)*$/
}),
new Transformer({
config,
config: _.get(config, 'transformers.autocomplete'),
name: "autocomplete",
exec: function (task) {
if (task.meta.completed) return task.text
const list = _.get(config, 'transformers.autocomplete.list')
const filter = _.get(config, 'transformers.autocomplete.filter')
if (!this.config || task.meta.completed) return task.text
const list = this.config.list
const filter = this.config.filter
if (!list && !filter) return task.text
if (list && (task.list !== list)) return task.text
if (filter && Repository.query([task], filter).length == 0 ) return task.text
task.addMetaData("completed", this.parseDate('now').format())
task.removeMetaData('remind')
return task.text
},
pattern: /^((?!\scompleted:).)*$/,
list: _.get(config, 'transformers.autocomplete.list')
pattern: /^((?!\scompleted:).)*$/
})
]
}
Expand Down
1 change: 1 addition & 0 deletions lib/views/imdone-atom-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ class ImdoneAtomView extends ScrollView
@emitter.emit 'board.update'

filter: (text) ->
@showMask()
text = @getFilter() unless text
if text == ''
@board.find('.task').show()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"fs-plus": "^2.8.1",
"git-up": "^2.0.1",
"ignore": "^3.3.7",
"imdone-core": "1.4.11",
"imdone-core": "1.4.12",
"json-editor": "^0.7.28",
"keen-tracking": "^1.4.0",
"laconic": "^0.2.2",
Expand Down

0 comments on commit 6a25cbd

Please sign in to comment.