From 0bb1e1ca4f419bafbdbc45886f946a3a83e3b193 Mon Sep 17 00:00:00 2001 From: bhushan354 Date: Fri, 13 Dec 2024 05:32:26 +0000 Subject: [PATCH 1/3] Update link label from 'View Course Page' to 'View Page' --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 8e82b21e90..579b72be9f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -846,7 +846,7 @@ en: view_other: View other campaigns view: View Course view_doc: The estimated number of views to articles edited by enrolled editors since the editor made their first edit to each article - view_page: View Course Page + view_page: View Page view_wiki: View on Wikipedia volunteer: one: Volunteer From 81073df25aa16e4fa20bd63c505889553424f9f3 Mon Sep 17 00:00:00 2001 From: bhushan354 Date: Sat, 14 Dec 2024 16:51:17 +0000 Subject: [PATCH 2/3] changes --- .../javascripts/components/user_profiles/course_details.jsx | 3 ++- config/locales/en.yml | 4 ++-- template.erb | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/components/user_profiles/course_details.jsx b/app/assets/javascripts/components/user_profiles/course_details.jsx index a84bec8e05..6a2fcbe4f7 100644 --- a/app/assets/javascripts/components/user_profiles/course_details.jsx +++ b/app/assets/javascripts/components/user_profiles/course_details.jsx @@ -2,10 +2,11 @@ import React from 'react'; import PropTypes from 'prop-types'; const CourseDetails = ({ courses }) => { + const labelKey = window.Features.wiki_ed ? 'courses.view_page' : 'courses_generic.view_page'; const elements = courses.map((course) => { return ( -
{I18n.t('courses.view_page')}
+
{I18n.t(labelKey)}
{course.course_title}
diff --git a/config/locales/en.yml b/config/locales/en.yml index 579b72be9f..3cdc197243 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -846,7 +846,7 @@ en: view_other: View other campaigns view: View Course view_doc: The estimated number of views to articles edited by enrolled editors since the editor made their first edit to each article - view_page: View Page + view_page: View Course Page view_wiki: View on Wikipedia volunteer: one: Volunteer @@ -1021,7 +1021,7 @@ en: uploads_none: This project has not contributed any images or other media files to Wikimedia Commons. user_uploads_none: Selected users have not contributed any images or other media files to this project. view_other: View other campaigns - view_page: View Program Page + view_page: View Page word_count_doc: An estimate of the number of words added to mainspace articles by the program's editors during the program term word_count_doc_wikidata: An estimate of the number of words added to mainspace items by the program's editors during the program term yourcourses: Your Programs diff --git a/template.erb b/template.erb index 0083b8f383..2cf8efd791 100644 --- a/template.erb +++ b/template.erb @@ -1 +1,2 @@ window.stores = <%= JSON.generate(translations) %>; +window.Features = { wiki_ed: <%= Features.wiki_ed?.to_json %> }; \ No newline at end of file From d7e55c265e7ce2a4cc16a25144c7259b53d05548 Mon Sep 17 00:00:00 2001 From: bhushan354 Date: Tue, 17 Dec 2024 00:59:35 +0530 Subject: [PATCH 3/3] used Features.wikiEd and removed window.Features --- .../javascripts/components/user_profiles/course_details.jsx | 2 +- template.erb | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/assets/javascripts/components/user_profiles/course_details.jsx b/app/assets/javascripts/components/user_profiles/course_details.jsx index 6a2fcbe4f7..bad3f3b9cb 100644 --- a/app/assets/javascripts/components/user_profiles/course_details.jsx +++ b/app/assets/javascripts/components/user_profiles/course_details.jsx @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; const CourseDetails = ({ courses }) => { - const labelKey = window.Features.wiki_ed ? 'courses.view_page' : 'courses_generic.view_page'; + const labelKey = Features.wikiEd ? 'courses.view_page' : 'courses_generic.view_page'; const elements = courses.map((course) => { return ( diff --git a/template.erb b/template.erb index 2cf8efd791..0083b8f383 100644 --- a/template.erb +++ b/template.erb @@ -1,2 +1 @@ window.stores = <%= JSON.generate(translations) %>; -window.Features = { wiki_ed: <%= Features.wiki_ed?.to_json %> }; \ No newline at end of file