fix: Improved model validation for Collection (#3749)

* fix: Added improved model validation for Collection attributes

* sp

* fix: Enforce title length in UI
This commit is contained in:
Tom Moor
2022-07-08 20:10:22 +02:00
committed by GitHub
parent 98106e7f6f
commit 4a46d19846
8 changed files with 48 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ import { observable } from "mobx";
import { observer } from "mobx-react";
import * as React from "react";
import { withTranslation, Trans, WithTranslation } from "react-i18next";
import { MAX_TITLE_LENGTH } from "@shared/constants";
import RootStore from "~/stores/RootStore";
import Collection from "~/models/Collection";
import Button from "~/components/Button";
@@ -127,6 +128,7 @@ class CollectionNew extends React.Component<Props> {
type="text"
label={t("Name")}
onChange={this.handleNameChange}
maxLength={MAX_TITLE_LENGTH}
value={this.name}
required
autoFocus