[MediaWiki-commits] [Gerrit] Register enabled surveys as RL modules via hook - change (mediawiki...QuickSurveys)
jenkins-bot has submitted this change and it was merged. Change subject: Register enabled surveys as RL modules via hook .. Register enabled surveys as RL modules via hook This creates a module per survey configured with survey messages for server side translation. This can also be responsible for registering any additional dependencies based on survey configuration. Additionally: - Fixed the QuickSurveysConfig so the config can be read - Creates language keys for link, and privacy-policy-link bug: T107586 Change-Id: I8ab993130bf3fe60de461ecdcff66b494281c310 --- M extension.json M i18n/en.json M i18n/qqq.json M includes/QuickSurveys.hooks.php 4 files changed, 87 insertions(+), 16 deletions(-) Approvals: Phuedx: Looks good to me, approved jenkins-bot: Verified diff --git a/extension.json b/extension.json index 1cd4b50..9011ef5 100644 --- a/extension.json +++ b/extension.json @@ -79,10 +79,13 @@ ], "BeforePageDisplay": [ "QuickSurveys\\Hooks::onBeforePageDisplay" + ], + "ResourceLoaderRegisterModules": [ + "QuickSurveys\\Hooks::onResourceLoaderRegisterModules" ] }, "config": { - "@QuickSurveysConfig": [ + "QuickSurveysConfig": [ { "@name": "survey name", "name": "internal example survey", @@ -117,9 +120,9 @@ "@description": "description of the survey", "description": "ext-quicksurveys-example-external-survey-description", "@link": "external link to the survey", - "link": "//example.org/survey", + "link": "ext-quicksurveys-example-external-survey-link", "@privacy-policy-link": "link to the privacy policy", - "privacy-policy-link": "//example.org/privacy-policy", + "privacy-policy-link": "ext-quicksurveys-example-external-survey-privacy-policy-link", "@privacy-policy-text": "text of the privacy policy", "privacy-policy-text": "ext-quicksurveys-example-external-survey-privacy-policy-text", "@enabled": "whether the survey is enabled", diff --git a/i18n/en.json b/i18n/en.json index 3160260..8641787 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -12,7 +12,9 @@ "ext-quicksurveys-example-internal-survey-answer-positive": "Yes", "ext-quicksurveys-example-internal-survey-answer-neutral": "Not sure", "ext-quicksurveys-example-internal-survey-answer-negative": "No", + "ext-quicksurveys-example-external-survey-link": "//example.org/survey", "ext-quicksurveys-example-external-survey-description": "This is the description of the example external survey.", + "ext-quicksurveys-example-external-survey-privacy-policy-link": "//example.org/privacy-policy", "ext-quicksurveys-example-external-survey-privacy-policy-text": "Privacy Policy", "ext-quicksurveys-survey-privacy-policy-default-text": "All submissions are anonymous. See the [[Project:Privacy_policy|privacy policy]].", "ext-quicksurveys-survey-confirm-msg": "Thanks for the feedback! We are using it to make {{SITENAME}} even better!", diff --git a/i18n/qqq.json b/i18n/qqq.json index f0509d3..f73098f 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -13,7 +13,9 @@ "ext-quicksurveys-example-internal-survey-answer-positive": "The positive answer for the example internal survey\n{{Identical|Yes}}", "ext-quicksurveys-example-internal-survey-answer-neutral": "The neutral answer for the example internal survey\n{{Identical|Not sure}}", "ext-quicksurveys-example-internal-survey-answer-negative": "The negative answer for the example internal survey\n{{Identical|No}}", + "ext-quicksurveys-example-external-survey-link": "Web link to the external survey", "ext-quicksurveys-example-external-survey-description": "description of the example survey", + "ext-quicksurveys-example-external-survey-privacy-policy-link": "Web link to the privacy policy", "ext-quicksurveys-example-external-survey-privacy-policy-text": "text of the privacy policy link\n{{Identical|Privacy policy}}", "ext-quicksurveys-survey-privacy-policy-default-text": "Default disclaimer about submitting surveys.", "ext-quicksurveys-survey-confirm-msg": "Confirmation message thanking user for their input.", diff --git a/includes/QuickSurveys.hooks.php b/includes/QuickSurveys.hooks.php index 4e172b3..bad852a 100644 --- a/includes/QuickSurveys.hooks.php +++ b/includes/QuickSurveys.hooks.php @@ -9,6 +9,7 @@ n
[MediaWiki-commits] [Gerrit] Register enabled surveys as RL modules via hook - change (mediawiki...QuickSurveys)
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/232283 Change subject: Register enabled surveys as RL modules via hook .. Register enabled surveys as RL modules via hook This creates a module per survey configured with survey messages for server side translation. This can also be responsible for registering any additional dependencies based on survey configuration. Additionally: - Fixed the QuickSurveysConfig so the config can be read - Creates language keys for link, and privacy-policy-link bug: T107586 Change-Id: I8ab993130bf3fe60de461ecdcff66b494281c310 --- M extension.json M i18n/en.json M i18n/qqq.json M includes/QuickSurveys.hooks.php 4 files changed, 75 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/QuickSurveys refs/changes/83/232283/1 diff --git a/extension.json b/extension.json index 7e1a91c..f29421d 100644 --- a/extension.json +++ b/extension.json @@ -26,11 +26,16 @@ "Hooks": { "ResourceLoaderGetConfigVars": [ "QuickSurveys\\Hooks::onResourceLoaderGetConfigVars" + ], + "ResourceLoaderRegisterModules": [ + "QuickSurveys\\Hooks::onResourceLoaderRegisterModules" ] }, "config": { - "@QuickSurveysConfig": [ + "QuickSurveysConfig": [ { + "@module": "Resourceloader module key for the survey", + "module": "ext.quicksurveys.survey.internal.example", "@name": "survey name", "name": "internal example survey", "@type": "internal or external link survey", @@ -58,15 +63,17 @@ } }, { + "@module": "Resourceloader module key for the survey", + "module": "ext.quicksurveys.survey.external.example", "name": "external example survey", "@type": "internal or external link survey", "type": "external", "@description": "description of the survey", "description": "ext-quicksurveys-example-external-survey-description", "@link": "external link to the survey", - "link": "//example.org/survey", + "link": "ext-quicksurveys-example-external-survey-link", "@privacy-policy-link": "link to the privacy policy", - "privacy-policy-link": "//example.org/privacy-policy", + "privacy-policy-link": "ext-quicksurveys-example-external-survey-privacy-policy-link", "@privacy-policy-text": "text of the privacy policy", "privacy-policy-text": "ext-quicksurveys-example-external-survey-privacy-policy-text", "@enabled": "whether the survey is enabled", diff --git a/i18n/en.json b/i18n/en.json index f53bfb4..b99949a 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -12,6 +12,8 @@ "ext-quicksurveys-example-internal-survey-answer-positive": "Yes", "ext-quicksurveys-example-internal-survey-answer-neutral": "Not sure", "ext-quicksurveys-example-internal-survey-answer-negative": "No", + "ext-quicksurveys-example-external-survey-link": "//example.org/survey", "ext-quicksurveys-example-external-survey-description": "This is the description of the example external survey.", + "ext-quicksurveys-example-external-survey-privacy-policy-link": "//example.org/privacy-policy", "ext-quicksurveys-example-external-survey-privacy-policy-text": "Privacy Policy" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 03c7a2a..bcf6063 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -13,6 +13,8 @@ "ext-quicksurveys-example-internal-survey-answer-positive": "The positive answer for the example internal survey\n{{Identical|Yes}}", "ext-quicksurveys-example-internal-survey-answer-neutral": "The neutral answer for the example internal survey\n{{Identical|Not sure}}", "ext-quicksurveys-example-internal-survey-answer-negative": "The negative answer for the example internal survey\n{{Identical|No}}", + "ext-quicksurveys-example-external-survey-link": "Web link to the external survey", "ext-quicksurveys-example-external-survey-description": "description of the example survey", + "ext-quicksurveys-example-external-survey-privacy-policy-link": "Web link to the privacy policy", "ext-quicksurveys-example-exte
[MediaWiki-commits] [Gerrit] Register enabled surveys as RL modules via hook - change (mediawiki...QuickSurveys)
Robmoen has uploaded a new change for review. https://gerrit.wikimedia.org/r/232210 Change subject: Register enabled surveys as RL modules via hook .. Register enabled surveys as RL modules via hook This creates a module per survey configured with survey messages for server side translation. This can also be responsible for registering any additional dependencies based on survey configuration. Additionally: - Fixed the QuickSurveysConfig so the config can be read - Creates language keys for link, privacy-policy-link, and privacy-policy-text bug: T107586 Change-Id: I8ab993130bf3fe60de461ecdcff66b494281c310 --- M extension.json M i18n/en.json M i18n/qqq.json M includes/QuickSurveys.hooks.php 4 files changed, 75 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/QuickSurveys refs/changes/10/232210/1 diff --git a/extension.json b/extension.json index 7e1a91c..30e4411 100644 --- a/extension.json +++ b/extension.json @@ -26,10 +26,13 @@ "Hooks": { "ResourceLoaderGetConfigVars": [ "QuickSurveys\\Hooks::onResourceLoaderGetConfigVars" + ], + "ResourceLoaderRegisterModules": [ + "QuickSurveys\\Hooks::onResourceLoaderRegisterModules" ] }, "config": { - "@QuickSurveysConfig": [ + "QuickSurveysConfig": [ { "@name": "survey name", "name": "internal example survey", @@ -48,7 +51,7 @@ "@schema": "Which schema to log to", "schema": "QuickSurveysResponse", "@enabled": "whether the survey is enabled", - "enabled": false, + "enabled": true, "@coverage": "percentage of users that will see the survey", "coverage": "50", "@platform": "for each platform (desktop, mobile), which version of it is targeted (stable, beta, alpha)", @@ -64,13 +67,13 @@ "@description": "description of the survey", "description": "ext-quicksurveys-example-external-survey-description", "@link": "external link to the survey", - "link": "//example.org/survey", + "link": "ext-quicksurveys-example-external-survey-link", "@privacy-policy-link": "link to the privacy policy", - "privacy-policy-link": "//example.org/privacy-policy", + "privacy-policy-link": "ext-quicksurveys-example-external-survey-privacy-policy-link", "@privacy-policy-text": "text of the privacy policy", "privacy-policy-text": "ext-quicksurveys-example-external-survey-privacy-policy-text", "@enabled": "whether the survey is enabled", - "enabled": false, + "enabled": true, "@coverage": "percentage of users that will see the survey", "coverage": "50", "@platform": "for each platform (desktop, mobile), which version of it is targeted (stable, beta, alpha)", diff --git a/i18n/en.json b/i18n/en.json index f53bfb4..b99949a 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -12,6 +12,8 @@ "ext-quicksurveys-example-internal-survey-answer-positive": "Yes", "ext-quicksurveys-example-internal-survey-answer-neutral": "Not sure", "ext-quicksurveys-example-internal-survey-answer-negative": "No", + "ext-quicksurveys-example-external-survey-link": "//example.org/survey", "ext-quicksurveys-example-external-survey-description": "This is the description of the example external survey.", + "ext-quicksurveys-example-external-survey-privacy-policy-link": "//example.org/privacy-policy", "ext-quicksurveys-example-external-survey-privacy-policy-text": "Privacy Policy" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 03c7a2a..bcf6063 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -13,6 +13,8 @@ "ext-quicksurveys-example-internal-survey-answer-positive": "The positive answer for the example internal survey\n{{Identical|Yes}}", "ext-quicksurveys-example-internal-survey-answer-neutral": "The neutral answer for the example internal survey\n{{Identical|Not sure}}", "ext-quicksurveys-example-internal-survey-answer-negative": "The negative answer for the example internal survey\n{{Identical|No}}", + "ext-quicksurveys-example-