|
|
@ -1,8 +1,7 @@ |
|
|
|
<script lang="ts" setup> |
|
|
|
<script lang="ts" setup> |
|
|
|
import { computed } from '@vue/reactivity' |
|
|
|
|
|
|
|
import { useToast } from 'vue-toastification' |
|
|
|
import { useToast } from 'vue-toastification' |
|
|
|
import { useSmartsheetStoreOrThrow } from '~/composables/useSmartsheetStore' |
|
|
|
import { computed, useSmartsheetStoreOrThrow } from '#imports' |
|
|
|
import { extractSdkResponseErrorMsg } from '~/utils/errorUtils' |
|
|
|
import { extractSdkResponseErrorMsg } from '~/utils' |
|
|
|
import MdiLockOutlineIcon from '~icons/mdi/lock-outline' |
|
|
|
import MdiLockOutlineIcon from '~icons/mdi/lock-outline' |
|
|
|
import MdiAccountIcon from '~icons/mdi/account' |
|
|
|
import MdiAccountIcon from '~icons/mdi/account' |
|
|
|
import MdiAccountGroupIcon from '~icons/mdi/account-group' |
|
|
|
import MdiAccountGroupIcon from '~icons/mdi/account-group' |
|
|
@ -25,19 +24,19 @@ function changeLockType(type: LockType) { |
|
|
|
return toast.info('Coming soon', { timeout: 3000 }) |
|
|
|
return toast.info('Coming soon', { timeout: 3000 }) |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
|
try { |
|
|
|
view.value.lock_type = type |
|
|
|
;(view.value as any).lock_type = type |
|
|
|
$api.dbView.update(view.value.id as string, { |
|
|
|
$api.dbView.update(view.value.id as string, { |
|
|
|
lock_type: type, |
|
|
|
lock_type: type, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
toast.success(`Successfully Switched to ${type} view`, { timeout: 3000 }) |
|
|
|
toast.success(`Successfully Switched to ${type} view`, { timeout: 3000 }) |
|
|
|
} catch (e) { |
|
|
|
} catch (e: any) { |
|
|
|
toast.error(extractSdkResponseErrorMsg(e)) |
|
|
|
toast.error(extractSdkResponseErrorMsg(e)) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const Icon = computed(() => { |
|
|
|
const Icon = computed(() => { |
|
|
|
switch (view?.value?.lock_type) { |
|
|
|
switch ((view.value as any).lock_type) { |
|
|
|
case LockType.Personal: |
|
|
|
case LockType.Personal: |
|
|
|
return MdiAccountIcon |
|
|
|
return MdiAccountIcon |
|
|
|
case LockType.Locked: |
|
|
|
case LockType.Locked: |
|
|
|