From 799a81aef9b2b4468e04b8e6fe7774c0074091a0 Mon Sep 17 00:00:00 2001
From: Alexis Poyen <apoyen@mail.apoyen.fr>
Date: Fri, 12 Jun 2020 17:20:39 +0200
Subject: [PATCH] Feat : On delete redisplay the Rounds List

---
 web/components/management/candidate-lists.js | 1 +
 web/components/management/round-desks.js     | 6 ++++++
 web/components/management/rounds-card.js     | 6 +-----
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/web/components/management/candidate-lists.js b/web/components/management/candidate-lists.js
index 172de6a..06f71fa 100644
--- a/web/components/management/candidate-lists.js
+++ b/web/components/management/candidate-lists.js
@@ -561,6 +561,7 @@ class CandidateList {
   emptyCandidateList() {
     this.area = null;
     document.getElementById("candidate-lists-list").innerHTML = "";
+    this.emptyCandidate();
     
   }
 
diff --git a/web/components/management/round-desks.js b/web/components/management/round-desks.js
index b365d73..48de29c 100644
--- a/web/components/management/round-desks.js
+++ b/web/components/management/round-desks.js
@@ -325,6 +325,12 @@ class RoundDesk {
     });
   }
 
+  emptyDesks() {
+    this.round = null;
+    document.getElementById("desk-round").innerHTML = ""
+    this.emptyDesksDetails();
+  }
+
   emptyDesksDetails() {
     this.desk = null;
     document.getElementById("desk-round-details").innerHTML = "";
diff --git a/web/components/management/rounds-card.js b/web/components/management/rounds-card.js
index 35b07cf..9bee067 100644
--- a/web/components/management/rounds-card.js
+++ b/web/components/management/rounds-card.js
@@ -270,16 +270,12 @@ class Round {
     await this.displayRounds();
     Common.toggleModal("round-modal", "round-modal-card");
     this.activateRound(round);
-    // TODO open desks
-    // TODO open candidateLists
     return round;
   }
 
   async deleteRound(round) {
     await this.RoundModel.deleteRound(round.ID);
-    await this.displayRounds();
-    // TODO empty desks
-    // TODO empty candidateLists
+    document.getElementById("display-rounds").click();
     document
       .getElementById("candidate-list-new")
       .setAttribute("disabled", "true");
-- 
GitLab