imdone-core 1.44.2 → 1.44.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.
@@ -62,7 +62,8 @@ module.exports = class EpicPlugin extends Plugin {
62
62
  addEpicItem(name, task) {
63
63
  const list = task.list
64
64
  this.initEpic(name)
65
- if (!this.getEpicItems(name, list)) this.epics[name].items[list] = []
65
+ if (!this.getEpicItemsInList(name, list)) this.epics[name].items[list] = []
66
+ if (this.getEpicItemsInList(name, list).find((t) => t.id === task.id)) return
66
67
  this.epics[name].items[list].push(task)
67
68
  }
68
69
 
@@ -74,11 +75,15 @@ module.exports = class EpicPlugin extends Plugin {
74
75
  return this.epics[name].epic
75
76
  }
76
77
 
77
- getEpicItems(name, list) {
78
- if (!list) return this.epics[name].items
78
+ getEpicItems(name) {
79
+ return this.epics[name].items
80
+ }
81
+
82
+ getEpicItemsInList(name, list) {
79
83
  return this.epics[name].items[list]
80
84
  }
81
85
 
86
+
82
87
  getEpicLists(name) {
83
88
  return Object.keys(this.getEpicItems(name))
84
89
  }
@@ -117,7 +122,7 @@ module.exports = class EpicPlugin extends Plugin {
117
122
 
118
123
  // Add epic link to epic tasks
119
124
  epicLists.forEach((list) => {
120
- this.getEpicItems(epicId, list).forEach((task) => {
125
+ this.getEpicItemsInList(epicId, list).forEach((task) => {
121
126
  task.interpretedContent = epicLink + task.interpretedContent
122
127
  task.init()
123
128
  })
@@ -145,10 +150,10 @@ module.exports = class EpicPlugin extends Plugin {
145
150
  let content = ''
146
151
 
147
152
  lists
148
- .filter((list) => this.getEpicItems(epicId, list.name))
153
+ .filter((list) => this.getEpicItemsInList(epicId, list.name))
149
154
  .reverse()
150
155
  .forEach((list) => {
151
- const tasks = this.getEpicItems(epicId, list.name)
156
+ const tasks = this.getEpicItemsInList(epicId, list.name)
152
157
  const listUrl = epicUrl + encodeURIComponent(` and list=${list.name}`)
153
158
  const listLink = `[${list.name}](${listUrl})`
154
159
  content = content + '\n\n#### ' + listLink + '\n'
package/lib/project.js CHANGED
@@ -15,6 +15,7 @@ const exec = require('child_process').exec
15
15
  const fastSort = require('fast-sort/dist/sort.js')
16
16
  const Task = require('./task')
17
17
  const eol = require('eol')
18
+ const { renderMarkdown } = require('./adapters/markdown')
18
19
 
19
20
  function calculateTotals(lists) {
20
21
  const totals = {}
@@ -777,4 +778,8 @@ module.exports = class WorkerProject extends Project {
777
778
  })
778
779
  })
779
780
  }
781
+
782
+ renderMarkdown(content) {
783
+ return renderMarkdown(content)
784
+ }
780
785
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imdone-core",
3
- "version": "1.44.2",
3
+ "version": "1.44.4",
4
4
  "description": "imdone-core",
5
5
  "main": "index.js",
6
6
  "scripts": {