Browse Source

fix: Added event to expanded form

pull/6539/head
Muhammed Mustafa 1 year ago
parent
commit
e678f13177
  1. 13
      packages/nc-gui/components/smartsheet/expanded-form/Comments.vue
  2. 19
      packages/nc-gui/components/smartsheet/expanded-form/index.vue

13
packages/nc-gui/components/smartsheet/expanded-form/Comments.vue

@ -115,6 +115,7 @@ const processedAudit = (log: string) => {
<div class="h-16 bg-white rounded-t-lg border-gray-200 border-b-1"> <div class="h-16 bg-white rounded-t-lg border-gray-200 border-b-1">
<div class="flex flex-row gap-2 m-2 p-1 bg-gray-100 rounded-lg"> <div class="flex flex-row gap-2 m-2 p-1 bg-gray-100 rounded-lg">
<div <div
v-e="['c:row-expand:comment']"
class="tab flex-1 px-4 py-2 transition-all text-gray-600 cursor-pointer rounded-lg" class="tab flex-1 px-4 py-2 transition-all text-gray-600 cursor-pointer rounded-lg"
:class="{ :class="{
'bg-white shadow !text-brand-500 !hover:text-brand-500': tab === 'comments', 'bg-white shadow !text-brand-500 !hover:text-brand-500': tab === 'comments',
@ -127,6 +128,7 @@ const processedAudit = (log: string) => {
</div> </div>
</div> </div>
<div <div
v-e="['c:row-expand:audit']"
class="tab flex-1 px-4 py-2 transition-all text-gray-600 cursor-pointer rounded-lg" class="tab flex-1 px-4 py-2 transition-all text-gray-600 cursor-pointer rounded-lg"
:class="{ :class="{
'bg-white shadow !text-brand-500 !hover:text-brand-500': tab === 'audits', 'bg-white shadow !text-brand-500 !hover:text-brand-500': tab === 'audits',
@ -171,6 +173,7 @@ const processedAudit = (log: string) => {
</div> </div>
<NcButton <NcButton
v-if="log.user === user!.email && !editLog && !appInfo.ee" v-if="log.user === user!.email && !editLog && !appInfo.ee"
v-e="['c:row-expand:comment:edit']"
type="secondary" type="secondary"
class="!px-2 opacity-0 group-hover:opacity-100 transition-all" class="!px-2 opacity-0 group-hover:opacity-100 transition-all"
size="sm" size="sm"
@ -192,7 +195,7 @@ const processedAudit = (log: string) => {
</div> </div>
<div v-if="log.id === editLog?.id" class="flex justify-end gap-1"> <div v-if="log.id === editLog?.id" class="flex justify-end gap-1">
<NcButton type="secondary" size="sm" @click="onCancel"> Cancel </NcButton> <NcButton type="secondary" size="sm" @click="onCancel"> Cancel </NcButton>
<NcButton size="sm" @click="onEditComment"> Save </NcButton> <NcButton v-e="['a:row-expand:comment:save']" size="sm" @click="onEditComment"> Save </NcButton>
</div> </div>
</div> </div>
</div> </div>
@ -209,7 +212,13 @@ const processedAudit = (log: string) => {
@keyup.enter.prevent="saveComment" @keyup.enter.prevent="saveComment"
> >
</a-input> </a-input>
<NcButton size="medium" class="!w-8" :disabled="!comment.length" @click="saveComment"> <NcButton
v-e="['a:row-expand:comment:save']"
size="medium"
class="!w-8"
:disabled="!comment.length"
@click="saveComment"
>
<GeneralIcon icon="send" /> <GeneralIcon icon="send" />
</NcButton> </NcButton>
</div> </div>

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

@ -459,13 +459,25 @@ 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 v-if="props.showNextPrevIcons" type="secondary" class="nc-prev-arrow !w-10" @click="$emit('prev')"> <NcButton
v-if="props.showNextPrevIcons"
v-e="['c:row-expand:prev']"
type="secondary"
class="nc-prev-arrow !w-10"
@click="$emit('prev')"
>
<GeneralIcon icon="arrowLeft" class="text-lg text-gray-700" /> <GeneralIcon icon="arrowLeft" class="text-lg text-gray-700" />
</NcButton> </NcButton>
<div class="flex flex-grow justify-center items-center font-semibold text-lg"> <div class="flex flex-grow justify-center items-center font-semibold text-lg">
<div>{{ meta.title }}</div> <div>{{ meta.title }}</div>
</div> </div>
<NcButton v-if="!props.lastRow" type="secondary" class="nc-next-arrow !w-10" @click="onNext"> <NcButton
v-if="!props.lastRow"
v-e="['c:row-expand:next']"
type="secondary"
class="nc-next-arrow !w-10"
@click="onNext"
>
<GeneralIcon icon="arrowRight" class="text-lg text-gray-700" /> <GeneralIcon icon="arrowRight" class="text-lg text-gray-700" />
</NcButton> </NcButton>
</div> </div>
@ -638,7 +650,8 @@ export default {
</div> </div>
<div class="flex flex-row gap-x-2 mt-4 pt-1.5 justify-end pt-4 gap-x-3"> <div class="flex flex-row gap-x-2 mt-4 pt-1.5 justify-end pt-4 gap-x-3">
<NcButton v-if="isMobileMode" type="secondary" @click="showDeleteRowModal = false">{{ $t('general.cancel') }} </NcButton> <NcButton v-if="isMobileMode" type="secondary" @click="showDeleteRowModal = false">{{ $t('general.cancel') }} </NcButton>
<NcButton @click="onConfirmDeleteRowClick">{{ $t('general.confirm') }} </NcButton>
<NcButton v-e="['a:row-expand:delete']" @click="onConfirmDeleteRowClick">{{ $t('general.confirm') }} </NcButton>
</div> </div>
</NcModal> </NcModal>
</template> </template>

Loading…
Cancel
Save