Skip to content

Client | Management

Mitchell Mastromonaco edited this page Apr 16, 2020 · 7 revisions

The management view allows an admin user to create, update and delete entities from the database. Each field is assigned to a property of the entity. All entities are imported dynamically from models in \client\src\app\shared\models\serverModels\.

Adding New Models

In order to add new models for use within the management view, a class must be created within \client\src\app\shared\models\serverModels\. This class must have the same name as the entity found in the server.

Also, all attributes within this class must have a default value of some sort in order to be picked up during the dynamic import.

Finally, the class must be imported somewhere. Thus far, the dump class has been Task.ts. In following with this point, the imports in Task.ts must not be deleted to maintain the integrity of the management view.

Create

All fields must be filled.

annotation

  • Fields
    • id [number][PK]
    • data [string]
    • imageId [number][FK]
    • comment [string]

image

  • Fields
    • id [number][PK]:
    • type [string]
    • preprocessing [boolean]
    • files [string]

submissionEvent

  • Should not be created

task

  • Fields
    • taskId [number][PK]
    • taskTypeId [number][FK]
    • annotationId[number][FK]
    • isComplete[boolean]
    • isVisible [boolean]
    • projectTitle [string]
    • comment [string]
    • assignedUserId [number][FK]

taskPriority

  • Fields
    • userId [number][PK][FK]
    • taskId [number][PK][FK]
    • priority [number]

taskType

  • Fields
    • id [number][PK]
    • title [string]
    • description [string]

user

  • Fields
    • id [string][PK]
    • firstName [string]
    • lastName [string]
    • email [string]
    • role [string]
    • password [string]

widget

  • Fields
    • id [number][PK]
    • annotationId [number][FK]
    • label [string]
    • type [string]
    • defaultEntryValue [string]
    • validationRegex [string]

Update

All fields must be filled.

annotation

  • Fields
    • id [number][PK]
    • data [string]
    • imageId [number][FK]
    • comment [string]

image

Does not update files!

  • Fields
    • id [number][PK]:
    • type [string]
    • preprocessing [boolean]
    • files [string]

submissionEvent

  • Should not be updated

task

  • Fields
    • taskId [number][PK]
    • taskTypeId [number][FK]
    • annotationId[number][FK]
    • isComplete[boolean]
    • isVisible [boolean]
    • projectTitle [string]
    • comment [string]
    • assignedUserId [number][FK]

taskPriority

  • Fields
    • userId [number][PK][FK]
    • taskId [number][PK][FK]
    • priority [number]

taskType

  • Fields
    • id [number][PK]
    • title [string]
    • description [string]

user

  • Fields
    • id [string][PK]
    • firstName [string]
    • lastName [string]
    • email [string]
    • role [string]
    • password [string]

widget

  • Fields
    • id [number][PK]
    • annotationId [number][FK]
    • label [string]
    • type [string]
    • defaultEntryValue [string]
    • validationRegex [string]

Delete

Only entity ID must be filled.

annotation

  • Fields
    • id [number][PK]

image

  • Fields
    • id [number][PK]

submissionEvent

  • Cannot be deleted.

task

  • Fields
    • taskId [number][PK]

taskPriority

  • Fields
    • userId [number][PK]
    • taskId [number][PK][FK]

taskType

  • Fields
    • id [number][PK]

user

  • Fields
    • id [string][PK]

widget

  • Fields
    • id [number][PK]:

Clone this wiki locally