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

PRMDR-873 - Enable ARF upload via ARF bucket #367

Merged
merged 21 commits into from
May 21, 2024
Merged

PRMDR-873 - Enable ARF upload via ARF bucket #367

merged 21 commits into from
May 21, 2024

Conversation

joefong-nhs
Copy link
Contributor

@joefong-nhs joefong-nhs commented May 17, 2024

No description provided.

@joefong-nhs joefong-nhs marked this pull request as ready for review May 20, 2024 10:10
const mockedUsePatient = usePatient as jest.Mock;
const mockPatient = buildPatientDetails();
const mockedAxios = axios as jest.Mocked<typeof axios>;
// const mockedAxios = axios as jest.Mocked<typeof axios>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed commented out lines?


expect(screen.getByRole('button', { name: 'Upload' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Upload' })).toBeDisabled();
// it.skip('can upload documents to both LG and ARF forms', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this if the design has changed to only handle ARF documents

@@ -123,7 +138,7 @@ describe('<SelectStage />', () => {

it.each([
{ name: 'ARF', documents: arfDocuments },
{ name: 'LG', documents: [buildLgFile(1, 2, 'Joe Blogs')] },
// { name: 'LG', documents: [buildLgFile(1, 2, 'Joe Blogs')] },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove a lot of the commented out code that follows...

/>
</Fieldset>
{/*<Fieldset>*/}
{/* <h2>Lloyd George records</h2>*/}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove


file_location += f"/{self.s3_file_key}"
return file_location
return f"s3://{self.s3_bucket_name}/{self.sub_folder}/{self.doc_type}/{self.nhs_number}/{self.id}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous code was more configurable to allow for more path forms such as

bucket/sub/doc...
bucket/sub....
bucket/doc...

This change now limits that and turns future changes into a state configuration rather than a route builder. I would revert this.

I also discourage having your return data set on the return line without a variable before hand.
It's trickier to debug from a break point perspective and if you fall into a pattern of returning function response, code debugging becomes difficult to say the least. The minor memory consideration does is less useful than the code maintainability.

e.g.

rhyme = "Humpty Dumpty sat on the wall"
return rhyme

vs

return "Humpty Dumpty sat on the wall"

@joefong-nhs joefong-nhs merged commit e4d59e3 into main May 21, 2024
16 checks passed
@joefong-nhs joefong-nhs deleted the PRMDR-873 branch May 21, 2024 13:10
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.

2 participants