Skip to content

Commit

Permalink
fix: some UI problems
Browse files Browse the repository at this point in the history
  • Loading branch information
albanm committed Dec 11, 2024
1 parent c8eaea0 commit 6a4ee70
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
5 changes: 3 additions & 2 deletions ui/src/components/organization-departments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
v-model="sort"
:items="sortItems"
name="sort"
density="comfortable"
:prepend-inner-icon="mdiSort"
@update:model-value="filterDeps"
/>
Expand Down Expand Up @@ -136,8 +137,8 @@ const refreshingDepartment = ref<string | null>(null)
const timestamp = ref(new Date().getTime())
const sort = ref('creation')
const sortItems = [
{ text: t('pages.organization.depSortCreation'), value: 'creation' },
{ text: t('pages.organization.depSortAlpha'), value: 'alpha' }
{ title: t('pages.organization.depSortCreation'), value: 'creation' },
{ title: t('pages.organization.depSortAlpha'), value: 'alpha' }
]
const writableDepartments = computed(() => isAdminOrga && !$uiConfig.readonly)
Expand Down
22 changes: 12 additions & 10 deletions ui/src/components/organization-partners.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,18 @@
{{ $t('common.createdAt') }} {{ $d(new Date(partner.createdAt)) }}
</v-list-item-subtitle>

<v-list-item-action
v-if="writablePartners"
class="ml-0"
>
<delete-partner-menu
:orga="orga"
:partner="partner"
@change="$emit('change')"
/>
</v-list-item-action>
<template #append>
<v-list-item-action
v-if="writablePartners"
class="ml-0"
>
<delete-partner-menu
:orga="orga"
:partner="partner"
@change="$emit('change')"
/>
</v-list-item-action>
</template>
</v-list-item>
<v-divider
v-if="currentPage && currentPage.length > i + 1"
Expand Down
12 changes: 6 additions & 6 deletions ui/src/components/resend-partner-invitation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
>
<template #activator="{props}">
<v-btn
icon
:icon="mdiSend"
color="warning"
variant="text"
size="small"
:title="$t('pages.organization.sendInvitationLink')"

v-bind="props"
>
<v-icon :icon="mdiSend" />
</v-btn>
/>
</template>
<v-card
v-if="menu"
Expand Down Expand Up @@ -83,14 +81,16 @@ const { orga, partner } = defineProps({
})
const emit = defineEmits(['change'])
const { redirects } = useStore()
const { sitesFetch, redirects } = useStore()
const redirect = useStringSearchParam('redirect')
const { sendUiNotif } = useUiNotif()
const { t } = useI18n()
const menu = ref(false)
const editPartner = ref({ ...partner })
sitesFetch.refresh()
const confirmInvitation = withUiNotif(async () => {
menu.value = false
await $fetch(`organizations/${orga.id}/partners`, { method: 'POST', body: { name: editPartner.value.name, contactEmail: editPartner.value.contactEmail, redirect: redirect.value } })
Expand Down
6 changes: 3 additions & 3 deletions ui/src/composables/use-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ function createStore () {

const redirects = computed(() => {
if (!sitesFetch.data.value) return
const redirects: { text: string, value: string }[] = [{ text: mainPublicUrl.host, value: mainRedirect.value }]
.concat(sitesFetch.data.value.results.map(site => ({ text: site.host, value: 'https://' + site.host + '/me/account' })))
const redirects: { title: string, value: string }[] = [{ title: mainPublicUrl.host, value: mainRedirect.value }]
.concat(sitesFetch.data.value.results.map(site => ({ title: site.host, value: 'https://' + site.host + '/me/account' })))
if (mainPublicUrl.host !== host && !sitesFetch.data.value.results.find(site => site.host === host)) {
redirects.push({ text: host, value: 'https://' + host + '/me/account' })
redirects.push({ title: host, value: 'https://' + host + '/me/account' })
}
return redirects
})
Expand Down

0 comments on commit 6a4ee70

Please sign in to comment.