Not show group in use indicator when tool is missing

This commit is contained in:
Alireza Heidari
2026-01-16 19:05:33 +01:00
committed by Arash
parent e99661633c
commit f2d5d58546
@@ -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.