|
|
@ -1,5 +1,8 @@ |
|
|
|
<script lang="ts" setup> |
|
|
|
<script lang="ts" setup> |
|
|
|
|
|
|
|
import { useI18n } from '#imports' |
|
|
|
const { signOut } = useGlobal() |
|
|
|
const { signOut } = useGlobal() |
|
|
|
|
|
|
|
const { t } = useI18n() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { deleteWorkspace, navigateToWorkspace, updateWorkspace } = useWorkspace() |
|
|
|
const { deleteWorkspace, navigateToWorkspace, updateWorkspace } = useWorkspace() |
|
|
|
const { workspacesList, activeWorkspaceId, activeWorkspace, workspaces } = storeToRefs(useWorkspace()) |
|
|
|
const { workspacesList, activeWorkspaceId, activeWorkspace, workspaces } = storeToRefs(useWorkspace()) |
|
|
@ -17,9 +20,9 @@ const form = ref({ |
|
|
|
|
|
|
|
|
|
|
|
const formRules = { |
|
|
|
const formRules = { |
|
|
|
title: [ |
|
|
|
title: [ |
|
|
|
{ required: true, message: 'Workspace name required' }, |
|
|
|
{ required: true, message: t('msg.wsNameRequired') }, |
|
|
|
{ min: 3, message: 'Workspace name must be at least 3 characters long' }, |
|
|
|
{ min: 3, message: t('msg.wsNameMinLength') }, |
|
|
|
{ max: 50, message: 'Workspace name must be at most 50 characters long' }, |
|
|
|
{ max: 50, message: t('msg.wsNameMaxLength') }, |
|
|
|
], |
|
|
|
], |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -104,9 +107,9 @@ const onCancel = () => { |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="flex flex-col items-center nc-workspace-settings-settings"> |
|
|
|
<div class="flex flex-col items-center nc-workspace-settings-settings"> |
|
|
|
<div class="item flex flex-col w-full"> |
|
|
|
<div class="item flex flex-col w-full"> |
|
|
|
<div class="font-medium text-base">Change Workspace Name</div> |
|
|
|
<div class="font-medium text-base">{{ $t('labels.changeWsName') }}</div> |
|
|
|
<a-form ref="formValidator" layout="vertical" no-style :model="form" class="w-full" @finish="titleChange"> |
|
|
|
<a-form ref="formValidator" layout="vertical" no-style :model="form" class="w-full" @finish="titleChange"> |
|
|
|
<div class="text-gray-500 mt-6 mb-1.5">Workspace name</div> |
|
|
|
<div class="text-gray-500 mt-6 mb-1.5">{{ $t('objects.workspace') $t('general.name')}}</div> |
|
|
|
<a-form-item name="title" :rules="formRules.title"> |
|
|
|
<a-form-item name="title" :rules="formRules.title"> |
|
|
|
<a-input |
|
|
|
<a-input |
|
|
|
v-model:value="form.title" |
|
|
|
v-model:value="form.title" |
|
|
@ -123,8 +126,8 @@ const onCancel = () => { |
|
|
|
data-testid="nc-workspace-settings-settings-rename-cancel" |
|
|
|
data-testid="nc-workspace-settings-settings-rename-cancel" |
|
|
|
@click="onCancel" |
|
|
|
@click="onCancel" |
|
|
|
> |
|
|
|
> |
|
|
|
<template #loading> Renaming Workspace </template> |
|
|
|
<template #loading> {{ $t('title.renamingWs') }} </template> |
|
|
|
Cancel |
|
|
|
{{ $t('general.cancel') }} |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
<NcButton |
|
|
|
<NcButton |
|
|
|
v-e="['c:workspace:settings:rename']" |
|
|
|
v-e="['c:workspace:settings:rename']" |
|
|
@ -134,18 +137,18 @@ const onCancel = () => { |
|
|
|
:loading="isDeleting" |
|
|
|
:loading="isDeleting" |
|
|
|
data-testid="nc-workspace-settings-settings-rename-submit" |
|
|
|
data-testid="nc-workspace-settings-settings-rename-submit" |
|
|
|
> |
|
|
|
> |
|
|
|
<template #loading> Renaming Workspace </template> |
|
|
|
<template #loading> {{ $t('title.renamingWs') }} </template> |
|
|
|
Rename Workspace |
|
|
|
{{ $t('title.renameWs') }} |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-form> |
|
|
|
</a-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="item flex flex-col"> |
|
|
|
<div class="item flex flex-col"> |
|
|
|
<div class="font-medium text-base">Delete Workspace</div> |
|
|
|
<div class="font-medium text-base">{{ $t('title.deleteWs') }}</div> |
|
|
|
<div class="text-gray-500 mt-2">Delete this workspace and all it’s contents.</div> |
|
|
|
<div class="text-gray-500 mt-2">{{ $t('msg.wsDeleteDlg') }}</div> |
|
|
|
<div class="flex flex-row mt-8 gap-x-2"> |
|
|
|
<div class="flex flex-row mt-8 gap-x-2"> |
|
|
|
<a-checkbox v-model:checked="isConfirmed" /> |
|
|
|
<a-checkbox v-model:checked="isConfirmed" /> |
|
|
|
<div class="flex">I understand that this action is irreversible</div> |
|
|
|
<div class="flex">{{ $t('msg.userConfirmation') }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-row w-full justify-end mt-8"> |
|
|
|
<div class="flex flex-row w-full justify-end mt-8"> |
|
|
@ -156,8 +159,8 @@ const onCancel = () => { |
|
|
|
:loading="isDeleting" |
|
|
|
:loading="isDeleting" |
|
|
|
@click="onDelete" |
|
|
|
@click="onDelete" |
|
|
|
> |
|
|
|
> |
|
|
|
<template #loading> Deleting Workspace </template> |
|
|
|
<template #loading> {{ $t('title.deletingWs') }} </template> |
|
|
|
Delete Workspace |
|
|
|
{{ $t('title.deleteWs') }} |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|