From f2d5d5854678239336c1c20c261f720d80ae577a Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Fri, 16 Jan 2026 19:05:33 +0100 Subject: [PATCH] Not show group in use indicator when tool is missing --- .../ServiceCredentialsGroupsList.vue | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/client/src/components/User/Credentials/ServiceCredentialsGroupsList.vue b/client/src/components/User/Credentials/ServiceCredentialsGroupsList.vue index 08594b89550..d6d127afdd4 100644 --- a/client/src/components/User/Credentials/ServiceCredentialsGroupsList.vue +++ b/client/src/components/User/Credentials/ServiceCredentialsGroupsList.vue @@ -95,12 +95,25 @@ const cardTitle = computed(() => (group: ServiceCredentialsGroupDetails) => { return `${group.serviceDefinition.name} (v${group.serviceDefinition.version}) - ${group.name}`; }); +/** + * Checks if the source tool for a credential group is missing/deleted. + * @param {ServiceCredentialsGroupDetails} group - The credential group to check. + * @returns {boolean} True if the tool is no longer available. + */ +const isToolMissing = computed(() => (group: ServiceCredentialsGroupDetails) => { + return !getToolForId(group.sourceId); +}); + /** * Checks if a credential group is currently in use by any tool. * @param {ServiceCredentialsGroupDetails} group - The credential group to check. * @returns {boolean} True if the group is in use. */ const isGroupInUse = computed(() => (group: ServiceCredentialsGroupDetails) => { + if (isToolMissing.value(group)) { + return false; + } + const userToolKey = userToolsServiceCredentialsStore.getUserToolKey(group.sourceId, group.sourceVersion); const userToolService = userToolsServicesCurrentGroupIds.value[userToolKey]; for (const groupId of Object.values(userToolService || {})) { @@ -111,15 +124,6 @@ const isGroupInUse = computed(() => (group: ServiceCredentialsGroupDetails) => { return false; }); -/** - * Checks if the source tool for a credential group is missing/deleted. - * @param {ServiceCredentialsGroupDetails} group - The credential group to check. - * @returns {boolean} True if the tool is no longer available. - */ -const isToolMissing = computed(() => (group: ServiceCredentialsGroupDetails) => { - return !getToolForId(group.sourceId); -}); - /** * Gets the display name for a tool, with a fallback for missing/deleted tools. * @param {ServiceCredentialsGroupDetails} group - The credential group.