Skip to content

Commit

Permalink
Merge branch 'master' into feat/issue-provider-rework
Browse files Browse the repository at this point in the history
* master:
  fix: edge case when creating new tags together with existing tags in short syntax
  Update README.md
  Add mention of sync in app summary
  build: add missing dep 2?
  • Loading branch information
johannesjo committed Dec 7, 2024
2 parents f7c7a87 + c1d608a commit 2d08b14
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
- Need some extra focus? A **Pomodoro timer** is also always at hand.
- **Collect personal metrics** to see, which of your work routines need adjustments.
- Integrate with **Jira**, **GitHub**, **GitLab**, **Gitea** and **OpenProject**. Auto import tasks assigned to you, plan the details locally, automatically create work logs, and get notified immediately, when something changes.
- Back up and synchronize your data across multiple devices with **Dropbox** and **WebDAV** support
- Attach context information to tasks and projects. Create **notes**, attach **files** or create **project-level bookmarks** for links, files, and even commands.
- Super Productivity **respects your privacy** and **does NOT collect any data** and there are no user accounts or registration. **You decide where you store your data!**
- It's **free** and **open source** and always will be.
Expand Down
22 changes: 22 additions & 0 deletions src/app/features/tasks/short-syntax.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,28 @@ describe('shortSyntax', () => {
});
});

it('should work for edge case #3728', () => {
const t = {
...TASK,
title: 'Test tag error #testing #someNewTag3',
tagIds: [],
};
const r = shortSyntax(t, CONFIG, [
...ALL_TAGS,
{ ...DEFAULT_TAG, id: 'testing_id', title: 'testing' },
]);

expect(r).toEqual({
newTagTitles: ['someNewTag3'],
remindAt: null,
projectId: undefined,
taskChanges: {
title: 'Test tag error',
tagIds: ['testing_id'],
},
});
});

it('should not add new "asd #asd" tag when disabled', () => {
const t = {
...TASK,
Expand Down
10 changes: 7 additions & 3 deletions src/app/features/tasks/store/short-syntax.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ export class ShortSyntaxEffects {
}

if (r.newTagTitles.length) {
actions.push(addNewTagsFromShortSyntax({ task, newTitles: r.newTagTitles }));
actions.push(
addNewTagsFromShortSyntax({ taskId: task.id, newTitles: r.newTagTitles }),
);
}

if (tagIds && tagIds.length) {
Expand Down Expand Up @@ -184,7 +186,7 @@ export class ShortSyntaxEffects {
ofType(addNewTagsFromShortSyntax),
// needed cause otherwise task gets the focus after blur & hide
tap((v) => this._layoutService.hideAddTaskBar()),
concatMap(({ task, newTitles }) => {
concatMap(({ taskId, newTitles }) => {
return this._matDialog
.open(DialogConfirmComponent, {
restoreFocus: true,
Expand All @@ -205,7 +207,9 @@ export class ShortSyntaxEffects {
})
.afterClosed()
.pipe(
mergeMap((isConfirm: boolean) => {
// NOTE: it is important to get a fresh task here, since otherwise we might run into #3728
withLatestFrom(this._taskService.getByIdOnce$(taskId)),
mergeMap(([isConfirm, task]) => {
const actions: any[] = [];
if (isConfirm) {
const newTagIds = [...task.tagIds];
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/tasks/store/task.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export const addNewTagsFromShortSyntax = createAction(
TaskActionTypes.AddNewTagsFromShortSyntax,

props<{
task: Task;
taskId: string;
newTitles: string[];
}>(),
);

0 comments on commit 2d08b14

Please sign in to comment.