diff --git a/api/src/model/entitites/cylinder.entity.ts b/api/src/model/entitites/cylinder.entity.ts index 69679d9..590c6ca 100644 --- a/api/src/model/entitites/cylinder.entity.ts +++ b/api/src/model/entitites/cylinder.entity.ts @@ -23,6 +23,10 @@ export class Cylinder { @Column({ name:'description', type: 'text', nullable: true }) description: string; + @Column({name: 'is_digital', type: 'boolean', default: false}) + isDigital: boolean; + + @ManyToMany(() => Key, (key) => key.cylinder, { onDelete: 'NO ACTION'}) keys: Key[]; diff --git a/client/src/app/modules/cylinder/components/create-cylinder/create-cylinder.component.html b/client/src/app/modules/cylinder/components/create-cylinder/create-cylinder.component.html index 792cdbf..312a096 100644 --- a/client/src/app/modules/cylinder/components/create-cylinder/create-cylinder.component.html +++ b/client/src/app/modules/cylinder/components/create-cylinder/create-cylinder.component.html @@ -1,10 +1,11 @@

Neuen Zylinder anlegen

+
Hier können Zylinder angelegt werden. Jeder Zylinder muss genau einer Schließanlage zugeordnet werden. Es können mehrere Schlüssel zu einem Zylinder zugeordnet werden.
Name - + @if ((createForm.controls.name.value || '').length > 20) { {{ (createForm.controls.name.value || '').length }} / 100 Zeichen } @else { @@ -12,11 +13,16 @@ } - - Beschreibung - - Zylinderlänge und co. - +
+ + Beschreibung + + Zylinderlänge und co. + + + Digitales Schloss +
+ @@ -27,9 +33,11 @@ } Zu welcher Schließanlage gehört der Zylinder? - + @if (isLoading) { + + } + -
diff --git a/client/src/app/modules/cylinder/components/create-cylinder/create-cylinder.component.ts b/client/src/app/modules/cylinder/components/create-cylinder/create-cylinder.component.ts index 3971823..6d8e1cc 100644 --- a/client/src/app/modules/cylinder/components/create-cylinder/create-cylinder.component.ts +++ b/client/src/app/modules/cylinder/components/create-cylinder/create-cylinder.component.ts @@ -11,10 +11,11 @@ import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { CommonModule } from '@angular/common'; +import { MatCheckboxModule } from '@angular/material/checkbox'; @Component({ selector: 'app-create-cylinder', - imports: [MatFormFieldModule, MatInputModule, MatDialogModule, ReactiveFormsModule, FormsModule, MatSelectModule, MatButtonModule, MatIconModule, MatProgressBarModule, CommonModule], + imports: [MatFormFieldModule, MatInputModule, MatDialogModule, ReactiveFormsModule, FormsModule, MatSelectModule, MatButtonModule, MatIconModule, MatProgressBarModule, CommonModule, MatCheckboxModule], templateUrl: './create-cylinder.component.html', styleUrl: './create-cylinder.component.scss' }) @@ -29,7 +30,8 @@ export class CreateCylinderComponent { createForm = new FormGroup({ name: new FormControl(null, Validators.required), system: new FormControl(null, Validators.required), - description: new FormControl(null) + description: new FormControl(null), + isDigital: new FormControl(false) }); ngOnInit() { diff --git a/client/src/app/modules/cylinder/cylinder.component.ts b/client/src/app/modules/cylinder/cylinder.component.ts index e4c1d50..7785353 100644 --- a/client/src/app/modules/cylinder/cylinder.component.ts +++ b/client/src/app/modules/cylinder/cylinder.component.ts @@ -12,6 +12,7 @@ import { MatButtonModule } from '@angular/material/button'; import { AgGridContainerComponent } from '../../shared/ag-grid/components/ag-grid-container/ag-grid-container.component'; import { CylinderArchiveComponent } from './components/cylinder-archive/cylinder-archive.component'; import { ICylinder } from '../../model/interface/cylinder.interface'; +import { DialogPosition } from '@angular/material/dialog' @Component({ selector: 'app-cylinder', @@ -77,10 +78,10 @@ export class CylinderComponent extends AgGridContainerComponent { openCreateCylinder() { this.dialog.open(CreateCylinderComponent, { - maxWidth: "calc(100vw - 24px)", - width: "30vw", + maxWidth: "calc(100vw - 48px)", + width: "800px", minWidth: "200px", - disableClose: true + disableClose: true, }).afterClosed().subscribe({ next: (cylinder) => { if (cylinder) { @@ -92,9 +93,9 @@ export class CylinderComponent extends AgGridContainerComponent { openArchive() { this.dialog.open(CylinderArchiveComponent, { - maxHeight: "calc(100vh - 24px)", - maxWidth: "calc(100vw - 24px)", - width: "50vw", + maxHeight: "calc(100vh - 48px)", + maxWidth: "calc(100vw - 48px)", + width: "800px", minWidth: "min(700px,calc(100vw - 24px))", height: "70vh", }) diff --git a/client/src/app/modules/keys/create/create.component.html b/client/src/app/modules/keys/create/create.component.html index a11f89d..21fa43d 100644 --- a/client/src/app/modules/keys/create/create.component.html +++ b/client/src/app/modules/keys/create/create.component.html @@ -4,19 +4,19 @@ Name - + @if ((createForm.controls.name.value || '').length > 20) { {{ (createForm.controls.name.value || '').length }} / 100 Zeichen } @else { - Wie soll der Schlüssel heißen? + Wie soll der Schlüssel heißen? Der Name beschreibt den Schlüssel. Er sollte aber nicht einem Mieter zugeordnet werden. }
Schlüsselnummer - - Nummer auf dem Schlüssel + + Die Nummer auf dem Schlüssel oder dem Chip.
diff --git a/client/src/app/modules/keys/create/create.component.ts b/client/src/app/modules/keys/create/create.component.ts index e00c0fb..c94e527 100644 --- a/client/src/app/modules/keys/create/create.component.ts +++ b/client/src/app/modules/keys/create/create.component.ts @@ -93,9 +93,9 @@ export class CreateKeyComponent { openSelectMultipleCylinders() { this.dialog.open(SelectKeyCylinderComponent, { - maxHeight: "calc(100vh - 24px)", - maxWidth: "calc(100vw - 24px)", - width: "50vw", + maxHeight: "calc(100vh - 48px)", + maxWidth: "calc(100vw - 48px)", + width: "800px", minWidth: "300px", height: "70vh", disableClose: true, diff --git a/client/src/app/modules/keys/keys.component.ts b/client/src/app/modules/keys/keys.component.ts index 2b3723c..209083a 100644 --- a/client/src/app/modules/keys/keys.component.ts +++ b/client/src/app/modules/keys/keys.component.ts @@ -170,8 +170,8 @@ export class KeysComponent extends AgGridContainerComponent { openCreateKey() { this.dialog.open(CreateKeyComponent, { - maxWidth: "calc(100vw - 24px)", - width: "30vw", + maxWidth: "calc(100vw - 48px)", + width: "800px", minWidth: "200px", disableClose: true }).afterClosed().subscribe({ @@ -193,8 +193,8 @@ export class KeysComponent extends AgGridContainerComponent { this.gridApi.setGridOption('loading', false) const ref = this.dialog.open(SelectKeyCylinderComponent, { data: cylinders, - maxHeight: "calc(100vh - 24px)", - maxWidth: "calc(100vw - 24px)", + maxHeight: "calc(100vh - 48px)", + maxWidth: "calc(100vw - 48px)", width: "50vw", minWidth: "300px", height: "70vh",