Skip to content

Commit

Permalink
fix(sidebar): Use correct timestamps for file details (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstoffan authored Dec 11, 2018
1 parent b02ea6a commit c0a8deb
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions flow-typed/box-ui-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ type BoxItem = {
item_collection?: BoxItemCollection,
path_collection?: BoxPathCollection,
interacted_at?: string,
content_created_at?: string,
content_modified_at?: string,
modified_at?: string,
created_at?: string,
shared_link?: SharedLink,
Expand Down
4 changes: 2 additions & 2 deletions src/components/ContentSidebar/SidebarFileProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ const SidebarFileProperties = ({
return (
<LoadingIndicatorWrapper isLoading={isLoading}>
<ItemProperties
createdAt={file.created_at}
createdAt={file.content_created_at}
description={file.description}
modifiedAt={file.modified_at}
modifiedAt={file.content_modified_at}
owner={getProp(file, 'owned_by.name')}
size={getFileSize(file.size, intl.locale)}
uploader={getProp(file, 'created_by.name')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ describe('components/ContentSidebar/SidebarFileProperties', () => {
const getMountWrapper = props => mount(<SidebarFilePropertiesComponent {...props} />);
const props = {
file: {
created_at: '2018-04-18T16:56:05.352Z',
content_created_at: '2018-04-18T16:56:05.352Z',
content_modified_at: '2018-04-18T16:56:05.352Z',
description: 'foo',
modified_at: '2018-04-18T16:56:05.352Z',
owned_by: {
name: 'foo',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ exports[`components/ContentSidebar/SidebarFileProperties render() should not ren
<SidebarFileProperties
file={
Object {
"created_at": "2018-04-18T16:56:05.352Z",
"content_created_at": "2018-04-18T16:56:05.352Z",
"content_modified_at": "2018-04-18T16:56:05.352Z",
"created_by": Object {
"name": "foo",
},
"description": "foo",
"modified_at": "2018-04-18T16:56:05.352Z",
"owned_by": Object {
"name": "foo",
},
Expand Down
2 changes: 2 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export const FIELD_ITEM_EXPIRATION = 'expires_at';
export const FIELD_PERMISSIONS = 'permissions';
export const FIELD_ITEM_COLLECTION = 'item_collection';
export const FIELD_PATH_COLLECTION = 'path_collection';
export const FIELD_CONTENT_CREATED_AT: 'content_created_at' = 'content_created_at';
export const FIELD_CONTENT_MODIFIED_AT: 'content_modified_at' = 'content_modified_at';
export const FIELD_MODIFIED_AT: 'modified_at' = 'modified_at';
export const FIELD_RESTORED_FROM = 'restored_from';
export const FIELD_CREATED_AT = 'created_at';
Expand Down
4 changes: 4 additions & 0 deletions src/util/__tests__/fields-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import {
FIELD_ITEM_COLLECTION,
FIELD_ITEM_EXPIRATION,
FIELD_PATH_COLLECTION,
FIELD_CONTENT_CREATED_AT,
FIELD_CONTENT_MODIFIED_AT,
FIELD_MODIFIED_AT,
FIELD_CREATED_AT,
FIELD_SHARED_LINK,
Expand Down Expand Up @@ -99,6 +101,8 @@ describe('util/fields', () => {
FIELD_FILE_VERSION,
FIELD_SHARED_LINK,
FIELD_PERMISSIONS,
FIELD_CONTENT_CREATED_AT,
FIELD_CONTENT_MODIFIED_AT,
FIELD_CREATED_AT,
FIELD_CREATED_BY,
FIELD_MODIFIED_AT,
Expand Down
4 changes: 4 additions & 0 deletions src/util/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {
FIELD_ITEM_COLLECTION,
FIELD_ITEM_EXPIRATION,
FIELD_PATH_COLLECTION,
FIELD_CONTENT_CREATED_AT,
FIELD_CONTENT_MODIFIED_AT,
FIELD_MODIFIED_AT,
FIELD_CREATED_AT,
FIELD_SHARED_LINK,
Expand Down Expand Up @@ -76,6 +78,8 @@ const SIDEBAR_FIELDS_TO_FETCH = [
FIELD_FILE_VERSION,
FIELD_SHARED_LINK,
FIELD_PERMISSIONS,
FIELD_CONTENT_CREATED_AT,
FIELD_CONTENT_MODIFIED_AT,
FIELD_CREATED_AT,
FIELD_CREATED_BY,
FIELD_MODIFIED_AT,
Expand Down

0 comments on commit c0a8deb

Please sign in to comment.