diff --git a/client/src/app/core/repositories/motions/motion-block-repository.service.ts b/client/src/app/core/repositories/motions/motion-block-repository.service.ts index cd59c6acd..028e035a8 100644 --- a/client/src/app/core/repositories/motions/motion-block-repository.service.ts +++ b/client/src/app/core/repositories/motions/motion-block-repository.service.ts @@ -44,6 +44,7 @@ export class MotionBlockRepositoryService extends BaseAgendaContentObjectReposit private httpService: HttpService ) { super(DS, dataSend, mapperService, viewModelStoreService, translate, MotionBlock, [Item]); + this.initSorting(); } public getAgendaTitle = (motionBlock: Partial | Partial) => { @@ -125,4 +126,13 @@ export class MotionBlockRepositoryService extends BaseAgendaContentObjectReposit const restPath = `/rest/motions/motion-block/${motionBlock.id}/follow_recommendations/`; await this.httpService.post(restPath); } + + /** + * Sets the default sorting (e.g. in dropdowns and for new users) to 'title' + */ + private initSorting(): void { + this.setSortFunction((a: ViewMotionBlock, b: ViewMotionBlock) => { + return this.languageCollator.compare(a.title, b.title); + }); + } } diff --git a/client/src/app/core/repositories/tags/tag-repository.service.ts b/client/src/app/core/repositories/tags/tag-repository.service.ts index 3aea0acda..53f633693 100644 --- a/client/src/app/core/repositories/tags/tag-repository.service.ts +++ b/client/src/app/core/repositories/tags/tag-repository.service.ts @@ -40,6 +40,7 @@ export class TagRepositoryService extends BaseRepository { translate: TranslateService ) { super(DS, dataSend, mapperService, viewModelStoreService, translate, Tag); + this.initSorting(); } public getVerboseName = (plural: boolean = false) => { @@ -51,4 +52,13 @@ export class TagRepositoryService extends BaseRepository { viewTag.getVerboseName = this.getVerboseName; return viewTag; } + + /** + * Sets the default sorting (e.g. in dropdowns and for new users) to 'name' + */ + private initSorting(): void { + this.setSortFunction((a: ViewTag, b: ViewTag) => { + return this.languageCollator.compare(a.name, b.name); + }); + } }