Repository: Piramide-Informatik/iws-manager-webapp
Pull request #262: fix styles approval status form
Author: login: AndresSelaya
Created: 2025-05-08T21:48:45Z | Merged: 2025-05-09T03:43:05Z



Diff:
diff --git a/src/app/modules/master-data/components/approval-status/components/approval-status-project/edit-approval-status/edit-approval-status.component.html b/src/app/modules/master-data/components/approval-status/components/approval-status-project/edit-approval-status/edit-approval-status.component.html
index 1015bacef..eb1be660b 100644
--- a/src/app/modules/master-data/components/approval-status/components/approval-status-project/edit-approval-status/edit-approval-status.component.html
+++ b/src/app/modules/master-data/components/approval-status/components/approval-status-project/edit-approval-status/edit-approval-status.component.html
@@ -1,22 +1,22 @@
 <p-card [style]="{ background: 'var(--light-cyan)' }" header="Bewilligungsstatus bearbeiten">
-    <form [formGroup]="editProjectCarrierForm" (ngSubmit)="onSubmit()">
+    <form [formGroup]="editApprovalStatusForm">
         <div class="form-container">
             <!-- Grupo: Bewilligungsstatus -->
             <div class="form-group">
-                <label for="absenceType">Bewilligungsstatus</label>
-                <input pInputText type="text" id="absenceType" formControlName="absenceType" autocomplete="off" />
+                <label for="approvalStatus">Bewilligungsstatus</label>
+                <input pInputText type="text" id="approvalStatus" formControlName="approvalStatus" autocomplete="off" />
             </div>
 
             <!-- Grupo: Reihenfolge -->
             <div class="form-group">
-                <label for="absenceTypeLabel">Reihenfolge</label>
-                <input pInputText type="text" id="absenceTypeLabel" formControlName="absenceTypeLabel" autocomplete="off" />
+                <label for="series">Reihenfolge</label>
+                <input pInputText type="text" id="series" formControlName="series" autocomplete="off" />
             </div>
 
             <!-- Grupo: gilt für Projekte -->
             <div class="form-group-check">
-                <label for="isHolidayChecked">gilt für Projekte</label>
-                <p-toggleswitch formControlName="isHoliday">
+                <label for="appliesToProject">gilt für Projekte</label>
+                <p-toggleswitch formControlName="appliesToProject" id="appliesToProject">
                     <ng-template #handle let-checked="checked">
                         <i [ngClass]="['!text-xs', 'pi', checked ? 'pi-check' : 'pi-times']"></i>
                     </ng-template>
@@ -25,8 +25,8 @@
 
             <!-- Grupo: gilt fur Netzwerke -->
             <div class="form-group-check">
-                <label for="canBeBookedChecked">gilt fur Netzwerke</label>
-                <p-toggleswitch formControlName="canBeBooked">
+                <label for="appliesToNetwork">gilt fur Netzwerke</label>
+                <p-toggleswitch formControlName="appliesToNetwork" id="appliesToNetwork">
                     <ng-template #handle let-checked="checked">
                         <i [ngClass]="['!text-xs', 'pi', checked ? 'pi-check' : 'pi-times']"></i>
                     </ng-template>
@@ -34,13 +34,9 @@
             </div>
 
             <!-- Botones -->
-            <div class="row justify-content-center">
-                <div class="col-auto">
-                    <p-button class="save me-2" size="small" [label]="'BUTTONS.SAVE' | translate" icon="pi pi-check" iconPos="left" />
-                </div>
-                <div class="col-auto">
-                    <p-button class="cancel me-2" size="small" [label]="'BUTTONS.CANCEL' | translate" icon="pi pi-times" iconPos="left" />
-                </div>
+            <div class="flex justify-content-center gap-2">
+                <p-button size="small" [label]="'BUTTONS.SAVE' | translate" icon="pi pi-check" iconPos="left" />
+                <p-button class="cancel" size="small" [label]="'BUTTONS.CANCEL' | translate" icon="pi pi-times" iconPos="left" />
             </div>
         </div>
     </form>
