Skip to content

Commit 9e5afff

Browse files
committed
fix(ui): make NamespaceInstructions dialog closeable
1 parent ef098aa commit 9e5afff

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

ui/src/components/Namespace/Namespace.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<NamespaceAdd v-model="showAddDialog" />
3-
<NamespaceInstructions v-model="showAddNamespaceInstructions" />
3+
<NamespaceInstructions v-model="showInstructionsDialog" />
44

55
<v-menu
66
:close-on-content-click="false"
@@ -108,6 +108,8 @@
108108

109109
<script setup lang="ts">
110110
import { ref, computed, onMounted } from "vue";
111+
import { useDisplay } from "vuetify";
112+
import { until } from "@vueuse/core";
111113
import NamespaceAdd from "./NamespaceAdd.vue";
112114
import NamespaceInstructions from "./NamespaceInstructions.vue";
113115
import NamespaceChip from "./NamespaceChip.vue";
@@ -117,7 +119,6 @@ import useNamespaceManager from "./composables/useNamespaceManager";
117119
import useAuthStore from "@/store/modules/auth";
118120
import CopyWarning from "@/components/User/CopyWarning.vue";
119121
import { envVariables } from "@/envVariables";
120-
import { useDisplay } from "vuetify";
121122
122123
defineOptions({
123124
inheritAttrs: false,
@@ -139,7 +140,7 @@ const {
139140
const { mdAndDown, thresholds } = useDisplay();
140141
141142
const showAddDialog = ref(false);
142-
const showAddNamespaceInstructions = computed(() => namespacesLoaded.value && !hasNamespaces.value && !props.isAdminContext);
143+
const showInstructionsDialog = ref(false);
143144
const userId = computed(() => authStore.id || localStorage.getItem("id") || "");
144145
145146
const showAdminButton = computed(() => {
@@ -168,5 +169,7 @@ const navigateToAdminPanel = () => {
168169
169170
onMounted(async () => {
170171
await loadCurrentNamespace();
172+
await until(namespacesLoaded).toBe(true);
173+
showInstructionsDialog.value = !hasNamespaces.value && !props.isAdminContext;
171174
});
172175
</script>

ui/src/components/Namespace/NamespaceInstructions.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<template>
22
<WindowDialog
3-
v-model="showNoNamespaceDialog"
3+
v-model="showNamespaceInstructions"
44
title="You have no namespaces associated"
55
icon="mdi-folder-alert"
66
icon-color="warning"
7-
persistent
8-
:show-close-button="false"
7+
@close="showNamespaceInstructions = false"
98
>
109
<div class="pa-6">
1110
<p>
@@ -70,15 +69,12 @@
7069
</template>
7170

7271
<script setup lang="ts">
73-
import { computed, ref } from "vue";
74-
import { useRoute } from "vue-router";
72+
import { ref } from "vue";
7573
import { envVariables } from "@/envVariables";
7674
import NamespaceAdd from "./NamespaceAdd.vue";
7775
import WindowDialog from "@/components/Dialogs/WindowDialog.vue";
7876
79-
const route = useRoute();
80-
const showDialog = defineModel<boolean>({ required: true });
77+
const showNamespaceInstructions = defineModel<boolean>({ required: true });
8178
const showNamespaceAdd = ref(false);
82-
const showNoNamespaceDialog = computed(() => route.name === "AcceptInvite" ? false : showDialog.value);
8379
const { isCommunity } = envVariables;
8480
</script>

ui/tests/layouts/__snapshots__/AppLayout.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ exports[`App Layout Component > Renders the component 1`] = `
342342
</main>
343343
<!---->
344344
<!--teleport start-->
345-
<div class="v-overlay v-overlay--absolute v-overlay--contained v-theme--light v-locale--is-ltr align-center justify-center w-100 h-100" style="z-index: 2410;" data-v-e7291ef4="" data-test="overlay">
345+
<div class="v-overlay v-overlay--absolute v-overlay--contained v-theme--light v-locale--is-ltr align-center justify-center w-100 h-100" style="z-index: 2000;" data-v-e7291ef4="" data-test="overlay">
346346
<transition-stub name="fade-transition" appear="true" persisted="false" css="true">
347347
<!---->
348348
</transition-stub>

0 commit comments

Comments
 (0)