-
Notifications
You must be signed in to change notification settings - Fork 35
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
[MB-7680] TOO can identify newest orders uploaded in TOO UI #6811
[MB-7680] TOO can identify newest orders uploaded in TOO UI #6811
Conversation
Bundle difference
|
Bundle difference
|
@jenniferlynparsons If we have a very long file name, we are never going to see the Added on date displayed. Maybe we can change the html so that we always display the Added on date and only truncate the file name portion not the entire paragraph contents. |
Bundle difference
|
Bundle difference
|
Bundle difference
|
Bundle difference
|
Bundle difference
|
Bundle difference
|
}); | ||
|
||
it('renders the title bar with the correct props', () => { | ||
expect(component.find('[data-testid="documentTitle"]').text()).toBe('Test File 4.gif - Added on 16 Jun 2021'); |
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.
What's with the extra whitespace in the title?
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.
Spacing weirdness that I've now replaced with some CSS padding.
@@ -72,14 +75,17 @@ const DocumentViewer = ({ files }) => { | |||
|
|||
const selectedFilename = filenameFromPath(selectedFile.filename); | |||
|
|||
const selectedFileDate = moment(selectedFile.createdAt).format('DD MMM YYYY'); |
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.
We likely have a formatter defined for this in src/shared/formatters.js
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 guess the main reason to use the formatDate
method in formatters is to provide default values? That makes sense.
@@ -25,12 +26,16 @@ const DocViewerMenu = ({ isOpen, files, handleClose, selectedFileIndex, handleSe | |||
const itemClasses = classnames(styles.menuItemBtn, { | |||
[styles.active]: i === selectedFileIndex, | |||
}); | |||
const filename = filenameFromPath(file.filename); | |||
const fileName = filenameFromPath(file.filename); | |||
const fileDate = moment(file.createdAt).format('DD-MMM-YYYY'); |
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.
similar point here about an existing formatter
@@ -125,6 +57,14 @@ describe('DocumentViewer component', () => { | |||
expect(menu.prop('files')).toBe(mockFiles); | |||
}); | |||
|
|||
it('renders the file creation date with the correctly sorted props', () => { | |||
expect(component.find('li button').at(0).text()).toBe('Test File 4.gif Uploaded on 16-Jun-2021'); |
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.
👍
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.
Looks good!
Bundle difference
|
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.
LGTM
Description
TOO sees the creation date for the uploaded orders on the document viewer, sorted by creation date.
Reviewer Notes
The Go tests are broken and I'm not sure why. I've added a second document creation call to the seed data generator functions so that's where the culprit might be.
Setup
Add any steps or code to run in this section to help others prepare to run your code:
Code Review Verification Steps
References
Screenshots