mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 16:28:31 +00:00
* feat: add configurable max length for text-based field values Add BASEROW_MAX_FIELD_TEXT_LENGTH (default 500000), enforced at the serializer and in the frontend for single line text, long text, URL and AI fields. Existing longer values remain readable; only new writes over the limit are rejected. Implements #5688 * fix: address review feedback for max text length - Fix rich text editor modal crashing on expand: guard FieldRichTextModal.serializeToMarkdown() while the editor is unmounted during the open transition. - Surface the max-length error inside the expanded modal (Alert banner) and block closing while the value is over the limit. - Fall back to the default limit in the frontend when the runtime config is missing or non-numeric instead of silently disabling it. - Improve the error message to show how many characters are over the limit (Max N chars (-x)). - Avoid a settings crash when BASEROW_MAX_FIELD_TEXT_LENGTH is set to an empty string. - Add frontend tests for the rich text modal and the validation.
39 lines
966 B
Vue
39 lines
966 B
Vue
<template>
|
|
<div
|
|
ref="cell"
|
|
class="grid-view__cell active"
|
|
:class="{ editing: editing, invalid: editing && !isValid() }"
|
|
@contextmenu="stopContextIfEditing($event)"
|
|
>
|
|
<div v-if="!editing" class="grid-field-text">{{ value }}</div>
|
|
<template v-else>
|
|
<input
|
|
ref="input"
|
|
v-model="copy"
|
|
type="text"
|
|
class="grid-field-text__input"
|
|
/>
|
|
<div v-show="!isValid()" class="grid-view__cell-error align-right">
|
|
{{ getError() }}
|
|
</div>
|
|
</template>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import gridField from '@baserow/modules/database/mixins/gridField'
|
|
import gridFieldInput from '@baserow/modules/database/mixins/gridFieldInput'
|
|
|
|
export default {
|
|
mixins: [gridField, gridFieldInput],
|
|
methods: {
|
|
afterEdit() {
|
|
this.$nextTick(() => {
|
|
this.$refs.input.focus()
|
|
this.$refs.input.selectionStart = this.$refs.input.selectionEnd = 100000
|
|
})
|
|
},
|
|
},
|
|
}
|
|
</script>
|