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

Attribute related changes #2467

Merged

Conversation

n1ro0
Copy link
Contributor

@n1ro0 n1ro0 commented Apr 16, 2021

Added

  • Admin: New type of attribute: CHOICES
  • Admin: Selection of multiple choices from attribute for product
  • Front: Product filter by attribute choices

@codecov
Copy link

codecov bot commented Apr 16, 2021

Codecov Report

Merging #2467 (5f91d63) into master (641bd53) will increase coverage by 0.02%.
The diff coverage is 88.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2467      +/-   ##
==========================================
+ Coverage   88.20%   88.22%   +0.02%     
==========================================
  Files         860      862       +2     
  Lines       38651    38820     +169     
  Branches     5000     5021      +21     
==========================================
+ Hits        34092    34250     +158     
- Misses       3421     3427       +6     
- Partials     1138     1143       +5     
Impacted Files Coverage Δ
shuup/admin/__init__.py 100.00% <ø> (ø)
shuup/front/__init__.py 100.00% <ø> (ø)
shuup/front/forms/product_list_modifiers.py 77.32% <79.31%> (+0.22%) ⬆️
shuup/utils/fields.py 53.12% <80.00%> (+53.12%) ⬆️
shuup/admin/modules/products/forms/base_forms.py 79.46% <90.00%> (+0.84%) ⬆️
shuup/core/models/_attributes.py 88.06% <90.00%> (-0.35%) ⬇️
shuup/admin/modules/attributes/forms.py 92.72% <92.72%> (ø)
shuup/admin/modules/attributes/form_parts.py 100.00% <100.00%> (ø)
shuup/admin/modules/attributes/views/edit.py 75.75% <100.00%> (ø)
shuup/core/models/__init__.py 100.00% <100.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 641bd53...5f91d63. Read the comment docs.

@n1ro0 n1ro0 force-pushed the add-attribute-options-and-attribute-filtering branch 3 times, most recently from 0d8848a to 80292f1 Compare April 19, 2021 13:57
Copy link
Contributor

@chessbr chessbr left a comment

Choose a reason for hiding this comment

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

1. Add the max_choices field in the base form part

image

You can show/hide it according to the user selection. Add some JS to the template to do it.

2. Use a different icon (maybe fa-list-ol) for the Choice Options and rename it to Choices

image

3. Add some buttons to add and remove forms this way, better user experience.

image

shuup/core/migrations/0086_auto_20210415_0847.py Outdated Show resolved Hide resolved
shuup/core/models/_attributes.py Outdated Show resolved Hide resolved
shuup/utils/fields.py Outdated Show resolved Hide resolved
shuup/front/forms/product_list_modifiers.py Outdated Show resolved Hide resolved
@n1ro0 n1ro0 force-pushed the add-attribute-options-and-attribute-filtering branch 6 times, most recently from 39fe456 to 8594221 Compare April 28, 2021 14:26
- Admin: New type of attribute: CHOICES
- Admin: Selection of multiple choices from attribute for product
- Front: Product filter by attribute choices
@chessbr chessbr force-pushed the add-attribute-options-and-attribute-filtering branch from 8594221 to fcd9838 Compare April 29, 2021 00:53
@chessbr chessbr force-pushed the add-attribute-options-and-attribute-filtering branch from fcd9838 to 540f16a Compare April 29, 2021 01:17
value = super().clean(value)
if self.min_limit is not None and len(value) < self.min_limit:
ending = "" if self.min_limit % 10 == 1 else "s"
raise forms.ValidationError(f"You can't select less than {self.min_limit} item{ending}.")
Copy link
Contributor

Choose a reason for hiding this comment

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

@n1ro0 n1ro0 force-pushed the add-attribute-options-and-attribute-filtering branch from 3211e9f to 8cb3ceb Compare April 29, 2021 11:21
@n1ro0 n1ro0 force-pushed the add-attribute-options-and-attribute-filtering branch from 8cb3ceb to 5f91d63 Compare April 29, 2021 11:59
@chessbr chessbr merged commit d901328 into shuup:master Apr 29, 2021
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.

None yet

2 participants