Skip to content

Commit 69cebb3

Browse files
committed
fix: files and links from phases in Assets Library
- Show files and links from phases in Assets Library - Hide a button to remove files and links from phases in Assets Library - Fix showing folder "Created By" for files when it created by CoderBot ref issue #3748
1 parent 31bf4c2 commit 69cebb3

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/components/AssetsLibrary/FilesGridView.jsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,32 +59,32 @@ const FilesGridView = ({
5959
let nameFieldRef
6060
let sharedWithFieldRef
6161
let dateFieldRef
62-
62+
6363
const updateSubContents = () => {
6464
if (selectedLink) {
6565
let link = links.filter(item => {
6666
return selectedLink.title === item.title
6767
&& selectedLink.createdBy === item.createdBy
6868
&& selectedLink.updatedAt === item.updatedAt
6969
})[0]
70-
70+
7171
if (!link) {
7272
link = _.cloneDeep(selectedLink)
7373
link.children = []
7474
}
75-
75+
7676
onChangeSubFolder(link)
7777
}
7878
}
79-
79+
8080
const clearSubContents = () => clearing = true
81-
81+
8282
const clearFieldValues = () => {
8383
nameFieldRef.clearFilter()
8484
sharedWithFieldRef.clearFilter()
8585
dateFieldRef.clearFilter()
8686
}
87-
87+
8888
const renderLink = (link) => {
8989
if (link.onClick) {
9090
return (
@@ -120,7 +120,7 @@ const FilesGridView = ({
120120
onChangeSubFolder(null)
121121
selectedLink = null
122122
}
123-
123+
124124
const renderSharedWith = (link) => {
125125
if (link.tag) {
126126
return (
@@ -147,14 +147,14 @@ const FilesGridView = ({
147147
)
148148
}
149149
}
150-
150+
151151
if (clearing) {
152152
setTimeout(() => {
153153
updateSubContents()
154154
clearing = false
155155
})
156156
}
157-
157+
158158
return (
159159
<div styleName="assets-gridview-container">
160160
{(subFolderContent) && (
@@ -264,7 +264,9 @@ const FilesGridView = ({
264264
{renderSharedWith(link)}
265265
</div>
266266
<div styleName="flex-item item-created-by">
267-
{!owner && (<div className="user-block txt-italic">Unknown</div>)}
267+
{!owner && !link.createdBy && (<div className="user-block"></div>)}
268+
{!owner && link.createdBy !== 'CoderBot' && (<div className="user-block txt-italic">Unknown</div>)}
269+
{!owner && link.createdBy === 'CoderBot' && (<div className="user-block">CoderBot</div>)}
268270
{owner && (
269271
<div className="spacing">
270272
<div className="user-block">

src/projects/detail/containers/AssetsInfoContainer.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ class AssetsInfoContainer extends React.Component {
412412
address: `/projects/messages/attachments/${attachment.id}`,
413413
attachmentId: attachment.id,
414414
attachment: true,
415-
deletable: true,
415+
deletable: false,
416416
createdAt: post.date,
417417
createdBy: attachment.createdBy,
418418
postId: post.id,
@@ -514,7 +514,7 @@ class AssetsInfoContainer extends React.Component {
514514

515515
const phaseFeeds = _.compact(
516516
visiblePhases.map((phase) => {
517-
const topic = _.get(phasesTopics, `[${phase.id}].topic`)
517+
const topic = _.get(phasesTopics, `[phase#${phase.id}].topic`)
518518

519519
if (!topic) {
520520
return null

0 commit comments

Comments
 (0)