imdone-core 1.54.2 → 1.54.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/migrate-config.js
CHANGED
|
@@ -135,7 +135,7 @@ module.exports = function (repo, defaultSettings = defaultSettingsObject) {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
// Remove settings.filteredLists
|
|
138
|
-
if (config.settings.filteredLists
|
|
138
|
+
if (config.settings.filteredLists) {
|
|
139
139
|
delete config.settings.filteredLists
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -95,7 +95,9 @@ module.exports = class DefaultBoardPropertiesPlugin extends Plugin {
|
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
const templatesFromTemplateDir = await readMarkdownFiles(templateDir);
|
|
98
|
-
const templatesFromGithubDir = await
|
|
98
|
+
const templatesFromGithubDir = await stat(githubDir)
|
|
99
|
+
? await readMarkdownFiles(githubDir, 'github_')
|
|
100
|
+
: {};
|
|
99
101
|
|
|
100
102
|
return { simple: simpleTemplate, ...templatesFromTemplateDir, ...templatesFromGithubDir };
|
|
101
103
|
}
|
package/lib/project.js
CHANGED
|
@@ -363,6 +363,7 @@ module.exports = class WorkerProject extends Project {
|
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
filterCards(cards, filter) {
|
|
366
|
+
this.hideLists = []
|
|
366
367
|
const {
|
|
367
368
|
result,
|
|
368
369
|
hideLists
|
|
@@ -415,7 +416,6 @@ module.exports = class WorkerProject extends Project {
|
|
|
415
416
|
|
|
416
417
|
set filter(filter) {
|
|
417
418
|
this.innerFilter = filter
|
|
418
|
-
this.hideLists = []
|
|
419
419
|
}
|
|
420
420
|
|
|
421
421
|
async addMetadata(task, key, value) {
|
package/lib/repository.js
CHANGED
|
@@ -34,12 +34,10 @@ var _isFunction = require('lodash.isfunction'),
|
|
|
34
34
|
newCard = require('./card'),
|
|
35
35
|
{ replaceDateLanguage } = require('./adapters/parsers/DateLanguageParser'),
|
|
36
36
|
{ getRawTask, isNumber, LIST_NAME_PATTERN } = require('./adapters/parsers/task/CardContentParser'),
|
|
37
|
-
XRegExp = require('xregexp')
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
XRegExp = require('xregexp'),
|
|
38
|
+
promisify = require('util').promisify
|
|
40
39
|
|
|
41
40
|
const appContext = require('./context/ApplicationContext')
|
|
42
|
-
const get = require('lodash.get')
|
|
43
41
|
|
|
44
42
|
var ERRORS = constants.ERRORS,
|
|
45
43
|
DEFAULT_FILE_PATTERN = constants.DEFAULT_FILE_PATTERN,
|
|
@@ -212,24 +210,28 @@ Repository.prototype.addAllMeta = function (meta) {
|
|
|
212
210
|
* @param {} list
|
|
213
211
|
* @return
|
|
214
212
|
*/
|
|
215
|
-
Repository.prototype.addList = function (list, cb) {
|
|
216
|
-
cb = tools.cb(cb)
|
|
217
|
-
if (this.listExists(list.name)) return cb()
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
this.config.code.include_lists.push(codeList)
|
|
213
|
+
Repository.prototype.addList = async function (list, cb) {
|
|
214
|
+
cb = tools.cb(cb);
|
|
215
|
+
if (this.listExists(list.name)) return cb();
|
|
216
|
+
|
|
217
|
+
try {
|
|
218
|
+
list = _omit(list, 'tasks');
|
|
219
|
+
this.config.lists.push(new List(list));
|
|
220
|
+
|
|
221
|
+
if (!list.filter && !/[a-z]/.test(list.name)) {
|
|
222
|
+
const codeList = list.name.replace(/\s+/g, '-').toUpperCase();
|
|
223
|
+
if (!this.config.code.include_lists.find((name) => name === codeList)) {
|
|
224
|
+
this.config.code.include_lists.push(codeList);
|
|
225
|
+
}
|
|
229
226
|
}
|
|
227
|
+
|
|
228
|
+
await promisify(this.saveConfig).bind(this)();
|
|
229
|
+
this.emit('list.modified', list);
|
|
230
|
+
cb();
|
|
231
|
+
} catch (err) {
|
|
232
|
+
cb(err);
|
|
230
233
|
}
|
|
231
|
-
|
|
232
|
-
}
|
|
234
|
+
};
|
|
233
235
|
|
|
234
236
|
Repository.prototype.removeList = function (list, cb) {
|
|
235
237
|
return new Promise((resolve, reject) => {
|
|
@@ -273,7 +275,7 @@ Repository.prototype.getConfig = function () {
|
|
|
273
275
|
* @return MemberExpression
|
|
274
276
|
*/
|
|
275
277
|
Repository.prototype.getLists = function () {
|
|
276
|
-
return this.getConfig().lists
|
|
278
|
+
return this.getConfig().lists.map(obj => ({...obj}));
|
|
277
279
|
}
|
|
278
280
|
|
|
279
281
|
Repository.prototype.getVisibleLists = function () {
|
|
@@ -771,8 +773,8 @@ Repository.prototype.getList = function (name) {
|
|
|
771
773
|
}
|
|
772
774
|
|
|
773
775
|
|
|
774
|
-
Repository.prototype.getListById = function(id) {
|
|
775
|
-
return
|
|
776
|
+
Repository.prototype.getListById = function(id, lists = this.getLists()) {
|
|
777
|
+
return lists.find((list) => list.id === id)
|
|
776
778
|
}
|
|
777
779
|
|
|
778
780
|
Repository.prototype.hideList = function (name, cb) {
|
|
@@ -867,11 +869,11 @@ Repository.prototype.updateList = function(id, {name, filter}) {
|
|
|
867
869
|
if (!filter && this.listExists(name)) return resolve()
|
|
868
870
|
|
|
869
871
|
const lists = this.getLists()
|
|
870
|
-
const list = this.getListById(id)
|
|
872
|
+
const list = this.getListById(id, lists)
|
|
871
873
|
const oldName = list.name
|
|
872
874
|
const oldFilter = list.filter
|
|
873
875
|
list.name = name
|
|
874
|
-
|
|
876
|
+
if (oldFilter) list.filter = filter
|
|
875
877
|
this.setLists(lists)
|
|
876
878
|
|
|
877
879
|
if (oldName === name || oldFilter) {
|