aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask
AgeCommit message (Collapse)Author
2024-03-27Add some styling to gnqa answer page.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Fix htmx swap.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Delete unused javascript in gnqa page.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Add missing braces/brackets.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Enable auto-complete in form.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Clean up gnqa answer page.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Delete unused template.Munyoki Kilyungi
* gn2/wqflask/templates/pubmed_modal.html: Delete. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Delete llm.css and it's references.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Require ouath2 for gnqa history search.Munyoki Kilyungi
* gn2/wqflask/views.py (gnqna_hist): Add "require_oauth2" decorator. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Add htmx indicator.Munyoki Kilyungi
Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com> Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-27Add some styling to AI search bar.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Move search box to below the header.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Wrap "search" block round entire div that nests the search box.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Format files.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Re-locate gnqa search box to gnqa.html.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Require log-in to use the gn-qa search system.Munyoki Kilyungi
* gn2/wqflask/views.py: Import require_oauth2. (gnqna): Add "require_oauth2" decorator. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Clean up base.html.Munyoki Kilyungi
* gn2/wqflask/templates/base.html: Replace TABS with white-space. Fix hanging html tags. Format file. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Rework GN-QA landing page.Munyoki Kilyungi
Co-authored-by: Alexander Kabui <alexanderkabua@gmail.com>
2024-03-27Fix mark-up in gn-qa landing page.Munyoki Kilyungi
Co-authored-by: Alexander Kabui <Alexanderkabua@gmail.com>
2024-03-26Revert "Disable CaseAttributeId - because it needs an update to the database"Frederick Muriuki Muriithi
This reverts commit 4539ef0297bb4b8c2954f250697c237069a16d64. This commit was ignoring the historical context that led to the changes in the schema of the `CaseAttribute*` tables, and leads to errors when the database schema is updated.
2024-03-26Add missing docstrings to save/metadata_edit functions.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Add "dataset.name" field to the editor form.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Only display the "edit" link when a user has edit permissions.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Add a final fallback for match expression.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Use correct variable name.Munyoki Kilyungi
* gn2/wqflask/oauth2/client.py (no_token_post): "uri" does not exist. Replace it with "uri_path." Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Delete unused variable.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Use "require_oauth2_edit_resource_access" for edit/save endpoints.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Implement "require_oauth2_edit_resource_access" decorator.Munyoki Kilyungi
* gn2/wqflask/oauth2/checks.py (require_oauth2): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Replace "__" prefix for with "_".Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Import user_logged_in from the clients module.Munyoki Kilyungi
Importing "user_logged_in" in the checks module just to export adds a layer of indirection and makes the code hard to read. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Delete repetitive statement in "render_ui".Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Remove unused imports.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Auto-pep8 (using flake8) file.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Replace "login_required" with "require_oauth2".Munyoki Kilyungi
* gn2/wqflask/edit.py: Replace "login_required" import with "require_oauth2". (metadata_edit): Replace "login_required" with "require_oauth2". (edit): Ditto. (save): Ditto. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Remove unused declared variable.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Remove typo from template.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Add extra "edit" buttons to the relevant sections.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Make the description bold.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Reset repo and pull then write changes before committing.Munyoki Kilyungi
* gn2/wqflask/edit.py: Import session_info. (save_dataset_metadata): Add author as an argument. Reset repo and pull then write changes before committing. Split strings before __run_cmd is called. (metadata_edit): Rename "metadata" -> "__metadata". (save): Save the output to the correct path. Pass author to "save_dataset_metadata". Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Prevent shell injection by disabling shell invocation in subprocess.Munyoki Kilyungi
See: <https://stackoverflow.com/questions/52019920/python3-sanitizing-user-input-passed-to-shell-as-parameter> for more information. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Add a hidden input form element for "section".Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Replace Path construct with a format string.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Add missing "curry" to __run_cmd.Munyoki Kilyungi
This is required to be able to pass __run_cmd through a pipeline. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Replace Path.join with urljoin for url paths.Munyoki Kilyungi
* gn2/wqflask/edit.py: Import urljoin. (metadata_edit): Replace Path with urljoin. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Have one template for datasets.Munyoki Kilyungi
* gn2/wqflask/templates/metadata/dataset.html: Move this ... * gn2/wqflask/templates/dataset.html: ... here. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Delete search dataset functionality in RDF.Munyoki Kilyungi
* gn2/wqflask/views.py (search_for_dataset): Delete. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Make GN3_LOCAL_URL local to avoid circular imports.Munyoki Kilyungi
* gn2/wqflask/edit.py: Move GN3_LOCAL_URL ... (metadata_edit): ... here. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Delete "raise_unimplemented".Munyoki Kilyungi
* gn2/wqflask/oauth2/groups.py: Remove unused "raise_unimplemented" import. * gn2/wqflask/oauth2/request_utils.py (raise_unimplemented): Delete function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Add new hidden input for metadata id.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Rename summary label to "edit-summary".Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>