Skip to content

Commit

Permalink
Display Tag ID in list
Browse files Browse the repository at this point in the history
  • Loading branch information
csaudiodesign committed Nov 7, 2023
1 parent 0d5e2f4 commit 3374d18
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deploy-app",
"version": "1.5.7",
"version": "1.5.8",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
6 changes: 6 additions & 0 deletions src/app/components/tag-list/tag-list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ <h2 class="icon-header">
</td>
</ng-container>

<!-- Tag ID Column -->
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Tag ID</th>
<td mat-cell *matCellDef="let row">{{row.tag_id}}</td>
</ng-container>

<!-- Tag Name Column -->
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Tag Name</th>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/tag-list/tag-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class TagListComponent implements OnInit, AfterViewInit {
};

/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['action', 'name', 'deployments', 'notes', 'created', 'updated'];
displayedColumns = ['action', 'id', 'name', 'deployments', 'notes', 'created', 'updated'];

isHandset$: Observable<boolean> = this.breakpointObserver.observe(Breakpoints.Handset)
.pipe(
Expand Down
1 change: 1 addition & 0 deletions src/app/components/tag-list/tags-datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export class TagsDataSource extends DataSource<Tag> {
return data.sort((a, b) => {
const isAsc = this.sort?.direction === 'asc';
switch (this.sort?.active) {
case 'id': return compare(a.tag_id ?? 0, b.tag_id ?? 0, isAsc);
case 'name': return compare(a.name ?? '', b.name ?? '', isAsc);
case 'deployments': return compare(a.deployments ?? 0, b.deployments ?? 0, isAsc);
case 'notes': return compare(a.notes ?? 0, b.notes ?? 0, isAsc);
Expand Down

0 comments on commit 3374d18

Please sign in to comment.