Skip to content

Commit

Permalink
feat: add column sorted in fichier tab
Browse files Browse the repository at this point in the history
  • Loading branch information
69pmb committed Feb 21, 2024
1 parent a8d93ed commit b5a13f9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
faRotateRight,
faAngleUp,
faEllipsisVertical,
faCheck,
} from '@fortawesome/free-solid-svg-icons';

import {AppComponent} from './app.component';
Expand Down Expand Up @@ -103,6 +104,7 @@ export class AppModule {
faTimesCircle,
faRotateRight,
faEllipsisVertical,
faCheck,
faGoogle
);
}
Expand Down
12 changes: 12 additions & 0 deletions src/app/list-fichier/list-fichier.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@
</mat-cell>
</ng-container>

<!-- SORTED -->
<ng-container matColumnDef="sorted">
<mat-header-cell *matHeaderCellDef mat-sort-header>
<span class="mat-text">Trié</span>
</mat-header-cell>
<mat-cell *matCellDef="let fichier">
<div *ngIf="fichier.sorted">
<fa-icon [icon]="faCheck"></fa-icon>
</div>
</mat-cell>
</ng-container>

<!-- Composition -->
<ng-container [matColumnDef]="expandedColumn">
<td
Expand Down
10 changes: 10 additions & 0 deletions src/app/list-fichier/list-fichier.component.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
@use 'list.component' as *;

@include link('title');

.mat-mdc-cell.mat-column-sorted {
@include color('purple');
}

@include media($mobile-width) {
.mat-column-sorted {
max-width: 20px;
}
}
3 changes: 3 additions & 0 deletions src/app/list-fichier/list-fichier.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {Dropbox} from '@utils/dropbox';
import {FormGroup, FormControl} from '@angular/forms';
import {yearsValidator} from '@utils/year.validator';
import {NavigationService} from '@services/navigation.service';
import {faCheck} from '@fortawesome/free-solid-svg-icons';

@Component({
selector: 'app-list-fichier',
Expand Down Expand Up @@ -48,6 +49,7 @@ export class ListFichierComponent
'category',
'size',
'publish',
'sorted',
];

override compositionColumns: (Field<Composition> | 'menu')[] = [
Expand All @@ -64,6 +66,7 @@ export class ListFichierComponent
pageComposition!: PageEvent;
sortComposition?: Sort<Composition>;
expandedElement?: Fichier;
faCheck = faCheck;
expandedColumn = 'compositions';
authors!: Dropdown[];
// Filters
Expand Down
1 change: 1 addition & 0 deletions src/app/list/list.component.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@use 'sass:list';
@use 'imports' as *;
@forward 'imports';

/* stylelint-disable selector-pseudo-element-no-unknown */
/* stylelint-disable selector-class-pattern */
Expand Down

0 comments on commit b5a13f9

Please sign in to comment.