Skip to content

Commit c358290

Browse files
committed
feat: show Modified date for folders on Assets Library page
ref issue #3273
1 parent 3ca36c3 commit c358290

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

src/components/AssetsLibrary/FilesGridView.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const FilesGridView = ({
8383
assetsMembers={assetsMembers}
8484
onDeletePostAttachment={onDeletePostAttachment}
8585
loggedInUser={loggedInUser}
86+
formatModifyDate={formatModifyDate}
8687
/>)}
8788
{(!subFolderContent) && (
8889
<div styleName={cn({'assets-gridview-container-active': (linkToEdit >= 0 || linkToDelete >= 0)}, '')}>

src/components/AssetsLibrary/LinksGridView.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const LinksGridView = ({
6262
goBack={goBack}
6363
assetsMembers={assetsMembers}
6464
isLinkSubFolder
65+
formatModifyDate={formatModifyDate}
6566
/>)}
6667
{(!subFolderContent) && (
6768
<div styleName={cn({'assets-gridview-container-active': (linkToEdit >= 0 || linkToDelete >= 0)}, '')}>

src/components/AssetsLibrary/SubFolder.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ class SubFolder extends React.Component {
5757
}
5858

5959
render() {
60-
const { link, renderLink, goBack, isLinkSubFolder, assetsMembers } = this.props
60+
const { link, renderLink, goBack, formatModifyDate, isLinkSubFolder, assetsMembers } = this.props
6161
const { linkToDelete } = this.state
6262

63-
const formatCreateDate = (link) => ((link.createdAt) ? moment(link.createdAt).format('MM/DD/YYYY h:mm A') : '—')
6463
return (
6564
<div styleName={cn({'assets-gridview-container-active': (linkToDelete >= 0)}, '')}>
6665
{(linkToDelete >= 0) && <div styleName="assets-gridview-modal-overlay"/>}
@@ -70,7 +69,7 @@ class SubFolder extends React.Component {
7069
<div styleName="flex-item-title item-type">Type</div>
7170
<div styleName="flex-item-title item-name">Name</div>
7271
<div styleName="flex-item-title item-created-by">Created By</div>
73-
<div styleName="flex-item-title item-modified">Created At</div>
72+
<div styleName="flex-item-title item-modified">Modified</div>
7473
<div styleName="flex-item-title item-action"/>
7574
</li>
7675
<li styleName="assets-gridview-row" key="assets-gridview-subfolder" onClick={goBack}>
@@ -118,7 +117,7 @@ class SubFolder extends React.Component {
118117
</div>
119118
</div>)}
120119
</div>
121-
<div styleName="flex-item item-modified">{formatCreateDate(childLink)}</div>
120+
<div styleName="flex-item item-modified">{formatModifyDate(childLink)}</div>
122121
<div styleName="flex-item item-action">
123122
{childLink.deletable && this.hasAccess(childLink.createdBy) && (
124123
<ItemOperations

src/projects/detail/containers/AssetsInfoContainer.jsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { PROJECT_ATTACHMENTS_FOLDER,
2020
FILE_PICKER_API_KEY,
2121
FILE_PICKER_FROM_SOURCES,
2222
FILE_PICKER_CNAME,
23-
FILE_PICKER_SUBMISSION_CONTAINER_NAME,
23+
FILE_PICKER_SUBMISSION_CONTAINER_NAME,
2424
FILE_PICKER_ACCEPT,
2525
} from '../../../config/constants'
2626
import AddLink from '../../../components/AssetsLibrary/AddLink'
@@ -249,7 +249,8 @@ class AssetsInfoContainer extends React.Component {
249249
links.push({
250250
title,
251251
address,
252-
createdAt: post.date,
252+
// use created at `date` to show as modified time for links inside folders
253+
updatedAt: post.date,
253254
createdBy: post.userId
254255
})
255256
}
@@ -277,7 +278,8 @@ class AssetsInfoContainer extends React.Component {
277278
links.push({
278279
title,
279280
address,
280-
createdAt: post.date,
281+
// use created at `date` to show as modified time for links inside folders
282+
updatedAt: post.date,
281283
createdBy: post.userId
282284
})
283285
}
@@ -304,7 +306,8 @@ class AssetsInfoContainer extends React.Component {
304306
return {
305307
title: name,
306308
address: url,
307-
createdAt: post.date,
309+
// use created at `date` to show as modified time for links inside folders
310+
updatedAt: post.date,
308311
createdBy: post.userId
309312
}
310313
})
@@ -329,6 +332,8 @@ class AssetsInfoContainer extends React.Component {
329332
links.push({
330333
title: feed.title,
331334
createdBy: feed.userId,
335+
// use created at `date` to show as modified time for folders
336+
updatedAt: feed.date,
332337
children: childrenLinks
333338
})
334339
}
@@ -367,6 +372,8 @@ class AssetsInfoContainer extends React.Component {
367372
attachmentLinks.push({
368373
title: feed.title,
369374
createdBy: feed.userId,
375+
// use created at `date` to show as modified time for folders
376+
updatedAt: feed.date,
370377
children: attachmentLinksPerFeed
371378
})
372379
}

0 commit comments

Comments
 (0)