Skip to content

Commit

Permalink
chore(ui): make namespace label clickable (#4393)
Browse files Browse the repository at this point in the history
  • Loading branch information
MilosPaunovic authored Jul 22, 2024
1 parent c47d158 commit 0e9e707
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
1 change: 1 addition & 0 deletions ui/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"vue/multi-word-component-names": [
"off"
],
"vue/no-deprecated-router-link-tag-prop": "off",
"no-unused-vars": [
"error",
{
Expand Down
34 changes: 16 additions & 18 deletions ui/src/components/namespace/Namespaces.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@
<el-col v-if="!namespaces || !namespaces.length" :span="24" class="my-2 p-3 namespaces empty">
<span>{{ t("no_namespaces") }}</span>
</el-col>
<el-col v-for="(namespace, index) in hierarchy(namespaces)" :key="index" :span="24" class="my-1 py-2 px-4 namespaces">
<el-col
v-for="(namespace, index) in hierarchy(namespaces)"
:key="index"
:span="24"
class="my-1 py-2 px-4 namespaces"
>
<el-tree :data="[namespace]" default-expand-all :props="{class: 'tree'}" class="h-auto">
<template #default="{data}">
<div class="node">
<router-link :to="{name: 'namespaces/update', params: {id: data.id}}" tag="div" class="node">
<div class="d-flex">
<VectorIntersection class="me-2 icon" />
<span>{{ data.label }}</span>
</div>
<el-button
size="small"
tag="router-link"
:to="{name: 'namespaces/update', params: {id: data.id}}"
>
<el-button size="small">
<TextSearch />
</el-button>
</div>
</router-link>
</template>
</el-tree>
</el-col>
Expand Down Expand Up @@ -84,7 +85,7 @@
const namespaces = computed(() => store.state.namespace.namespaces as Namespace[]);
const loadData = () => {
// TODO: Implement a new endpoint which does not require size limit but returns everything
const query = {size: 10000, page: 1, ...(filter.value ? {q: filter.value} : {})}
const query = {size: 10000, page: 1, ...(filter.value ? {q: filter.value} : {})};
store.dispatch("namespace/search", query);
};
Expand Down Expand Up @@ -160,15 +161,6 @@ $active: #A396FF;
overflow: hidden;
background: var(--bs-body-bg);
&:hover {
background: var(--bs-body-bg);
color: $active;
}
.el-tree-node__expand-icon {
display: none;
}
.icon {
color: $active;
}
Expand All @@ -179,6 +171,12 @@ $active: #A396FF;
display: flex;
align-items: center;
justify-content: space-between;
color: var(--el-text-color-regular);
&:hover {
background: var(--bs-body-bg);
color: $active;
}
}
}
</style>

0 comments on commit 0e9e707

Please sign in to comment.