Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loris integration phase 2 pull develop da6e8cba73b4da8465224c85125b119ec15cbd62 #1630

Conversation

david-montano-metalab
Copy link
Contributor

📝 Description

🔗 Jira Ticket M2-7488

Changes include:

  • Updates the loris branch with the lates develop changes

sultanofcardio and others added 30 commits September 3, 2024 11:46
…ipant (M2-6223) (#1565)

This PR adds a new endpoint `/activities/applet/{applet_id}/subject/{subject_id}`, which allows the caller to fetch an object containing the list of activities and activity flows that have been assigned to the subject specified by `subject_id` in some way. Each activity or flow will have a non-nullable array property called `assignments` containing the list of assignments of that activity/flow where the given subject is the **respondent**.

It is yet undecided at a product level whether auto assigned activities/flows can be manually assigned, but the API currently allows this. Thus, it is possible for the data returned from this endpoint to contain an activity/flow with both `autoAssign` set to `true`, and a non-empty `assignments` property.

The caller of the endpoint must be authenticated as a user with one of the following user roles:
- Owner
- Manager
- Coordinator
- Reviewer (with access to the subject)
This pull request introduces the unassign endpoint for activity assignments. The unassign functionality allows authorized users to mark assignments as deleted. It ensures that previously assigned activities or flows can be unassigned, effectively updating the database to reflect the unassignment.

* feature: Completed unassign endpoint using the same json structure of the assign assignments endpoint request. Implemented get_assignments_by_activity_or_flow_id_and_subject_id to retrieve assignment_id using activity_id and subject_id. Crated unassign_many to update multiple schemas at a time using the _update CRUD base function
* Calling assignment endpoint and then unassign to test functionality
* Created tests for unassign feature
* Recover applet_assignments function and completed unassign_many function
* Typing consistency for delete requests and Optional types on unassign feature
* Update src/apps/activity_assignments/router.py

Co-authored-by: Farmer Paul <[email protected]>

---------

Co-authored-by: Farmer Paul <[email protected]>
…ID (M2-6223) (#1592)

* fix: match by both respondent & target subject

Assignments being returned by this endpoint were only matching by
respondent subject, but the AC for M2-6223 states to return assignments
matching both by respondent & target subject. So adjusted the function
to match by one of those, or both, based on the `match_by` parameter.

Fixed tests to test this condition as well.

* fix: remove redundant CRUD function

The `check_for_assignment_and_notify` function was using a CRUD function
`get_by_respondent_subject_id` to return assignments matching a given
respondent subject, which did not perform soft-delete integrity checks.
The same functionality exists in `get_by_applet_and_subject` but with
soft-delete integrity checks, so removed the old function in favour of
this one.

* refactor: use `Filters` class, simplify code

On @rcmerlo's recommendation, switched to using `QueryParams` and
`Filters` class for filtering assignments queries by respondent or
target subject. In doing so, discovered that `get_by_applet_and_subject`
was not in fact needed; all the functionality is now provided by
`get_by_applet`.
* Created new startup script

* testing env

* feature env version

* feature start manifest
* feat: adding unity type

* change to fix odd validation behavior on item responses

* refactor unityFile to unity

* ruff formatting

* ruff linting import order change

* Adding unity tests

* ruff format

* test name fix

* re-adding wrongly removed test

* moving unity file file to config

---------

Co-authored-by: Ramir Mesquita <[email protected]>
This PR adds a field called `severity` to the subscale lookup table JSONB data. This allows subscale lookup tables to be saved with severity data
…#1594)

* chore: Update some dependencies to fix some security issues

* feature: Handle reassign an assignment in creation endpoint (M2-7461)

* Refatoring assignments service and crud to use upsert

* chore: Move assignments tests to one file to remove duplicated fixtures
…2-6978) (#1581)

Modified answers applet_validate_multiinformant_assessment api to return BAD REQUEST instead of 200 OK response using pydantic validation and modified the answers tests script to validate new responses.
* Update CORS ALLOW ORIGIN env variables to match any localhost pattern. Update MAILING__MAIL__SERVER to 'mailhog'.

* Update README with steps related to running API locally.

* Additional notes

* spelling
…1604)

This PR updates the validation for the subscale lookup table to support ranges in the `age` field using the tilde character (~), similar to the `score` and `rawScore` fields.
…2-7919) (#1611)

This PR creates the new endpoint `/subjects/respondent/{respondent_subject_id}/activity-or-flow/{activity_or_flow_id}`, which returns a list of subjects based on an association with the respondent subject and activity/flow specified. The endpoint is accessible by users with the following applet roles:
- Owner
- Manager
- Coordinator
- Reviewer (who is assigned the `respondent_subject_id` subject)

Each subject in the list returned will be the target subject of at least one:
- Assignment where `respondent_subject_id` is the respondent subject (including auto-assigned activities/flows)
- Submission where `respondent_subject_id` is the source subject

In addition to the usual `SubjectReadResponse` properties, there are two extra ones that I'd like to highlight:
- `submissionCount`: This is the number of answers that the respondent has submitted for a given subject and activity/flow
- `currentlyAssigned`: Whether the activity/flow is currently assigned for the respondent to complete about a given subject

Activities/flows that have been unassigned and don't have any submissions aren't included
…or target (M2-7853) (#1614)

This PR creates the new endpoint `GET /activities/applet/{applet_id}/target/{subject_id}`, which returns a list of activities and flows that are associated with the specified target subject within the applet. The endpoint is accessible by users with the following applet roles:

- Owner
- Manager
- Coordinator
- Reviewer (who is assigned the target subject)

Each activity/flow in the list will be returned based on one of the following conditions
- The activity/flow is set to auto assign
- The activity/flow is manually assigned to some respondent, with the specified target subject as its target
- Answers have been submitted at some point in the past for the activity/flow with the specified target subject as the target

The return type is `ActivityOrFlowWithAssignmentsPublic`

---------

Co-authored-by: Rodrigo Merlo <[email protected]>
…date

[M2-7838] Add passed tests to the slack output steps
Billie He and others added 12 commits October 8, 2024 12:41
…ondent-entities

feat: Add endpoint to get activities/flows assigned to or submitted for respondent (M2-7854)
* feature(conditionalLogic): Accept new activity items

* wip(conditionalLogic): DateItem support

* wip(conditionalLogic): time and timerange added

* wip(conditionalLogic) Fix validation errors for time an date

* wip(sliderRow): Add slider row validation

* wip(conditionalLogic) Remove type from tume renge

* wip(conditionalLogic): allow all activity items types

* wip(conditionalLogic): Split score and reports and conditionalLogic

* wip(conditionalLogic): Add special public model

* wip(conditionalLogic): Change index type

* wip(conditionalLogic): Change option based items validation

* feature/new_items_types

* chore/fixing code quality

* chore/fixing singleTimePayload, minMaxTimePayload, activity_item_change on code quality and fixing date test on test_custom_validation

* chore/cleaning test_custom_validation comment

* chore/ruff format condition.py and test_custom_validation

---------

Co-authored-by: ivan koryshkin <[email protected]>
Co-authored-by: iwankrshkin <[email protected]>
Co-authored-by: Felipe Imperio <[email protected]>
…7830) (#1623)

This PR updates the applet duplication endpoint to optionally include an optional `include_report_server` property that defaults to false (making it backwards compatible).

The following properties are duplicated:
- `reportServerIp`
- `reportPublicKey`
- `reportIncludeUserId`
- `reportIncludeCaseId`
- `reportEmailBody`
* chore: add language assertion to invitation tests

* fix: tom's fixture function return type

* chore: rename mailing service html template getter

* fix: shell account re-invite unit test

* chore: parameterize invitation unit tests

* chore: fix html email template formatting

* feat: implement fallback to English for localized email templates

* feat: add placeholder templates for greek emails

* fix: lints

* fix: some typing errors in invitation unit tests

* chore: replace placeholder with actual greek translations

* chore: rename parameter names for email template function

* chore: add tests for assignment email language

---------

Co-authored-by: Billie He <[email protected]>
* chore: Update python version to 3.11

* chore: Getting away from passlib and using bcrypt directly

* chore: Moving from python-jose  lib to pyJWT

* fix: Rebase and fix pipfile.lock
)

* Adding DR ECR

* extra output

* fixed region
Copy link

github-actions bot commented Oct 17, 2024

➡️ Preview environment failed to be destroyed

Copy link

❌ E2E tests failed

david-montano-metalab and others added 4 commits October 17, 2024 12:56
…#1616)

* Changes Score class allowing two new arguments:  scoring_type and sucale_name and verifies that data is saved into the DataBase, then retriving it when create_report is executed. 
* Fixed issues with SinglePayload class and adjusted tests accordingly.
@david-montano-metalab david-montano-metalab marked this pull request as ready for review October 18, 2024 16:14
@david-montano-metalab david-montano-metalab merged commit a74bd23 into loris-integration-phase-2 Oct 18, 2024
14 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.