|
|
@ -10,6 +10,7 @@ import { logArrayInColumnInfoForm } from 'src/app/helperFunctions/logArrayInColu
|
|
|
|
import { MatTableDataSource } from '@angular/material/table';
|
|
|
|
import { MatTableDataSource } from '@angular/material/table';
|
|
|
|
import { MatPaginator } from '@angular/material/paginator';
|
|
|
|
import { MatPaginator } from '@angular/material/paginator';
|
|
|
|
import { MatSort } from '@angular/material/sort';
|
|
|
|
import { MatSort } from '@angular/material/sort';
|
|
|
|
|
|
|
|
import { BehaviorSubject } from 'rxjs';
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
@Component({
|
|
|
|
selector: 'app-bikes',
|
|
|
|
selector: 'app-bikes',
|
|
|
@ -127,6 +128,7 @@ export class BikesComponent {
|
|
|
|
|
|
|
|
|
|
|
|
relockingInterval = null;
|
|
|
|
relockingInterval = null;
|
|
|
|
relockingDuration = 1000 * 60 * 1;
|
|
|
|
relockingDuration = 1000 * 60 * 1;
|
|
|
|
|
|
|
|
isLoaded = false;
|
|
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
constructor(
|
|
|
|
private bikesService: BikesService,
|
|
|
|
private bikesService: BikesService,
|
|
|
@ -159,6 +161,7 @@ export class BikesComponent {
|
|
|
|
this.reloadingTable = false;
|
|
|
|
this.reloadingTable = false;
|
|
|
|
const tempDataSource = [];
|
|
|
|
const tempDataSource = [];
|
|
|
|
for (const row of newTableDataSource) {
|
|
|
|
for (const row of newTableDataSource) {
|
|
|
|
|
|
|
|
this.isLoaded = true;
|
|
|
|
const oldRow = this.getRowById(row.id);
|
|
|
|
const oldRow = this.getRowById(row.id);
|
|
|
|
/** make sure to not overwrite a row that is being edited */
|
|
|
|
/** make sure to not overwrite a row that is being edited */
|
|
|
|
if (!oldRow) {
|
|
|
|
if (!oldRow) {
|
|
|
@ -173,6 +176,7 @@ export class BikesComponent {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.bikesService.loadBikes();
|
|
|
|
this.bikesService.loadBikes();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.relockingInterval = setInterval(() => {
|
|
|
|
this.relockingInterval = setInterval(() => {
|
|
|
|
for (const row of this.data.data) {
|
|
|
|
for (const row of this.data.data) {
|
|
|
|
if (row.isLockedByMe) {
|
|
|
|
if (row.isLockedByMe) {
|
|
|
@ -251,6 +255,8 @@ export class BikesComponent {
|
|
|
|
|
|
|
|
|
|
|
|
reloadTable() {
|
|
|
|
reloadTable() {
|
|
|
|
this.reloadingTable = true;
|
|
|
|
this.reloadingTable = true;
|
|
|
|
|
|
|
|
this.isLoaded = false;
|
|
|
|
|
|
|
|
this.data.data = [];
|
|
|
|
this.bikesService.loadBikes();
|
|
|
|
this.bikesService.loadBikes();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|