From 9b4ac3b992fd90889fdfe5ddc9d2b0d07ddb9aef Mon Sep 17 00:00:00 2001
From: Fuzi_fauzia 
Date: Thu, 8 Aug 2024 16:19:07 +0700
Subject: [PATCH] penambahan floor pada room building dan code pada mster floor
---
 src/app/_layout/footer/footer.component.html  |  2 +-
 .../add-edit-list.component.html              | 52 +++++++++++++++----
 .../add-edit-list/add-edit-list.component.ts  | 18 ++++++-
 .../list-monitoring.component.html            | 16 ++++++
 .../list-monitoring.component.ts              |  7 ++-
 .../add-edit-master.component.html            | 14 +++++
 .../add-edit-master.component.ts              | 17 +++++-
 .../master-floor/master-floor.component.html  | 17 ++++++
 .../master-floor/master-floor.component.ts    | 16 ++++++
 .../service/monitoring-api.service.ts         |  9 ++++
 src/app/login/login.component.html            |  2 +-
 11 files changed, 152 insertions(+), 18 deletions(-)
diff --git a/src/app/_layout/footer/footer.component.html b/src/app/_layout/footer/footer.component.html
index 104ad54..c9a39b4 100644
--- a/src/app/_layout/footer/footer.component.html
+++ b/src/app/_layout/footer/footer.component.html
@@ -13,7 +13,7 @@
         href="https://allbestsistem.com/"
         target="_blank"
         style="background-color: #ffffff !important;"
-        >Smart Building Management Systems (V@2024-07-26.01)
+        >Smart Building Management Systems (V@2024-08-8.01)
       
   
diff --git a/src/app/content/hemat-app/list-monitoring/add-edit-list/add-edit-list.component.html b/src/app/content/hemat-app/list-monitoring/add-edit-list/add-edit-list.component.html
index 12f24c0..c2b44f8 100644
--- a/src/app/content/hemat-app/list-monitoring/add-edit-list/add-edit-list.component.html
+++ b/src/app/content/hemat-app/list-monitoring/add-edit-list/add-edit-list.component.html
@@ -66,23 +66,21 @@
                               
                             
                           
-                        
-                        
+
+                          
                         
                       
                     
diff --git a/src/app/content/hemat-app/list-monitoring/add-edit-list/add-edit-list.component.ts b/src/app/content/hemat-app/list-monitoring/add-edit-list/add-edit-list.component.ts
index 9e426ee..f6f6ef5 100644
--- a/src/app/content/hemat-app/list-monitoring/add-edit-list/add-edit-list.component.ts
+++ b/src/app/content/hemat-app/list-monitoring/add-edit-list/add-edit-list.component.ts
@@ -22,6 +22,7 @@ export class AddEditListComponent {
 
   dataBuildingList: any;
   dataRoomList: any;
+  dataFloorList: any;
   dataMasterStatus: any;
   roombuildingId: any;
   dataRoomBuilding: any;
@@ -60,11 +61,13 @@ export class AddEditListComponent {
     this.dataListBuilding();
     this.dataListRoom();
     this.dataListMaster();
+    this.dataListFloor();
 
     this.projectInfo = this.formBuilder.group({
       buildingId: ["", Validators.required],
       roomId: [""],
       statusId: ["", Validators.required],
+      floorId: ["", Validators.required],
       userArray: this.formBuilder.array([this.createRoom()]),
     });
     this.userList = this.projectInfo.get('userArray') as FormArray;
@@ -221,6 +224,18 @@ export class AddEditListComponent {
     });
   }
 
+  dataListFloor() {
+    this.monitoringApiService.getListFloorDataUnmap(6).subscribe(data => {
+      console.log(data);
+      
+      const newArray = data.data.map(item => ({
+        id: item.id,
+        name: `${item.name} (${item.code})`
+      }));
+      this.dataFloorList = newArray
+    });
+  }
+
   dataListMaster() {
     this.monitoringApiService.getMasterListData().subscribe(data => {
       const dataStatus = data.data.find(
@@ -239,7 +254,8 @@ export class AddEditListComponent {
       const transformedData = {
         buildingId: formData.buildingId,
         roomId: formData.userArray.map(room => room.roomId),
-        statusId: formData.statusId
+        statusId: formData.statusId,
+        floorId: formData.floorId
       };
       this.monitoringApiService.postBatchBuilding(transformedData).subscribe((res) => {
         this.router.navigate(["/list-monitoring"]);
diff --git a/src/app/content/hemat-app/list-monitoring/list-monitoring.component.html b/src/app/content/hemat-app/list-monitoring/list-monitoring.component.html
index a2f0c62..2260a6a 100644
--- a/src/app/content/hemat-app/list-monitoring/list-monitoring.component.html
+++ b/src/app/content/hemat-app/list-monitoring/list-monitoring.component.html
@@ -94,6 +94,22 @@
                         
                       
 
+                      
+                        
+                          Floor
+                        
+                        
+                          {{ value.name }}
+                        
+                      
+
                        {
       this.data = res;
-      this.filteredRows = this.data.results.data;
+      // this.filteredRows = this.data.results.data;
+      this.filteredRows = this.data.results.data.sort((a, b) => b.id - a.id);
+      
     });
   }
 
@@ -66,7 +68,8 @@ export class ListMonitoringComponent {
     return (
       row.buildingEntity.name.toLowerCase().includes(searchTermLC) ||
       row.roomEntity.name.toLowerCase().includes(searchTermLC) ||
-      row.statusEntity.name.toLowerCase().includes(searchTermLC)
+      row.statusEntity.name.toLowerCase().includes(searchTermLC) ||
+      row.floorEntity.name.toLowerCase().includes(searchTermLC)
     );
   }
 
diff --git a/src/app/content/hemat-app/master/add-edit-master/add-edit-master.component.html b/src/app/content/hemat-app/master/add-edit-master/add-edit-master.component.html
index 2dccb2c..8c8ef08 100644
--- a/src/app/content/hemat-app/master/add-edit-master/add-edit-master.component.html
+++ b/src/app/content/hemat-app/master/add-edit-master/add-edit-master.component.html
@@ -20,6 +20,20 @@
           Name is required.
         
       
+