Browse Source

fix: form view ui fix

pull/6500/head
sreehari jayaraj 1 year ago
parent
commit
b35973929a
  1. 14
      packages/nc-gui/components/cell/attachment/utils.ts
  2. 2
      packages/nc-gui/components/smartsheet/Cell.vue
  3. 2
      packages/nc-gui/components/smartsheet/header/Cell.vue
  4. 7
      packages/nc-gui/lang/en.json
  5. 4
      packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index/index.vue

14
packages/nc-gui/components/cell/attachment/utils.ts

@ -33,6 +33,8 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState(
(updateModelValue: (data: string | Record<string, any>[]) => void) => { (updateModelValue: (data: string | Record<string, any>[]) => void) => {
const isReadonly = inject(ReadonlyInj, ref(false)) const isReadonly = inject(ReadonlyInj, ref(false))
const { t } = useI18n()
const isPublic = inject(IsPublicInj, ref(false)) const isPublic = inject(IsPublicInj, ref(false))
const isForm = inject(IsFormInj, ref(false)) const isForm = inject(IsFormInj, ref(false))
@ -61,8 +63,6 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState(
const { appInfo } = useGlobal() const { appInfo } = useGlobal()
const { t } = useI18n()
const { getAttachmentSrc } = useAttachment() const { getAttachmentSrc } = useAttachment()
const defaultAttachmentMeta = { const defaultAttachmentMeta = {
@ -140,8 +140,14 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState(
} }
// this prevent file with same names // this prevent file with same names
const isFileNameAlreadyExist = attachments.value.some((el) => el.title === file.name) const isFileNameAlreadyExist = attachments.value.some((el) => el.title === file.name)
if (isFileNameAlreadyExist) return if (isFileNameAlreadyExist) {
message.error(
t('labels.duplicateAttachment', {
filename: file.name,
}),
)
return
}
files.push(file) files.push(file)
} }

2
packages/nc-gui/components/smartsheet/Cell.vue

@ -211,7 +211,7 @@ onUnmounted(() => {
'nc-grid-numeric-cell-right': isGrid && isNumericField && !isEditColumnMenu && !isForm && !isExpandedFormOpen, 'nc-grid-numeric-cell-right': isGrid && isNumericField && !isEditColumnMenu && !isForm && !isExpandedFormOpen,
'h-10': isForm && !isSurveyForm && !isAttachment(column) && !props.virtual, 'h-10': isForm && !isSurveyForm && !isAttachment(column) && !props.virtual,
'nc-grid-numeric-cell-left': (isForm && isNumericField && isExpandedFormOpen) || isEditColumnMenu, 'nc-grid-numeric-cell-left': (isForm && isNumericField && isExpandedFormOpen) || isEditColumnMenu,
'!min-h-40 resize-y': isTextArea(column) && props.editEnabled, '!min-h-30 resize-y': isTextArea(column) && (isForm || isSurveyForm),
'!border-2': props.editEnabled && (isSurveyForm || isForm), '!border-2': props.editEnabled && (isSurveyForm || isForm),
}, },
]" ]"

2
packages/nc-gui/components/smartsheet/header/Cell.vue

@ -63,7 +63,7 @@ const openDropDown = () => {
@click.right="openDropDown" @click.right="openDropDown"
@click="isDropDownOpen = false" @click="isDropDownOpen = false"
> >
<SmartsheetHeaderCellIcon v-if="column && !props.hideIcon" /> <SmartsheetHeaderCellIcon v-if="column && !props.hideIcon" class="self-start" />
<div <div
v-if="column" v-if="column"
class="name pl-1" class="name pl-1"

7
packages/nc-gui/lang/en.json

@ -299,7 +299,7 @@
"noFieldsFound": "No fields found", "noFieldsFound": "No fields found",
"displayValue": "Display Value", "displayValue": "Display Value",
"expand": "Expand", "expand": "Expand",
"hideAll":"Hide all", "hideAll": "Hide all",
"hideSystemFields": "hideSystemFields", "hideSystemFields": "hideSystemFields",
"removeFile": "Remove File", "removeFile": "Remove File",
"hasMany": "Has Many", "hasMany": "Has Many",
@ -385,6 +385,7 @@
} }
}, },
"labels": { "labels": {
"duplicateAttachment": "File with name {filename} already attached",
"toAddress": "To Address", "toAddress": "To Address",
"subject": "Subject", "subject": "Subject",
"body": "Body", "body": "Body",
@ -809,7 +810,7 @@
"selectBarcodeFormat": "Select a Barcode format", "selectBarcodeFormat": "Select a Barcode format",
"projName": "Enter Project Name", "projName": "Enter Project Name",
"selectGroupField": "Select a Grouping Field", "selectGroupField": "Select a Grouping Field",
"selectGroupFieldNotFound" : "No Single Select Field can be found. Please create one first.", "selectGroupFieldNotFound": "No Single Select Field can be found. Please create one first.",
"selectGeoField": "Select a GeoData Field", "selectGeoField": "Select a GeoData Field",
"selectGeoFieldNotFound": "No GeoData Field can be found. Please create one first.", "selectGeoFieldNotFound": "No GeoData Field can be found. Please create one first.",
"password": { "password": {
@ -844,7 +845,7 @@
"key": "Key" "key": "Key"
}, },
"msg": { "msg": {
"enterPassword":"Enter password", "enterPassword": "Enter password",
"bySigningUp": "By signing up, you agree to the", "bySigningUp": "By signing up, you agree to the",
"subscribeToOurWeeklyNewsletter": "Subscribe to our weekly newsletter", "subscribeToOurWeeklyNewsletter": "Subscribe to our weekly newsletter",
"verifyingPassword": "Verifying Password", "verifyingPassword": "Verifying Password",

4
packages/nc-gui/pages/index/[typeOrId]/form/[viewId]/index/index.vue

@ -186,8 +186,8 @@ const onDecode = async (scannedCodeValue: string) => {
</LazySmartsheetDivDataCell> </LazySmartsheetDivDataCell>
<div <div
class="flex flex-col gap-2 text-slate-500 dark:text-slate-300 text-[0.75rem] my-2 px-1" class="flex flex-col gap-2 text-slate-500 dark:text-slate-300 text-[0.75rem] my-2 px-1 leading-[18px]"
style="word-break: break-all" style="word-break: break-word"
> >
<div v-for="error of v$.localState[field.title]?.$errors" :key="error" class="text-red-500"> <div v-for="error of v$.localState[field.title]?.$errors" :key="error" class="text-red-500">
{{ error.$message }} {{ error.$message }}

Loading…
Cancel
Save