|
|
|
<script lang="ts" setup>
|
|
|
|
import { message } from 'ant-design-vue'
|
|
|
|
import { extractSdkResponseErrorMsg, useApi } from '#imports'
|
|
|
|
|
|
|
|
const { api } = useApi()
|
|
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
|
|
const settings = ref<{ invite_only_signup?: boolean }>({ invite_only_signup: false })
|
|
|
|
|
|
|
|
const loadSettings = async () => {
|
|
|
|
try {
|
|
|
|
const response = await api.orgAppSettings.get()
|
|
|
|
settings.value = response
|
|
|
|
} catch (e: any) {
|
|
|
|
message.error(await extractSdkResponseErrorMsg(e))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const saveSettings = async () => {
|
|
|
|
try {
|
|
|
|
await api.orgAppSettings.set(settings.value)
|
|
|
|
message.success(t('msg.success.settingsSaved'))
|
|
|
|
} catch (e: any) {
|
|
|
|
message.error(await extractSdkResponseErrorMsg(e))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
loadSettings()
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<<<<<<< HEAD
|
|
|
|
<<<<<<< HEAD
|
|
|
|
<div data-testid="nc-app-settings">
|
|
|
|
<div class="text-xl mt-4 mb-8 text-center font-weight-bold capitalize">{{ $t('activity.settings') }}</div>
|
|
|
|
<div class="flex justify-center">
|
|
|
|
=======
|
|
|
|
<div class="p-7">
|
|
|
|
<h1 class="text-xl mt-4 mb-5 pl-3.5 font-weight-bold">Settings</h1>
|
|
|
|
=======
|
|
|
|
<div class="p-7 flex flex-col items-center">
|
|
|
|
<h1 class="text-xl mt-4 mb-5 pl-3.5 font-bold">Settings</h1>
|
|
|
|
>>>>>>> e66bad074 (fix: allignment)
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
>>>>>>> 41d0c7c53 (fix: ui changes)
|
|
|
|
<a-form-item>
|
|
|
|
<a-checkbox
|
|
|
|
v-model:checked="settings.invite_only_signup"
|
|
|
|
v-e="['c:account:enable-signup']"
|
|
|
|
class="nc-checkbox nc-invite-only-signup-checkbox !mt-6"
|
|
|
|
name="virtual"
|
|
|
|
@change="saveSettings"
|
|
|
|
/>
|
|
|
|
</a-form-item>
|
|
|
|
{{ $t('labels.inviteOnlySignup') }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
:deep(.ant-checkbox-wrapper) {
|
|
|
|
@apply !flex-row-reverse !flex !justify-start gap-4;
|
|
|
|
justify-content: flex-start;
|
|
|
|
}
|
|
|
|
</style>
|