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

Updated Document Upload and details #3643

Merged
merged 13 commits into from
Dec 14, 2023

Conversation

FuriousLlama
Copy link
Collaborator

No description provided.

@FuriousLlama FuriousLlama added the enhancement New feature or request label Dec 8, 2023
@FuriousLlama FuriousLlama self-assigned this Dec 8, 2023
Copy link
Contributor

github-actions bot commented Dec 8, 2023

✅ No secrets were detected in the code.

Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Merging #3643 (dabbb99) into dev (b6f33c1) will increase coverage by 4.81%.
The diff coverage is 49.43%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #3643      +/-   ##
==========================================
+ Coverage   69.47%   74.28%   +4.81%     
==========================================
  Files        1372      902     -470     
  Lines       34356    19045   -15311     
  Branches     6474     5443    -1031     
==========================================
- Hits        23868    14148    -9720     
+ Misses      10232     4897    -5335     
+ Partials      256        0     -256     
Flag Coverage Δ
unittests 74.28% <49.43%> (+4.81%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ce/frontend/src/components/common/GenericModal.tsx 92.20% <100.00%> (ø)
...frontend/src/components/common/Section/Section.tsx 77.77% <100.00%> (+2.77%) ⬆️
...rontend/src/features/documents/ComposedDocument.ts 83.11% <100.00%> (+1.17%) ⬆️
...c/features/documents/DocumentMetadataYupSchema.tsx 100.00% <100.00%> (ø)
...es/documents/documentDetail/DocumentDetailForm.tsx 50.00% <ø> (ø)
.../documents/documentDetail/DocumentDetailHeader.tsx 100.00% <ø> (ø)
...es/documents/documentDetail/DocumentDetailView.tsx 78.57% <60.00%> (+1.64%) ⬆️
...es/documents/documentUpload/DocumentUploadForm.tsx 46.15% <25.00%> (-15.92%) ⬇️
...s/documents/documentUpload/DocumentUploadModal.tsx 50.00% <40.00%> (-50.00%) ⬇️
...cuments/documentUpload/DocumentUploadContainer.tsx 1.53% <10.00%> (-0.19%) ⬇️
... and 1 more

... and 473 files with indirect coverage changes

@devinleighsmith
Copy link
Collaborator

@FuriousLlama there are some minor variations compared to the mockup that I see in https://jira.th.gov.bc.ca/browse/PSP-7338

Can you please confirm that what you have in this story is approved by Ana, and if so, get here to update the mockups so we don't get test failures.

// handle validations
if (changeEvent.target !== null) {
var target = changeEvent.target;
if (target.files !== null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

target.files?.length !== null & target.files.length >= 1
(or similar)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure, added the check for at least one file

setIsDragging(false);
};

const shortenString = (text: string, maxlenght: number, terminator: string = '...'): string => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

maxlenght -> maxLength

{selectedFile !== null && (
<StyledSelectedFile>
<SectionField label="File to add" labelWidth="3">
{shortenString(selectedFile.name || '', 20)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe could use the OverflowTip component instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I checked with ana and this way worked better

Copy link
Collaborator

@devinleighsmith devinleighsmith left a comment

Choose a reason for hiding this comment

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

was this tested on multiple browsers? I do wonder if there could be any variations.

validExtensions: string[];
}

const FileDragAndDrop: FunctionComponent<React.PropsWithChildren<IFileDragAndDropProps>> = ({
Copy link
Collaborator

Choose a reason for hiding this comment

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

The test coverage on this isn't great. Unit testing this completely may not be realistic but is there anything we can do here?

)}
</Row>

<Section
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems duplicated from the DocumentDetailHeader

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure what you mean.

}));

const onDocumentSelected = () => {
debugger;
Copy link
Collaborator

Choose a reason for hiding this comment

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

thinking this was not intentional.

Copy link
Contributor

✅ No secrets were detected in the code.

Copy link
Contributor

✅ No secrets were detected in the code.

@@ -215,12 +217,19 @@ export const GenericModal = (props: Omit<BsModalProps, 'onHide'> & ModalProps) =
title="cancel-modal"
variant={cancelButtonVariant ?? 'secondary'}
onClick={close}
test-id="cancel-modal-button"
Copy link
Collaborator

Choose a reason for hiding this comment

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

we already have the title property to get the buttons in tests. not opposed to adding test ids but I believe the right syntax is data-testid="..."

See here: https://testing-library.com/docs/queries/bytestid/

Comment on lines 226 to 232
<Button
title="ok-modal"
variant={okButtonVariant ?? 'primary'}
onClick={ok}
disabled={handleOkDisabled}
test-id="ok-modal-button"
>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment re: test-id

Copy link
Contributor

✅ No secrets were detected in the code.

1 similar comment
Copy link
Contributor

✅ No secrets were detected in the code.

@devinleighsmith
Copy link
Collaborator

image

@devinleighsmith
Copy link
Collaborator

image

@devinleighsmith
Copy link
Collaborator

@FuriousLlama just trying to save Praveen some time, if Ana and you have already talked and she approved your version of the modal, she needs to update her mockup or Praveen will log bugs stating the mockup doesn't match - lets get ahead of that.

Copy link
Contributor

✅ No secrets were detected in the code.

1 similar comment
Copy link
Contributor

✅ No secrets were detected in the code.

Copy link
Contributor

✅ No secrets were detected in the code.

@FuriousLlama FuriousLlama merged commit 750c95c into bcgov:dev Dec 14, 2023
9 checks passed
@FuriousLlama FuriousLlama deleted the features/psp-7321 branch December 15, 2023 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants