Skip to content

Commit

Permalink
Merge pull request #24 from mitwelten/23-rename-entries-to-notes
Browse files Browse the repository at this point in the history
23 rename entries to notes
  • Loading branch information
cspindler authored Sep 21, 2023
2 parents 63dc60c + 4f56ea6 commit 0d5e2f4
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ _Deployments list view_

## Tags

Tags are used for multiple purposes: To group __deployments__ into units of dependent devices (for example a WiFi Accesspoint, Camera Nodes and an Aggregator Node), and to mark/tag __entries__ on the map ([viz.mitwelten.org](https://viz.mitwelten.org)). The tag list view gives an overview of all existing tags with number of assignments to either __deployment__ or __entry__ records.
Tags are used for multiple purposes: To group __deployments__ into units of dependent devices (for example a WiFi Accesspoint, Camera Nodes and an Aggregator Node), and to mark/tag __notes__ on the map ([viz.mitwelten.org](https://viz.mitwelten.org)). The tag list view gives an overview of all existing tags with number of assignments to either __deployment__ or __note__ records.

![list-tags](./assets/list-tags.png)
_Tags list view_
Expand Down
Binary file modified assets/list-tags.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.6",
"version": "1.5.7",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
10 changes: 5 additions & 5 deletions src/app/components/tag-list/tag-list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h2 class="icon-header">
</button>
<button mat-icon-button (click)="deleteTag(row)"
matTooltip="Delete this tag" matTooltipPosition="before" matTooltipClass="tight-tooltip"
[disabled]="!(row.deployments === 0 && row.entries === 0)">
[disabled]="!(row.deployments === 0 && row.notes === 0)">
<mat-icon class="material-symbols-outlined">delete</mat-icon>
</button>
</td>
Expand All @@ -49,10 +49,10 @@ <h2 class="icon-header">
<td mat-cell *matCellDef="let row"><ng-container *ngIf="row.deployments > 0">{{row.deployments}}</ng-container></td>
</ng-container>

<!-- Entries Column -->
<ng-container matColumnDef="entries">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Entries</th>
<td mat-cell *matCellDef="let row"><ng-container *ngIf="row.entries > 0">{{row.entries}}</ng-container></td>
<!-- Notes Column -->
<ng-container matColumnDef="notes">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Notes</th>
<td mat-cell *matCellDef="let row"><ng-container *ngIf="row.notes > 0">{{row.notes}}</ng-container></td>
</ng-container>

<!-- Created At Column -->
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', 'entries', 'created', 'updated'];
displayedColumns = ['action', 'name', 'deployments', 'notes', 'created', 'updated'];

isHandset$: Observable<boolean> = this.breakpointObserver.observe(Breakpoints.Handset)
.pipe(
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/tag-list/tags-datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class TagsDataSource extends DataSource<Tag> {
switch (this.sort?.active) {
case 'name': return compare(a.name ?? '', b.name ?? '', isAsc);
case 'deployments': return compare(a.deployments ?? 0, b.deployments ?? 0, isAsc);
case 'entries': return compare(a.entries ?? 0, b.entries ?? 0, isAsc);
case 'notes': return compare(a.notes ?? 0, b.notes ?? 0, isAsc);
case 'created': return compare(a.created_at ?? 0, b.created_at ?? 0, isAsc);
case 'updated': return compare(a.updated_at ?? 0, b.updated_at ?? 0, isAsc);
default: return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/tag.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export type Tag = {
tag_id?: number;
name: string;
deployments?: number;
entries?: number;
notes?: number;
created_at?: string;
updated_at?: string;
};

0 comments on commit 0d5e2f4

Please sign in to comment.