|
|
@ -168,7 +168,9 @@ const isExpanded = useVModel(props, 'modelValue', emits, { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const onClose = () => { |
|
|
|
const onClose = () => { |
|
|
|
if (changedColumns.value.size > 0) { |
|
|
|
if (!isUIAllowed('dataEdit')) { |
|
|
|
|
|
|
|
isExpanded.value = false |
|
|
|
|
|
|
|
} else if (changedColumns.value.size > 0) { |
|
|
|
isCloseModalOpen.value = true |
|
|
|
isCloseModalOpen.value = true |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (_row.value?.rowMeta?.new) emits('cancel') |
|
|
|
if (_row.value?.rowMeta?.new) emits('cancel') |
|
|
@ -457,7 +459,7 @@ const onIsExpandedUpdate = (v: boolean) => { |
|
|
|
|
|
|
|
|
|
|
|
if (changedColumns.value.size === 0 && !isUnsavedFormExist.value) { |
|
|
|
if (changedColumns.value.size === 0 && !isUnsavedFormExist.value) { |
|
|
|
isExpanded.value = v |
|
|
|
isExpanded.value = v |
|
|
|
} else if (!v) { |
|
|
|
} else if (!v && isUIAllowed('dataEdit')) { |
|
|
|
preventModalStatus.value = true |
|
|
|
preventModalStatus.value = true |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
isExpanded.value = v |
|
|
|
isExpanded.value = v |
|
|
@ -555,7 +557,7 @@ export default { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="flex gap-2"> |
|
|
|
<div class="flex gap-2"> |
|
|
|
<NcButton |
|
|
|
<NcButton |
|
|
|
v-if="!isNew" |
|
|
|
v-if="isUIAllowed('dataEdit') && !isNew" |
|
|
|
type="secondary" |
|
|
|
type="secondary" |
|
|
|
class="!xs:hidden text-gray-700" |
|
|
|
class="!xs:hidden text-gray-700" |
|
|
|
@click="!isNew ? copyRecordUrl() : () => {}" |
|
|
|
@click="!isNew ? copyRecordUrl() : () => {}" |
|
|
@ -566,29 +568,25 @@ export default { |
|
|
|
{{ isRecordLinkCopied ? $t('labels.copiedRecordURL') : $t('labels.copyRecordURL') }} |
|
|
|
{{ isRecordLinkCopied ? $t('labels.copiedRecordURL') : $t('labels.copyRecordURL') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
<NcDropdown v-if="!isNew" placement="bottomRight"> |
|
|
|
<NcDropdown v-if="isUIAllowed('dataEdit') && !isNew" placement="bottomRight"> |
|
|
|
<NcButton type="secondary" class="nc-expand-form-more-actions w-10"> |
|
|
|
<NcButton type="secondary" class="nc-expand-form-more-actions w-10"> |
|
|
|
<GeneralIcon icon="threeDotVertical" class="text-md text-gray-700" /> |
|
|
|
<GeneralIcon icon="threeDotVertical" class="text-md text-gray-700" /> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
<template #overlay> |
|
|
|
<template #overlay> |
|
|
|
<NcMenu> |
|
|
|
<NcMenu> |
|
|
|
<NcMenuItem v-if="!isNew" class="text-gray-700" @click="_loadRow()"> |
|
|
|
<NcMenuItem class="text-gray-700" @click="_loadRow()"> |
|
|
|
<div v-e="['c:row-expand:reload']" class="flex gap-2 items-center" data-testid="nc-expanded-form-reload"> |
|
|
|
<div v-e="['c:row-expand:reload']" class="flex gap-2 items-center" data-testid="nc-expanded-form-reload"> |
|
|
|
<component :is="iconMap.reload" class="cursor-pointer" /> |
|
|
|
<component :is="iconMap.reload" class="cursor-pointer" /> |
|
|
|
{{ $t('general.reload') }} |
|
|
|
{{ $t('general.reload') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
<NcMenuItem v-if="!isNew && isMobileMode" class="text-gray-700" @click="!isNew ? copyRecordUrl() : () => {}"> |
|
|
|
<NcMenuItem v-if="isMobileMode" class="text-gray-700" @click="!isNew ? copyRecordUrl() : () => {}"> |
|
|
|
<div v-e="['c:row-expand:copy-url']" data-testid="nc-expanded-form-copy-url" class="flex gap-2 items-center"> |
|
|
|
<div v-e="['c:row-expand:copy-url']" data-testid="nc-expanded-form-copy-url" class="flex gap-2 items-center"> |
|
|
|
<component :is="iconMap.link" class="cursor-pointer nc-duplicate-row" /> |
|
|
|
<component :is="iconMap.link" class="cursor-pointer nc-duplicate-row" /> |
|
|
|
{{ $t('labels.copyRecordURL') }} |
|
|
|
{{ $t('labels.copyRecordURL') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem class="text-gray-700" @click="!isNew ? onDuplicateRow() : () => {}"> |
|
|
|
v-if="isUIAllowed('dataEdit') && !isNew" |
|
|
|
|
|
|
|
class="text-gray-700" |
|
|
|
|
|
|
|
@click="!isNew ? onDuplicateRow() : () => {}" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<div |
|
|
|
<div |
|
|
|
v-e="['c:row-expand:duplicate']" |
|
|
|
v-e="['c:row-expand:duplicate']" |
|
|
|
data-testid="nc-expanded-form-duplicate" |
|
|
|
data-testid="nc-expanded-form-duplicate" |
|
|
@ -600,12 +598,8 @@ export default { |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
<NcDivider v-if="isUIAllowed('dataEdit') && !isNew" /> |
|
|
|
<NcDivider /> |
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem class="!text-red-500 !hover:bg-red-50" @click="!isNew && onDeleteRowClick()"> |
|
|
|
v-if="isUIAllowed('dataEdit') && !isNew" |
|
|
|
|
|
|
|
class="!text-red-500 !hover:bg-red-50" |
|
|
|
|
|
|
|
@click="!isNew && onDeleteRowClick()" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<div v-e="['c:row-expand:delete']" data-testid="nc-expanded-form-delete" class="flex gap-2 items-center"> |
|
|
|
<div v-e="['c:row-expand:delete']" data-testid="nc-expanded-form-delete" class="flex gap-2 items-center"> |
|
|
|
<component :is="iconMap.delete" class="cursor-pointer nc-delete-row" /> |
|
|
|
<component :is="iconMap.delete" class="cursor-pointer nc-delete-row" /> |
|
|
|
<span class="-ml-0.25"> |
|
|
|
<span class="-ml-0.25"> |
|
|
|