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

Custom widgets for single and multiple choice questions #43

Merged
merged 24 commits into from Mar 11, 2019

Conversation

Projects
None yet
2 participants
@fkm
Copy link
Contributor

commented Mar 5, 2019

Powered by Ember Power Select

  • Current threshold for search field is at 3 choices.
  • Currently not styled through UIkit.
  • searchMessage seems to be overridden by noMatchesMessage (see API reference)

fkm added some commits Mar 5, 2019

@fkm fkm requested a review from czosel Mar 5, 2019

fkm added some commits Mar 5, 2019

REFACTOR text by moving them to translations
Moves the texts from the template to the translations and
adds a computed property for the default placeholder text
as that has to be different for single and multiple choice.
REFACTOR selected item reference
There are different properties for single and multiple choices.

The new computed property chooses the target from _valueKey
which is already present.

Additionally, I updated the onChange action to use _valueKey.
REFACTOR choices to use computed property `multiple`
This is IMO less error-prone than just taking any available choices.
Although, this would probably never be a problem...
REFACTOR import order
Third-party modules before local ones.
CHANGE dropdown to disallow clearing
Cleaing a single choice question is not allowed by the backend.
Consequently, the frontend should not offer it.
FIX widget not saving the result
I manipulated field.question instead of using onSave...
ADD styling customizations via variables
Based on the existing widgets with a
lightened color for highlighted backgrounds.
Show resolved Hide resolved translations/de-de.yaml Outdated
@czosel

This comment has been minimized.

Copy link
Contributor

commented Mar 6, 2019

Mostly nitpicking, looks good in general! 👍

czosel and others added some commits Mar 7, 2019

Update translations/de-de.yaml
Workaround to have the text cater to both situations it can be displayed in.

Co-Authored-By: fkm <fkm@users.noreply.github.com>
CHANGE custom types to not use "default"
Instead of:
* default, powerselect

We now use:
* radio, powerselect
* checkbox, powerselect
REFACTOR let to const
Comes with the corresponding change to ESLint.
CHANGE condition to use variable type
_valueKey might be logically sound but in practice not really needed.
@czosel

This comment has been minimized.

Copy link
Contributor

commented Mar 8, 2019

Looks all good now! Only codecov still seems to be unhappy ...
Seems that L40 in powerselect.js is missing.

fkm added some commits Mar 11, 2019

ADD comment concerning "else path not taken"
Although this doesn't affect coverage it might be useful to know.

@czosel czosel merged commit cade6ac into projectcaluma:master Mar 11, 2019

2 checks passed

codecov/patch 100% of diff hit (target 100%)
Details
codecov/project 100% (+0%) compared to 64d0484
Details

@fkm fkm deleted the fkm:feature/custom-widgets branch Apr 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.