disable checkbox for dashboard-station
This commit is contained in:
parent
7a80335860
commit
9c53c382ff
@ -28,6 +28,7 @@ import {AutoRefreshComponent} from './map/auto-refresh/auto-refresh.component';
|
|||||||
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
||||||
import {MatCheckboxModule} from '@angular/material/checkbox';
|
import {MatCheckboxModule} from '@angular/material/checkbox';
|
||||||
import {MatTooltipModule} from '@angular/material/tooltip';
|
import {MatTooltipModule} from '@angular/material/tooltip';
|
||||||
|
import {MatProgressSpinnerModule} from "@angular/material/progress-spinner";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
@ -61,7 +62,8 @@ import {MatTooltipModule} from '@angular/material/tooltip';
|
|||||||
MatTableModule,
|
MatTableModule,
|
||||||
MatSlideToggleModule,
|
MatSlideToggleModule,
|
||||||
MatCheckboxModule,
|
MatCheckboxModule,
|
||||||
MatTooltipModule
|
MatTooltipModule,
|
||||||
|
MatProgressSpinnerModule
|
||||||
],
|
],
|
||||||
providers: [],
|
providers: [],
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent]
|
||||||
|
@ -83,7 +83,8 @@
|
|||||||
<ng-container matColumnDef="select">
|
<ng-container matColumnDef="select">
|
||||||
<th *matHeaderCellDef mat-header-cell></th>
|
<th *matHeaderCellDef mat-header-cell></th>
|
||||||
<td *matCellDef="let row" mat-cell>
|
<td *matCellDef="let row" mat-cell>
|
||||||
<mat-checkbox (change)="$event ? selectRow($event, row) : null" (click)="$event.stopPropagation()"
|
<mat-checkbox [disabled]="isCheckBoxDisable(row)"
|
||||||
|
(change)="$event ? selectRow($event, row) : null" (click)="$event.stopPropagation()"
|
||||||
[checked]="selectionModel.isSelected(row)"
|
[checked]="selectionModel.isSelected(row)"
|
||||||
matTooltip="toggle to view marker on map"
|
matTooltip="toggle to view marker on map"
|
||||||
matTooltipPosition="above">
|
matTooltipPosition="above">
|
||||||
@ -120,7 +121,8 @@
|
|||||||
<ng-container matColumnDef="select">
|
<ng-container matColumnDef="select">
|
||||||
<th *matHeaderCellDef mat-header-cell></th>
|
<th *matHeaderCellDef mat-header-cell></th>
|
||||||
<td *matCellDef="let row" mat-cell>
|
<td *matCellDef="let row" mat-cell>
|
||||||
<mat-checkbox (change)="$event ? selectRow($event, row) : null" (click)="$event.stopPropagation()"
|
<mat-checkbox [disabled]="isCheckBoxDisable(row)"
|
||||||
|
(change)="$event ? selectRow($event, row) : null" (click)="$event.stopPropagation()"
|
||||||
[checked]="selectionModel.isSelected(row)"
|
[checked]="selectionModel.isSelected(row)"
|
||||||
matTooltip="toggle to view marker on map"
|
matTooltip="toggle to view marker on map"
|
||||||
matTooltipPosition="above">
|
matTooltipPosition="above">
|
||||||
@ -151,6 +153,12 @@
|
|||||||
<tr *matHeaderRowDef="displayedColumnsFrom" mat-header-row></tr>
|
<tr *matHeaderRowDef="displayedColumnsFrom" mat-header-row></tr>
|
||||||
<tr *matRowDef="let row; columns: displayedColumnsFrom;" mat-row></tr>
|
<tr *matRowDef="let row; columns: displayedColumnsFrom;" mat-row></tr>
|
||||||
</table>
|
</table>
|
||||||
|
<mat-card *ngIf="isLoading" style="display: flex; justify-content: center; align-items: center">
|
||||||
|
<mat-progress-spinner
|
||||||
|
color="primary"
|
||||||
|
mode="indeterminate">
|
||||||
|
</mat-progress-spinner>
|
||||||
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,7 +16,6 @@ img {
|
|||||||
|
|
||||||
.button-back:hover, .button-wiki:hover {
|
.button-back:hover, .button-wiki:hover {
|
||||||
background: #086ed2;
|
background: #086ed2;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.submit-date {
|
.submit-date {
|
||||||
|
@ -92,6 +92,7 @@ export class DashboardComponent implements OnInit {
|
|||||||
iterableFromSource: any[];
|
iterableFromSource: any[];
|
||||||
selectionModel = new SelectionModel<IDashboardCommonBikePoint>(true, []);
|
selectionModel = new SelectionModel<IDashboardCommonBikePoint>(true, []);
|
||||||
colors = ['black', 'gray', 'green', 'orange', 'purple', 'red'];
|
colors = ['black', 'gray', 'green', 'orange', 'purple', 'red'];
|
||||||
|
isLoading: boolean;
|
||||||
|
|
||||||
station: IDashboardCommonBikePoint;
|
station: IDashboardCommonBikePoint;
|
||||||
maxStartDate: Date;
|
maxStartDate: Date;
|
||||||
@ -137,6 +138,7 @@ export class DashboardComponent implements OnInit {
|
|||||||
text: 'Loading...'
|
text: 'Loading...'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
this.isLoading = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
@ -255,11 +257,13 @@ export class DashboardComponent implements OnInit {
|
|||||||
await this.service.fetchDashboardStationTo(this.station.id, initDate, initDate).then((source) => {
|
await this.service.fetchDashboardStationTo(this.station.id, initDate, initDate).then((source) => {
|
||||||
this.stationToSource = this.setBikePointColorToSource(source);
|
this.stationToSource = this.setBikePointColorToSource(source);
|
||||||
this.iterableToSource = source;
|
this.iterableToSource = source;
|
||||||
|
this.isLoading = false;
|
||||||
this.changeDetectorRefs.detectChanges();
|
this.changeDetectorRefs.detectChanges();
|
||||||
});
|
});
|
||||||
await this.service.fetchDashboardStationFrom(this.station.id, initDate, initDate).then((source) => {
|
await this.service.fetchDashboardStationFrom(this.station.id, initDate, initDate).then((source) => {
|
||||||
this.stationFromSource = this.setBikePointColorFromSource(source);
|
this.stationFromSource = this.setBikePointColorFromSource(source);
|
||||||
this.iterableFromSource = source;
|
this.iterableFromSource = source;
|
||||||
|
this.isLoading = false;
|
||||||
this.changeDetectorRefs.detectChanges();
|
this.changeDetectorRefs.detectChanges();
|
||||||
});
|
});
|
||||||
this.service.fetchDashboardStationCharts(this.station.id, initDate, initDate, 'duration').then((source) => {
|
this.service.fetchDashboardStationCharts(this.station.id, initDate, initDate, 'duration').then((source) => {
|
||||||
@ -347,6 +351,9 @@ export class DashboardComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
chart: {
|
chart: {
|
||||||
|
toolbar: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
type: 'line',
|
type: 'line',
|
||||||
height: chartHeight,
|
height: chartHeight,
|
||||||
zoom: {
|
zoom: {
|
||||||
@ -397,6 +404,7 @@ export class DashboardComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async onSubmit(): Promise<any> {
|
async onSubmit(): Promise<any> {
|
||||||
|
this.isLoading = false;
|
||||||
this.actualStartDate = this.form.get('daterange').value.start;
|
this.actualStartDate = this.form.get('daterange').value.start;
|
||||||
this.actualEndDate = this.form.get('daterange').value.end;
|
this.actualEndDate = this.form.get('daterange').value.end;
|
||||||
this.map.removeTableStationMarkerOnReload();
|
this.map.removeTableStationMarkerOnReload();
|
||||||
@ -409,6 +417,7 @@ export class DashboardComponent implements OnInit {
|
|||||||
this.colors = ['black', 'gray', 'green', 'orange', 'purple', 'red'];
|
this.colors = ['black', 'gray', 'green', 'orange', 'purple', 'red'];
|
||||||
this.stationToSource = this.setBikePointColorToSource(source);
|
this.stationToSource = this.setBikePointColorToSource(source);
|
||||||
this.iterableToSource = source;
|
this.iterableToSource = source;
|
||||||
|
this.isLoading = false;
|
||||||
this.changeDetectorRefs.detectChanges();
|
this.changeDetectorRefs.detectChanges();
|
||||||
});
|
});
|
||||||
await this.service.fetchDashboardStationFrom(
|
await this.service.fetchDashboardStationFrom(
|
||||||
@ -418,6 +427,7 @@ export class DashboardComponent implements OnInit {
|
|||||||
).then((source) => {
|
).then((source) => {
|
||||||
this.stationFromSource = this.setBikePointColorFromSource(source);
|
this.stationFromSource = this.setBikePointColorFromSource(source);
|
||||||
this.iterableFromSource = source;
|
this.iterableFromSource = source;
|
||||||
|
this.isLoading = false;
|
||||||
this.changeDetectorRefs.detectChanges();
|
this.changeDetectorRefs.detectChanges();
|
||||||
});
|
});
|
||||||
this.service.fetchDashboardStationCharts(
|
this.service.fetchDashboardStationCharts(
|
||||||
@ -508,6 +518,9 @@ export class DashboardComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
chart: {
|
chart: {
|
||||||
|
toolbar: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
type: 'line',
|
type: 'line',
|
||||||
height: chartHeight,
|
height: chartHeight,
|
||||||
zoom: {
|
zoom: {
|
||||||
@ -615,4 +628,8 @@ export class DashboardComponent implements OnInit {
|
|||||||
this.colors = this.colors.filter(c => c !== color);
|
this.colors = this.colors.filter(c => c !== color);
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isCheckBoxDisable(row): boolean {
|
||||||
|
return row.stationId === this.station.id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user