diff --git a/client/src/app/core/app-config.ts b/client/src/app/core/app-config.ts index 487042193..99a049f06 100644 --- a/client/src/app/core/app-config.ts +++ b/client/src/app/core/app-config.ts @@ -17,7 +17,7 @@ export interface ModelEntry extends BaseModelEntry { } export interface SearchableModelEntry extends BaseModelEntry { - viewModel: new (...args: any[]) => BaseViewModel & Searchable; + viewModel: ViewModelConstructor; searchOrder: number; } diff --git a/client/src/app/core/core-services/autoupdate.service.ts b/client/src/app/core/core-services/autoupdate.service.ts index 2944a4cae..49ae85aaa 100644 --- a/client/src/app/core/core-services/autoupdate.service.ts +++ b/client/src/app/core/core-services/autoupdate.service.ts @@ -129,7 +129,7 @@ export class AutoupdateService { * @returns A list of basemodels constructed from the given models. */ private mapObjectsToBaseModels(collection: string, models: object[]): BaseModel[] { - const targetClass = this.modelMapper.getModelConstructorFromCollectionString(collection); + const targetClass = this.modelMapper.getModelConstructor(collection); if (!targetClass) { throw new Error(`Unregistered resource ${collection}`); } diff --git a/client/src/app/core/core-services/collectionStringMapper.service.ts b/client/src/app/core/core-services/collectionStringMapper.service.ts index 81a348bd9..b91aeaa9a 100644 --- a/client/src/app/core/core-services/collectionStringMapper.service.ts +++ b/client/src/app/core/core-services/collectionStringMapper.service.ts @@ -5,20 +5,22 @@ import { BaseRepository } from 'app/core/repositories/base-repository'; import { ViewModelConstructor, BaseViewModel } from 'app/site/base/base-view-model'; /** - * Holds a mapping entry with the matching collection string, - * model constructor, view model constructor and the repository + * Unifies the ModelConstructor and ViewModelConstructor. */ -type MappingEntry = [ - string, - ModelConstructor, - ViewModelConstructor, - BaseRepository -]; +interface UnifiedConstructors { + COLLECTIONSTRING: string; + new (...args: any[]): any; +} + +/** + * Every types supported: (View)ModelConstructors, repos and collectionstrings. + */ +type TypeIdentifier = UnifiedConstructors | BaseRepository | string; /** * Registeres the mapping between collection strings, models constructors, view * model constructors and repositories. - * All models ned to be registered! + * All models need to be registered! */ @Injectable({ providedIn: 'root' @@ -28,28 +30,11 @@ export class CollectionStringMapperService { * Maps collection strings to mapping entries */ private collectionStringMapping: { - [collectionString: string]: MappingEntry; - } = {}; - - /** - * Maps models to mapping entries - */ - private modelMapping: { - [modelName: string]: MappingEntry; - } = {}; - - /** - * Maps view models to mapping entries - */ - private viewModelMapping: { - [viewModelname: string]: MappingEntry; - } = {}; - - /** - * Maps repositories to mapping entries - */ - private repositoryMapping: { - [repositoryName: string]: MappingEntry; + [collectionString: string]: [ + ModelConstructor, + ViewModelConstructor, + BaseRepository + ]; } = {}; public constructor() {} @@ -65,71 +50,42 @@ export class CollectionStringMapperService { viewModel: ViewModelConstructor, repository: BaseRepository ): void { - const entry: MappingEntry = [collectionString, model, viewModel, repository]; - this.collectionStringMapping[collectionString] = entry; - this.modelMapping[model.name] = entry; - this.viewModelMapping[viewModel.name] = entry; - this.repositoryMapping[repository.name] = entry; + this.collectionStringMapping[collectionString] = [model, viewModel, repository]; } - // The following accessors are for giving one of EntryType by given a different object - // of EntryType. - - public getCollectionStringFromModelConstructor(ctor: ModelConstructor): string { - return this.modelMapping[ctor.name][0]; - } - public getCollectionStringFromViewModelConstructor(ctor: ViewModelConstructor): string { - return this.viewModelMapping[ctor.name][0]; - } - public getCollectionStringFromRepository( - repository: BaseRepository - ): string { - return this.repositoryMapping[repository.name][0]; + /** + * @param obj The object to get the collection string from. + * @returns the collectionstring + */ + public getCollectionString(obj: TypeIdentifier): string { + if (typeof obj === 'string') { + return obj; + } else { + return obj.COLLECTIONSTRING; + } } - public getModelConstructorFromCollectionString(collectionString: string): ModelConstructor { - return this.collectionStringMapping[collectionString][1] as ModelConstructor; - } - public getModelConstructorFromViewModelConstructor( - ctor: ViewModelConstructor - ): ModelConstructor { - return this.viewModelMapping[ctor.name][1] as ModelConstructor; - } - public getModelConstructorFromRepository( - repository: BaseRepository - ): ModelConstructor { - return this.repositoryMapping[repository.name][1] as ModelConstructor; + /** + * @param obj The object to get the model constructor from. + * @returns the model constructor + */ + public getModelConstructor(obj: TypeIdentifier): ModelConstructor { + return this.collectionStringMapping[this.getCollectionString(obj)][0] as ModelConstructor; } - public getViewModelConstructorFromCollectionString( - collectionString: string - ): ViewModelConstructor { - return this.collectionStringMapping[collectionString][2] as ViewModelConstructor; - } - public getViewModelConstructorFromModelConstructor( - ctor: ModelConstructor - ): ViewModelConstructor { - return this.modelMapping[ctor.name][2] as ViewModelConstructor; - } - public getViewModelConstructorFromRepository( - repository: BaseRepository - ): ViewModelConstructor { - return this.repositoryMapping[repository.name][2] as ViewModelConstructor; + /** + * @param obj The object to get the view model constructor from. + * @returns the view model constructor + */ + public getViewModelConstructor(obj: TypeIdentifier): ViewModelConstructor { + return this.collectionStringMapping[this.getCollectionString(obj)][1] as ViewModelConstructor; } - public getRepositoryFromCollectionString( - collectionString: string - ): BaseRepository { - return this.collectionStringMapping[collectionString][3] as BaseRepository; - } - public getRepositoryFromModelConstructor( - ctor: ModelConstructor - ): BaseRepository { - return this.modelMapping[ctor.name][3] as BaseRepository; - } - public getRepositoryFromViewModelConstructor( - ctor: ViewModelConstructor - ): BaseRepository { - return this.viewModelMapping[ctor.name][3] as BaseRepository; + /** + * @param obj The object to get the repository from. + * @returns the repository + */ + public getRepository(obj: TypeIdentifier): BaseRepository { + return this.collectionStringMapping[this.getCollectionString(obj)][2] as BaseRepository; } } diff --git a/client/src/app/core/core-services/data-store.service.ts b/client/src/app/core/core-services/data-store.service.ts index 895f0c1ab..46974db24 100644 --- a/client/src/app/core/core-services/data-store.service.ts +++ b/client/src/app/core/core-services/data-store.service.ts @@ -187,7 +187,7 @@ export class DataStoreService { const storage: ModelStorage = {}; Object.keys(serializedStore).forEach(collectionString => { storage[collectionString] = {} as ModelCollection; - const target = this.modelMapper.getModelConstructorFromCollectionString(collectionString); + const target = this.modelMapper.getModelConstructor(collectionString); if (target) { Object.keys(serializedStore[collectionString]).forEach(id => { const data = JSON.parse(serializedStore[collectionString][id]); @@ -218,7 +218,7 @@ export class DataStoreService { if (typeof collectionType === 'string') { return collectionType; } else { - return this.modelMapper.getCollectionStringFromModelConstructor(collectionType); + return this.modelMapper.getCollectionString(collectionType); } } diff --git a/client/src/app/core/core-services/time-travel.service.ts b/client/src/app/core/core-services/time-travel.service.ts index 86de9a804..e36e155c7 100644 --- a/client/src/app/core/core-services/time-travel.service.ts +++ b/client/src/app/core/core-services/time-travel.service.ts @@ -68,7 +68,7 @@ export class TimeTravelService { [collectionString, id] = historyObject.element_id.split(':'); if (historyObject.full_data) { - const targetClass = this.modelMapperService.getModelConstructorFromCollectionString(collectionString); + const targetClass = this.modelMapperService.getModelConstructor(collectionString); await this.DS.add([new targetClass(historyObject.full_data)]); } else { await this.DS.remove(collectionString, [+id]); diff --git a/client/src/app/core/core-services/view-model-store.service.ts b/client/src/app/core/core-services/view-model-store.service.ts index 941aafbf2..ded3f9384 100644 --- a/client/src/app/core/core-services/view-model-store.service.ts +++ b/client/src/app/core/core-services/view-model-store.service.ts @@ -23,11 +23,7 @@ export class ViewModelStoreService { private getRepository( collectionType: ViewModelConstructor | string ): BaseRepository { - if (typeof collectionType === 'string') { - return this.mapperService.getRepositoryFromCollectionString(collectionType) as BaseRepository; - } else { - return this.mapperService.getRepositoryFromViewModelConstructor(collectionType as ViewModelConstructor); - } + return this.mapperService.getRepository(collectionType) as BaseRepository; } /** diff --git a/client/src/app/core/repositories/base-repository.ts b/client/src/app/core/repositories/base-repository.ts index 51de67707..5582a97d0 100644 --- a/client/src/app/core/repositories/base-repository.ts +++ b/client/src/app/core/repositories/base-repository.ts @@ -8,8 +8,10 @@ import { Identifiable } from '../../shared/models/base/identifiable'; import { auditTime } from 'rxjs/operators'; import { ViewModelStoreService } from '../core-services/view-model-store.service'; import { OnAfterAppsLoaded } from '../onAfterAppsLoaded'; +import { Collection } from 'app/shared/models/base/collection'; -export abstract class BaseRepository implements OnAfterAppsLoaded { +export abstract class BaseRepository + implements OnAfterAppsLoaded, Collection { /** * Stores all the viewModel in an object */ @@ -30,10 +32,18 @@ export abstract class BaseRepository = new Subject(); - private _name: string; + private _collectionString: string; - public get name(): string { - return this._name; + public get collectionString(): string { + return this._collectionString; + } + + /** + * Needed for the collectionStringMapper service to treat repositories the same as + * ModelConstructors and ViewModelConstructors. + */ + public get COLLECTIONSTRING(): string { + return this._collectionString; } /** @@ -52,7 +62,7 @@ export abstract class BaseRepository, protected depsModelCtors?: ModelConstructor[] ) { - this._name = baseModelCtor.name; + this._collectionString = baseModelCtor.COLLECTIONSTRING; } public onAfterAppsLoaded(): void { @@ -82,10 +92,7 @@ export abstract class BaseRepository { - if ( - model.collection === - this.collectionStringMapperService.getCollectionStringFromModelConstructor(this.baseModelCtor) - ) { + if (model.collection === this.collectionStringMapperService.getCollectionString(this.baseModelCtor)) { delete this.viewModelStore[model.id]; this.updateAllObservables(model.id); } diff --git a/client/src/app/shared/models/base/base-model.ts b/client/src/app/shared/models/base/base-model.ts index 20f996644..6b7443217 100644 --- a/client/src/app/shared/models/base/base-model.ts +++ b/client/src/app/shared/models/base/base-model.ts @@ -2,7 +2,10 @@ import { Deserializable } from './deserializable'; import { Identifiable } from './identifiable'; import { Collection } from './collection'; -export type ModelConstructor> = new (...args: any[]) => T; +export interface ModelConstructor> { + COLLECTIONSTRING: string; + new (...args: any[]): T; +} /** * Abstract parent class to set rules and functions for all models. diff --git a/client/src/app/site/agenda/models/view-item.ts b/client/src/app/site/agenda/models/view-item.ts index 48da0747b..eb6c3f1d4 100644 --- a/client/src/app/site/agenda/models/view-item.ts +++ b/client/src/app/site/agenda/models/view-item.ts @@ -4,6 +4,8 @@ import { Speaker } from 'app/shared/models/agenda/speaker'; import { BaseAgendaViewModel, isAgendaBaseModel } from 'app/site/base/base-agenda-view-model'; export class ViewItem extends BaseViewModel { + public static COLLECTIONSTRING = Item.COLLECTIONSTRING; + private _item: Item; private _contentObject: BaseAgendaViewModel; diff --git a/client/src/app/site/agenda/models/view-topic.ts b/client/src/app/site/agenda/models/view-topic.ts index c037da9b2..7ff96d190 100644 --- a/client/src/app/site/agenda/models/view-topic.ts +++ b/client/src/app/site/agenda/models/view-topic.ts @@ -11,6 +11,8 @@ import { BaseViewModel } from 'app/site/base/base-view-model'; * @ignore */ export class ViewTopic extends BaseAgendaViewModel { + public static COLLECTIONSTRING = Topic.COLLECTIONSTRING; + protected _topic: Topic; private _attachments: ViewMediafile[]; private _agendaItem: ViewItem; diff --git a/client/src/app/site/assignments/models/view-assignment.ts b/client/src/app/site/assignments/models/view-assignment.ts index 394e11ee0..fb829c399 100644 --- a/client/src/app/site/assignments/models/view-assignment.ts +++ b/client/src/app/site/assignments/models/view-assignment.ts @@ -8,6 +8,8 @@ import { ViewTag } from 'app/site/tags/models/view-tag'; import { BaseViewModel } from 'app/site/base/base-view-model'; export class ViewAssignment extends BaseAgendaViewModel { + public static COLLECTIONSTRING = Assignment.COLLECTIONSTRING; + private _assignment: Assignment; private _relatedUser: ViewUser[]; private _agendaItem: ViewItem; diff --git a/client/src/app/site/base/base-view-model.ts b/client/src/app/site/base/base-view-model.ts index b26661021..973b7eea5 100644 --- a/client/src/app/site/base/base-view-model.ts +++ b/client/src/app/site/base/base-view-model.ts @@ -2,7 +2,10 @@ import { Displayable } from './displayable'; import { Identifiable } from '../../shared/models/base/identifiable'; import { Collection } from 'app/shared/models/base/collection'; -export type ViewModelConstructor = new (...args: any[]) => T; +export interface ViewModelConstructor { + COLLECTIONSTRING: string; + new (...args: any[]): T; +} /** * Base class for view models. alls view models should have titles. diff --git a/client/src/app/site/common/models/view-chatmessage.ts b/client/src/app/site/common/models/view-chatmessage.ts index e4e1759ea..3803d4e5f 100644 --- a/client/src/app/site/common/models/view-chatmessage.ts +++ b/client/src/app/site/common/models/view-chatmessage.ts @@ -2,6 +2,8 @@ import { ChatMessage } from 'app/shared/models/core/chat-message'; import { BaseViewModel } from 'app/site/base/base-view-model'; export class ViewChatMessage extends BaseViewModel { + public static COLLECTIONSTRING = ChatMessage.COLLECTIONSTRING; + private _chatMessage: ChatMessage; /** diff --git a/client/src/app/site/config/models/view-config.ts b/client/src/app/site/config/models/view-config.ts index 484b0ec5e..793a2bfb5 100644 --- a/client/src/app/site/config/models/view-config.ts +++ b/client/src/app/site/config/models/view-config.ts @@ -36,6 +36,8 @@ interface ConfigConstant { * The view model for configs. */ export class ViewConfig extends BaseViewModel { + public static COLLECTIONSTRING = Config.COLLECTIONSTRING; + /** * The underlying config. */ @@ -62,15 +64,15 @@ export class ViewConfig extends BaseViewModel { } public get id(): number { - return this.config ? this.config.id : null; + return this.config.id; } public get key(): string { - return this.config ? this.config.key : null; + return this.config.key; } public get value(): Object { - return this.config ? this.config.value : null; + return this.config.value; } public get label(): string { diff --git a/client/src/app/site/history/models/view-history.ts b/client/src/app/site/history/models/view-history.ts index 4dbaf99e8..8d055d8ba 100644 --- a/client/src/app/site/history/models/view-history.ts +++ b/client/src/app/site/history/models/view-history.ts @@ -6,6 +6,8 @@ import { ViewUser } from 'app/site/users/models/view-user'; * View model for history objects */ export class ViewHistory extends BaseViewModel { + public static COLLECTIONSTRING = History.COLLECTIONSTRING; + /** * Private BaseModel of the history */ diff --git a/client/src/app/site/mediafiles/models/view-mediafile.ts b/client/src/app/site/mediafiles/models/view-mediafile.ts index 804e76faf..5b2d8b060 100644 --- a/client/src/app/site/mediafiles/models/view-mediafile.ts +++ b/client/src/app/site/mediafiles/models/view-mediafile.ts @@ -5,6 +5,8 @@ import { SearchRepresentation } from 'app/core/ui-services/search.service'; import { ViewUser } from 'app/site/users/models/view-user'; export class ViewMediafile extends BaseViewModel implements Searchable { + public static COLLECTIONSTRING = Mediafile.COLLECTIONSTRING; + private _mediafile: Mediafile; private _uploader: ViewUser; diff --git a/client/src/app/site/motions/models/view-category.ts b/client/src/app/site/motions/models/view-category.ts index cc40b76e5..9caa0ceee 100644 --- a/client/src/app/site/motions/models/view-category.ts +++ b/client/src/app/site/motions/models/view-category.ts @@ -11,6 +11,8 @@ import { Searchable } from 'app/site/base/searchable'; * @ignore */ export class ViewCategory extends BaseViewModel implements Searchable { + public static COLLECTIONSTRING = Category.COLLECTIONSTRING; + private _category: Category; public get category(): Category { diff --git a/client/src/app/site/motions/models/view-change-recommendation.ts b/client/src/app/site/motions/models/view-change-recommendation.ts index b4dc647d4..874881c58 100644 --- a/client/src/app/site/motions/models/view-change-recommendation.ts +++ b/client/src/app/site/motions/models/view-change-recommendation.ts @@ -11,6 +11,8 @@ import { ViewUnifiedChange, ViewUnifiedChangeType } from './view-unified-change' * @ignore */ export class ViewMotionChangeRecommendation extends BaseViewModel implements ViewUnifiedChange { + public static COLLECTIONSTRING = MotionChangeRecommendation.COLLECTIONSTRING; + private _changeRecommendation: MotionChangeRecommendation; public get id(): number { diff --git a/client/src/app/site/motions/models/view-motion-block.ts b/client/src/app/site/motions/models/view-motion-block.ts index de69aaf7a..470b78190 100644 --- a/client/src/app/site/motions/models/view-motion-block.ts +++ b/client/src/app/site/motions/models/view-motion-block.ts @@ -11,6 +11,8 @@ import { BaseViewModel } from 'app/site/base/base-view-model'; * @ignore */ export class ViewMotionBlock extends BaseAgendaViewModel implements Searchable { + public static COLLECTIONSTRING = MotionBlock.COLLECTIONSTRING; + private _motionBlock: MotionBlock; private _agendaItem: ViewItem; diff --git a/client/src/app/site/motions/models/view-motion-comment-section.ts b/client/src/app/site/motions/models/view-motion-comment-section.ts index 9baf6015c..183ea9453 100644 --- a/client/src/app/site/motions/models/view-motion-comment-section.ts +++ b/client/src/app/site/motions/models/view-motion-comment-section.ts @@ -10,6 +10,8 @@ import { ViewGroup } from 'app/site/users/models/view-group'; * @ignore */ export class ViewMotionCommentSection extends BaseViewModel { + public static COLLECTIONSTRING = MotionCommentSection.COLLECTIONSTRING; + private _section: MotionCommentSection; private _readGroups: ViewGroup[]; diff --git a/client/src/app/site/motions/models/view-motion.ts b/client/src/app/site/motions/models/view-motion.ts index d78bc6f97..ad6c4faf4 100644 --- a/client/src/app/site/motions/models/view-motion.ts +++ b/client/src/app/site/motions/models/view-motion.ts @@ -45,6 +45,8 @@ export enum ChangeRecoMode { * @ignore */ export class ViewMotion extends BaseAgendaViewModel implements Searchable { + public static COLLECTIONSTRING = Motion.COLLECTIONSTRING; + protected _motion: Motion; protected _category: ViewCategory; protected _submitters: ViewUser[]; diff --git a/client/src/app/site/motions/models/view-statute-paragraph.ts b/client/src/app/site/motions/models/view-statute-paragraph.ts index 2e5240d58..f841be61d 100644 --- a/client/src/app/site/motions/models/view-statute-paragraph.ts +++ b/client/src/app/site/motions/models/view-statute-paragraph.ts @@ -11,6 +11,8 @@ import { SearchRepresentation } from 'app/core/ui-services/search.service'; * @ignore */ export class ViewStatuteParagraph extends BaseViewModel implements Searchable { + public static COLLECTIONSTRING = StatuteParagraph.COLLECTIONSTRING; + private _paragraph: StatuteParagraph; public get statuteParagraph(): StatuteParagraph { diff --git a/client/src/app/site/motions/models/view-workflow.ts b/client/src/app/site/motions/models/view-workflow.ts index 027bee33c..9e0d7a306 100644 --- a/client/src/app/site/motions/models/view-workflow.ts +++ b/client/src/app/site/motions/models/view-workflow.ts @@ -7,6 +7,8 @@ import { BaseViewModel } from '../../base/base-view-model'; * @ignore */ export class ViewWorkflow extends BaseViewModel { + public static COLLECTIONSTRING = Workflow.COLLECTIONSTRING; + private _workflow: Workflow; public get workflow(): Workflow { diff --git a/client/src/app/site/projector/models/view-countdown.ts b/client/src/app/site/projector/models/view-countdown.ts index a06bcb542..fd16373c5 100644 --- a/client/src/app/site/projector/models/view-countdown.ts +++ b/client/src/app/site/projector/models/view-countdown.ts @@ -4,6 +4,8 @@ import { ProjectorElementBuildDeskriptor } from 'app/site/base/projectable'; import { BaseViewModel } from 'app/site/base/base-view-model'; export class ViewCountdown extends BaseProjectableViewModel { + public static COLLECTIONSTRING = Countdown.COLLECTIONSTRING; + private _countdown: Countdown; public get countdown(): Countdown { diff --git a/client/src/app/site/projector/models/view-projector.ts b/client/src/app/site/projector/models/view-projector.ts index 8009ebf59..2bfe8c5c9 100644 --- a/client/src/app/site/projector/models/view-projector.ts +++ b/client/src/app/site/projector/models/view-projector.ts @@ -2,6 +2,8 @@ import { BaseViewModel } from '../../base/base-view-model'; import { Projector, ProjectorElements } from 'app/shared/models/core/projector'; export class ViewProjector extends BaseViewModel { + public static COLLECTIONSTRING = Projector.COLLECTIONSTRING; + private _projector: Projector; public get projector(): Projector { diff --git a/client/src/app/site/projector/models/view-projectormessage.ts b/client/src/app/site/projector/models/view-projectormessage.ts index 092677f9c..3c4a2711c 100644 --- a/client/src/app/site/projector/models/view-projectormessage.ts +++ b/client/src/app/site/projector/models/view-projectormessage.ts @@ -4,6 +4,8 @@ import { ProjectorMessage } from 'app/shared/models/core/projector-message'; import { BaseViewModel } from 'app/site/base/base-view-model'; export class ViewProjectorMessage extends BaseProjectableViewModel { + public static COLLECTIONSTRING = ProjectorMessage.COLLECTIONSTRING; + private _message: ProjectorMessage; public get projctormessage(): ProjectorMessage { diff --git a/client/src/app/site/tags/models/view-tag.ts b/client/src/app/site/tags/models/view-tag.ts index fb5b07e4c..5464b982f 100644 --- a/client/src/app/site/tags/models/view-tag.ts +++ b/client/src/app/site/tags/models/view-tag.ts @@ -11,6 +11,8 @@ import { Searchable } from 'app/site/base/searchable'; * @ignore */ export class ViewTag extends BaseViewModel implements Searchable { + public static COLLECTIONSTRING = Tag.COLLECTIONSTRING; + private _tag: Tag; public get tag(): Tag { diff --git a/client/src/app/site/users/models/view-group.ts b/client/src/app/site/users/models/view-group.ts index f972b6dcb..3949d0741 100644 --- a/client/src/app/site/users/models/view-group.ts +++ b/client/src/app/site/users/models/view-group.ts @@ -2,6 +2,8 @@ import { BaseViewModel } from '../../base/base-view-model'; import { Group } from 'app/shared/models/users/group'; export class ViewGroup extends BaseViewModel { + public static COLLECTIONSTRING = Group.COLLECTIONSTRING; + private _group: Group; public get group(): Group { 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 c35b4a6e3..487dbfef6 100644 --- a/client/src/app/site/users/models/view-personal-note.ts +++ b/client/src/app/site/users/models/view-personal-note.ts @@ -2,6 +2,8 @@ import { BaseViewModel } from 'app/site/base/base-view-model'; import { PersonalNote } from 'app/shared/models/users/personal-note'; export class ViewPersonalNote extends BaseViewModel { + public static COLLECTIONSTRING = PersonalNote.COLLECTIONSTRING; + private _personalNote: PersonalNote; public get personalNote(): PersonalNote { diff --git a/client/src/app/site/users/models/view-user.ts b/client/src/app/site/users/models/view-user.ts index bddeac5ec..8afef1b58 100644 --- a/client/src/app/site/users/models/view-user.ts +++ b/client/src/app/site/users/models/view-user.ts @@ -7,6 +7,8 @@ import { ViewGroup } from './view-group'; import { BaseViewModel } from 'app/site/base/base-view-model'; export class ViewUser extends BaseProjectableViewModel implements Searchable { + public static COLLECTIONSTRING = User.COLLECTIONSTRING; + private _user: User; private _groups: ViewGroup[];