Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
JackGruber committed Jan 26, 2022
2 parents 0739ae8 + 5fa3cee commit 04f5c08
Show file tree
Hide file tree
Showing 11 changed files with 12,683 additions and 51 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

## not released

## v1.5.5 (2022-01-26)

- Improved: Alias keyword `AS` is now case insensetive #43
- Fix: #47 Wrong color for finished todos (`todo [done]`) where loaded from the pluginsettings
- Fix: #42 Table misformatted if values are blank
- Fix: #29 #38 Text from note disappear (Thanks to @ken1kob)

## v1.5.4 (2021-10-09)

- Fix: Default value for `Update on Joplin sync`

## v1.5.3 (2021-10-09)

- Add: Option `Update on Joplin sync` to start the Noteoverview update after Joplin syncronisation
- Improved: Start first Noteoverview update after the first Joplin syncronisation (Not as before after 5 minutes)

## v1.5.2 (2021-08-12)

- Fix: #22 Loading error on over 100 notebooks and orphan notebooks
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ A note overview is created based on the defined search and the specified fields.
- [Show all ToDos with no due date](#show-all-todos-with-no-due-date)
- [Rename fields](#rename-fields)
- [Notes without a tag](#notes-without-a-tag)
- [Notes createt last 7 days](#notes-createt-last-7-days)
- [Notes created last 7 days](#notes-created-last-7-days)
- [Cooking recipes overview](#cooking-recipes-overview)
- [Details option](#details-option)
- [Change count for single overview](#change-count-for-single-overview)
Expand Down Expand Up @@ -120,7 +120,7 @@ In addition to the Joplin fields, there are the following virtual fields:
- `file`: List of all attachments
- `file_size`: List of all attachments including their size
- `size`: Size of the note, including attachments
- `tag`: Assigned tags of the note
- `tags`: Assigned tags of the note
- `notebook`: Folder in which the note is stored
- `breadcrumb`: Folder breadcrumb (Folder path)
- `image`: In this field a image resource from the note will be displayed. This field can be configured using the `image` option
Expand Down Expand Up @@ -284,7 +284,7 @@ fields: updated_time, title
-->
```

### Notes createt last 7 days
### Notes created last 7 days

```yml
<!-- note-overview-plugin
Expand Down Expand Up @@ -374,6 +374,7 @@ Settings for the plugin, accessible at `Tools > Options > Note overview`.
| `Show note count` | Show the number of notes found. | `off` |
| `Note count text` | Text for the display of the found notes, `{count}` is replace with the number of matched notes. | `Note count: {{count}}` |
| `Update interval in minutes` | How often the overview notes should be updated. | `5` |
| `Update on Joplin sync` | Update the Noteoverview after a Joplin syncronisation. Independent of the update interval. | `No` |
| `Field status: open todo` | Text for the `status` field, when the todo is not completed. | |
| `Field status: todo completed` | Text for the `status` field, when the todo is completed. | |
| `Field status: todo over due` | Text for the `status` field, when the due date of the todo is exceeded. | |
Expand Down
25 changes: 25 additions & 0 deletions __test__/data/notes/multipleEmpty/body.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Pro

## Next

<!-- note-overview-plugin
search: type:todo iscompleted:0 notebook:"2 - NEXT" tag:pro
fields: title, created_time, body, todo_due, tags
sort: created_time ASC
-->

## Waiting

<!-- note-overview-plugin
search: type:todo iscompleted:0 notebook:"3 - WAITING" tag:pro
fields: title, created_time, body, todo_due, tags
sort: created_time ASC
-->

## Someday / Maybe

<!-- note-overview-plugin
search: type:todo iscompletetd:0 notebook:"5 - SOMEDAY / MAYBE" tag:pro
fields: title, created_time
sort: created_time ASC
-->
6 changes: 6 additions & 0 deletions __test__/data/notes/multipleEmpty/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "",
"title": "Test note mock",
"body": "",
"type_": 1
}
52 changes: 52 additions & 0 deletions __test__/noteoverview.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,58 @@ describe("Get image nr X from body", function () {
});
});

describe("Check getHeaderFields", function () {
it(`Check return value`, async () => {
const testCases = [
{
aliasStr:
"title AS Nazov, updated_time AS CTime, tags AS Tagy, breadcrumb AS Umiesnenie",
fields: ["title", "updated_time", "tags", "breadcrumb"],
expected: ["Nazov", "CTime", "Tagy", "Umiesnenie"],
},
{
aliasStr:
"title AS Nazov, updated_time as CTime, tags AS Tagy, breadcrumb AS Umiesnenie",
fields: ["title", "updated_time", "tags", "breadcrumb"],
expected: ["Nazov", "CTime", "Tagy", "Umiesnenie"],
},
{
aliasStr:
"updated_time as CTime, tags AS Tagy, breadcrumb AS Umiesnenie, title AS Nazov",
fields: ["title", "updated_time", "tags", "breadcrumb"],
expected: ["Nazov", "CTime", "Tagy", "Umiesnenie"],
},
{
aliasStr:
"updated_time as CTime, tags AS Tagy, breadcrumb AS Umiesnenie, title AS Nazov,",
fields: ["title", "updated_time", "tags", "breadcrumb"],
expected: ["Nazov", "CTime", "Tagy", "Umiesnenie"],
},
{
aliasStr:
"title AS Nazov, updated_time AS 💾🕒, tags as Tagy, breadcrumb AS Umiesnenie,",
fields: ["title", "updated_time", "tags", "breadcrumb"],
expected: ["Nazov", "💾🕒", "Tagy", "Umiesnenie"],
},
{
aliasStr:
"title AS Nazov, updated_time AS 💾🕒, tags as #️⃣ Tagy, breadcrumb AS Umiesnenie,",
fields: ["title", "updated_time", "tags", "breadcrumb"],
expected: ["Nazov", "💾🕒", "#️⃣ Tagy", "Umiesnenie"],
},
];

for (const testCase of testCases) {
const actual = await noteoverview.getHeaderFields(
testCase.aliasStr,
testCase.fields
);
expect(actual.length).toEqual(testCase.fields.length);
expect(actual).toEqual(testCase.expected);
}
});
});

describe("get MD excerpt", function () {
it(`remove ~~ ++ ==`, async () => {
const settings = { maxlength: 100 };
Expand Down
3 changes: 2 additions & 1 deletion __test__/update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ describe("noteoverview.update", function () {
jest.spyOn(logging, "info").mockReset();
});

it(`Check matching noteoverview blocks`, async () => {
it(`Check calls of getOverviewContent function`, async () => {
/* prettier-ignore */
const testCases = [
{ noteid: "simpleEmpty", expected: 1, },
{ noteid: "simple", expected: 1, },
{ noteid: "multipleEmpty", expected: 3, },
];

const spyOnegetOverviewContent = jest.spyOn(
Expand Down
Loading

0 comments on commit 04f5c08

Please sign in to comment.