Skip to content

Conversation

@vikasrohit
Copy link

Refactored the usage of details.products[0] in project creation. We are still using this path to access the product id of the legacy (v2) projects while rendering legacy projects.

for #2396

…d while creating project

Refactored the usage of `details.products[0]` in project creation. We are still using this path to access the product id of the legacy (v2) projects while rendering legacy projects
if (projectTemplate) {
// load project details page directly
if (project.key === incompleteProjectTemplateKey) {
if (projectTemplate.key === incompleteProjectTemplate.key) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for consistency this line looks like can be replaced to use id: projectTemplate.id === incompleteProjectTemplate.id.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. However, I left that intentionally considering that in future we have to keep versions of templates i.e. we would try to eliminate the usage of templates by id as much as possible. In this specific case I am using key because this loads the project template based on the key in URL and in case we get new a template for the same key (through versioning), it would still got the project details page with the latest template of that key instead of asking the project template again.

@vikasrohit vikasrohit merged commit f273453 into dev Aug 22, 2018
@vikasrohit vikasrohit deleted the feature/refactoring-way-to-store-template-id branch September 5, 2018 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants