Repository: oppia/oppia

Issue:
[Contributor Dashboard] Increase subheading width in translate text modal.
<!--
  - Thanks for taking the time to propose a new feature for the Oppia project.
  - Before filing a new issue, please do a quick search to check that it hasn't
  - already been filed on the [issue tracker](https://github.com/oppia/oppia/issues)._
  -->
The current subheading width is set to 60%, though this results in awkward overflow:
<img width="1675" alt="Screen Shot 2020-06-11 at 4 02 47 PM" src="https://user-images.githubusercontent.com/9004726/84452127-c9e2f980-ac09-11ea-877a-50f09605888d.png">

Ideally, if space is available the subheading should expand to fit the available width.

We also want to fully expand the subheading (Topic - Story - Chapter) in the translation cards when possible:

<img width="667" alt="Screen Shot 2020-12-15 at 4 35 43 PM" src="https://user-images.githubusercontent.com/9004726/102275575-94d69d00-3ef3-11eb-8307-bea14ac114c0.png">

Note: For a guide on how to access Oppia's webpages, see [this](https://github.com/oppia/oppia/wiki/How-to-access-Oppia-webpages).


Discussion:
I would like to work on it.

Can I work on this issue?
@subodhk01 I see that you signed the CLA. I've assigned you this issue, so you can go ahead and start working on it. Thanks! 
@sagangwee Thanks!
@sagangwee I was unable to reproduce the issue, since I'm new to the platform can you please explain how were you able to get to the Modal in image? 
@subodhk01 So first, you'll need to enable the contributor dashboard by going into the feconf.py file and setting `COMMUNITY_DASHBOARD_ENABLED` to True.

Then, you can following [these](https://docs.google.com/document/d/1JYX4nvTcblaVVYAlTi7rApE0lWSBx0v_ZCCr_8WW4Wc/edit#heading=h.8u0749eek6xc
) steps to populate translation opportunities in the dashboard. Once that's done, you should see translation opportunities at /community_dashboard
@subodhk01 Any updates on this issue?
Hey @subodhk01 What's up? Do you need some help with this?
@kevintab95 @sagangwee Could you please assign this issue to me? Thanks
@sagangwee @kevintab95  i am completely new to open source. Can i take this as my first issue? Thanks
@sagangwee I would like to work on this issue. Could you please assign this to me ?
@sagangwee I want to take up this issue. Can you please assign it to me?

@RaviKumar7870 I have assigned you the issue!
@RaviKumar7870 how quickly can you fix this bug? It's blocking the upcoming release, so we need to fix it as quickly as possible! In the next 2 days would be best.
@U8NWXD Sorry to say, but due to some unavoidable reason I can't work on it before 22nd Dec. :(
No problem! Reassigning to @aks681. Akshay, could you make sure this gets fixed ASAP?
@RaviKumar7870 if no one's started working on this by the 22nd, you're welcome to claim it again if you can get it fixed in a couple days

Resolving patch:
diff --git a/core/controllers/contributor_dashboard.py b/core/controllers/contributor_dashboard.py
--- a/core/controllers/contributor_dashboard.py
+++ b/core/controllers/contributor_dashboard.py
@@ -283,7 +283,9 @@ def get(self):
                 if contribution_rights else []),
             'can_review_questions': (
                 contribution_rights.can_review_questions
-                if contribution_rights else False)
+                if contribution_rights else False),
+            'can_suggest_questions': (
+                config_domain.CONTRIBUTOR_CAN_SUGGEST_QUESTIONS.value)
         })
 
 
diff --git a/core/domain/config_domain.py b/core/domain/config_domain.py
--- a/core/domain/config_domain.py
+++ b/core/domain/config_domain.py
@@ -459,6 +459,11 @@ def get_all_config_property_names(cls):
     'contributor_dashboard_is_enabled', BOOL_SCHEMA,
     'Enable contributor dashboard page. The default value is true.', True)
 
+CONTRIBUTOR_CAN_SUGGEST_QUESTIONS = ConfigProperty(
+    'contributor_can_suggest_questions', BOOL_SCHEMA,
+    'Whether the contributor can suggest questions for skill opportunities.',
+    False)
+
 CONTRIBUTOR_DASHBOARD_REVIEWER_EMAILS_IS_ENABLED = ConfigProperty(
     'contributor_dashboard_reviewer_emails_is_enabled', BOOL_SCHEMA,
     (


Test patch:
diff --git a/core/controllers/contributor_dashboard_test.py b/core/controllers/contributor_dashboard_test.py
--- a/core/controllers/contributor_dashboard_test.py
+++ b/core/controllers/contributor_dashboard_test.py
@@ -492,12 +492,15 @@ class UserContributionRightsDataHandlerTest(test_utils.GenericTestBase):
 
     def test_guest_user_check_contribution_rights(self):
         response = self.get_json('/usercontributionrightsdatahandler')
+        config_services.set_property(
+            'admin', 'contributor_can_suggest_questions', False)
 
         self.assertEqual(
             response, {
                 'can_review_translation_for_language_codes': [],
                 'can_review_voiceover_for_language_codes': [],
-                'can_review_questions': False
+                'can_review_questions': False,
+                'can_suggest_questions': False
             })
 
     def test_user_check_contribution_rights(self):
@@ -506,12 +509,16 @@ def test_user_check_contribution_rights(self):
         user_id = self.get_user_id_from_email(user_email)
         self.login(user_email)
 
+        config_services.set_property(
+            'admin', 'contributor_can_suggest_questions', False)
+
         response = self.get_json('/usercontributionrightsdatahandler')
         self.assertEqual(
             response, {
                 'can_review_translation_for_language_codes': [],
                 'can_review_voiceover_for_language_codes': [],
-                'can_review_questions': False
+                'can_review_questions': False,
+                'can_suggest_questions': False
             })
 
         user_services.allow_user_to_review_question(user_id)
@@ -521,7 +528,36 @@ def test_user_check_contribution_rights(self):
             response, {
                 'can_review_translation_for_language_codes': [],
                 'can_review_voiceover_for_language_codes': [],
-                'can_review_questions': True
+                'can_review_questions': True,
+                'can_suggest_questions': False
+            })
+
+    def test_can_suggest_questions_flag_in_response(self):
+        user_email = 'user@example.com'
+        self.signup(user_email, 'user')
+        self.login(user_email)
+        config_services.set_property(
+            'admin', 'contributor_can_suggest_questions', False)
+
+        response = self.get_json('/usercontributionrightsdatahandler')
+        self.assertEqual(
+            response, {
+                'can_review_translation_for_language_codes': [],
+                'can_review_voiceover_for_language_codes': [],
+                'can_review_questions': False,
+                'can_suggest_questions': False
+            })
+
+        config_services.set_property(
+            'admin', 'contributor_can_suggest_questions', True)
+
+        response = self.get_json('/usercontributionrightsdatahandler')
+        self.assertEqual(
+            response, {
+                'can_review_translation_for_language_codes': [],
+                'can_review_voiceover_for_language_codes': [],
+                'can_review_questions': False,
+                'can_suggest_questions': True
             })
 
 
diff --git a/core/tests/protractor_desktop/contributorDashboard.js b/core/tests/protractor_desktop/contributorDashboard.js
--- a/core/tests/protractor_desktop/contributorDashboard.js
+++ b/core/tests/protractor_desktop/contributorDashboard.js
@@ -65,6 +65,11 @@ describe('Contributor dashboard page', function() {
     await users.createUser(USER_EMAILS[0], 'user0');
     await users.createUser(USER_EMAILS[1], 'user1');
     await users.createAndLoginAdminUser(ADMIN_EMAIL, 'management');
+    await adminPage.editConfigProperty(
+      'Whether the contributor can suggest questions for skill opportunities.',
+      'Boolean', async function(elem) {
+        await elem.setValue(true);
+      });
 
     await topicsAndSkillsDashboardPage.get();
     await topicsAndSkillsDashboardPage.createTopic(
@@ -232,7 +237,13 @@ describe('Admin page contributor reviewer form', function() {
       translationReviewerEmail, translationReviewerUsername);
     await users.createUser(voiceoverReviewerEmail, voiceoverReviewerUsername);
     await users.createUser(questionReviewerEmail, questionReviewerUsername);
-    await users.createAdmin(ADMIN_EMAIL, 'assignReviewer');
+    await users.createAndLoginAdminUser(ADMIN_EMAIL, 'assignReviewer');
+    await adminPage.editConfigProperty(
+      'Whether the contributor can suggest questions for skill opportunities.',
+      'Boolean', async function(elem) {
+        await elem.setValue(true);
+      });
+    await users.logout();
   });
 
   beforeEach(async function() {