1
0

feat(teams): add public flags to teams to allow easier sharing with other teams (#2179)

Resolves #2173
Co-authored-by: Daniel Herrmann <daniel.herrmann1@gmail.com>
Reviewed-on: https://kolaente.dev/vikunja/vikunja/pulls/2179
Reviewed-by: konrad <k@knt.li>
Co-authored-by: waza-ari <daniel.herrmann@makerspace-darmstadt.de>
Co-committed-by: waza-ari <daniel.herrmann@makerspace-darmstadt.de>
This commit is contained in:
waza-ari
2024-03-10 14:04:32 +00:00
committed by konrad
parent d7fdefcead
commit ffa82556e0
22 changed files with 392 additions and 45 deletions

View File

@ -33,6 +33,27 @@
>
{{ $t('team.attributes.nameRequired') }}
</p>
<div
v-if="configStore.publicTeamsEnabled"
class="field"
>
<label
class="label"
for="teamIsPublic"
>{{ $t('team.attributes.isPublic') }}</label>
<div
class="control is-expanded"
:class="{ 'is-loading': teamService.loading }"
>
<Fancycheckbox
v-model="team.isPublic"
:disabled="teamMemberService.loading || undefined"
:class="{ 'disabled': teamService.loading }"
>
{{ $t('team.attributes.isPublicDescription') }}
</Fancycheckbox>
</div>
</div>
<div class="field">
<label
class="label"
@ -242,6 +263,7 @@ import {useI18n} from 'vue-i18n'
import {useRoute, useRouter} from 'vue-router'
import Editor from '@/components/input/AsyncEditor'
import Fancycheckbox from '@/components/input/fancycheckbox.vue'
import Multiselect from '@/components/input/multiselect.vue'
import User from '@/components/misc/user.vue'
@ -254,12 +276,14 @@ import {RIGHTS as Rights} from '@/constants/rights'
import {useTitle} from '@/composables/useTitle'
import {success} from '@/message'
import {useAuthStore} from '@/stores/auth'
import {useConfigStore} from '@/stores/config'
import type {ITeam} from '@/modelTypes/ITeam'
import type {IUser} from '@/modelTypes/IUser'
import type {ITeamMember} from '@/modelTypes/ITeamMember'
const authStore = useAuthStore()
const configStore = useConfigStore()
const route = useRoute()
const router = useRouter()
const {t} = useI18n({useScope: 'global'})

View File

@ -25,6 +25,26 @@
>
</div>
</div>
<div
v-if="configStore.publicTeamsEnabled"
class="field"
>
<label
class="label"
for="teamIsPublic"
>{{ $t('team.attributes.isPublic') }}</label>
<div
class="control is-expanded"
:class="{ 'is-loading': teamService.loading }"
>
<Fancycheckbox
v-model="team.isPublic"
:class="{ 'disabled': teamService.loading }"
>
{{ $t('team.attributes.isPublicDescription') }}
</Fancycheckbox>
</div>
</div>
<p
v-if="showError && team.name === ''"
class="help is-danger"
@ -46,11 +66,14 @@ import TeamModel from '@/models/team'
import TeamService from '@/services/team'
import CreateEdit from '@/components/misc/create-edit.vue'
import Fancycheckbox from '@/components/input/fancycheckbox.vue'
import {useTitle} from '@/composables/useTitle'
import {useRouter} from 'vue-router'
import {success} from '@/message'
import {useConfigStore} from '@/stores/config'
const {t} = useI18n()
const title = computed(() => t('team.create.title'))
useTitle(title)
@ -60,6 +83,8 @@ const teamService = shallowReactive(new TeamService())
const team = reactive(new TeamModel())
const showError = ref(false)
const configStore = useConfigStore()
async function newTeam() {
if (team.name === '') {
showError.value = true