fix(connection): share connection group path map
This commit is contained in:
1 parent
8311a88b07
commit
1c34b2b568
12 files changed
+114
-15
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { storeToRefs } from "pinia";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useConnectionStore } from "@/stores/connectionStore";
|
||||
|
||||
/** Resolves the sidebar group path label for connection dropdown options. */
|
||||
export function useConnectionGroupLabel() {
|
||||
const connectionStore = useConnectionStore();
|
||||
const { connectionGroupPaths } = storeToRefs(connectionStore);
|
||||
const { t } = useI18n();
|
||||
|
||||
function connectionGroupLabel(connectionId: string): string {
|
||||
return connectionGroupPaths.value.get(connectionId)?.join(" / ") || t("connectionGroup.ungroupedLabel");
|
||||
}
|
||||
|
||||
return { connectionGroupPaths, connectionGroupLabel };
|
||||
}
|
||||
Reference in new issue
Block a user