generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: "Review and check your Statuses" now shows any problems (#2399)
* feat: Add (empty for now) column 'Problems (if any)' * feat: Report any empty status symbols in settings * feat: Report any duplicate status symbols in settings * feat: Report any unknown next status symbols in settings * feat: Report DONE statuses whose next status type is a problem for recurrence See #2089 and #2304 * feat: Add a gentle message for statuses with non-conventional type. * refactor: . Unwrap else block, to reduce indentation. * refactor: - Flip if and then unwrap else block, to reduce indentation. * fix: Make punctuation consistent at end of messages. * fix: Format values in messages, so that they stand out. * fix: Correct the display of empty symbols. They were rendered in Obsidian as `` * refactor: . Flip if condition to reduce nesting. * refactor: . Use early return to reduce nesting. * docs: I've realised that recurring DONE to IN_PROGRESS is OK So update the heading in the relevant docs page. See #2304 (comment) * feat: Add link to page 'Recurring Tasks and Custom Statuses' * feat:
- Loading branch information
1 parent
aa4a745
commit e8edb72
Showing
7 changed files
with
148 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...gsReport.test.StatusSettingsReport_should_include_problems_in_table.approved.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
| Status Symbol | Next Status Symbol | Status Name | Status Type | Problems (if any) | | ||
| ----- | ----- | ----- | ----- | ----- | | ||
| `space` | `x` | Todo | `TODO` | | | ||
| `x` | `space` | Done | `DONE` | | | ||
| `/` | `x` | In Progress | `IN_PROGRESS` | | | ||
| `/` | `x` | In Progress DUPLICATE | `IN_PROGRESS` | Duplicate symbol '`/`': this status will be ignored. | | ||
| `X` | `space` | X - conventionally DONE, but this is CANCELLED | `CANCELLED` | For information, the conventional type for status symbol `X` is `DONE`: you may wish to review this type. | | ||
| | | | `TODO` | Empty symbol: this status will be ignored. | | ||
| `p` | `q` | Unknown next symbol | `TODO` | Next symbol `q` is unknown: create a status with symbol `q`. | | ||
| `c` | `d` | Followed by d | `TODO` | Next symbol `d` is unknown: create a status with symbol `d`. | | ||
| `n` | `n` | Non-task | `NON_TASK` | | | ||
| `1` | `space` | DONE followed by TODO | `DONE` | | | ||
| `2` | `/` | DONE followed by IN_PROGRESS | `DONE` | | | ||
| `3` | `x` | DONE followed by DONE | `DONE` | This `DONE` status is followed by `DONE`, not `TODO` or `IN_PROGRESS`: this will not work well for recurring tasks. See [Recurring Tasks and Custom Statuses](https://publish.obsidian.md/tasks/Getting+Started/Statuses/Recurring+Tasks+and+Custom+Statuses). | | ||
| `4` | `X` | DONE followed by CANCELLED | `DONE` | This `DONE` status is followed by `CANCELLED`, not `TODO` or `IN_PROGRESS`: this will not work well for recurring tasks. See [Recurring Tasks and Custom Statuses](https://publish.obsidian.md/tasks/Getting+Started/Statuses/Recurring+Tasks+and+Custom+Statuses). | | ||
| `5` | `n` | DONE followed by NON_TASK | `DONE` | This `DONE` status is followed by `NON_TASK`, not `TODO` or `IN_PROGRESS`: this will not work well for recurring tasks. See [Recurring Tasks and Custom Statuses](https://publish.obsidian.md/tasks/Getting+Started/Statuses/Recurring+Tasks+and+Custom+Statuses). | |
12 changes: 6 additions & 6 deletions
12
...ingsReport.test.StatusSettingsReport_should_tabulate_StatusSettings.approved.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
| Status Symbol | Next Status Symbol | Status Name | Status Type | | ||
| ----- | ----- | ----- | ----- | | ||
| `space` | `x` | Todo | `TODO` | | ||
| `x` | `space` | Done | `DONE` | | ||
| `/` | `x` | In Progress | `IN_PROGRESS` | | ||
| `-` | `space` | Cancelled | `CANCELLED` | | ||
| Status Symbol | Next Status Symbol | Status Name | Status Type | Problems (if any) | | ||
| ----- | ----- | ----- | ----- | ----- | | ||
| `space` | `x` | Todo | `TODO` | | | ||
| `x` | `space` | Done | `DONE` | | | ||
| `/` | `x` | In Progress | `IN_PROGRESS` | | | ||
| `-` | `space` | Cancelled | `CANCELLED` | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,34 @@ | ||
import { StatusSettings } from '../src/Config/StatusSettings'; | ||
import { tabulateStatusSettings } from '../src/StatusSettingsReport'; | ||
import type { StatusCollection } from '../src/StatusCollection'; | ||
import { verifyWithFileExtension } from './TestingTools/ApprovalTestHelpers'; | ||
import { coreStatusesData, createStatuses } from './TestingTools/StatusesTestHelpers'; | ||
|
||
describe('StatusSettingsReport', () => { | ||
it('should tabulate StatusSettings', () => { | ||
const statusSettings = new StatusSettings(); | ||
const markdown = tabulateStatusSettings(statusSettings); | ||
verifyWithFileExtension(markdown, '.md'); | ||
}); | ||
|
||
it('should include problems in table', () => { | ||
const customStatusesData: StatusCollection = [ | ||
['/', 'In Progress', 'x', 'IN_PROGRESS'], | ||
['/', 'In Progress DUPLICATE', 'x', 'IN_PROGRESS'], | ||
['X', 'X - conventionally DONE, but this is CANCELLED', ' ', 'CANCELLED'], | ||
['', '', '', 'TODO'], // A new, unedited status | ||
['p', 'Unknown next symbol', 'q', 'TODO'], | ||
['c', 'Followed by d', 'd', 'TODO'], | ||
['n', 'Non-task', 'n', 'NON_TASK'], | ||
['1', 'DONE followed by TODO', ' ', 'DONE'], | ||
['2', 'DONE followed by IN_PROGRESS', '/', 'DONE'], | ||
['3', 'DONE followed by DONE', 'x', 'DONE'], | ||
['4', 'DONE followed by CANCELLED', 'X', 'DONE'], | ||
['5', 'DONE followed by NON_TASK', 'n', 'DONE'], | ||
]; | ||
const { statusSettings } = createStatuses(coreStatusesData, customStatusesData); | ||
|
||
const markdown = tabulateStatusSettings(statusSettings); | ||
verifyWithFileExtension(markdown, '.md'); | ||
}); | ||
}); |