-
Notifications
You must be signed in to change notification settings - Fork 1
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
1879 edit operation #2253
1879 edit operation #2253
Conversation
35e2059
to
87d046c
Compare
@router.get( | ||
"/v2/operations/{uuid:operation_id}/with-documents", | ||
response={200: OperationOutWithDocuments, codes_4xx: Message}, | ||
tags=OPERATION_TAGS, | ||
description="""Retrieves the details of a specific operation by its ID along with it's documents""", | ||
exclude_none=True, | ||
auth=authorize("approved_authorized_roles"), | ||
) | ||
@handle_http_errors() | ||
def get_operation_with_documents(request: HttpRequest, operation_id: UUID) -> Tuple[Literal[200], Operation]: | ||
return 200, OperationService.get_if_authorized(get_current_user_guid(request), operation_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a new API route, though I was split on if I should add a query param like documents
and return the documents if it was true. Can we have conditional Django Ninja schemas? Is a separate route fine?
167ab97
to
c6bc0f9
Compare
Issue Edited fields do not reflect entered values after page refresh Test Steps |
fd00682
to
3d61bf8
Compare
2ec2102
to
e313350
Compare
e313350
to
8dd850a
Compare
Re #2287 |
Q: are the uploaded files supposed to have download links? Thanks |
There is a bug with the Read only file widget, it's not unique to this issue: |
Added the file preview prop! Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYC, :)
Perhaps the backend service should verify that regulated_products
should only be set for specific registration purposes (e.g., ELECTRICITY_IMPORT_OPERATION and POTENTIAL_REPORTING_OPERATION)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked Brianna about this and she said not to worry about it seeing as all of the purpose conditionals are changing re: the business area.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment here to remind us to potentially add that conditional in the future after the create registration purpose service gets redone. Thanks for the heads up, this was a good issue to raise 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: perhaps def test_industry_users_can_only_get_their_own_operations_with_documents(self)
should be two separate tests:
def test_industry_user_can_get_owned_operation_with_documents(self):
def test_industry_user_cannot_get_unowned_operation_with_documents(self):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't spend much time in here and was just following the patterns set in the get_operation
test above this. However I can update this if you think it's a good use of my time.
#1879
To test this make sure to reset the database since it includes updated fixtures:
cd bc_obps && make reset_db && make run
Operations
dashboard in theAdministration
moduleView Operation
in the action column and clickView Operation
(made an issue to fix theStart Registration
andContinue Registration
URLs)Edit
button at the bottom of the formSubmit
Other things to test:
View Details
for Operation 14 which has a purpose ofElectricity Import Operation
Regulated product names
field does not appear underRegistration Purpose
View Details
for Operation 14 which has a purpose ofPotential Reporting Operation
Regulated product names
field does not appear underRegistration Purpose