HC-IPPM / HC-IPPM/safe-inputs

Record upload route(s)

Open
#409 0 comments 0 reactions 0 assignees View on GitHub
frontend (/ui) high priority
Dominant language
TypeScript
Stars
3
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Issue write-up incomplete, likely to break this down in to sub-routes.

should:
- redirect users without a session to the login page (`useSession` with `allow_unauthenticated` `false`)
- have a route parameter for the target `collection_id`
- query API for collection information (render whole route loading spinner meanwhile)
```
Query CollectionDetails($collection_id: String!, $lang: String!) {
collection(collection_id: $collection_id){
stable_key
major_ver
minor_ver
is_current_version
created_by
created_at
is_locked
name(lang: $lang)
description(lang: $lang)

column_defs {
header
name(lang: $lang)
description(lang: $lang)
data_type

conditions {
condition_type
parameters
}
}
}
}
```
- display collection information (name, description, etc), maybe as a description list (`dl`) element
- display column definitions, potentially under a `details` element, as there may be many
- display upload form and button (the current excell parser component, more or less)
- TODO implement `validate_new_records` in the GQL API, return information that can be used to highlight and display errors client-side
- query API for past records uploaded by the current user (render a header for this section and a sub-section loading spinner while querying)
```
Query RecordDetails($collection_id: String!) {
collection(collection_id: $collection_id){
records_uploaded_by { #defaults to email of session user
id
data
created_at
}
}
}
```
- display table of past records uploaded by the current user. Include a button to delete individual records?

This might be doing too much on one page. We may want the display of past records to be a sub-route.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.