From ed49ae600cbecc0e068cddf55d8f8975fc7825fd Mon Sep 17 00:00:00 2001
From: dcz <dcz@ipipan.waw.pl>
Date: Tue, 10 Oct 2023 21:17:19 +0200
Subject: [PATCH] Hiding frames bugfix.

---
 .../unification/Unification/LexicalUnitEdit.vue           | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/frontend/src/components/unification/Unification/LexicalUnitEdit.vue b/frontend/src/components/unification/Unification/LexicalUnitEdit.vue
index 891426a..4643ecd 100644
--- a/frontend/src/components/unification/Unification/LexicalUnitEdit.vue
+++ b/frontend/src/components/unification/Unification/LexicalUnitEdit.vue
@@ -768,6 +768,10 @@ Object.assign(LexicalUnitEdit, {
       return !this.hidden_frame_ids.includes(frame.id) && !this.hidden_frame_status_set.includes(frame.status) &&
               ((frame.status != 'B' && frame.status != 'C') || this.isSuperLeksykograf());
     },
+    getInvisibleFrameCnt() {
+        const invisibleFrames = this.frames.filter(frame => !this.isFrameVisible(frame));
+        return invisibleFrames.length;
+    },
     changeStatusButtonTitleToDefault() {
       const isSuperLeksykograf = this.isSuperLeksykograf();
       this.statusButtonTitle = isSuperLeksykograf ? 'Sprawdź' : 'Gotowe';
@@ -950,7 +954,7 @@ Object.assign(LexicalUnitEdit, {
       return (this.isSuperLeksykograf() && this.unified_frame.status === 'O') && this.unified_frame.assignee_username !== window.USER_USERNAME;
     },
     hideFrame(frame) {
-      this.hidden_frame_ids.add(frame.id);
+      this.hidden_frame_ids.push(frame.id);
     },
     resetFrameVisibilityRestictions() {
       this.hidden_frame_ids = [];
@@ -1325,7 +1329,7 @@ export default LexicalUnitEdit;
             <td id="wrong-frame" class="table-button-menu-td" style="padding: 10px 15px 10px 15px; color: #000000;" @click="!this.isSuperLeksykograf() ? change_slowal_frame_status('B') : this.active_slowal_frame && this.active_slowal_frame.status === 'B' ? slowal_frame_status_change_with_confirmation('frame_confirm_invalid') : change_slowal_frame_status('B')">{{createSlowalBadStatusButtonLabel()}}</td>
             <td id="hide-slowal-frame" style="padding: 10px 15px 10px 15px; color: #000000;">
               <div class="d-flex">
-                Ukryj:
+                Ukryj {{getInvisibleFrameCnt() > 0 ? '('+getInvisibleFrameCnt()+')' : ''}}:
                 O <input id="checkbox-status-o" type="checkbox" @change="hideFrameOfStatus('O', $event)" class="custom-control custom-checkbox mr-1">
                 <template v-if="this.isSuperLeksykograf()">B <input id="checkbox-status-b" type="checkbox" @change="hideFrameOfStatus('B', $event)" class="custom-control custom-checkbox mr-1"></template>
                 <template v-if="this.isSuperLeksykograf()">C <input id="checkbox-status-c" type="checkbox" @change="hideFrameOfStatus('C', $event)" class="custom-control custom-checkbox mr-1"></template>
-- 
GitLab