Add sorting preset selection in sort dialog
Signed-off-by: trivernis <trivernis@protonmail.com>pull/12/head
parent
12d85b50cc
commit
91531bc940
@ -0,0 +1,7 @@
|
|||||||
|
<span *ngFor="let key of this.preset.sortKeys" class="sort-key">
|
||||||
|
<span class="sort-key-type">{{key.sortType}}</span>
|
||||||
|
<span *ngIf="key.sortType === 'Namespace'" class="sort-key-namespace"> {{key.namespaceName}}</span>
|
||||||
|
<ng-icon *ngIf="key.sortDirection === 'Ascending'" class="sort-key-direction" name="matExpandLess"></ng-icon>
|
||||||
|
<ng-icon *ngIf="key.sortDirection === 'Descending'" class="sort-key-direction" name="matExpandMore"></ng-icon>
|
||||||
|
<span class="key-divider">| </span>
|
||||||
|
</span>
|
@ -0,0 +1,20 @@
|
|||||||
|
@import "src/colors";
|
||||||
|
|
||||||
|
|
||||||
|
.sort-key-direction {
|
||||||
|
font-size: 1.5em;
|
||||||
|
vertical-align: bottom;
|
||||||
|
margin-bottom: 0.6em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sort-key-type {
|
||||||
|
color: $primary-lighter-50
|
||||||
|
}
|
||||||
|
|
||||||
|
.sort-key-namespace {
|
||||||
|
color: $accent-lighter-10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sort-key:last-child .key-divider {
|
||||||
|
display: none;
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { SortPresetItemComponent } from './sort-preset-item.component';
|
||||||
|
|
||||||
|
describe('SortPresetItemComponent', () => {
|
||||||
|
let component: SortPresetItemComponent;
|
||||||
|
let fixture: ComponentFixture<SortPresetItemComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ SortPresetItemComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(SortPresetItemComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@ -0,0 +1,16 @@
|
|||||||
|
import {ChangeDetectionStrategy, Component, Input} from "@angular/core";
|
||||||
|
import {SortingPreset} from "../../../../../../api/models/SortingPreset";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: "app-sort-preset-item",
|
||||||
|
templateUrl: "./sort-preset-item.component.html",
|
||||||
|
styleUrls: ["./sort-preset-item.component.scss"],
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
|
})
|
||||||
|
export class SortPresetItemComponent {
|
||||||
|
|
||||||
|
@Input() preset!: SortingPreset;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue