diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index b20eebb70..7c99755db 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -40,15 +40,15 @@ export class AppComponent { */ public constructor( translate: TranslateService, + appRef: ApplicationRef, + servertimeService: ServertimeService, operator: OperatorService, loginDataService: LoginDataService, constantsService: ConstantsService, // Needs to be started, so it can register itself to the WebsocketService - servertimeService: ServertimeService, themeService: ThemeService, countUsersService: CountUsersService, // Needed to register itself. configService: ConfigService, - loadFontService: LoadFontService, - appRef: ApplicationRef + loadFontService: LoadFontService ) { // manually add the supported languages translate.addLangs(['en', 'de', 'cs']); @@ -66,9 +66,7 @@ export class AppComponent { filter(s => s), take(1) ) - .subscribe(() => { - servertimeService.startScheduler(); - }); + .subscribe(() => servertimeService.startScheduler()); } /** diff --git a/client/src/app/core/repositories/base-repository.ts b/client/src/app/core/repositories/base-repository.ts index c8314d3e7..1dbaa356e 100644 --- a/client/src/app/core/repositories/base-repository.ts +++ b/client/src/app/core/repositories/base-repository.ts @@ -104,6 +104,9 @@ export abstract class BaseRepository { @@ -112,17 +115,26 @@ export abstract class BaseRepository { - ownViewModel.updateDependencies(viewModel); - }); - this.updateAllObservables(model.id); + this.updateDependency(viewModel); } }); } } + /** + * Updates all models with the provided `update` which is a dependency. + * + * @param update The dependency to update. + */ + protected updateDependency(update: BaseViewModel): void { + // if an domain object we need was added or changed, update viewModelStore + this.getViewModelList().forEach(ownViewModel => { + ownViewModel.updateDependencies(update); + this.updateViewModelObservable(ownViewModel.id); + }); + this.updateViewModelListObservable(); + } + /** * Saves the update to an existing model. So called "update"-function * @param update the update that should be created diff --git a/client/src/app/core/repositories/motions/motion-repository.service.ts b/client/src/app/core/repositories/motions/motion-repository.service.ts index b84b1429b..cd5f62e18 100644 --- a/client/src/app/core/repositories/motions/motion-repository.service.ts +++ b/client/src/app/core/repositories/motions/motion-repository.service.ts @@ -21,7 +21,6 @@ import { MotionBlock } from 'app/shared/models/motions/motion-block'; import { MotionChangeRecommendation } from 'app/shared/models/motions/motion-change-reco'; import { MotionPoll } from 'app/shared/models/motions/motion-poll'; import { OSTreeSortEvent } from 'app/shared/components/sorting-tree/sorting-tree.component'; -import { PersonalNoteService } from '../../ui-services/personal-note.service'; import { TreeService } from 'app/core/ui-services/tree.service'; import { User } from 'app/shared/models/users/user'; import { ViewMotionChangeRecommendation } from 'app/site/motions/models/view-change-recommendation'; @@ -40,6 +39,10 @@ import { ViewMotionBlock } from 'app/site/motions/models/view-motion-block'; import { ViewMediafile } from 'app/site/mediafiles/models/view-mediafile'; import { ViewTag } from 'app/site/tags/models/view-tag'; import { BaseAgendaContentObjectRepository } from '../base-agenda-content-object-repository'; +import { BaseViewModel } from 'app/site/base/base-view-model'; +import { PersonalNote, PersonalNoteContent } from 'app/shared/models/users/personal-note'; +import { ViewPersonalNote } from 'app/site/users/models/view-personal-note'; +import { OperatorService } from 'app/core/core-services/operator.service'; /** * Repository Services for motions (and potentially categories) @@ -67,7 +70,6 @@ export class MotionRepositoryService extends BaseAgendaContentObjectRepository this.getIdentifierOrTitle(viewMotion); viewMotion.getTitle = () => this.getTitle(viewMotion); @@ -180,6 +185,60 @@ export class MotionRepositoryService extends BaseAgendaContentObjectRepository { + return pn.userId === this.operator.user.id; + }); + + if (!personalNote) { + return; + } + + const notes = personalNote.notes; + const collection = Motion.COLLECTIONSTRING; + if (notes && notes[collection] && notes[collection][motionId]) { + return notes[collection][motionId]; + } + } + + /** + * + * @param update + * + * @overwrite + */ + protected updateDependency(update: BaseViewModel): void { + if (update instanceof ViewPersonalNote) { + if (this.operator.isAnonymous || update.userId !== this.operator.user.id) { + return; + } + const notes = update.notes; + const collection = Motion.COLLECTIONSTRING; + + this.getViewModelList().forEach(ownViewModel => { + if (notes && notes[collection] && notes[collection][ownViewModel.id]) { + ownViewModel.personalNote = notes[collection][ownViewModel.id]; + } else { + ownViewModel.personalNote = null; + } + this.updateViewModelObservable(ownViewModel.id); + }); + this.updateViewModelListObservable(); + } else { + super.updateDependency(update); + } + } + /** * Add custom hook into the observables. The motions get a virtual weight (a sequential number) for the * call list order. One can just sort for this number instead of dealing with the sort parent id and weight. @@ -194,10 +253,6 @@ export class MotionRepositoryService extends BaseAgendaContentObjectRepository (motion.personalNote = note)); } }) ); diff --git a/client/src/app/core/repositories/users/personal-note-repository.service.ts b/client/src/app/core/repositories/users/personal-note-repository.service.ts index 193f286a4..9bddf0c94 100644 --- a/client/src/app/core/repositories/users/personal-note-repository.service.ts +++ b/client/src/app/core/repositories/users/personal-note-repository.service.ts @@ -33,20 +33,20 @@ export class PersonalNoteRepositoryService extends BaseRepository { - throw new Error('TODO'); + throw new Error('Not supported'); } public async update(personalNote: Partial, viewPersonalNote: ViewPersonalNote): Promise { - throw new Error('TODO'); + throw new Error('Not supported'); } public async delete(viewPersonalNote: ViewPersonalNote): Promise { - throw new Error('TODO'); + throw new Error('Not supported'); } } diff --git a/client/src/app/core/ui-services/base-filter-list.service.ts b/client/src/app/core/ui-services/base-filter-list.service.ts index e63106a0d..c5019180c 100644 --- a/client/src/app/core/ui-services/base-filter-list.service.ts +++ b/client/src/app/core/ui-services/base-filter-list.service.ts @@ -18,10 +18,16 @@ import { BaseRepository } from '../repositories/base-repository'; export interface OsFilter { property: string; label?: string; - options: (OsFilterOption | string)[]; + options: OsFilterOptions; count?: number; } +/** + * The type of all filter options. This is an array of options. One option + * can be OsFilterOption or a string. + */ +export type OsFilterOptions = (OsFilterOption | string)[]; + /** * Describes a list of available options for a drop down menu of a filter. * A filter condition of null will be interpreted as a negative filter diff --git a/client/src/app/core/ui-services/personal-note.service.ts b/client/src/app/core/ui-services/personal-note.service.ts index 7f7943d3c..b181259ea 100644 --- a/client/src/app/core/ui-services/personal-note.service.ts +++ b/client/src/app/core/ui-services/personal-note.service.ts @@ -1,27 +1,14 @@ import { Injectable } from '@angular/core'; -import { Observable, BehaviorSubject } from 'rxjs'; - import { DataStoreService } from '../core-services/data-store.service'; import { OperatorService } from '../core-services/operator.service'; import { PersonalNote, PersonalNoteObject, PersonalNoteContent } from '../../shared/models/users/personal-note'; import { BaseModel } from '../../shared/models/base/base-model'; import { HttpService } from '../core-services/http.service'; +import { BaseViewModel } from 'app/site/base/base-view-model'; /** - * All subjects are organized by the collection string and id of the model. - */ -interface PersonalNoteSubjects { - [collectionString: string]: { - [id: number]: BehaviorSubject; - }; -} - -/** - * Handles personal notes. - * - * Get updated by subscribing to `getPersonalNoteObserver`. Save personal notes by calling - * `savePersonalNote`. + * Handles saving personal notes. */ @Injectable({ providedIn: 'root' @@ -33,12 +20,7 @@ export class PersonalNoteService { private personalNoteObject: PersonalNoteObject; /** - * All subjects for all observers. - */ - private subjects: PersonalNoteSubjects = {}; - - /** - * Watches for changes in the personal note model. + * Watches for changes in the personal note model and the operator. */ public constructor(private operator: OperatorService, private DS: DataStoreService, private http: HttpService) { operator.getUserObservable().subscribe(() => this.updatePersonalNoteObject()); @@ -61,51 +43,6 @@ export class PersonalNoteService { const operatorId = this.operator.user.id; const objects = this.DS.filter(PersonalNote, pn => pn.user_id === operatorId); this.personalNoteObject = objects.length === 0 ? null : objects[0]; - - this.updateSubscribers(); - } - - /** - * Update all subscribers. - */ - private updateSubscribers(): void { - Object.keys(this.subjects).forEach(collectionString => { - Object.keys(this.subjects[collectionString]).forEach(id => { - this.subjects[collectionString][id].next(this.getPersonalNoteContent(collectionString, +id)); - }); - }); - } - - /** - * Gets the content from a note by the collection string and id. - */ - private getPersonalNoteContent(collectionString: string, id: number): PersonalNoteContent { - if ( - !this.personalNoteObject || - !this.personalNoteObject.notes || - !this.personalNoteObject.notes[collectionString] || - !this.personalNoteObject.notes[collectionString][id] - ) { - return null; - } - return this.personalNoteObject.notes[collectionString][id]; - } - - /** - * Returns an observalbe for a given BaseModel. - * @param model The model to observe the personal note from. - */ - public getPersonalNoteObserver(model: BaseModel): Observable { - if (!this.subjects[model.collectionString]) { - this.subjects[model.collectionString] = {}; - } - if (!this.subjects[model.collectionString][model.id]) { - const subject = new BehaviorSubject( - this.getPersonalNoteContent(model.collectionString, model.id) - ); - this.subjects[model.collectionString][model.id] = subject; - } - return this.subjects[model.collectionString][model.id].asObservable(); } /** @@ -113,7 +50,7 @@ export class PersonalNoteService { * @param model The model the content belongs to * @param content The new content. */ - public async savePersonalNote(model: BaseModel, content: PersonalNoteContent): Promise { + public async savePersonalNote(model: BaseModel | BaseViewModel, content: PersonalNoteContent): Promise { const pnObject: Partial = this.personalNoteObject || {}; if (!pnObject.notes) { pnObject.notes = {}; @@ -129,19 +66,4 @@ export class PersonalNoteService { await this.http.put(`rest/users/personal-note/${pnObject.id}/`, pnObject); } } - - /** - * Changes the 'favorite' status of a personal note, without changing other information - * - * @param model - * @param star The new status to set - */ - public async setPersonalNoteStar(model: BaseModel, star: boolean): Promise { - let content: PersonalNoteContent = this.getPersonalNoteContent(model.collectionString, model.id); - if (!content) { - content = { note: null, star: star }; - } - content.star = star; - return this.savePersonalNote(model, content); - } } diff --git a/client/src/app/site/motions/models/view-motion.ts b/client/src/app/site/motions/models/view-motion.ts index 2730d9483..8f448b474 100644 --- a/client/src/app/site/motions/models/view-motion.ts +++ b/client/src/app/site/motions/models/view-motion.ts @@ -60,7 +60,7 @@ export class ViewMotion extends BaseAgendaViewModel implements Searchable { protected _tags: ViewTag[]; protected _parent: ViewMotion; protected _changeRecommendations: ViewMotionChangeRecommendation[]; - public personalNote: PersonalNoteContent; + public personalNote?: PersonalNoteContent; /** * Is set by the repository; this is the order of the flat call list given by @@ -314,7 +314,7 @@ export class ViewMotion extends BaseAgendaViewModel implements Searchable { * @returns the current state */ public get star(): boolean { - return this.personalNote && this.personalNote.star ? true : false; + return !!this.personalNote && !!this.personalNote.star; } /** @@ -323,7 +323,7 @@ export class ViewMotion extends BaseAgendaViewModel implements Searchable { * @returns true if personalContent is present and has notes */ public get hasNotes(): boolean { - return this.personalNote && this.personalNote.note ? true : false; + return !!this.personalNote && !!this.personalNote.note; } /** @@ -372,7 +372,8 @@ export class ViewMotion extends BaseAgendaViewModel implements Searchable { attachments?: ViewMediafile[], tags?: ViewTag[], parent?: ViewMotion, - changeRecommendations?: ViewMotionChangeRecommendation[] + changeRecommendations?: ViewMotionChangeRecommendation[], + personalNote?: PersonalNoteContent ) { super(Motion.COLLECTIONSTRING); this._motion = motion; @@ -387,6 +388,7 @@ export class ViewMotion extends BaseAgendaViewModel implements Searchable { this._tags = tags; this._parent = parent; this._changeRecommendations = changeRecommendations; + this.personalNote = personalNote; } public getAgendaItem(): ViewItem { diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.html b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.html index a1351161b..64e60ac78 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.html +++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.html @@ -145,7 +145,7 @@ - + @@ -157,7 +157,7 @@ - +
diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts index 99d720802..94034f4ba 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts +++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts @@ -29,7 +29,6 @@ import { MotionPdfExportService } from 'app/site/motions/services/motion-pdf-exp import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service'; import { NotifyService } from 'app/core/core-services/notify.service'; import { OperatorService } from 'app/core/core-services/operator.service'; -import { PersonalNoteContent } from 'app/shared/models/users/personal-note'; import { PersonalNoteService } from 'app/core/ui-services/personal-note.service'; import { PromptService } from 'app/core/ui-services/prompt.service'; import { StatuteParagraphRepositoryService } from 'app/core/repositories/motions/statute-paragraph-repository.service'; @@ -316,11 +315,6 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit, */ public highlightedLineTyping: number; - /** - * The personal notes' content for this motion - */ - public personalNoteContent: PersonalNoteContent; - /** * new state extension label to be submitted, if state extensions can be set */ @@ -379,7 +373,7 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit, translate: TranslateService, matSnackBar: MatSnackBar, public vp: ViewportService, - private operator: OperatorService, + public operator: OperatorService, public perms: LocalPermissionsService, private router: Router, private route: ActivatedRoute, @@ -562,9 +556,6 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit, if (newViewMotion) { this.motion = newViewMotion; this.newStateExtension = this.motion.stateExtension; - this.personalNoteService.getPersonalNoteObserver(this.motion.motion).subscribe(pn => { - this.personalNoteContent = pn; - }); this.patchForm(this.motion); } }); @@ -1400,8 +1391,16 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit, /** * Toggles the favorite status */ - public async toggleFavorite(): Promise { - this.personalNoteService.setPersonalNoteStar(this.motion.motion, !this.motion.star); + public toggleFavorite(): void { + if (!this.motion.personalNote) { + this.motion.personalNote = { + note: '', + star: true + }; + } else { + this.motion.personalNote.star = !this.motion.personalNote.star; + } + this.personalNoteService.savePersonalNote(this.motion, this.motion.personalNote).then(null, this.raiseError); } /** diff --git a/client/src/app/site/motions/modules/motion-detail/components/personal-note/personal-note.component.html b/client/src/app/site/motions/modules/motion-detail/components/personal-note/personal-note.component.html index 9d526d533..81a065064 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/personal-note/personal-note.component.html +++ b/client/src/app/site/motions/modules/motion-detail/components/personal-note/personal-note.component.html @@ -5,8 +5,8 @@ -
-
+
+
No personal note
@@ -25,7 +25,7 @@ matTooltip="{{ 'Edit' | translate }}"> edit - diff --git a/client/src/app/site/motions/modules/motion-detail/components/personal-note/personal-note.component.ts b/client/src/app/site/motions/modules/motion-detail/components/personal-note/personal-note.component.ts index 67fac7c8d..8cfdc882f 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/personal-note/personal-note.component.ts +++ b/client/src/app/site/motions/modules/motion-detail/components/personal-note/personal-note.component.ts @@ -1,8 +1,6 @@ -import { Component, Input, OnDestroy } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { FormBuilder, FormGroup } from '@angular/forms'; -import { Subscription } from 'rxjs'; - import { BaseComponent } from 'app/base.component'; import { MotionPdfExportService } from 'app/site/motions/services/motion-pdf-export.service'; import { PersonalNoteContent } from 'app/shared/models/users/personal-note'; @@ -17,34 +15,12 @@ import { ViewMotion } from 'app/site/motions/models/view-motion'; templateUrl: './personal-note.component.html', styleUrls: ['./personal-note.component.scss'] }) -export class PersonalNoteComponent extends BaseComponent implements OnDestroy { +export class PersonalNoteComponent extends BaseComponent { /** * The motion, which the personal note belong to. */ - private _motion: ViewMotion; - - /** - * Sets the motion. If the motion updates (changes, and so on), the subscription - * for the personal note will be established. - */ @Input() - public set motion(motion: ViewMotion) { - this._motion = motion; - if (this.personalNoteSubscription) { - this.personalNoteSubscription.unsubscribe(); - } - if (motion && motion.motion) { - this.personalNoteSubscription = this.personalNoteService - .getPersonalNoteObserver(motion.motion) - .subscribe(pn => { - this.personalNote = pn; - }); - } - } - - public get motion(): ViewMotion { - return this._motion; - } + public motion: ViewMotion; /** * The edit form for the note @@ -56,16 +32,6 @@ export class PersonalNoteComponent extends BaseComponent implements OnDestroy { */ public isEditMode = false; - /** - * The personal note. - */ - public personalNote: PersonalNoteContent; - - /** - * The subscription for the personal note. - */ - private personalNoteSubscription: Subscription; - /** * Constructor. Creates form * @@ -90,7 +56,7 @@ export class PersonalNoteComponent extends BaseComponent implements OnDestroy { public editPersonalNote(): void { this.personalNoteForm.reset(); this.personalNoteForm.patchValue({ - note: this.personalNote ? this.personalNote.note : '' + note: this.motion.personalNote ? this.motion.personalNote.note : '' }); this.isEditMode = true; } @@ -100,8 +66,8 @@ export class PersonalNoteComponent extends BaseComponent implements OnDestroy { */ public async savePersonalNote(): Promise { let content: PersonalNoteContent; - if (this.personalNote) { - content = Object.assign({}, this.personalNote); + if (this.motion.personalNote) { + content = Object.assign({}, this.motion.personalNote); content.note = this.personalNoteForm.get('note').value; } else { content = { @@ -117,19 +83,10 @@ export class PersonalNoteComponent extends BaseComponent implements OnDestroy { } } - /** - * Remove the subscription if this component isn't needed anymore. - */ - public ngOnDestroy(): void { - if (this.personalNoteSubscription) { - this.personalNoteSubscription.unsubscribe(); - } - } - /** * Triggers a pdf export of the personal note */ public printPersonalNote(): void { - this.pdfService.exportPersonalNote(this.personalNote, this.motion); + this.pdfService.exportPersonalNote(this.motion.personalNote, this.motion); } } diff --git a/client/src/app/site/motions/services/motion-filter-list.service.ts b/client/src/app/site/motions/services/motion-filter-list.service.ts index 8582acaa8..600c81e9e 100644 --- a/client/src/app/site/motions/services/motion-filter-list.service.ts +++ b/client/src/app/site/motions/services/motion-filter-list.service.ts @@ -1,6 +1,8 @@ import { Injectable } from '@angular/core'; -import { BaseFilterListService, OsFilter, OsFilterOption } from 'app/core/ui-services/base-filter-list.service'; +import { TranslateService } from '@ngx-translate/core'; + +import { BaseFilterListService, OsFilter, OsFilterOptions } from 'app/core/ui-services/base-filter-list.service'; import { Motion } from 'app/shared/models/motions/motion'; import { ViewMotion } from '../models/view-motion'; import { CategoryRepositoryService } from 'app/core/repositories/motions/category-repository.service'; @@ -9,7 +11,6 @@ import { StorageService } from 'app/core/core-services/storage.service'; import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service'; import { MotionBlockRepositoryService } from 'app/core/repositories/motions/motion-block-repository.service'; import { MotionCommentSectionRepositoryService } from 'app/core/repositories/motions/motion-comment-section-repository.service'; -import { TranslateService } from '@ngx-translate/core'; import { ConfigService } from 'app/core/ui-services/config.service'; import { ViewWorkflow } from '../models/view-workflow'; import { OperatorService } from 'app/core/core-services/operator.service'; @@ -25,13 +26,18 @@ export class MotionFilterListService extends BaseFilterListService { - // return notesRepo.hasPersonalNote('Motion', m.id) - // } - // }; + this.operator.getUserObservable().subscribe(() => { + this.updateFilterDefinitions(this.filterOptions); + }); + } /** * Subscibes to changing MotionBlocks, and updates the filter accordingly */ private subscribeMotionBlocks(): void { this.motionBlockRepo.getViewModelListObservable().subscribe(motionBlocks => { - const motionBlockOptions = []; - motionBlocks.forEach(mb => { - motionBlockOptions.push({ - condition: mb.id, - label: mb.title, - isActive: false - }); - }); + const motionBlockOptions: OsFilterOptions = motionBlocks.map(mb => ({ + condition: mb.id, + label: mb.title, + isActive: false + })); if (motionBlocks.length) { motionBlockOptions.push('-'); motionBlockOptions.push({ @@ -187,14 +183,11 @@ export class MotionFilterListService extends BaseFilterListService { - const categoryOptions: (OsFilterOption | string)[] = []; - categories.forEach(cat => { - categoryOptions.push({ - condition: cat.id, - label: cat.prefixedName, - isActive: false - }); - }); + const categoryOptions: OsFilterOptions = categories.map(cat => ({ + condition: cat.id, + label: cat.prefixedName, + isActive: false + })); if (categories.length) { categoryOptions.push('-'); categoryOptions.push({ @@ -235,10 +228,10 @@ export class MotionFilterListService extends BaseFilterListService { - const commentOptions: (OsFilterOption | string)[] = []; - comments.forEach(comm => { - commentOptions.push({ - condition: comm.id, - label: comm.name, - isActive: false - }); - }); + const commentOptions: OsFilterOptions = comments.map(comment => ({ + condition: comment.id, + label: comment.name, + isActive: false + })); if (comments.length) { commentOptions.push('-'); commentOptions.push({ diff --git a/client/src/app/site/users/models/view-personal-note.ts b/client/src/app/site/users/models/view-personal-note.ts index 487dbfef6..97b637308 100644 --- a/client/src/app/site/users/models/view-personal-note.ts +++ b/client/src/app/site/users/models/view-personal-note.ts @@ -1,5 +1,5 @@ import { BaseViewModel } from 'app/site/base/base-view-model'; -import { PersonalNote } from 'app/shared/models/users/personal-note'; +import { PersonalNote, PersonalNotesFormat } from 'app/shared/models/users/personal-note'; export class ViewPersonalNote extends BaseViewModel { public static COLLECTIONSTRING = PersonalNote.COLLECTIONSTRING; @@ -7,11 +7,19 @@ export class ViewPersonalNote extends BaseViewModel { private _personalNote: PersonalNote; public get personalNote(): PersonalNote { - return this._personalNote ? this._personalNote : null; + return this._personalNote; } public get id(): number { - return this.personalNote ? this.personalNote.id : null; + return this.personalNote.id; + } + + public get userId(): number { + return this.personalNote.user_id; + } + + public get notes(): PersonalNotesFormat { + return this.personalNote.notes; } /** @@ -19,7 +27,7 @@ export class ViewPersonalNote extends BaseViewModel { */ public getVerboseName; - public constructor(personalNote?: PersonalNote) { + public constructor(personalNote: PersonalNote) { super(PersonalNote.COLLECTIONSTRING); this._personalNote = personalNote; } @@ -28,7 +36,5 @@ export class ViewPersonalNote extends BaseViewModel { return this.personalNote ? this.personalNote.toString() : null; }; - public updateDependencies(update: BaseViewModel): void { - throw new Error('Todo'); - } + public updateDependencies(update: BaseViewModel): void {} }