11<script setup lang="ts">
22import { computed } from " vue" ;
3+ import { storeToRefs } from " pinia" ;
34import CapabilityCard from " @/components/platformcapabilities/CapabilityCard.vue" ;
45import { useAuditingCapability } from " @/components/platformcapabilities/capabilities/AuditingCapability" ;
56import { useMonitoringCapability } from " @/components/platformcapabilities/capabilities/MonitoringCapability" ;
67import { useErrorCapability } from " @/components/platformcapabilities/capabilities/ErrorCapability" ;
78import { Capability } from " @/components/platformcapabilities/constants" ;
89import { getAuditingWizardPages } from " @/components/platformcapabilities/wizards/AuditingWizardPages" ;
910import { getMonitoringWizardPages } from " @/components/platformcapabilities/wizards/MonitoringWizardPages" ;
10- import { getErrorWizardPages } from " @/components/platformcapabilities/wizards/ErrorWizardPages" ;
11+ import { usePlatformCapabilitiesStore } from " @/stores/PlatformCapabilitiesStore" ;
12+ import FAIcon from " @/components/FAIcon.vue" ;
13+ import { faChevronDown , faChevronUp } from " @fortawesome/free-solid-svg-icons" ;
14+
15+ const platformCapabilitiesStore = usePlatformCapabilitiesStore ();
16+ const { visibility } = storeToRefs (platformCapabilitiesStore );
1117
1218const auditing = useAuditingCapability ();
1319const monitoring = useMonitoringCapability ();
1420const error = useErrorCapability ();
1521
1622const auditingWizardPages = computed (() => getAuditingWizardPages (auditing .status .value ));
1723const monitoringWizardPages = computed (() => getMonitoringWizardPages (monitoring .status .value ));
18- const errorWizardPages = computed (() => getErrorWizardPages (error .status .value ));
24+
25+ // Check if any cards are hidden (to show restore option)
26+ const hasHiddenCards = computed (() => ! visibility .value .showAuditingCard || ! visibility .value .showMonitoringCard || ! visibility .value .showErrorCard );
1927 </script >
2028
2129<template >
22- <div class =" platform-capabilities" >
30+ <div v-if = " visibility.showSection " class =" platform-capabilities" >
2331 <div class =" capabilities-header" >
24- <h6 >Platform Capabilities</h6 >
25- <p class =" capabilities-description" >Discover and configure the capabilities of the Particular Service Platform</p >
32+ <div class =" capabilities-title-row" >
33+ <div >
34+ <h6 >Platform Capabilities</h6 >
35+ <p class =" capabilities-description" >Discover and configure the capabilities of the Particular Service Platform</p >
36+ </div >
37+ <div class =" capabilities-actions" >
38+ <button v-if =" hasHiddenCards" class =" btn-link restore-btn" @click =" platformCapabilitiesStore.showAll()" v-tippy =" 'Show all hidden cards'" >Show All</button >
39+ <button class =" btn-icon hide-section-btn" @click =" platformCapabilitiesStore.toggleSection()" v-tippy =" 'Hide this section'" >
40+ <FAIcon :icon =" faChevronUp" />
41+ </button >
42+ </div >
43+ </div >
2644 </div >
2745 <div class =" capabilities-list" >
2846 <CapabilityCard
47+ v-if =" visibility.showAuditingCard"
2948 :title =" Capability.Auditing"
3049 subtitle =" Track and search all successful messages flowing through your system"
3150 :status =" auditing.status.value"
@@ -36,8 +55,10 @@ const errorWizardPages = computed(() => getErrorWizardPages(error.status.value))
3655 :help-button-text =" auditing.helpButtonText.value"
3756 :help-button-url =" auditing.helpButtonUrl.value"
3857 :wizard-pages =" auditingWizardPages"
58+ @hide =" platformCapabilitiesStore.toggleAuditingCard()"
3959 ></CapabilityCard >
4060 <CapabilityCard
61+ v-if =" visibility.showMonitoringCard"
4162 :title =" Capability.Monitoring"
4263 subtitle =" Monitor endpoint performance and throughput"
4364 :status =" monitoring.status.value"
@@ -48,8 +69,10 @@ const errorWizardPages = computed(() => getErrorWizardPages(error.status.value))
4869 :help-button-text =" monitoring.helpButtonText.value"
4970 :help-button-url =" monitoring.helpButtonUrl.value"
5071 :wizard-pages =" monitoringWizardPages"
72+ @hide =" platformCapabilitiesStore.toggleMonitoringCard()"
5173 ></CapabilityCard >
5274 <CapabilityCard
75+ v-if =" visibility.showErrorCard"
5376 :title =" Capability.Error"
5477 subtitle =" Manage and retry failed messages"
5578 :status =" error.status.value"
@@ -59,26 +82,98 @@ const errorWizardPages = computed(() => getErrorWizardPages(error.status.value))
5982 :isLoading =" error.isLoading.value"
6083 :help-button-text =" error.helpButtonText.value"
6184 :help-button-url =" error.helpButtonUrl.value"
62- :wizard-pages = " errorWizardPages "
85+ @hide = " platformCapabilitiesStore.toggleErrorCard() "
6386 ></CapabilityCard >
6487 </div >
6588 </div >
89+ <div v-else class =" platform-capabilities-collapsed" >
90+ <button class =" btn-link expand-btn" @click =" platformCapabilitiesStore.toggleSection()" >
91+ <FAIcon :icon =" faChevronDown" />
92+ <span >Show Platform Capabilities</span >
93+ </button >
94+ </div >
6695</template >
6796
6897<style scoped>
6998.capabilities-header {
7099 margin-bottom : 10px ;
71100}
101+
102+ .capabilities-title-row {
103+ display : flex ;
104+ justify-content : space-between ;
105+ align-items : flex-start ;
106+ }
107+
72108.capabilities-description {
73109 font-size : 14px ;
74110 color : var (--text-secondary , #666 );
75111 margin : 0 ;
76112}
113+
114+ .capabilities-actions {
115+ display : flex ;
116+ align-items : center ;
117+ gap : 8px ;
118+ }
119+
120+ .btn-link {
121+ background : none ;
122+ border : none ;
123+ color : var (--primary-color , #007bff );
124+ cursor : pointer ;
125+ font-size : 14px ;
126+ padding : 4px 8px ;
127+ }
128+
129+ .btn-link :hover {
130+ text-decoration : underline ;
131+ }
132+
133+ .btn-icon {
134+ background : none ;
135+ border : none ;
136+ color : var (--text-secondary , #666 );
137+ cursor : pointer ;
138+ padding : 4px 8px ;
139+ border-radius : 4px ;
140+ transition : all 0.2s ease ;
141+ }
142+
143+ .btn-icon :hover {
144+ background-color : var (--hover-bg , #f0f0f0 );
145+ color : var (--text-primary , #333 );
146+ }
147+
77148.capabilities-list {
78149 display : flex ;
79150 gap : 16px ;
80151}
152+
81153.capabilities-list > * {
82154 flex : 1 ;
83155}
156+
157+ .platform-capabilities-collapsed {
158+ padding : 8px 0 ;
159+ }
160+
161+ .expand-btn {
162+ display : flex ;
163+ align-items : center ;
164+ gap : 8px ;
165+ background : none ;
166+ border : none ;
167+ color : var (--text-secondary , #666 );
168+ cursor : pointer ;
169+ font-size : 14px ;
170+ padding : 8px 12px ;
171+ border-radius : 4px ;
172+ transition : all 0.2s ease ;
173+ }
174+
175+ .expand-btn :hover {
176+ background-color : var (--hover-bg , #f0f0f0 );
177+ color : var (--text-primary , #333 );
178+ }
84179 </style >
0 commit comments