Skip to content

Commit a1dfaed

Browse files
author
Vikas Agarwal
committed
Hotfix for fixing attachments for v2 projects. It is setting the category incorrectly, which is causing the files to be not visible after project has been migrated to v3.
1 parent 1ffb587 commit a1dfaed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/projects/detail/components/SpecSection.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ const SpecSection = props => {
163163
// to upload attachments for products. We need to come up with a better way to handle this.
164164
// defaults to appDefinition to be backward compatible
165165
let category = _.get(props, 'category', 'appDefinition')
166+
// NOTE temporary patch for handling wrong category for v2 projects' attachments
167+
// it is happening because we are merging project and product templates for v2 projects and we don't have files
168+
// field in project templates but we have it for product templates which in turn has category set as `product`
169+
category = projectLatest.version && projectLatest.version === 'v2' ? 'appDefinition' : category
166170
category = 'product' === category ? `${category}#${projectLatest.id}` : category
167171
return (
168172
<FileListContainer

0 commit comments

Comments
 (0)