-
Notifications
You must be signed in to change notification settings - Fork 39
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
[MDS-6118] FE extract permits - DRAFT #3236
Conversation
… covering basic functionality
…T FOUND so namespace config must be wrong
generate_table_migration: | ||
@echo "+\n++ Generating history table migration ...\n+" | ||
@docker compose $(DC_FILE) exec backend bash -c "flask generate_table_migration $(TABLE)" | ||
|
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 little script to auto-generate a CREATE TABLE migration for new tables.
Pretty much the same as the history table creation scripts, just with creating the actual table instead of a _version
table
@@ -0,0 +1,203 @@ | |||
import { createAppSlice, rejectHandler } from "@mds/common/redux/createAppSlice"; |
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.
@taraepp Put in actual implementations here for the
- Fetch Status
- Delete permit conditions
actions
@@ -54,6 +53,9 @@ def sub_conditions(self): | |||
|
|||
@hybrid_property | |||
def step(self): | |||
if self._step: | |||
return self._step |
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 in a _step
column that contains the step
extracted for the permit, and return that if defined instead of the auto-generated step. Note: This will require some work to make work nicely with auto-generation of step when adding / editing conditions
@@ -0,0 +1,162 @@ | |||
import uuid |
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.
This file contains pretty much all the logic for mapping between conditions returned from the permit service to the PermitConditions
model in Core, including mapping of Category, and building of a nested structure
|
||
|
||
@celery.task(max_retries=360) | ||
def poll_update_permit_extraction_status(permit_extraction_task_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.
Introduced this celery task to poll for a status update from the permit service. The actual triggering of the permit extraction task through the API happens within the actual POST
endpoint
return <LoadingOutlined style={{ fontSize: 120 }} />; | ||
} | ||
|
||
return permitExtraction?.task_status === PermitExtractionStatus.in_progress ? ( |
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.
This could use some cleanup 😅
dispatch(fetchPermits(id)); | ||
} | ||
|
||
if (permitExtraction?.task_status === PermitExtractionStatus.in_progress) { |
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.
Trigger polling for status update when the extraction status job is in progress
|
||
|
||
assert get_data['records'][0]['mine_document_guid'] in guids | ||
assert get_data['records'][1]['mine_document_guid'] in guids |
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.
Hopefully this makes this test a bit less flaky, think the documents are just not returned in any particular order, so sometimes it just fails
Quality Gate passed for 'bcgov-sonarcloud_mds_permits'Issues Measures |
Quality Gate passed for 'bcgov-sonarcloud_mds_minespace-web'Issues Measures |
Quality Gate failed for 'bcgov-sonarcloud_mds_common'Failed conditions |
Quality Gate failed for 'bcgov-sonarcloud_mds_core-web'Failed conditions |
Quality Gate passed for 'bcgov-sonarcloud_mds_core-api'Issues Measures |
Objective
This is not ready to be reviewed, but for handover purposes (and to get Core API sonarcloud results (https://bcmines.atlassian.net/browse/MDS-0000)
Why are you making this change? Provide a short explanation and/or screenshots