Refactored default colors screen
This commit is contained in:
parent
1cc41f863b
commit
6783c04c97
@ -1,17 +1,19 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component, Injector } from '@angular/core';
|
||||||
import { AppStateService } from '../../../../state/app-state.service';
|
import { AppStateService } from '../../../../state/app-state.service';
|
||||||
import { Colors, DictionaryControllerService } from '@redaction/red-ui-http';
|
import { Colors, DictionaryControllerService } from '@redaction/red-ui-http';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { SortingOption, SortingService } from '../../../../services/sorting.service';
|
|
||||||
import { PermissionsService } from '../../../../services/permissions.service';
|
import { PermissionsService } from '../../../../services/permissions.service';
|
||||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||||
|
import { BaseListingComponent } from '../../../shared/base/base-listing.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-default-colors-screen',
|
selector: 'redaction-default-colors-screen',
|
||||||
templateUrl: './default-colors-screen.component.html',
|
templateUrl: './default-colors-screen.component.html',
|
||||||
styleUrls: ['./default-colors-screen.component.scss']
|
styleUrls: ['./default-colors-screen.component.scss']
|
||||||
})
|
})
|
||||||
export class DefaultColorsScreenComponent {
|
export class DefaultColorsScreenComponent extends BaseListingComponent {
|
||||||
|
protected readonly _sortKey = 'default-colors';
|
||||||
|
|
||||||
public viewReady = false;
|
public viewReady = false;
|
||||||
private _colorsObj: Colors;
|
private _colorsObj: Colors;
|
||||||
public colors: { key: string; value: string }[] = [];
|
public colors: { key: string; value: string }[] = [];
|
||||||
@ -20,22 +22,15 @@ export class DefaultColorsScreenComponent {
|
|||||||
private readonly _appStateService: AppStateService,
|
private readonly _appStateService: AppStateService,
|
||||||
private readonly _activatedRoute: ActivatedRoute,
|
private readonly _activatedRoute: ActivatedRoute,
|
||||||
private readonly _dictionaryControllerService: DictionaryControllerService,
|
private readonly _dictionaryControllerService: DictionaryControllerService,
|
||||||
private readonly _sortingService: SortingService,
|
|
||||||
private readonly _dialogService: AdminDialogService,
|
private readonly _dialogService: AdminDialogService,
|
||||||
public readonly permissionsService: PermissionsService
|
public readonly permissionsService: PermissionsService,
|
||||||
|
protected readonly _injector: Injector
|
||||||
) {
|
) {
|
||||||
|
super(_injector);
|
||||||
this._appStateService.activateRuleSet(_activatedRoute.snapshot.params.ruleSetId);
|
this._appStateService.activateRuleSet(_activatedRoute.snapshot.params.ruleSetId);
|
||||||
this._loadColors();
|
this._loadColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
public get sortingOption(): SortingOption {
|
|
||||||
return this._sortingService.getSortingOption('default-colors');
|
|
||||||
}
|
|
||||||
|
|
||||||
public toggleSort($event) {
|
|
||||||
this._sortingService.toggleSort('default-colors', $event);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async loadRuleSetsData(): Promise<void> {
|
public async loadRuleSetsData(): Promise<void> {
|
||||||
await this._appStateService.loadAllRuleSets();
|
await this._appStateService.loadAllRuleSets();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user