diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index c120085..2d7fee4 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -34,7 +34,7 @@ import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { LoginComponent } from './pages/login/login.component';
-import { BikesComponent, DeleteConfirmationDialog } from './pages/tables/bikes/bikes.component';
+import { BikesComponent } from './pages/tables/bikes/bikes.component';
import { GraphQLModule } from './graphql.module';
import { ParticipantsComponent } from './pages/tables/participants/participants.component';
import { LendingStationsComponent } from './pages/tables/lending-stations/lending-stations.component';
@@ -44,7 +44,8 @@ import { MenuListItemComponent } from './components/menu-list-item/menu-list-ite
import {SidenavProfileComponent} from './components/sidenav-profile/sidenav-profile.component';
import { NavService }from './components/menu-list-item/nav.service';
import { TokenInterceptor } from './helper/token.interceptor';
-import { BikeComponent } from './pages/dataPages/bike/bike.component'
+import { BikeComponent } from './pages/dataPages/bike/bike.component';
+import { TableComponent, DeleteConfirmationDialog } from './components/table/table.component'
@NgModule({
@@ -59,7 +60,8 @@ import { BikeComponent } from './pages/dataPages/bike/bike.component'
TableOverviewComponent,
CellComponent,
DeleteConfirmationDialog,
- BikeComponent
+ BikeComponent,
+ TableComponent
],
imports: [
BrowserModule,
diff --git a/src/app/pages/tables/bikes/delete-confirmation-dialog.html b/src/app/components/table/delete-confirmation-dialog.html
similarity index 100%
rename from src/app/pages/tables/bikes/delete-confirmation-dialog.html
rename to src/app/components/table/delete-confirmation-dialog.html
diff --git a/src/app/components/table/table.component.html b/src/app/components/table/table.component.html
new file mode 100644
index 0000000..dc4faff
--- /dev/null
+++ b/src/app/components/table/table.component.html
@@ -0,0 +1,237 @@
+
+
+
+
+
+
+ Filter
+
+
+
+
+ nur ungespeicherte Elemente anzeigen
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+
+ {{ getTranslation(column.name) }}
+ |
+
+
+
+ {{ element[column.name] }}
+ {{
+ element[column.name]
+ }}
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ locked
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/components/table/table.component.scss b/src/app/components/table/table.component.scss
new file mode 100644
index 0000000..8907e62
--- /dev/null
+++ b/src/app/components/table/table.component.scss
@@ -0,0 +1,53 @@
+.table-page-wrapper {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ .table-control {
+ margin: 0.5em;
+ flex: none;
+ .table-control-button {
+ margin: 0.25em;
+ }
+ .filter {
+ margin-right: 0.5em;
+ }
+ .mat-paginator {
+ display: inline-block;
+ width: 50em;
+ margin-right: 0.5em;
+ }
+ }
+ .table-container {
+ flex: 1;
+ width: auto;
+ margin-left: 0.5em;
+ margin-right: 0.5em;
+ max-width: 100%;
+ overflow: auto;
+ table {
+ max-width: 100%;
+ margin: 0 auto;
+ .mat-header-cell,
+ .mat-footer-cell,
+ .mat-cell {
+ min-width: 3em;
+ box-sizing: border-box;
+ padding: 0 0.25em;
+ }
+ ::ng-deep.mat-form-field {
+ width: 100%;
+ }
+
+ .mat-table-sticky {
+ filter: brightness(90%);
+ //opacity: 1;
+ }
+
+ .button-wrapper {
+ display: flex;
+ flex-direction: row;
+ }
+ }
+ }
+ }
+
\ No newline at end of file
diff --git a/src/app/components/table/table.component.ts b/src/app/components/table/table.component.ts
new file mode 100644
index 0000000..c628f5b
--- /dev/null
+++ b/src/app/components/table/table.component.ts
@@ -0,0 +1,364 @@
+import { SelectionModel } from '@angular/cdk/collections';
+import {
+ Component,
+ EventEmitter,
+ Input,
+ Output,
+ ViewChild,
+} from '@angular/core';
+import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
+import { BikesService, CargoBikeResult } from 'src/app/services/bikes.service';
+import { flatten } from 'src/app/helperFunctions/flattenObject';
+import { deepen } from 'src/app/helperFunctions/deepenObject';
+import { SchemaService } from 'src/app/services/schema.service';
+
+import { logArrayInColumnInfoForm } from 'src/app/helperFunctions/logArrayInColumnInfoForm';
+import { MatTableDataSource } from '@angular/material/table';
+import { MatPaginator } from '@angular/material/paginator';
+import { MatSort } from '@angular/material/sort';
+import { MatDialog, MatDialogRef } from '@angular/material/dialog';
+
+@Component({
+ selector: 'app-table',
+ templateUrl: './table.component.html',
+ styleUrls: ['./table.component.scss'],
+})
+export class TableComponent {
+ /** this array defines the columns and translations of the table and the order they are displayed */
+ @Input()
+ columnInfo: {
+ name: string;
+ translation: string;
+ acceptedForCreation?: boolean;
+ requiredForCreation?: boolean;
+ sticky?: boolean;
+ readonly?: boolean;
+ type?: string;
+ link?: (row: any) => string;
+ }[] = [];
+
+ @Input()
+ dataService: any;
+
+ @Input()
+ tableDataGQLType: string;
+ @Input()
+ tableDataGQLCreateInputType: string;
+ @Input()
+ tableDataGQLUpdateInputType: string;
+
+ @ViewChild(MatPaginator) paginator: MatPaginator;
+ @ViewChild(MatSort) sort: MatSort;
+
+ additionalColumnsFront: string[] = ['select'];
+ additionalColumnsBack: string[] = ['buttons'];
+ displayedColumns: string[] = [];
+
+ loadingRowIds: string[] = [];
+
+ /** data source of the table */
+ data: MatTableDataSource