|
|
@ -16,6 +16,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',
|
|
|
@ -109,6 +110,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,
|
|
|
@ -135,6 +137,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) {
|
|
|
@ -149,6 +152,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) {
|
|
|
@ -212,6 +216,8 @@ export class BikesComponent {
|
|
|
|
|
|
|
|
|
|
|
|
reloadTable() {
|
|
|
|
reloadTable() {
|
|
|
|
this.reloadingTable = true;
|
|
|
|
this.reloadingTable = true;
|
|
|
|
|
|
|
|
this.isLoaded = false;
|
|
|
|
|
|
|
|
this.data.data = [];
|
|
|
|
this.bikesService.loadBikes();
|
|
|
|
this.bikesService.loadBikes();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|