Skip to content

Commit

Permalink
Merge pull request #330 from imdone/story/List-tasks-in-a-story/task/…
Browse files Browse the repository at this point in the history
…If-no-story-is-given-list-the-stories-and-use-the-last-story-as-the-default-selection

Story/list tasks in a story/task/if no story is given list the stories and use the last story as the default selection
  • Loading branch information
piascikj committed Sep 13, 2023
2 parents 06e0f52 + e57b5ab commit b6a7c03
Show file tree
Hide file tree
Showing 62 changed files with 891 additions and 218 deletions.
25 changes: 14 additions & 11 deletions backlog/.imdone/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,28 @@ code:
- IDEA
- NOTE
- REVIEW
- CURRENT
- BACKLOG
lists:
- hidden: false
ignore: false
name: NOTE
id: jea6phpllxpsj7m
- name: BACKLOG
hidden: false
ignore: false
id: jea67colm3nm22s
- hidden: false
name: TODO
- name: CURRENT
hidden: false
ignore: false
id: jea6n0olmh5lhcn
- name: TODO
hidden: false
ignore: false
id: jea6phpllxpsj7j
- hidden: false
name: DOING
- name: DOING
hidden: false
ignore: false
id: jea6phpllxpsj7k
- hidden: false
- name: DONE
hidden: false
ignore: false
name: DONE
id: jea6phpllxpsj7l
settings:
openIn: default
Expand Down Expand Up @@ -59,7 +62,7 @@ settings:
addCheckBoxTasks: false
doneList: DONE
taskPrefix: '##'
tagPrefix: +
tagPrefix: '#'
metaSep: ':'
orderMeta: true
maxLines: 6
Expand Down
12 changes: 6 additions & 6 deletions backlog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ This is the story summary
```bash
npx imdone start <task-id>
```
- [ ] This should find the task and create a branch named `story/<sid>/<group>/<task id>/<task filname>`
- [ ] Move the task to the `DOING` list
- [ ] If the branch exists, check it out
- [ ] Set the task id in session so we know what to close
- [ ] Save the branch name in session so we can check it out again
- [x] This should find the task and create a branch named `story/<sid>/<group>/<task id>/<task filname>`
- [x] Move the task to the `DOING` list
- [x] If the branch exists, check it out
- [x] Set the task id in session so we know what to close
- [x] Save the branch name in session so we can check it out again

#### Add breadcrumbs for the next developer or ensemble
1. Open the file with the same name as the branch under backlog and add content!!!
2. commit and push the branch or run `mob done`
2. commit and push the branch

