introduction of proper text length limiting

This commit is contained in:
Sören Oesterwind 2023-07-09 20:17:05 +02:00
parent 09e74f9eb6
commit abb7e7bab3
4 changed files with 11 additions and 10 deletions

View File

@ -32,12 +32,13 @@ enum itemStatus {
lost lost
} }
// comments and descriptions -> @db.VarChar(2048)
model Item { model Item {
id Int @id @unique @default(autoincrement()) id Int @id @unique @default(autoincrement())
SKU String? @unique SKU String? @unique
amount Int @default(1) amount Int @default(1)
name String name String
comment String? comment String? @db.VarChar(2048)
status itemStatus @default(normal) /// TODO: Would it be better to create a separate model for this as well instead of providing several static statuses to choose from(enum)? status itemStatus @default(normal) /// TODO: Would it be better to create a separate model for this as well instead of providing several static statuses to choose from(enum)?
contactInfo contactInfo? @relation(fields: [contactInfoId], references: [id]) contactInfo contactInfo? @relation(fields: [contactInfoId], references: [id])
@ -81,7 +82,7 @@ model StorageUnit {
model itemCategory { model itemCategory {
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
name String @unique name String @unique
description String? description String? @db.VarChar(2048)
Item Item[] Item Item[]
} }

View File

@ -11,12 +11,12 @@
<div class="modal-body"> <div class="modal-body">
<div class="mb-3"> <div class="mb-3">
<label for="itemModifyModalName" class="form-label">Name</label> <label for="itemModifyModalName" class="form-label">Name</label>
<input type="text" class="form-control" id="itemModifyModalName" name="name" required /> <input type="text" class="form-control" id="itemModifyModalName" name="name" maxlength="128" required />
<div id="itemModifyModalNameText" class="form-text">This name should be unqiue.</div> <div id="itemModifyModalNameText" class="form-text">This name should be unqiue.</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="itemModifyModalComment" class="form-label">Comment</label> <label for="itemModifyModalComment" class="form-label">Comment</label>
<input type="text" class="form-control" id="itemModifyModalComment" name="comment" /> <input type="text" class="form-control" id="itemModifyModalComment" maxlength="2048" name="comment" />
<div id="itemModifyModalDescText" class="form-text">Optional</div> <div id="itemModifyModalDescText" class="form-text">Optional</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
@ -36,12 +36,12 @@
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="itemModifyModalSKU" class="form-label">SKU</label> <label for="itemModifyModalSKU" class="form-label">SKU</label>
<input type="text" class="form-control" id="itemModifyModalSKU" name="sku" /> <input type="text" class="form-control" id="itemModifyModalSKU" maxlength="64" name="sku" />
<div id="itemModifyModalSKUText" class="form-text">Optional</div> <div id="itemModifyModalSKUText" class="form-text">Optional</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="itemModifyModalManuf" class="form-label">Manufacturer</label> <label for="itemModifyModalManuf" class="form-label">Manufacturer</label>
<input type="text" class="form-control" id="itemModifyModalManuf" name="manufacturer" /> <input type="text" class="form-control" id="itemModifyModalManuf" maxlength="190" name="manufacturer" />
<div id="itemModifyModalSKUText" class="form-text">Optional</div> <div id="itemModifyModalSKUText" class="form-text">Optional</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
@ -98,7 +98,7 @@
<tr> <tr>
<th scope="col" data-field="SKU" class="sku" data-sortable="true">SKU</th> <th scope="col" data-field="SKU" class="sku" data-sortable="true">SKU</th>
<th scope="col" data-field="name" data-sortable="true">Name</th> <th scope="col" data-field="name" data-sortable="true">Name</th>
<th scope="col" data-field="comment" data-sortable="true">Comment</th> <th scope="col" data-field="comment" data-sortable="true" data-width="80">Comment</th>
<th scope="col" data-field="status" data-sortable="true">Status</th> <th scope="col" data-field="status" data-sortable="true">Status</th>
<th scope="col" data-field="actions" data-searchable="false">Actions</th> <th scope="col" data-field="actions" data-searchable="false">Actions</th>
</tr> </tr>

View File

@ -20,12 +20,12 @@
<div class="modal-body"> <div class="modal-body">
<div class="mb-3"> <div class="mb-3">
<label for="editCategoryModalName" class="form-label">Name</label> <label for="editCategoryModalName" class="form-label">Name</label>
<input type="text" class="form-control" id="editCategoryModalName" name="name" required /> <input type="text" class="form-control" id="editCategoryModalName" maxlength="128" name="name" required />
<div id="editCategoryModalNameText" class="form-text">This name should be unqiue.</div> <div id="editCategoryModalNameText" class="form-text">This name should be unqiue.</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="editCategoryModalDescription" class="form-label">Description</label> <label for="editCategoryModalDescription" class="form-label">Description</label>
<input type="text" class="form-control" id="editCategoryModalDescription" name="description" /> <input type="text" class="form-control" id="editCategoryModalDescription" maxlength="2048" name="description" />
<div id="editCategoryModalDescText" class="form-text">Optional</div> <div id="editCategoryModalDescText" class="form-text">Optional</div>
</div> </div>
<input type="text" id="editCategoryModalId" name="id" hidden /> <input type="text" id="editCategoryModalId" name="id" hidden />

View File

@ -13,7 +13,7 @@
<div class="modal-body"> <div class="modal-body">
<div class="mb-3"> <div class="mb-3">
<label for="storageLocationModalName" class="form-label">Name</label> <label for="storageLocationModalName" class="form-label">Name</label>
<input type="text" class="form-control" id="storageLocationModalName" name="name" required /> <input type="text" class="form-control" id="storageLocationModalName" name="name" maxlength="128" required />
<div id="storageLocationModalNameText" class="form-text">This name should be unqiue.</div> <div id="storageLocationModalNameText" class="form-text">This name should be unqiue.</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">