-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Design change requests * fix sorted by display bug * Design change requests * fix sorted by display bug
- Loading branch information
1 parent
e3b32d1
commit 386c6a9
Showing
4 changed files
with
230 additions
and
127 deletions.
There are no files selected for viewing
193 changes: 103 additions & 90 deletions
193
liquid-prep-app/src/app/components/dashboard/sensors/sensors.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,121 @@ | ||
<div class="search-section" [hidden]="!isSearchVisible"> | ||
<div class="search-input-wrapper"> | ||
<input type="text" [(ngModel)]="searchQuery" placeholder="Search sensors" (input)="onSearchInputChange()" /> | ||
<mat-icon matPrefix class="search-icon">search</mat-icon> | ||
</div> | ||
</div> | ||
<div class="sensors-landing-page"> | ||
<div class="search-section" [hidden]="!isSearchVisible"> | ||
<input type="text" class="searchbox" [(ngModel)]="searchQuery" placeholder="Search sensors" | ||
(input)="onSearchInputChange()" /> | ||
</div> | ||
|
||
<div class="filter-section" [hidden]="!isFilterVisible"> | ||
<div class="filter-buttons"> | ||
<div class="filter-section" [hidden]="!isFilterVisible"> | ||
<div class="filter-buttons"> | ||
|
||
<!-- Connection Status --> | ||
<div class="filter-button-group"> | ||
<ng-container *ngFor="let option of filterOptions.connectionStatusOptions; let isFirst = first"> | ||
<ng-container *ngIf="isFirst"> | ||
<h2 class="filter-heading">Status</h2> | ||
</ng-container> | ||
<button | ||
class="filter-button" | ||
(click)="toggleFilterOption(option)" | ||
[class.active]="isSelectedFilterOption(option)" | ||
> | ||
{{ option }} | ||
</button> | ||
</ng-container> | ||
</div> | ||
|
||
<!-- Field Location --> | ||
<div class="filter-button-group"> | ||
<ng-container *ngFor="let option of filterOptions.fieldLocationOptions; let isFirst = first"> | ||
<ng-container *ngIf="isFirst"> | ||
<h2 class="filter-heading">Field Location</h2> | ||
</ng-container> | ||
<button | ||
class="filter-button" | ||
(click)="toggleFilterOption(option)" | ||
[class.active]="isSelectedFilterOption(option)" | ||
> | ||
{{ option }} | ||
</button> | ||
<!-- Connection Status --> | ||
<div class="filter-button-group"> | ||
<ng-container *ngFor="let option of filterOptions.connectionStatusOptions; let isFirst = first"> | ||
<ng-container *ngIf="isFirst"> | ||
<h2 class="filter-heading">Status</h2> | ||
</ng-container> | ||
</div> | ||
<button | ||
class="clear-filters-button" | ||
(click)="clearFilter()" | ||
[class.active]="selectedFilterOptions.length === 0" | ||
> | ||
Clear Filter | ||
</button> | ||
<button class="filter-button" (click)="toggleFilterOption(option)" | ||
[class.active]="isSelectedFilterOption(option)"> | ||
<span [class.no-field-selected]="option === null"> | ||
{{ option === null ? noFieldSelectedText : option }} | ||
</span> | ||
</button> | ||
</ng-container> | ||
</div> | ||
</div> | ||
|
||
<div class="filteredby-section" [hidden]="!isFilteredByVisible"> | ||
<span class="filter-label">Filtered by</span> | ||
<!-- Field Location --> | ||
<div class="filter-button-group"> | ||
<ng-container *ngFor="let option of selectedFilterOptions"> | ||
<button | ||
class="filter-button" | ||
(click)="toggleFilterOption(option)" | ||
[class.active]="isSelectedFilterOption(option)" | ||
> | ||
{{ option }} | ||
<ng-container *ngFor="let option of filterOptions.fieldLocationOptions; let isFirst = first"> | ||
<ng-container *ngIf="isFirst"> | ||
<h2 class="filter-heading">Field Location</h2> | ||
</ng-container> | ||
<button class="filter-button" (click)="toggleFilterOption(option)" | ||
[class.active]="isSelectedFilterOption(option)"> | ||
<span [class.no-field-selected]="option === null"> | ||
{{ option === null ? noFieldSelectedText : option }} | ||
</span> | ||
</button> | ||
</ng-container> | ||
</div> | ||
<button | ||
class="clear-filters-button" | ||
(click)="clearFilter()" | ||
[class.active]="selectedFilterOptions.length === 0" | ||
> | ||
Clear Filter | ||
</button> | ||
<button class="clear-filters-button" (click)="clearFilter()" [class.active]="selectedFilterOptions.length === 0"> | ||
Clear Filters | ||
</button> | ||
</div> | ||
</div> | ||
|
||
<!-- Display the filtered and sorted items --> | ||
<div class="sensor-results" [hidden]="isFilterVisible"> | ||
<mat-list> | ||
<ng-container *ngIf="displayedItems.length > 0; else noItemsFound"> | ||
<mat-list-item *ngFor="let item of displayedItems"> | ||
<a mat-list-item class="sensorLink" [ngClass]="{'offline': item.connectionStatus === 'Not Connected'}"> | ||
<h4 mat-line class="lastUpdatedTime">{{ item.lastUpdated }}</h4> | ||
<p mat-line class="menu-list-body"> | ||
<span class="sensorInfo"> | ||
{{ item.sensorName }} <span class="sensorSpacer">·</span> {{ item.fieldLocation }} | ||
<div class="filteredby-section" [hidden]="!isFilteredByVisible"> | ||
<span class="filter-label">Filtered by</span> | ||
<div class="filter-button-group"> | ||
<ng-container *ngFor="let option of selectedFilterOptions"> | ||
<button class="filter-button" [class.active]="isSelectedFilterOption(option)" disabled> | ||
<span [class.no-field-selected]="option === null"> | ||
{{ option === null ? noFieldSelectedText : option }} | ||
</span> | ||
</button> | ||
</ng-container> | ||
</div> | ||
<button class="clear-filters-button" (click)="clearFilter()" [class.active]="selectedFilterOptions.length === 0"> | ||
Clear Filters | ||
</button> | ||
</div> | ||
|
||
<div class="sortedby-section" [hidden]="!isSortedByVisible"> | ||
<span class="sort-label">Sorted by </span> | ||
<span class="sort-option"> | ||
{{ selectedSortLabel }} | ||
</span> | ||
</div> | ||
|
||
|
||
<!-- Display the filtered and sorted items --> | ||
<div class="sensor-results" [hidden]="isFilterVisible"> | ||
<mat-list> | ||
<ng-container *ngIf="displayedItems.length > 0; else noResults"> | ||
<mat-list-item *ngFor="let item of displayedItems"> | ||
<a mat-list-item class="sensorLink" [ngClass]="{'offline': item.connectionStatus === 'Not Connected'}"> | ||
<h4 mat-line class="lastUpdatedTime">{{ item.lastUpdated }}</h4> | ||
<p mat-line class="menu-list-body"> | ||
<span class="sensor-info"> | ||
{{ item.sensorName }} <span class="sensorSpacer">·</span> | ||
<span [class.no-field-selected]="item.fieldLocation === null"> | ||
{{ item.fieldLocation === null ? noFieldSelectedText : item.fieldLocation }} | ||
</span> | ||
<span class="sensorMoisture">Moisture Level: {{ item.moistureLevel }}</span> | ||
</p> | ||
</a> | ||
</mat-list-item> | ||
</ng-container> | ||
</mat-list> | ||
<span class="sensor-moisture"> | ||
<span *ngIf="item.moistureLevel; else moistureLevelNotDetected"> | ||
Moisture Level: {{ item.moistureLevel }} | ||
</span> | ||
<ng-template #moistureLevelNotDetected> | ||
Moisture levels not detected. Check connection. | ||
</ng-template> | ||
</span> | ||
</span> | ||
</p> | ||
</a> | ||
</mat-list-item> | ||
</ng-container> | ||
</mat-list> | ||
|
||
<ng-template #noItemsFound> | ||
<div class="no-sensors"> | ||
<mat-icon class="no-sensor-icon">sensors_off</mat-icon> | ||
<ng-template #noResults> | ||
<div class="no-results" *ngIf="originalDisplayedItemsLength !== 0 && displayedItems.length === 0 && selectedFilterOptions.length === 0"> | ||
<div class="no-sensors-text"> | ||
<p>No sensors found with these parameters.</p> | ||
<p>{{clearSearchDisplayText}}</p> | ||
</div> | ||
</div> | ||
|
||
<div class="no-sensors-title"> | ||
No sensors detected | ||
</div> | ||
<div class="no-sensors" *ngIf="originalDisplayedItemsLength === 0"> | ||
<mat-icon class="no-sensor-icon">sensors_off</mat-icon> | ||
|
||
<div class="no-sensors-text"> | ||
<p>Check that wifi and bluetooth are enabled on your device and the sensors are turned on.</p> | ||
<div class="no-sensors-title"> | ||
No sensors detected | ||
</div> | ||
|
||
<p>You may need to set up your gateways first. See the user manual for instructions.</p> | ||
</div> | ||
<div class="no-sensors-text"> | ||
<p>Check that wifi and bluetooth are enabled on your device and the sensors are turned on.</p> | ||
<p>You may need to set up your gateways first. See the user manual for instructions.</p> | ||
</div> | ||
</div> | ||
</ng-template> | ||
|
||
</ng-template> | ||
</div> | ||
|
||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.