#### Complete a task
```bash
Expand Down
14 changes: 14 additions & 0 deletions backlog/import-tasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Import tasks

After collaborative design, import a story and story tasks from markdown

## Tasks
- [x] `./backlog` is the default project folder
- [x] Initialize imdone in the backlog folder
- [x] `<story-id>` should be the markdown title
- [x] On import always remove the contents of the `backlog/story/<story-id>`
- [x] Shold handle a file with the following format
- [x] Make sure checked items are put in DONE list
- [x] use `markdown-it.parse` to create AST
- [x] Save story-id project path so it's available for starting a task
- [ ] Refactor to domain
17 changes: 17 additions & 0 deletions backlog/list-tasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# List tasks in a story

List all the tasks in a story

```bash
npx imdone ls -p backlog -s <story-id>
```

## Tasks

- [ ] `./backlog` is the default project folder
- Adds all content before `## Tasks` to story
- [ ] Can also pass in the story id with the `-s <story-id> option
- [ ] If no story is given list the stories and use the last story as the default selection
- [ ] Produces output the same as input
- [ ] Can also use a filter
- [ ] Can output as JSON
17 changes: 7 additions & 10 deletions backlog/start-task.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Start task

After collaborative design, import a story and story tasks from markdown
Start a task by task-id

## Tasks
- [x] `./backlog` is the default project folder
- [x] Initialize imdone in the backlog folder
- [x] `<story-id>` should be the markdown title
- [x] On import always remove the contents of the `backlog/story/<story-id>`
- [x] Shold handle a file with the following format
- [x] Make sure checked items are put in DONE list
- [x] use `markdown-it.parse` to create AST
- [x] Save story-id project path so it's available for starting a task
- [ ] Refactor to domain

- [ ] This should find the task and create a branch named `story/<sid>/task/<task filname>`
- [ ] Move the task to the `DOING` list
- [ ] If the branch exists, check it out
- [ ] Set the task id in session so we know what to close
- [ ] Save the branch name in session so we can check it out again
19 changes: 19 additions & 0 deletions backlog/stories/.imdone/actions/board.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = function (task) {
const project = this.project
const groups = [...new Set(
project.getCards('meta.group = *').map((card) => card.meta.group && card.meta.group[0])
)].map(group => {
const name = group
const value = `"${group}"`
return { name, value}
})
return [{name: 'All tasks', value: '*'}, ...groups].map((group) => {
const filterValue = encodeURIComponent(`meta.group = ${group.value} or tags = story`)
return {
title: group.name,
action: function () {
project.openUrl(`imdone://active.repo?filter=${filterValue}`)
}
}
})
}
4 changes: 4 additions & 0 deletions backlog/stories/.imdone/actions/card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = function (task) {
const project = this.project
return []
}
67 changes: 67 additions & 0 deletions backlog/stories/.imdone/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
keepEmptyPriority: true
code:
include_lists:
- TODO
- DOING
- DONE
- PLANNING
- FIXME
- ARCHIVE
- HACK
- CHANGED
- XXX
- IDEA
- NOTE
- REVIEW
- BACKLOG
lists:
- hidden: false
ignore: false
name: NOTE
id: jea6phpllxpsj7m
- name: BACKLOG
hidden: false
ignore: false
id: jea67colm3nm22s
- hidden: false
name: TODO
id: jea6phpllxpsj7j
- hidden: false
name: DOING
id: jea6phpllxpsj7k
- hidden: false
ignore: false
name: DONE
id: jea6phpllxpsj7l
settings:
openIn: default
customOpenIn: ''
editorTheme: blackboard
journalType: New File
journalPath: tasks
appendNewCardsTo: imdone-tasks.md
newCardSyntax: HASHTAG
replaceSpacesWith: '-'
plugins:
devMode: false
journalTemplate: null
theme: dark
views: []
name: stories
cards:
colors: []
template: |
<!-- created:${(new Date()).toISOString()} task-id:${sid} -->
trackChanges: false
metaNewLine: false
addCompletedMeta: false
addCheckBoxTasks: false
doneList: DONE
taskPrefix: '##'
tagPrefix: +
metaSep: ':'
orderMeta: true
maxLines: 6
addNewCardsToTop: true
defaultList: TODO
17 changes: 17 additions & 0 deletions backlog/stories/.imdone/properties/card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const generateRandomString = (length) => {
let result = '';
const characters =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
const charactersLength = characters.length;
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
};

