Skip to content

Commit d88ce1b

Browse files
author
vikasrohit
authored
Merge pull request #2265 from appirio-tech/hotfix/attachments_category_fix_for_v2_projects
Hotfix for fixing attachments for v2 projects
2 parents 1ffb587 + a1dfaed commit d88ce1b

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)