Browse Source

Added wrapping to text in non-survey mode and modified wrapping survey mode

pull/5531/head
nith2001 2 years ago
parent
commit
a4e0eafbcf
  1. 15
      packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue
  2. 17
      packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue

15
packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue

@ -75,9 +75,18 @@ const onDecode = async (scannedCodeValue: string) => {
class="color-transition relative flex flex-col justify-center gap-2 w-full max-w-[max(33%,600px)] m-auto py-4 pb-8 px-16 md:(bg-white dark:bg-slate-700 rounded-lg border-1 border-gray-200 shadow-xl)" class="color-transition relative flex flex-col justify-center gap-2 w-full max-w-[max(33%,600px)] m-auto py-4 pb-8 px-16 md:(bg-white dark:bg-slate-700 rounded-lg border-1 border-gray-200 shadow-xl)"
> >
<template v-if="sharedFormView"> <template v-if="sharedFormView">
<h1 class="prose-2xl font-bold self-center my-4">{{ sharedFormView.heading }}</h1> <h1
class="prose-2xl font-bold self-center my-4"
style="word-break: break-all"
>
{{ sharedFormView.heading }}
</h1>
<h2 v-if="sharedFormView.subheading" class="prose-lg text-slate-500 dark:text-slate-300 self-center mb-4 leading-6"> <h2
v-if="sharedFormView.subheading"
class="prose-lg text-slate-500 dark:text-slate-300 self-center mb-4 leading-6"
style="word-break: break-all"
>
{{ sharedFormView.subheading }} {{ sharedFormView.subheading }}
</h2> </h2>
@ -180,7 +189,7 @@ const onDecode = async (scannedCodeValue: string) => {
</a-button> </a-button>
</LazySmartsheetDivDataCell> </LazySmartsheetDivDataCell>
<div class="flex flex-col gap-2 text-slate-500 dark:text-slate-300 text-[0.75rem] my-2 px-1"> <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">
<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 }}
</div> </div>

17
packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue

@ -244,13 +244,17 @@ onMounted(() => {
class="max-w-[max(33%,600px)] mx-auto flex flex-col justify-end" class="max-w-[max(33%,600px)] mx-auto flex flex-col justify-end"
> >
<div class="px-4 md:px-0 flex flex-col justify-end"> <div class="px-4 md:px-0 flex flex-col justify-end">
<h1 class="prose-2xl font-bold self-center my-4" data-testid="nc-survey-form__heading"> <h1
class="prose-2xl font-bold self-center my-4"
data-testid="nc-survey-form__heading"
style="word-break: break-all">
{{ sharedFormView.heading }} {{ sharedFormView.heading }}
</h1> </h1>
<h2 <h2
v-if="sharedFormView.subheading && sharedFormView.subheading !== ''" v-if="sharedFormView.subheading && sharedFormView.subheading !== ''"
class="prose-lg text-slate-500 dark:text-slate-300 self-center mb-4 leading-6" class="prose-lg text-slate-500 dark:text-slate-300 self-center mb-4 leading-6"
style="word-break: break-all"
data-testid="nc-survey-form__sub-heading" data-testid="nc-survey-form__sub-heading"
> >
{{ sharedFormView?.subheading }} {{ sharedFormView?.subheading }}
@ -305,12 +309,12 @@ onMounted(() => {
@update:edit-enabled="editEnabled[index] = $event" @update:edit-enabled="editEnabled[index] = $event"
/> />
<div class="flex flex-col gap-2 text-slate-500 dark:text-slate-300 text-[0.75rem] my-2 px-1"> <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">
<div v-for="error of v$.localState[field.title]?.$errors" :key="error" class="nc-form-field-required-error text-red-500"> <div v-for="error of v$.localState[field.title]?.$errors" :key="error" class="text-red-500">
{{ error.$message }} {{ error.$message }}
</div> </div>
<div <div
class="nc-form-field-description block text-[14px]" class="block text-[14px]"
:class="field.uidt === UITypes.Checkbox ? 'text-center' : ''" :class="field.uidt === UITypes.Checkbox ? 'text-center' : ''"
data-testid="nc-survey-form__field-description" data-testid="nc-survey-form__field-description"
> >
@ -499,11 +503,6 @@ onMounted(() => {
} }
} }
.nc-form-field-description, .nc-form-field-required-error {
word-break: break-all;
}
.nc-form-column-label__checkbox { .nc-form-column-label__checkbox {
@apply flex items-center justify-center gap-2 text-left; @apply flex items-center justify-center gap-2 text-left;
} }

Loading…
Cancel
Save