module.exports = function (task) {
const project = this.project
return {
sid: generateRandomString(5)
}
}
19 changes: 19 additions & 0 deletions backlog/stories/Import-tasks/.imdone/actions/board.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = function (task) {
const project = this.project
const groups = [...new Set(
project.getCards('meta.group = *').map((card) => card.meta.group && card.meta.group[0])
)].map(group => {
const name = group
const value = `"${group}"`
return { name, value}
})
return [{name: 'All tasks', value: '*'}, ...groups].map((group) => {
const filterValue = encodeURIComponent(`meta.group = ${group.value} or tags = story`)
return {
title: group.name,
action: function () {
project.openUrl(`imdone://active.repo?filter=${filterValue}`)
}
}
})
}
4 changes: 4 additions & 0 deletions backlog/stories/Import-tasks/.imdone/actions/card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = function (task) {
const project = this.project
return []
}
65 changes: 65 additions & 0 deletions backlog/stories/Import-tasks/.imdone/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
keepEmptyPriority: true
code:
include_lists:
- TODO
- DOING
- DONE
- PLANNING
- FIXME
- ARCHIVE
- HACK
- CHANGED
- XXX
- IDEA
- NOTE
- REVIEW
- BACKLOG
lists:
- name: NOTE
hidden: false
ignore: false
id: jea6phpllxpsj7m
- name: TODO
hidden: false
ignore: false
id: jea6phpllxpsj7j
- name: DOING
hidden: false
ignore: false
id: jea6phpllxpsj7k
- name: DONE
hidden: false
ignore: false
id: jea6phpllxpsj7l
settings:
openIn: default
customOpenIn: ''
editorTheme: blackboard
journalType: New File
journalPath: tasks
appendNewCardsTo: imdone-tasks.md
newCardSyntax: HASHTAG
replaceSpacesWith: '-'
plugins:
devMode: false
journalTemplate: null
theme: dark
views: []
name: Import-tasks
cards:
colors: []
template: |
<!-- created:${(new Date()).toISOString()} task-id:${sid} -->
trackChanges: false
metaNewLine: false
addCompletedMeta: false
addCheckBoxTasks: false
doneList: DONE
taskPrefix: '##'
tagPrefix: +
metaSep: ':'
orderMeta: true
maxLines: 6
addNewCardsToTop: true
defaultList: TODO
17 changes: 17 additions & 0 deletions backlog/stories/Import-tasks/.imdone/properties/card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const generateRandomString = (length) => {
let result = '';
const characters =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
const charactersLength = characters.length;
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
};

module.exports = function (task) {
const project = this.project
return {
sid: generateRandomString(5)
}
}
3 changes: 3 additions & 0 deletions backlog/stories/Import-tasks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## #CURRENT After collaborative design, import a story and story tasks from markdown
<!-- #story -->
<!-- created:2023-09-12T13:05:36.035Z task-id:g4ihW order:-10 story-id:Import-tasks -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## #DONE `./backlog` is the default project folder
<!-- #task -->
<!-- created:2023-09-12T13:05:36.053Z task-id:RHwz2 group:"Ungrouped Tasks" story-id:Import-tasks order:10 -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## #DONE Import adds story cards to current
<!-- story-id:Import-tasks group:"Ungrouped Tasks" #task -->
<!-- created:2023-09-13T00:59:06.160Z task-id:7fCRq order:-30 -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## #DONE Initialize imdone in the backlog folder
<!-- #task -->
<!-- created:2023-09-12T13:05:36.055Z task-id:tzubx group:"Ungrouped Tasks" story-id:Import-tasks order:20 -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## #DONE Make sure checked items are put in DONE list
<!-- #task -->
<!-- created:2023-09-12T13:05:36.064Z task-id:DCM3w group:"Ungrouped Tasks" story-id:Import-tasks order:60 -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## #DONE On import always remove the contents of the `backlog/story/<story-id>`
<!-- #task -->
<!-- created:2023-09-12T13:05:36.059Z task-id:uwCAv group:"Ungrouped Tasks" story-id:Import-tasks order:40 -->
3 changes: 3 additions & 0 deletions backlog/stories/Import-tasks/tasks/Refactor-to-domain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## #DONE Refactor to domain
<!-- #task -->
<!-- created:2023-09-12T13:05:36.072Z task-id:w9AhL group:"Ungrouped Tasks" story-id:Import-tasks order:-20 -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## #DONE Save story-id project path so it's available for starting a task
<!-- #task -->
<!-- created:2023-09-12T13:05:36.069Z task-id:eGOkf group:"Ungrouped Tasks" story-id:Import-tasks order:80 -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## #DONE Shold handle a file with the following format
<!-- #task -->
<!-- created:2023-09-12T13:05:36.062Z task-id:6lshu group:"Ungrouped Tasks" story-id:Import-tasks order:50 -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## #DONE `<story-id>` should be the markdown title
<!-- #task -->
<!-- created:2023-09-12T13:05:36.057Z task-id:pSyPB group:"Ungrouped Tasks" story-id:Import-tasks order:30 -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## #DONE use `markdown-it.parse` to create AST
<!-- #task -->
<!-- created:2023-09-12T13:05:36.066Z task-id:YU3Ur group:"Ungrouped Tasks" story-id:Import-tasks order:70 -->
Loading

0 comments on commit b6a7c03

Please sign in to comment.