Skip to content

Commit 0a946a5

Browse files
committed
Refactor messages to show when choosing an access URL - refs BT#22639
1 parent a41a72f commit 0a946a5

File tree

3 files changed

+36
-16
lines changed

3 files changed

+36
-16
lines changed

assets/vue/components/accessurl/AccessUrlChooser.vue

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,50 @@ const { visible, isLoading, accessUrls, doRedirectToPortal } = useAccessUrlChoos
1414
:modal="true"
1515
:closable="false"
1616
:header="t('Access URL')"
17-
:style="{ width: '50vw' }"
17+
:style="{ width: '60vw' }"
1818
>
1919
<i
2020
v-if="isLoading"
2121
class="pi pi-spin pi-spinner"
2222
/>
2323
<div
24-
v-else-if="accessUrls.length"
25-
class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4"
24+
class="space-y-4"
25+
v-else-if="1 === accessUrls.length"
2626
>
27-
<div
28-
v-for="accessUrl in accessUrls"
29-
:key="accessUrl.id"
30-
class="text-center"
31-
@click="doRedirectToPortal(accessUrl.url)"
32-
>
33-
{{ accessUrl.url }}
34-
<p
35-
v-if="accessUrl.description"
36-
v-text="accessUrl.description"
37-
/>
27+
<p>{{ t("You only have access to the URL %s", [accessUrls[0].url]) }}</p>
28+
<p v-text="t('You will therefore be automatically redirected to this URL.')" />
29+
</div>
30+
<div
31+
class="space-y-4"
32+
v-else-if="accessUrls.length > 1"
33+
>
34+
<p v-text="t('You have access to multiple URLs. Here is the list of your accesses.')" />
35+
<p v-text="t('Please click on the link below corresponding to the URL you wish to access.')" />
36+
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
37+
<div
38+
v-for="accessUrl in accessUrls"
39+
:key="accessUrl.id"
40+
class="text-center"
41+
@click="doRedirectToPortal(accessUrl.url)"
42+
>
43+
<span
44+
class="cursor-pointer"
45+
v-text="accessUrl.url"
46+
/>
47+
<p
48+
v-if="accessUrl.description"
49+
v-text="accessUrl.description"
50+
/>
51+
</div>
3852
</div>
3953
</div>
4054
<p
4155
v-else
42-
v-text="t('No active access URLs found')"
56+
v-text="
57+
t(
58+
'You do not currently have access to any URL. Please ask the administrator to grant you access to the URL to which you belong.',
59+
)
60+
"
4361
/>
4462
</Dialog>
4563
</template>

assets/vue/composables/accessurl/accessUrlChooser.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export function useAccessUrlChooser() {
2424
accessUrls.value = items
2525

2626
if (1 === items.length) {
27+
isLoading.value = false
28+
2729
await doRedirectToPortal(items[0].url)
2830
}
2931
} catch (error) {

assets/vue/store/securityStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const useSecurityStore = defineStore("security", () => {
99
const isAuthenticated = computed(() => !isEmpty(user.value))
1010

1111
const showAccessUrlChooser = computed(() => {
12-
return !!(isAuthenticated.value && !isAdmin.value && window.is_login_url)
12+
return !!(isAuthenticated.value && window.is_login_url)
1313
})
1414

1515
/**

0 commit comments

Comments
 (0)