Closed chrisvanrun closed 8 months ago
Quick note, reading the pitch I am reminded that the above instructions should also include something for:
multiple choice dropdown
(and migrate to multiple choice
+ select
widget)~Edit: Added to above instructions.
Because of support issues v2023.06.x
hasn't been made the previous release this cycle.
@chrisvanrun can this be done now?
Yes. V2023.11 is now the oldest release currently in usage. If I read my old-self instructions correctly that means this can have a go.
Once the resulting changeset is live we can update CIRRUS to remove the same references in the next release.
Make QuestionWidgetKindChoices.NUMBER_INPUT" the default for NUMBER` Make QuestionWidgetKindChoices.CHECKBOX_SELECT_MULTIPLE the default for MULTIPLE_CHOICE
These currently allow an empty choice ("---") for the widget which is always the default. Do we want to force a choice of widget here?
CIRRUS has defaults for the widgets, so it is not presently required:
Albeit it'll be cleaner to 'always have a widget selected'.
Edit: cross tagging: https://github.com/comic/grand-challenge.org/pull/3181
Okay, I see that as a separate issue from removing the _TEXT
options, so I will not enforce widget selection for those types.
Question.objects.filter(answer_type=Question.AnswerType.MULTIPLE_CHOICE_DROPDOWN).update(answer_type=Question.AnswerType.MULTIPLE_CHOICE, widget=QuestionWidgetKindChoices.SELECT_MULTIPLE)
Is multiple choice dropdown also deprecated?
Question.objects.filter(answer_type=Question.AnswerType.MULTIPLE_CHOICE_DROPDOWN).update(answer_type=Question.AnswerType.MULTIPLE_CHOICE, widget=QuestionWidgetKindChoices.SELECT_MULTIPLE)
Is multiple choice dropdown also deprecated?
Quickly double-checked in CIRRUS. I had added that as clean-up but neglected to add that to the specifically marked as deprecated.
Yes, it is deprecated. The MultiSelectWidget
and MultiCheckBoxWidget
widgets were introduced to replace that odd answer type.
With the introduction of:
Some old question types can/should be removed once CIRRUS
v2023.06.x
is the previous release.A two-staged approach should happen:
1. Remove from options and (manually migrate)
AnswerType.SINGLE_LINE_TEXT
andAnswerType.MULTI_LINE_TEXT
are no longer selectable options in production.[x] Ensure users get an error when saving, suggesting AnswerType.TEXT as an alternative.
Migrate data manually via the following commands.
Question.objects.filter(answer_type=Question.AnswerType.SINGLE_LINE_TEXT).update(answer_type=Question.AnswerType.TEXT, widget=QuestionWidgetKindChoices.TEXT_INPUT)
Question.objects.filter(answer_type=Question.AnswerType.MULTI_LINE_TEXT).update(answer_type=Question.AnswerType.TEXT, widget=QuestionWidgetKindChoices.TEXT_AREA)
Question.objects.filter(answer_type=Question.AnswerType.MULTIPLE_CHOICE_DROPDOWN).update(answer_type=Question.AnswerType.MULTIPLE_CHOICE, widget=QuestionWidgetKindChoices.SELECT_MULTIPLE)
2. Remove model members
AnswerType.SINGLE_LINE_TEXT
andAnswerType.MULTI_LINE_TEXT
and all references to them from the models.'Number input'
serialisation forQuestionWidgetKindChoices.NUMBER_INPUT
to'Number Input'
(Note capitalization of the 'i'). CIRRUS supports both 'input' and 'Input' but the latter is in common style.QuestionWidgetKindChoices.NUMBER_INPUT" the default for
NUMBER`~QuestionWidgetKindChoices.CHECKBOX_SELECT_MULTIPLE
the default forMULTIPLE_CHOICE
~QuestionWidgetKindChoices.RADIO_SELECT
the default forCHOICE