diff --git a/addons/survey/__manifest__.py b/addons/survey/__manifest__.py index abadb891fd5..e78a4008f95 100644 --- a/addons/survey/__manifest__.py +++ b/addons/survey/__manifest__.py @@ -99,6 +99,9 @@ sent mails with personal token for the invitation of the survey. 'web.assets_tests': [ 'survey/static/tests/**/*', ], + 'web.assets_common': [ + 'survey/static/src/js/tours/survey_tour.js', + ] }, 'license': 'LGPL-3', } diff --git a/addons/survey/models/survey_survey.py b/addons/survey/models/survey_survey.py index e97f9900f4a..9c9189e6add 100644 --- a/addons/survey/models/survey_survey.py +++ b/addons/survey/models/survey_survey.py @@ -953,7 +953,7 @@ class Survey(models.Model): return { 'type': 'ir.actions.act_url', 'name': "Test Survey", - 'target': 'new', + 'target': 'self', 'url': '/survey/test/%s' % self.access_token, } diff --git a/addons/survey/static/src/js/tours/survey_tour.js b/addons/survey/static/src/js/tours/survey_tour.js new file mode 100644 index 00000000000..c4dff0ed223 --- /dev/null +++ b/addons/survey/static/src/js/tours/survey_tour.js @@ -0,0 +1,61 @@ +/** @odoo-module */ + +import { _t } from 'web.core'; +import { Markup } from 'web.utils'; +import tour from 'web_tour.tour'; + +tour.register('survey_tour', { + url: "/web", + rainbowManMessage: _t("Congratulations! You are now ready to collect feedback like a pro :-)"), + sequence: 225, +}, [ + ...tour.stepUtils.goToAppSteps('survey.menu_surveys', Markup(_t("Ready to change the way you gather data?"))), +{ + trigger: 'body:has(.o_survey_load_sample) .o_survey_sample_container', + content: Markup(_t("Load a sample Survey to get started quickly.")), + position: 'bottom', +}, { + trigger: 'button[name=action_test_survey]', + content: _t("Let's give it a spin!"), + position: 'bottom', +}, { + trigger: '.o_survey_start button[type=submit]', + content: _t("Let's get started!"), + position: 'bottom', +}, { + trigger: '.o_survey_simple_choice button[type=submit]', + extra_trigger: '.js_question-wrapper span:contains("How frequently")', + content: _t("Whenever you pick an answer, Odoo saves it for you."), + position: 'bottom', +}, { + trigger: '.o_survey_numerical_box button[type=submit]', + extra_trigger: '.js_question-wrapper span:contains("How many")', + content: _t("Only a single question left!"), + position: 'bottom', +}, { + trigger: '.o_survey_matrix button[value=finish]', + extra_trigger: '.js_question-wrapper span:contains("How likely")', + content: _t("Now that you are done, submit your form."), + position: 'bottom', +}, { + trigger: '.o_survey_review a', + content: _t("Let's have a look at your answers!"), + position: 'bottom', +}, { + trigger: '.alert-info a:contains("This is a Test Survey")', + content: _t("Now, use this shortcut to go back to the survey."), + position: 'bottom', +}, { + trigger: 'button[name=action_survey_user_input_completed]', + content: _t("Here, you can overview all the participations."), + position: 'bottom', +}, { + trigger: 'td[name=survey_id]', + content: _t("Let's open the survey you just submitted."), + position: 'bottom', +}, { + trigger: '.breadcrumb a:contains("Feedback Form")', + content: _t("Use the breadcrumbs to quickly go back to the dashboard."), + position: 'bottom', +} +]); diff --git a/addons/survey/views/survey_templates.xml b/addons/survey/views/survey_templates.xml index be6de09bce4..2d8e9f6a49d 100644 --- a/addons/survey/views/survey_templates.xml +++ b/addons/survey/views/survey_templates.xml @@ -282,7 +282,7 @@ -
+
If you wish, you can review your answers