diff --git a/src/app/modules/master-data/components/approval-status/components/approval-status-project/edit-approval-status/edit-approval-status.component.scss b/src/app/modules/master-data/components/approval-status/components/approval-status-project/edit-approval-status/edit-approval-status.component.scss
index c7ca04d05..7b9107eb8 100644
--- a/src/app/modules/master-data/components/approval-status/components/approval-status-project/edit-approval-status/edit-approval-status.component.scss
+++ b/src/app/modules/master-data/components/approval-status/components/approval-status-project/edit-approval-status/edit-approval-status.component.scss
@@ -2,7 +2,6 @@
 .form-container {
     display: flex;
     flex-direction: column;
-    gap: 1rem;
 }
 
 // Grupos de formulario
@@ -10,11 +9,10 @@
 .form-group-check {
     display: flex;
     align-items: center;
-    margin-bottom: 1rem;
+    margin-bottom: 0.5rem;
 
     label {
         width: 150px;
-        font-weight: 500;
     }
 
     input,
@@ -24,30 +22,3 @@
         margin-left: 1rem;
     }
 }
-
-// Fila de botones
-.button-row {
-    display: flex;
-    justify-content: center;
-    align-items: center;
-    gap: 0.5rem;
-    margin-top: 1rem;
-
-    .btn-save {
-       
-        color: white;
-        transition: background-color 0.3s ease;
-
-        
-    }
-
-    .btn-cancel {
-        background-color: #000 !important;
-        color: white !important;
-        transition: background-color 0.3s ease;
-
-        &:hover {
-            background-color: #333 !important;
-        }
-    }
-}
\ No newline at end of file
diff --git a/src/app/modules/master-data/components/approval-status/components/approval-status-project/edit-approval-status/edit-approval-status.component.ts b/src/app/modules/master-data/components/approval-status/components/approval-status-project/edit-approval-status/edit-approval-status.component.ts
index 806adf30f..b80bc8a4a 100644
--- a/src/app/modules/master-data/components/approval-status/components/approval-status-project/edit-approval-status/edit-approval-status.component.ts
+++ b/src/app/modules/master-data/components/approval-status/components/approval-status-project/edit-approval-status/edit-approval-status.component.ts
@@ -8,27 +8,14 @@ import { FormGroup, FormControl, Validators } from '@angular/forms';
   styleUrl: './edit-approval-status.component.scss',
 })
 export class EditApprovalStatusComponent implements OnInit {
-  editProjectCarrierForm!: FormGroup;
-  isHoliday: boolean = false;
-  canBeBooked: boolean = false;
+  public editApprovalStatusForm!: FormGroup;
 
   ngOnInit(): void {
-    this.editProjectCarrierForm = new FormGroup({
-      absenceType: this.requiredControl(),
-      absenceTypeLabel: this.requiredControl(),
-      shareOfDay: this.requiredControl(),
+    this.editApprovalStatusForm = new FormGroup({
+      approvalStatus: new FormControl('', [Validators.required]),
+      series: new FormControl('', [Validators.required]),
+      appliesToProject: new FormControl('', [Validators.required]),
+      appliesToNetwork: new FormControl('', [Validators.required]),
     });
   }
-
-  private requiredControl(): FormControl {
-    return new FormControl('', [Validators.required]);
-  }
-
-  onSubmit(): void {
-    if (this.editProjectCarrierForm.valid) {
-      console.log(this.editProjectCarrierForm.value);
-    } else {
-      console.log("Ungültiges Formular");
-    }
-  }
 }


Reviews:
user: login: roo-dev22
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-09T00:02:09Z
user: login: AndresSelaya
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-09T00:58:59Z
user: login: FabDevX
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-09T02:39:14Z
user: login: roo-dev22
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-09T03:42:57Z

Review comments:
diff_hunk: @@ -8,27 +8,18 @@ import { FormGroup, FormControl, Validators } from '@angular/forms';
   styleUrl: './edit-approval-status.component.scss',
 })
 export class EditApprovalStatusComponent implements OnInit {
-  editProjectCarrierForm!: FormGroup;
-  isHoliday: boolean = false;
-  canBeBooked: boolean = false;
+  public editApprovalStatusForm!: FormGroup;
 
   ngOnInit(): void {
-    this.editProjectCarrierForm = new FormGroup({
-      absenceType: this.requiredControl(),
-      absenceTypeLabel: this.requiredControl(),
-      shareOfDay: this.requiredControl(),
+    this.editApprovalStatusForm = new FormGroup({
+      approvalStatus: new FormControl('', [Validators.required]),
+      series: new FormControl('', [Validators.required]),
+      appliesToProject: new FormControl('', [Validators.required]),
+      appliesToNetwork: new FormControl('', [Validators.required]),
     });
   }
 
-  private requiredControl(): FormControl {
-    return new FormControl('', [Validators.required]);
-  }
-
   onSubmit(): void {
-    if (this.editProjectCarrierForm.valid) {
-      console.log(this.editProjectCarrierForm.value);
-    } else {
-      console.log("Ungültiges Formular");
-    }
+    console.log(this.editApprovalStatusForm.value);
path: src/app/modules/master-data/components/approval-status/components/approval-status-project/edit-approval-status/edit-approval-status.component.ts
user: login: roo-dev22
body: Please remove this console.log
created_at: 2025-05-09T00:01:53Z
author_association: CONTRIBUTOR
diff_hunk: @@ -8,27 +8,18 @@ import { FormGroup, FormControl, Validators } from '@angular/forms';
   styleUrl: './edit-approval-status.component.scss',
 })
 export class EditApprovalStatusComponent implements OnInit {
-  editProjectCarrierForm!: FormGroup;
-  isHoliday: boolean = false;
-  canBeBooked: boolean = false;
+  public editApprovalStatusForm!: FormGroup;
 
   ngOnInit(): void {
-    this.editProjectCarrierForm = new FormGroup({
-      absenceType: this.requiredControl(),
-      absenceTypeLabel: this.requiredControl(),
-      shareOfDay: this.requiredControl(),
+    this.editApprovalStatusForm = new FormGroup({
+      approvalStatus: new FormControl('', [Validators.required]),
+      series: new FormControl('', [Validators.required]),
+      appliesToProject: new FormControl('', [Validators.required]),
+      appliesToNetwork: new FormControl('', [Validators.required]),
     });
   }
 
-  private requiredControl(): FormControl {
-    return new FormControl('', [Validators.required]);
-  }
-
   onSubmit(): void {
-    if (this.editProjectCarrierForm.valid) {
-      console.log(this.editProjectCarrierForm.value);
-    } else {
-      console.log("Ungültiges Formular");
-    }
+    console.log(this.editApprovalStatusForm.value);
path: src/app/modules/master-data/components/approval-status/components/approval-status-project/edit-approval-status/edit-approval-status.component.ts
user: login: AndresSelaya
body: fixed
created_at: 2025-05-09T00:58:59Z
author_association: CONTRIBUTOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-05-09T01:41:08Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=Piramide-Informatik_iws-manager-webapp&pullRequest=262) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=Piramide-Informatik_iws-manager-webapp&pullRequest=262&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=Piramide-Informatik_iws-manager-webapp&pullRequest=262&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=Piramide-Informatik_iws-manager-webapp&pullRequest=262&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=Piramide-Informatik_iws-manager-webapp&pullRequest=262&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=Piramide-Informatik_iws-manager-webapp&pullRequest=262&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=Piramide-Informatik_iws-manager-webapp&pullRequest=262)


author_association: NONE