Skip to content

Commit 918acaf

Browse files
committed
fix(note) - add fields to notes for title, content and reference
1 parent 4f6cf70 commit 918acaf

5 files changed

Lines changed: 25 additions & 5 deletions

File tree

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
<app-note-editor [isEditMode]="false" [initiator]="initiator"></app-note-editor>
1+
<app-note-editor
2+
[isEditMode]="false"
3+
[initiator]="initiator"
4+
[title]="title"
5+
[passedContent]="content"
6+
[reference]="reference"
7+
>
8+
</app-note-editor>

apps/codever-ui/src/app/my-notes/create-note/create-personal-note.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ import { ActivatedRoute } from '@angular/router';
77
})
88
export class CreatePersonalNoteComponent {
99
initiator; // which component the call is coming from (e.g 'bookmarklet')
10+
title; // title if passed on
11+
content; // content if passed ond
12+
reference; // content if passed ond
1013
constructor(private route: ActivatedRoute) {}
1114

1215
ngOnInit(): void {
16+
this.title = this.route.snapshot.queryParamMap.get('title');
17+
this.content = this.route.snapshot.queryParamMap.get('content');
1318
this.initiator = this.route.snapshot.queryParamMap.get('initiator');
19+
this.reference = this.route.snapshot.queryParamMap.get('reference');
1420
}
1521
}

apps/codever-ui/src/app/my-notes/save-note-form/note-editor.component.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,12 @@ export class NoteEditorComponent implements OnInit, OnDestroy, OnChanges {
8181

8282
filteredTags: Observable<any[]>;
8383

84+
@Input()
8485
title; // value of "title" query parameter if present
8586

87+
@Input()
88+
passedContent = ''; // value of "title" query parameter if present
89+
8690
@Input()
8791
isEditMode = false;
8892

@@ -98,6 +102,9 @@ export class NoteEditorComponent implements OnInit, OnDestroy, OnChanges {
98102
@Input()
99103
initiator: string;
100104

105+
@Input()
106+
reference = '';
107+
101108
scrollStrategy: ScrollStrategy;
102109

103110
private destroy$: Subject<void> = new Subject<void>();
@@ -162,9 +169,9 @@ export class NoteEditorComponent implements OnInit, OnDestroy, OnChanges {
162169
buildForm(): void {
163170
this.noteForm = this.formBuilder.group({
164171
title: [this.title ? this.title : '', Validators.required],
165-
reference: '',
172+
reference: this.reference,
166173
tags: this.formBuilder.array([], [tagsValidator, Validators.required]),
167-
content: ['', textSizeValidator(5000, 500)],
174+
content: [this.passedContent, textSizeValidator(5000, 500)],
168175
});
169176
}
170177

apps/codever-ui/src/app/new-entry/new-entry.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class NewEntryComponent implements OnInit {
6262
this.router.navigate(['/my-notes/new'], {
6363
queryParams: {
6464
reference: this.url,
65-
code: this.selection,
65+
content: this.selection,
6666
title: this.title,
6767
popup: this.popup,
6868
initiator: this.initiator,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Codever",
3-
"version": "8.12.0",
3+
"version": "8.12.1",
44
"description": "Codever - bookmarks, snippets and notes manager for developers & co",
55
"scripts": {
66
"test": "echo \"Error: no test specified\" && exit 1",

0 commit comments

Comments
 (0)