From 19a585fffbea670f80135c9064bad5deb422b3c0 Mon Sep 17 00:00:00 2001
From: kbeyro <121854496+kbeyro@users.noreply.github.com>
Date: Tue, 13 May 2025 11:18:43 +0200
Subject: [PATCH 1/3] add state

---
 src/app/model/cluster-manager.ts                       |  1 +
 .../admin/clusters/manager/manager.component.html      |  4 ++++
 .../managerdetails/managerdetails.component.html       | 10 ++++++++++
 3 files changed, 15 insertions(+)

diff --git a/src/app/model/cluster-manager.ts b/src/app/model/cluster-manager.ts
index ef3780ff..754b5332 100644
--- a/src/app/model/cluster-manager.ts
+++ b/src/app/model/cluster-manager.ts
@@ -14,4 +14,5 @@ export class ClusterManager {
     public deployment: ClusterDeployment;
     public externalNetworks: ClusterExtNetwork[]
     public domainNames: string[];
+    public state : string;
 }
\ No newline at end of file
diff --git a/src/app/shared/admin/clusters/manager/manager.component.html b/src/app/shared/admin/clusters/manager/manager.component.html
index 6703da03..5162a5a6 100644
--- a/src/app/shared/admin/clusters/manager/manager.component.html
+++ b/src/app/shared/admin/clusters/manager/manager.component.html
@@ -29,6 +29,9 @@
                 <th pSortableColumn="codename" id="codename"> {{ 'CLUSTERS.CODENAME' | translate }}
                     <p-sortIcon field="codename"></p-sortIcon>
                 </th>
+                <th pSortableColumn="state" id="state"> {{ 'CLUSTERS.STATE' | translate }}
+                    <p-sortIcon field="state"></p-sortIcon>
+                </th>
                 <th pSortableColumn="creationDate" id="creationDate"> {{ 'CLUSTERS.CREATION_DATE' | translate }}
                     <p-sortIcon field="creationDate"></p-sortIcon>
                 </th>
@@ -43,6 +46,7 @@
                 <td  [routerLink]="[cluster.id]">{{cluster.id}}</td>
                 <td>{{cluster.name}}</td>
                 <td>{{cluster.codename}}</td>
+                <td>{{'CLUSTER.'+cluster.state | translate}}</td>
                 <td>{{cluster.creationDate | date: 'dd-MM-yyyy HH:mm'}}</td>
                 <td>{{cluster.modificationDate | date: 'dd-MM-yyyy HH:mm'}}</td>
                 <td class="text-right">
diff --git a/src/app/shared/admin/clusters/managerdetails/managerdetails.component.html b/src/app/shared/admin/clusters/managerdetails/managerdetails.component.html
index 827bbe94..f17b073d 100644
--- a/src/app/shared/admin/clusters/managerdetails/managerdetails.component.html
+++ b/src/app/shared/admin/clusters/managerdetails/managerdetails.component.html
@@ -60,6 +60,16 @@
                     </div>
                 </div>
 
+                <div class="form-group">
+                    <label for="state" class="col-sm-2 control-label">{{ 'CLUSTERS.STATE' | translate }}</label>
+                    <div class="col-sm-10">
+                        <div class="col-sm-10">
+                            <input type="text" class="form-control" id="state" name="state"
+                                   placeholder="{{'CLUSTER.' + cluster.state | translate}}" [disabled]="true">
+                        </div>
+                    </div>
+                </div>
+
 
                 <div class="form-group">
                     <label for="clusterCreationDate" class="col-sm-2 control-label">{{ 'CLUSTERS.CREATION_DATE' | translate }}</label>
-- 
GitLab


From 9fcc057dd80562b3a6acf3cb910be794fef9c1d3 Mon Sep 17 00:00:00 2001
From: kbeyro <121854496+kbeyro@users.noreply.github.com>
Date: Tue, 13 May 2025 14:22:14 +0200
Subject: [PATCH 2/3] fix state translation

---
 src/app/shared/admin/clusters/manager/manager.component.html    | 2 +-
 .../admin/clusters/managerdetails/managerdetails.component.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/app/shared/admin/clusters/manager/manager.component.html b/src/app/shared/admin/clusters/manager/manager.component.html
index 5162a5a6..49225644 100644
--- a/src/app/shared/admin/clusters/manager/manager.component.html
+++ b/src/app/shared/admin/clusters/manager/manager.component.html
@@ -46,7 +46,7 @@
                 <td  [routerLink]="[cluster.id]">{{cluster.id}}</td>
                 <td>{{cluster.name}}</td>
                 <td>{{cluster.codename}}</td>
-                <td>{{'CLUSTER.'+cluster.state | translate}}</td>
+                <td>{{('CLUSTERS.'+cluster.state.toString().toUpperCase() ) | translate}}</td>
                 <td>{{cluster.creationDate | date: 'dd-MM-yyyy HH:mm'}}</td>
                 <td>{{cluster.modificationDate | date: 'dd-MM-yyyy HH:mm'}}</td>
                 <td class="text-right">
diff --git a/src/app/shared/admin/clusters/managerdetails/managerdetails.component.html b/src/app/shared/admin/clusters/managerdetails/managerdetails.component.html
index f17b073d..28edc9a5 100644
--- a/src/app/shared/admin/clusters/managerdetails/managerdetails.component.html
+++ b/src/app/shared/admin/clusters/managerdetails/managerdetails.component.html
@@ -65,7 +65,7 @@
                     <div class="col-sm-10">
                         <div class="col-sm-10">
                             <input type="text" class="form-control" id="state" name="state"
-                                   placeholder="{{'CLUSTER.' + cluster.state | translate}}" [disabled]="true">
+                                   placeholder="{{'CLUSTERS.' + cluster.state.toString().toUpperCase()| translate}}" [disabled]="true">
                         </div>
                     </div>
                 </div>
-- 
GitLab


From 9f311c12194ff8c96d9a1f0f2718c5b52c3d99d8 Mon Sep 17 00:00:00 2001
From: kbeyro <121854496+kbeyro@users.noreply.github.com>
Date: Tue, 13 May 2025 14:34:39 +0200
Subject: [PATCH 3/3] fix test

---
 .../clusters/managerdetails/managerdetails.component.spec.ts    | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/app/shared/admin/clusters/managerdetails/managerdetails.component.spec.ts b/src/app/shared/admin/clusters/managerdetails/managerdetails.component.spec.ts
index 351890d2..eef78c6c 100644
--- a/src/app/shared/admin/clusters/managerdetails/managerdetails.component.spec.ts
+++ b/src/app/shared/admin/clusters/managerdetails/managerdetails.component.spec.ts
@@ -21,6 +21,7 @@ describe('ClusterManagerDetailsComponent', () => {
   const mockCluster: ClusterManager = {
     id: 1,
     name: 'Test Cluster',
+    state: "UP",
     description: 'Test Description',
     externalNetworks: [],
     creationDate: new Date('2025-01-01'),
@@ -169,6 +170,7 @@ describe('ClusterManagerDetailsComponent', () => {
     const mockResponse: ClusterManager = {
       id: 1,
       name: 'Test Cluster',
+      state:"UP",
       description: 'Test Description',
       externalNetworks: [],
       creationDate: new Date('2025-01-01'),
-- 
GitLab