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) => {
const isReadonly = inject(ReadonlyInj, ref(false))
const { t } = useI18n()
const isPublic = inject(IsPublicInj, ref(false))
const isForm = inject(IsFormInj, ref(false))
@ -61,8 +63,6 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState(
const { appInfo } = useGlobal()
const { t } = useI18n()
const { getAttachmentSrc } = useAttachment()
const defaultAttachmentMeta = {
@ -140,8 +140,14 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState(
}
// this prevent file with same names
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)
}

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

@ -211,7 +211,7 @@ onUnmounted(() => {
'nc-grid-numeric-cell-right': isGrid && isNumericField && !isEditColumnMenu && !isForm && !isExpandedFormOpen,
'h-10': isForm && !isSurveyForm && !isAttachment(column) && !props.virtual,
'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),
},
]"

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

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

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

@ -299,7 +299,7 @@
"noFieldsFound": "No fields found",
"displayValue": "Display Value",
"expand": "Expand",
"hideAll":"Hide all",
"hideAll": "Hide all",
"hideSystemFields": "hideSystemFields",
"removeFile": "Remove File",
"hasMany": "Has Many",
@ -385,6 +385,7 @@
}
},
"labels": {
"duplicateAttachment": "File with name {filename} already attached",
"toAddress": "To Address",
"subject": "Subject",
"body": "Body",
@ -809,7 +810,7 @@
"selectBarcodeFormat": "Select a Barcode format",
"projName": "Enter Project Name",
"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",
"selectGeoFieldNotFound": "No GeoData Field can be found. Please create one first.",
"password": {
@ -844,7 +845,7 @@
"key": "Key"
},
"msg": {
"enterPassword":"Enter password",
"enterPassword": "Enter password",
"bySigningUp": "By signing up, you agree to the",
"subscribeToOurWeeklyNewsletter": "Subscribe to our weekly newsletter",
"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>
<div
class="flex flex-col gap-2 text-slate-500 dark:text-slate-300 text-[0.75rem] my-2 px-1"
style="word-break: break-all"
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-word"
>
<div v-for="error of v$.localState[field.title]?.$errors" :key="error" class="text-red-500">
{{ error.$message }}

Loading…
Cancel
Save