Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSF should be flexible to support id values to be numeric as well as alphanumeric #3456

Closed
2 of 6 tasks
adityasharma7 opened this issue Sep 3, 2019 · 2 comments
Closed
2 of 6 tasks
Labels
3: Medium complexity feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can
Milestone

Comments

@adityasharma7
Copy link
Contributor

adityasharma7 commented Sep 3, 2019

What is the motivation for adding / enhancing this feature?

We have all the id values of product, category, attribute etc defined as numeric type.
https://github.com/DivanteLtd/vue-storefront/blob/master/core/modules/catalog/types/Product.ts
https://github.com/DivanteLtd/vue-storefront-api/blob/master/config/elastic.schema.product.json
https://github.com/DivanteLtd/vue-storefront-integration-boilerplate/blob/master/1.%20Expose%20the%20API%20endpoints%20required%20by%20VS/Product%20Attributes.md
https://github.com/DivanteLtd/vue-storefront-integration-boilerplate/blob/master/1.%20Expose%20the%20API%20endpoints%20required%20by%20VS/Required%20API%20specification.md
https://github.com/DivanteLtd/vue-storefront-api/blob/master/config/elastic.schema.attribute.json
It may be possible that the ecommerce ERP, it is integrated with may have support for alphanumeric identifier.
We would like to contribute towards the effort to make it support alphanumeric if community finds it useful.
Slack thread link: https://vuestorefront.slack.com/archives/CA5B80T4M/p1567406131004600

What are the acceptance criteria

Enable VSF to support id values to accept alphanumeric as well as numeric values.

  • ...

Can you complete this feature request by yourself?

  • YES
  • NO

Which Release Cycle state this refers to? Info for developer.

Pick one option.

  • This is a normal feature request. This should be available on https://test.storefrontcloud.io and then after tests this can be added to next Vue Storefront version. In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
  • (Pick this option only if you're sure) This is an important improvement request for current Release Candidate version on https://next.storefrontcloud.io and should be placed in next RC version. In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
  • (Pick this option only if you're sure) This is a critical improvement request for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version. In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.

Additional information

@adityasharma7 adityasharma7 added the feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can label Sep 3, 2019
@pkarw
Copy link
Collaborator

pkarw commented Sep 3, 2019

Hey! yeah, it makes sense; in the core, we're never casting these data to numeric but rather comparing the values always as strings so it's definitely what we aimed at (to let ppl. use the string ids); Please prepare the PR but also make sure it's still backward compatible

@pkarw pkarw added this to the 2.0-rc milestone Sep 3, 2019
@adityasharma7
Copy link
Contributor Author

Thanks @pkarw for looking into it!
We will definitely ensure the backward compatibility.

@sandermangel sandermangel added this to Backlog in Issue Kanban Sep 6, 2019
phoenixdev-kl added a commit to phoenixdev-kl/vue-storefront that referenced this issue Sep 17, 2019
* develop: (21 commits)
  changelog updated
  changelog updated
  add-to-car-fixed
  Small docs improvement
  featurer: output compression + html minifier
  Updated changelog vuestorefront#3456
  productId should support number as well as string https://vuejs.org/v2/guide/components-props.html#Prop-Validation Followed as described for Multiple possible types
  Improved: changes number to number | string It should support numeric as well string values
  Fixed: issue changing item_id to  string | number [tsl] ERROR in /vue-storefront/vue-storefront/core/modules/cart/helpers/productsEquals.ts(16,3)       TS2322: Type 'string | number' is not assignable to type 'number'.   Type 'string' is not assignable to type 'number'.
  Improved: id values should be either number or string. Changing type to any removes types.
  Changed productId type to null so that it supports numeric as well as string values https://vuejs.org/v2/guide/components-props.html#Prop-Validation
  Added tracing support
  Improved: changed type of all the id values to any instead of number VSF should be flexible to support id values to be numeric as well as alphanumeric It may be possible that the ecommerce ERP, it is integrated with may have support for alphanumeric identifier.
  Fixed test
  updated CHANGELOG.md
  Added an mock when you want to overwrite the api search implementation
  Created src/search/adapter as we need to have the folder
  Removed the loading of global as it is not working so easy.
  Added logging for debugging it while developing
  Changed order if imports for search adapter
  ...
@pkarw pkarw closed this as completed Sep 24, 2019
Issue Kanban automation moved this from Backlog to Done Sep 24, 2019
@pkarw pkarw modified the milestones: 2.0-rc, 1.11.0-rc.1 Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: Medium complexity feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can
Projects
No open projects
Issue Kanban
  
Done
Development

No branches or pull requests

2 participants