Save DataSet

This commit is contained in:
2022-12-21 18:35:26 +01:00
parent db13b1ab1b
commit 0f28e18ed2
13 changed files with 359 additions and 40 deletions

View File

@@ -59,16 +59,9 @@ export class DataSetEditComponent implements OnInit {
if (this.form.invalid) {
return;
}
/*
this.document.loadForm(this.form);
let id;
if (this.route$.snapshot.paramMap.get('id') === 'new') {
id = await DataSet.add(this.document, this.http$, this._data);
} else {
id = await DataSet.update(this.document, this._http, this._data);
}
this._router.navigate(['../../Detail', id], { relativeTo: this._route});
*/
const id = await DataSet.add(this.document, this.http$);
// this._router.navigate(['../../Detail', id], { relativeTo: this._route});
}
generateNumber() {
this.form.patchValue({

View File

@@ -23,9 +23,14 @@
</ng-container>
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef mat-sort-header>Źródło</mat-header-cell>
<mat-header-cell *matHeaderCellDef mat-sort-header>Nazwa</mat-header-cell>
<mat-cell *matCellDef="let item">{{item.name}}</mat-cell>
</ng-container>
<ng-container matColumnDef="source">
<mat-header-cell *matHeaderCellDef mat-sort-header>Źródło</mat-header-cell>
<mat-cell *matCellDef="let item">{{item.source}}</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let item; columns: displayedColumns;" [routerLink]="['Detail/', item.id]"></mat-row>

View File

@@ -11,7 +11,7 @@ import { DataSet } from 'src/app/models/dataSet.model';
styleUrls: ['./data-sets-list.component.scss']
})
export class DataSetsListComponent implements OnInit {
displayedColumns = ['number', 'name'];
displayedColumns = ['number', 'name', 'source'];
dataSource!: MatTableDataSource<DataSet>;
@ViewChild(MatPaginator) paginator!: MatPaginator;