Browse Source

fix: repeated chevron design

pull/6441/head
sreehari jayaraj 1 year ago
parent
commit
78981607af
  1. 3
      packages/nc-gui/components/nc/Select.vue
  2. 25
      packages/nc-gui/components/workspace/InviteSection.vue

3
packages/nc-gui/components/nc/Select.vue

@ -104,7 +104,4 @@ const onChange = (value: string) => {
} }
} }
} }
.nc-select .ant-select {
height: fit-content;
}
</style> </style>

25
packages/nc-gui/components/workspace/InviteSection.vue

@ -50,7 +50,7 @@ watch(inviteData, (newVal) => {
const emailToAdd = newVal.email.split(',')[0].trim() || newVal.email.split(' ')[0].trim() const emailToAdd = newVal.email.split(',')[0].trim() || newVal.email.split(' ')[0].trim()
if (!validateEmail(emailToAdd)) { if (!validateEmail(emailToAdd)) {
emailValidation.isError = true emailValidation.isError = true
emailValidation.message = 'INVALID EMAIL' emailValidation.message = 'Invalid Email'
return return
} }
/** /**
@ -73,12 +73,12 @@ watch(inviteData, (newVal) => {
const handleEnter = () => { const handleEnter = () => {
if (inviteData.email.length < 1) { if (inviteData.email.length < 1) {
emailValidation.isError = true emailValidation.isError = true
emailValidation.message = 'EMAIL SHOULD NOT BE EMPTY' emailValidation.message = 'Email Should Not Be Empty'
return return
} }
if (!validateEmail(inviteData.email.trim())) { if (!validateEmail(inviteData.email.trim())) {
emailValidation.isError = true emailValidation.isError = true
emailValidation.message = 'INVALID EMAIL' emailValidation.message = 'Invalid Email'
return return
} }
inviteData.email += ' ' inviteData.email += ' '
@ -146,12 +146,12 @@ const onPaste = (e: ClipboardEvent) => {
inputArray?.forEach((el) => { inputArray?.forEach((el) => {
if (el.length < 1) { if (el.length < 1) {
emailValidation.isError = true emailValidation.isError = true
emailValidation.message = 'EMAIL SHOULD NOT BE EMPTY' emailValidation.message = 'Email Should Not Be Empty'
return return
} }
if (!validateEmail(el.trim())) { if (!validateEmail(el.trim())) {
emailValidation.isError = true emailValidation.isError = true
emailValidation.message = 'INVALID EMAIL' emailValidation.message = 'Invalid Email'
return return
} }
/** /**
@ -177,7 +177,7 @@ const onPaste = (e: ClipboardEvent) => {
<div class="flex flex-col items-cenyet"> <div class="flex flex-col items-cenyet">
<div <div
ref="divRef" ref="divRef"
class="flex w-130 border-1 gap-1 items-center flex-wrap min-h-8 max-h-30 overflow-y-scroll rounded-lg nc-scrollbar-md" class="flex w-130 border-1 gap-1 items-center flex-wrap min-h-8 max-h-30 rounded-lg nc-scrollbar-md"
tabindex="0" tabindex="0"
:class="{ :class="{
'border-primary/100': isDivFocused, 'border-primary/100': isDivFocused,
@ -189,7 +189,7 @@ const onPaste = (e: ClipboardEvent) => {
<span <span
v-for="(email, index) in emailBadges" v-for="(email, index) in emailBadges"
:key="email" :key="email"
class="text-[14px] border-1 text-brand-500 bg-brand-50 rounded-md ml-1 p-0.5" class="leading-4 border-1 text-brand-500 bg-brand-50 rounded-md ml-1 p-0.5"
> >
{{ email }} {{ email }}
<component <component
@ -213,9 +213,6 @@ const onPaste = (e: ClipboardEvent) => {
<span v-if="emailValidation.isError" class="ml-2 text-red-500 text-[10px] mt-1.5">{{ emailValidation.message }}</span> <span v-if="emailValidation.isError" class="ml-2 text-red-500 text-[10px] mt-1.5">{{ emailValidation.message }}</span>
</div> </div>
<NcSelect v-model:value="inviteData.roles" class="min-w-30 !rounded px-1" data-testid="roles"> <NcSelect v-model:value="inviteData.roles" class="min-w-30 !rounded px-1" data-testid="roles">
<template #suffixIcon>
<MdiChevronDown />
</template>
<template v-for="role of allowedRoles" :key="`role-option-${role}`"> <template v-for="role of allowedRoles" :key="`role-option-${role}`">
<a-select-option v-if="role" :value="role"> <a-select-option v-if="role" :value="role">
<NcBadge :color="RoleColors[role]"> <NcBadge :color="RoleColors[role]">
@ -229,13 +226,11 @@ const onPaste = (e: ClipboardEvent) => {
type="primary" type="primary"
:disabled="!emailBadges.length || isInvitingCollaborators || emailValidation.isError" :disabled="!emailBadges.length || isInvitingCollaborators || emailValidation.isError"
size="small" size="small"
:loading="isInvitingCollaborators"
@click="inviteCollaborator" @click="inviteCollaborator"
> >
<div class="flex flex-row items-center gap-x-2 pr-1"> <MdiPlus />
<GeneralLoader v-if="isInvitingCollaborators" class="flex" /> {{ isInvitingCollaborators ? 'Adding' : 'Add' }} Member(s)
<MdiPlus v-else />
{{ isInvitingCollaborators ? 'Adding' : 'Add' }} User(s)
</div>
</NcButton> </NcButton>
</div> </div>
</div> </div>

Loading…
Cancel
Save