-
Notifications
You must be signed in to change notification settings - Fork 293
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
Add support for additional survey question type "open_text" #3762
Comments
This is what I've done with minimal changes to our existing components (looks similar to the design but definitely not identical) Here you can see it working |
@danielgent, please, add IB. |
I've had a go @eugene-manuilov. 🤷 Seems less clear to me than just reading the actual code, so I'm not sure if I've done what's expected |
Thanks, @danielgent. It's better than just "merge my PR", but still requires a bit more infomration. Could you please add more details? When you write IB, think that you write it for someone who is not familiar with your PR, so once they read your IB they understand what needs to be done. When I read an instruction like One more thing that is missing in IB is how the new question component should be added to the |
@eugene-manuilov I don't see the AC telling me to touch the I'm going to put changes to this IB on hold for now. The whole diff of the working PR is only about 100 actual lines of code, of that most, is copy-pasted. |
@danielgent it assumes to do it. The |
Thanks @danielgent – you're right that the ACs don't mention changing the I think the IB is mostly good to go here with one important caveat and that is the absence of test coverage which is often not explicitly called for in the ACs. As mentioned on #3760 (comment) we want to make sure each question type is added to the "main" test suite for surveys which are the tests for |
IB ✅ |
I've added a test for this question type to This wasn't mentioned in the IB though so I don't think it's been thought through 🤔 In order for the test to pass, it requires changes to the I'll just make these changes in anyway and then after we can discuss the best way |
Assigning back to you @tofumatt for another round of CR (I have some questions) I also did 3761 and 3760 and they're very similar so
|
@danielgent sure, I will take another look at this. |
QA Update: ❌@felixarntz @tofumatt since Daniel has departed, I still have two observations that I would like to raise.
|
Ready for another pass @wpdarren 👍 |
QA Update: ✅Verified
|
Approval ❌Similar to #3761 (comment), the implementation here does not match the ACs, as it is relying on The overall question schema is always only including the |
When the initial user feedback survey was introduced, scope of the MVP was limited to only support questions of the "rating" type, since that was the only one used for the initial survey. This should now be followed up on, with this issue focusing on the "open_text" question type.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
SurveyQuestionOpenText
JS component should be introduced and integrated into the user feedback survey JS infrastructure, rendering a survey question of type "open_text"./survey/trigger/
API response are as follows:question.question.subtitle
should, if present, be displayed right below the text input (see screenshot).question.question.placeholder
should, if present, be displayed as a text input placeholder (see screenshot).answerQuestion
function prop) should look as follows:answer
property with the string from the text input.{ answer: 'My open text response' }
Implementation Brief
Create new component
Create
assets/js/components/surveys/SurveyQuestionOpenText.js
Base on SurveyQuestionRating.js
.googlesitekit-survey__open-text
SurveyHeader
to match stylingTextField
,Input
,HelperText
componentsquestion
,subtitle
,placeholder
answerQuestion
,dismissSurvey
TextField
'shelperText
prop (with the childsubtitle
)answerQuestion
as per ACIn
assets/sass/components/surveys/_googlesitekit-surveys.scss
.googlesitekit-survey__open-text
.googlesitekit-survey__body
,.mdc-text-field
, and.mdc-text-field-helper-line
Add new component to map on `assets/js/components/surveys/CurrentSurvey.js§
ComponentMap
also needs to mapopen_text
toSurveyQuestionOpenText
❗ ❗ See PR here with everything done up until here #3771 ❗ ❗
Create new story
Create
assets/js/components/surveys/SurveyQuestionOpenText.stories.js
(Based on SurveyQuestionRating.stories.js)Test Coverage
assets/js/components/surveys/CurrentSurvey.test.js
for the new question type.We need to add this question type to the "main" test suite for
CurrentSurvey
to make sure the question type works as expected when "plugged in" to the rest of the survey components, next button, etc.Visual Regression Changes
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: