Merge pull request #3435 from vvlladd28/improvment/widget-bundle/sort

Added sorting of widget bundles by name
This commit is contained in:
Igor Kulikov 2020-09-14 10:53:04 +03:00 committed by GitHub
commit 5f7a4edd5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,6 +37,7 @@ import { getCurrentAuthUser } from '@app/core/auth/auth.selectors';
import { Authority } from '@shared/models/authority.enum'; import { Authority } from '@shared/models/authority.enum';
import { DialogService } from '@core/services/dialog.service'; import { DialogService } from '@core/services/dialog.service';
import { ImportExportService } from '@home/components/import-export/import-export.service'; import { ImportExportService } from '@home/components/import-export/import-export.service';
import { Direction } from "@shared/models/page/sort-order";
@Injectable() @Injectable()
export class WidgetsBundlesTableConfigResolver implements Resolve<EntityTableConfig<WidgetsBundle>> { export class WidgetsBundlesTableConfigResolver implements Resolve<EntityTableConfig<WidgetsBundle>> {
@ -55,6 +56,7 @@ export class WidgetsBundlesTableConfigResolver implements Resolve<EntityTableCon
this.config.entityComponent = WidgetsBundleComponent; this.config.entityComponent = WidgetsBundleComponent;
this.config.entityTranslations = entityTypeTranslations.get(EntityType.WIDGETS_BUNDLE); this.config.entityTranslations = entityTypeTranslations.get(EntityType.WIDGETS_BUNDLE);
this.config.entityResources = entityTypeResources.get(EntityType.WIDGETS_BUNDLE); this.config.entityResources = entityTypeResources.get(EntityType.WIDGETS_BUNDLE);
this.config.defaultSortOrder = {property: 'title', direction: Direction.ASC};
this.config.entityTitle = (widgetsBundle) => widgetsBundle ? this.config.entityTitle = (widgetsBundle) => widgetsBundle ?
widgetsBundle.title : ''; widgetsBundle.title : '';