Browse Source

fix : lint

pull/7181/head
musharaf-nocodb 9 months ago
parent
commit
96d0f2d18b
  1. 4
      packages/nc-gui/components/account/UserList.vue
  2. 10
      packages/nc-gui/components/account/UsersModal.vue
  3. 21
      packages/nc-gui/components/nc/SelectOption.vue
  4. 11
      packages/nc-gui/components/roles/Selector.vue
  5. 9
      packages/nc-gui/components/smartsheet/column/DateOptions.vue
  6. 2
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  7. 7
      packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue

4
packages/nc-gui/components/account/UserList.vue

@ -227,9 +227,9 @@ const openDeleteModal = (user: UserType) => {
<div data-rec="true">{{ $t(`objects.roleType.orgLevelCreator`) }}</div> <div data-rec="true">{{ $t(`objects.roleType.orgLevelCreator`) }}</div>
<GeneralIcon <GeneralIcon
v-if="el?.roles === OrgUserRoles.CREATOR" v-if="el?.roles === OrgUserRoles.CREATOR"
id="nc-selected-item-icon"
icon="check" icon="check"
class="w-4 h-4 text-primary" class="w-4 h-4 text-primary"
id="nc-selected-item-icon"
/> />
</div> </div>
<span class="text-gray-500 text-xs whitespace-normal" data-rec="true"> <span class="text-gray-500 text-xs whitespace-normal" data-rec="true">
@ -246,9 +246,9 @@ const openDeleteModal = (user: UserType) => {
<div data-rec="true">{{ $t(`objects.roleType.orgLevelViewer`) }}</div> <div data-rec="true">{{ $t(`objects.roleType.orgLevelViewer`) }}</div>
<GeneralIcon <GeneralIcon
v-if="el.roles === OrgUserRoles.VIEWER" v-if="el.roles === OrgUserRoles.VIEWER"
id="nc-selected-item-icon"
icon="check" icon="check"
class="w-4 h-4 text-primary" class="w-4 h-4 text-primary"
id="nc-selected-item-icon"
/> />
</div> </div>
<span class="text-gray-500 text-xs whitespace-normal" data-rec="true"> <span class="text-gray-500 text-xs whitespace-normal" data-rec="true">

10
packages/nc-gui/components/account/UsersModal.vue

@ -193,7 +193,11 @@ const emailInput: VNodeRef = (el) => (el as HTMLInputElement)?.focus()
<a-form-item name="role" :rules="[{ required: true, message: $t('msg.roleRequired') }]"> <a-form-item name="role" :rules="[{ required: true, message: $t('msg.roleRequired') }]">
<div class="ml-1 mb-1 text-xs text-gray-500">{{ $t('labels.selectUserRole') }}</div> <div class="ml-1 mb-1 text-xs text-gray-500">{{ $t('labels.selectUserRole') }}</div>
<a-select v-model:value="usersData.role" class="nc-user-roles" dropdown-class-name="nc-dropdown-user-role !px-2"> <a-select
v-model:value="usersData.role"
class="nc-user-roles"
dropdown-class-name="nc-dropdown-user-role !px-2"
>
<a-select-option <a-select-option
class="nc-role-option" class="nc-role-option"
:value="OrgUserRoles.CREATOR" :value="OrgUserRoles.CREATOR"
@ -203,9 +207,9 @@ const emailInput: VNodeRef = (el) => (el as HTMLInputElement)?.focus()
<div data-rec="true">{{ $t(`objects.roleType.orgLevelCreator`) }}</div> <div data-rec="true">{{ $t(`objects.roleType.orgLevelCreator`) }}</div>
<GeneralIcon <GeneralIcon
v-if="usersData.role === OrgUserRoles.CREATOR" v-if="usersData.role === OrgUserRoles.CREATOR"
id="nc-selected-item-icon"
icon="check" icon="check"
class="w-4 h-4 text-primary" class="w-4 h-4 text-primary"
id="nc-selected-item-icon"
/> />
</div> </div>
@ -223,9 +227,9 @@ const emailInput: VNodeRef = (el) => (el as HTMLInputElement)?.focus()
<div data-rec="true">{{ $t(`objects.roleType.orgLevelViewer`) }}</div> <div data-rec="true">{{ $t(`objects.roleType.orgLevelViewer`) }}</div>
<GeneralIcon <GeneralIcon
v-if="usersData.role === OrgUserRoles.VIEWER" v-if="usersData.role === OrgUserRoles.VIEWER"
id="nc-selected-item-icon"
icon="check" icon="check"
class="w-4 h-4 text-primary" class="w-4 h-4 text-primary"
id="nc-selected-item-icon"
/> />
</div> </div>
<span class="text-gray-500 text-xs whitespace-normal" data-rec="true"> <span class="text-gray-500 text-xs whitespace-normal" data-rec="true">

21
packages/nc-gui/components/nc/SelectOption.vue

@ -1,13 +1,3 @@
<template>
<a-select-option :value="value">
<div class="flex items-center w-full justify-between w-full gap-2">
<div class="truncate flex-1">
<slot />
</div>
<component v-if="isSelected" id="nc-selected-item-icon" class="text-primary w-6 h-6" :is="iconMap.check" />
</div>
</a-select-option>
</template>
<script lang="ts" setup> <script lang="ts" setup>
interface Props { interface Props {
isSelected?: boolean isSelected?: boolean
@ -20,4 +10,13 @@ const value = computed(() => props.value)
console.log(props.isSelected, isSelected) console.log(props.isSelected, isSelected)
</script> </script>
<template>
<a-select-option :value="value">
<div class="flex items-center w-full justify-between w-full gap-2">
<div class="truncate flex-1">
<slot />
</div>
<component :is="iconMap.check" v-if="isSelected" id="nc-selected-item-icon" class="text-primary w-6 h-6" />
</div>
</a-select-option>
</template>

11
packages/nc-gui/components/roles/Selector.vue

@ -1,8 +1,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import { RoleDescriptions } from 'nocodb-sdk' import { RoleDescriptions } from 'nocodb-sdk'
import type { RoleLabels } from 'nocodb-sdk' import type { RoleLabels } from 'nocodb-sdk'
import { toRef } from '#imports'
import type { SelectValue } from 'ant-design-vue/es/select' import type { SelectValue } from 'ant-design-vue/es/select'
import { toRef } from '#imports'
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
@ -35,7 +35,7 @@ function onChangeRole(val: SelectValue) {
</script> </script>
<template> <template>
<div size="lg" ref="dropdownRef" class="nc-roles-selector relative" @click="isDropdownOpen = !isDropdownOpen"> <div ref="dropdownRef" size="lg" class="nc-roles-selector relative" @click="isDropdownOpen = !isDropdownOpen">
<RolesBadge data-testid="roles" :role="roleRef" :inherit="inheritRef === role" :size="sizeRef" /> <RolesBadge data-testid="roles" :role="roleRef" :inherit="inheritRef === role" :size="sizeRef" />
<a-select <a-select
v-model:value="roleRef" v-model:value="roleRef"
@ -45,12 +45,7 @@ function onChangeRole(val: SelectValue) {
class="py-1 !absolute top-0 left-0 w-full h-full z-10 text-xs opacity-0" class="py-1 !absolute top-0 left-0 w-full h-full z-10 text-xs opacity-0"
@change="onChangeRole" @change="onChangeRole"
> >
<a-select-option <a-select-option v-for="rl in props.roles" :key="rl" v-e="['c:workspace:settings:user-role-change']" :value="rl">
v-for="rl in props.roles"
:key="rl"
v-e="['c:workspace:settings:user-role-change']"
:value="rl"
>
<div <div
:class="{ :class="{
'w-[350px]': descriptionRef, 'w-[350px]': descriptionRef,

9
packages/nc-gui/components/smartsheet/column/DateOptions.vue

@ -18,8 +18,13 @@ if (!vModel.value.meta?.date_format) {
<template> <template>
<a-form-item :label="$t('labels.dateFormat')"> <a-form-item :label="$t('labels.dateFormat')">
<a-select show-search v-model:value="vModel.meta.date_format" class="nc-date-select" dropdown-class-name="nc-dropdown-date-format"> <a-select
<a-select-option v-for="(format, i) of [ ...dateFormats,...dateMonthFormats]" :key="i" :value="format"> v-model:value="vModel.meta.date_format"
show-search
class="nc-date-select"
dropdown-class-name="nc-dropdown-date-format"
>
<a-select-option v-for="(format, i) of [...dateFormats, ...dateMonthFormats]" :key="i" :value="format">
<div class="flex gap-2 justify-between items-center"> <div class="flex gap-2 justify-between items-center">
{{ format }} {{ format }}
<component <component

2
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -585,7 +585,6 @@ export default {
</template> </template>
<template v-else> <template v-else>
<div class="flex flex-row w-full"> <div class="flex flex-row w-full">
<NcButton <NcButton
v-if="props.showNextPrevIcons && !isFirstRow" v-if="props.showNextPrevIcons && !isFirstRow"
v-e="['c:row-expand:prev']" v-e="['c:row-expand:prev']"
@ -664,7 +663,6 @@ export default {
'!bg-gray-50 !px-0 !select-text': isReadOnlyVirtualCell(col), '!bg-gray-50 !px-0 !select-text': isReadOnlyVirtualCell(col),
}" }"
> >
<LazySmartsheetVirtualCell <LazySmartsheetVirtualCell
v-if="isVirtualCol(col)" v-if="isVirtualCol(col)"
v-model="_row.row[col.title]" v-model="_row.row[col.title]"

7
packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue

@ -94,7 +94,12 @@ if (!localValue.value && allowEmpty !== true) {
</span> </span>
</NcTooltip> </NcTooltip>
</div> </div>
<component :is="iconMap.check" v-if="localValue === option.value" id="nc-selected-item-icon" class="text-primary w-4 h-4" /> <component
:is="iconMap.check"
v-if="localValue === option.value"
id="nc-selected-item-icon"
class="text-primary w-4 h-4"
/>
</div> </div>
</a-select-option> </a-select-option>
</NcSelect> </NcSelect>

Loading…
Cancel
Save