Skip to content

Commit

Permalink
Fix part of #19570: language name in language dropdown list in contri…
Browse files Browse the repository at this point in the history
…butor admin dashboard (#19594)

* fix language name in language dropdown to list language name first

* change var to let

* fix integration test

* Fix #19511: make name optional for subscribing (#19534)

* fix #19511: make name optional for subscribing

* fix lint

* use Optional

* return non_empty validator

* remove Union

* Fix #18661: Specific partnership interest form for each language (#19402)

* Fix #18661: specific partnership form link

* linting

* frontend tests

* ts-checks

* fixes

* minor changes

* resolve conflict

* fix tests

* Fix issue #19408 About Page is not responsive (#19530)

changes done in about-page.component.css

Co-authored-by: 2008sahil <getinter6@gmail.com>

* Fix #18512: Graph Interaction Mobile Grey Out Bug (#19532)

* Fix Reset Button Styling on Graph

* Change to Flow Root

* Fix #18079: Add fixed height to Skill dialogbox (#19558)

* added fixed height

* fixed search bar

* lint

---------

Co-authored-by: Nikita Vorobev <vorobyev.nikita@gmail.com>

* Fix #19398 Added make stop in case of non zero exit code (#19483)

* Trap command used to check for Sudden Exit of running tests on code

* trap command is added with sigint handler

* trap command is added with sigint handler

* trap command is added with sigint handler

* trap command is added with sigint handler

* trap command is added with sigint handler

* changed done as reuqired

* coe updated to check for exit aprt from keyboard interrupt also

* code for all tests updated in makeflie to stop containers in any case of failure

* code for all tests updated in makeflie to stop containers in any case of failure

* make stop will executed for all exit code apart from 0 now

* removed extra spaces

* removed the extra echo commands

* backend tests workflow changed

* backend tests workflow changed

* removed the extra echo commands

* Fixes google-chrome not found for Mac users in Docker setup (#19512)

* fix: chrome version for mac

* chore: removed newlines

* chore: refracted the variables name

* Fix #19545: Exploration editor category creating new categories when selecting old ones. (#19549)

* Fix Exploration Editor Category Select

* Change to Value Change

* Fix #19536: Adds hover effect to subscribe button on android page (#19565)

* button replaced by primary-button in android page, also disabled attribute added

* fix linter error

* Creates voiceover language policy model (#19456)

* Creates voiceover model

* Adds test for entity voiceover model

* Add voiceover domain and service methods.

* Adds voiceover domain and services tests

* Fixes mypy checks

* Creates voiceover policy model

* Fixes linter issues.

* Address review comments

* Adds regex check for language accent code

* Updates voiceover policy model name.

* Adds voiceover language accent constants

* Adds language accent codes list for voiceovers

* updates docstring

* updates docstring

* Deletes voice policy dir and shifts it into voiceover dir

* Adds helper methods to get & save in VoiceoverAutogenerationPolicyModel

* Creates json files to stores L-a constants.

* Adds test to validate voiceover language accent constants.

* Removes dead code

* Updates code comment

* Updates code comment

* Updates Readme.

* Adds note to developers

* Updates code comment

* GSoC_2.5: Frontend changes to enable pinning of opportunties (#19122)

* Front-end changes

* Fix frontend tests

* Fix frontend tests

* Fix linting

* Fix tests

* Fix tests

* Fix tests

* Fix linting

* Fix linting

* Fix linting

* Fix CI checks

* Fix all linting errors

* Update the frontend files and write unit tests

* Fix failing unit tests

* Fix failing unit tests

* Fix failing unit tests

* Fix failing unit tests

* Fix failing CI checks

* Fix failing unit tests

* Fix CI Checks

* Fix lint checks

* Fix typescript typecheck errors

* Fix typescript typecheck errors

* Fix typescript typecheck errors

* Address Review Comments

* Fix flaky tests

* Fix lints and add coverage tests

* Fix lints and add coverage tests

* Fix #15377: Interaction changes still remain in pop-up after cancellation (#19579)

Fix Customization Args Saved Memento

* Fix issue #19576:Library Page Search Results Alignment Issue  (#19588)

searched results alligned to center

Co-authored-by: 2008sahil <getinter6@gmail.com>

* use regex for matching

* change regex

* Fix #19516: Navigation issues in the blog author page (#19517)

fix: Navigation issues in the blog author page

* fix : [BUG]: Cursor should be hand pointer instead of text pointer #19575 (#19584)

* Click-Arrow edit button text solved

* some minor fixes

* Fix issue #19407:Blog page is not responsive on mobile devices (#19474)

* fixed UI changes in blog page

* passing lint testcase1

* passing lint testcase2

* all lint case passed

* all lint case passed

* final commit

* done suggested changes

* Suggested Changes Done

* added media query at 470px

* fixed UI changes in blog page

* passing lint testcase1

* passing lint testcase2

* all lint case passed

* all lint case passed

* final commit

* done suggested changes

* Suggested Changes Done

* Resolved responsive issues in blog page

* solved responsive issues

* added margin to blog-navigate icon

* fixed all changes

* linter issue resolved

* linter issue resolved

* all linter checks resolved

* changed naming to no-result-found

---------

Co-authored-by: 2008sahil <getinter6@gmail.com>

* FIX #19571 : Add a space after "or" Conjunction and Second Option in Exploration Multi-selection. (#19573)

{{Fix spacing with OR}}

Co-authored-by: Sean Lip <sean@seanlip.org>

* Fix #10647: Fixed faulty navbar on topic editor (#19567)

* fixed the navbar on subtopic page and also added necessary tests

* removed unnecessary function

* fixed coverage issues

* added dynamic icon in navbar

* fixed some linting issues

* simplified the boolean expression

* Fix #19507: Corrected responsive design for exploration editor nav tools  (#19600)

Fixed responsive issue with exploration editor

* Remove unused dependencies: `py` (via `pytest` upgrade)and `PyGithub` (#19553)

* removed unused deps

* removed unused tests

* upgraded pytest to 7.4.4

* fix regex

* fix docstring

* fix tests

* fix test

* fix test

---------

Co-authored-by: Nikita Vorobev <vorobyev.nikita@gmail.com>
Co-authored-by: Yashwardhan Jyani <100014271+yashwardhan-jyani@users.noreply.github.com>
Co-authored-by: Sahil Gupta <155609546+2008sahil@users.noreply.github.com>
Co-authored-by: 2008sahil <getinter6@gmail.com>
Co-authored-by: Justin Nguyen <70992422+jnvtnguyen@users.noreply.github.com>
Co-authored-by: Harsh Keshari <108923011+hrshkshri@users.noreply.github.com>
Co-authored-by: Yash Dugriyal <127002519+yash1378@users.noreply.github.com>
Co-authored-by: Akash Jaiswal <akashjaiswal3846@gmail.com>
Co-authored-by: sagar-subedi <66303548+sagar-subedi@users.noreply.github.com>
Co-authored-by: Nikhil <nikhil.agarwal.2019@gmail.com>
Co-authored-by: Ashwath Kannan <98253080+Ash-2k3@users.noreply.github.com>
Co-authored-by: Afzal Khan <tricktomade@gmail.com>
Co-authored-by: Yogesh Saini <97088265+Ykumar1415@users.noreply.github.com>
Co-authored-by: Rahat <136263179+rahat2134@users.noreply.github.com>
Co-authored-by: Sean Lip <sean@seanlip.org>
Co-authored-by: Sambhav Kaushik <92575005+masterboy376@users.noreply.github.com>
Co-authored-by: amyyeung17 <amyyeung17@gmail.com>
Co-authored-by: Harshvardhan Singh <73544247+Lawful2002@users.noreply.github.com>
  • Loading branch information
19 people authored Feb 20, 2024
1 parent c28963e commit 6948ba9
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ describe('Contributor dashboard Admin page', () => {
ContributorDashboardAdminBackendApiService);
let ngbModal: NgbModal;
let $window: WindowRef;

class MockNgbModalRef {
componentInstance!: {};
}
Expand Down Expand Up @@ -84,7 +85,7 @@ describe('Contributor dashboard Admin page', () => {
],
providers: [
ContributorDashboardAdminStatsBackendApiService,
ContributorDashboardAdminBackendApiService
ContributorDashboardAdminBackendApiService,
],
schemas: [NO_ERRORS_SCHEMA]
}).overrideModule(BrowserDynamicTestingModule, {
Expand Down Expand Up @@ -122,15 +123,18 @@ describe('Contributor dashboard Admin page', () => {
.and.returnValue(Promise.resolve({
translation_reviewers_count: {
en: 1,
ar: 1
ar: 1,
ms: 1,
az: 1,
'hi-en': 1
},
question_reviewers_count: 1
} as CommunityContributionStatsBackendDict));

fetchAssignedLanguageIdsSpy = spyOn(
contributorDashboardAdminStatsBackendApiService,
'fetchAssignedLanguageIds')
.and.returnValue(Promise.resolve(['en', 'ar']));
.and.returnValue(Promise.resolve(['en', 'ar', 'az', 'ms', 'hi-en']));

spyOn(
contributorDashboardAdminStatsBackendApiService,
Expand Down Expand Up @@ -266,10 +270,14 @@ describe('Contributor dashboard Admin page', () => {
component.ngOnInit();
tick();
fixture.detectChanges();

component.selectLanguage('العربية (Arabic)');
expect(component.selectedLanguage.language).toBe('العربية (Arabic)');
expect(component.selectedLanguage.id).toBe('ar');
const nonDefaultLanguage = {
id: 'ar',
language: 'Arabic (العربية)'
};
component.selectLanguage(nonDefaultLanguage.language);
expect(component.selectedLanguage.language)
.toBe(nonDefaultLanguage.language);
expect(component.selectedLanguage.id).toBe(nonDefaultLanguage.id);
}));

it('should select last activity from dropdown', fakeAsync(() => {
Expand Down Expand Up @@ -346,10 +354,14 @@ describe('Contributor dashboard Admin page', () => {
expect(component.selectedTopicIds).toEqual(['1', '2']);
expect(component.selectedLanguage.language).toBe('English');
expect(component.selectedLanguage.id).toBe('en');

component.selectLanguage('العربية (Arabic)');
expect(component.selectedLanguage.language).toBe('العربية (Arabic)');
expect(component.selectedLanguage.id).toBe('ar');
const nonDefaultLanguage = {
id: 'ar',
language: 'Arabic (العربية)'
};
component.selectLanguage(nonDefaultLanguage.language);
expect(component.selectedLanguage.language)
.toBe(nonDefaultLanguage.language);
expect(component.selectedLanguage.id).toBe(nonDefaultLanguage.id);
expect(component.selectedTopicIds).toEqual(['1', '2']);
}));

Expand Down Expand Up @@ -654,5 +666,22 @@ describe('Contributor dashboard Admin page', () => {
expect(modalSpy).toHaveBeenCalledWith(UsernameInputModal);
expect(openRoleEditorSpy).toHaveBeenCalledWith('user1');
}));

it('should start any language with its English name', fakeAsync(() => {
component.ngOnInit();
tick();
expect(component.languageChoices).toContain({
id: 'ms',
language: 'Bahasa Melayu (بهاس ملايو)'
});
expect(component.languageChoices).toContain({
id: 'hi-en',
language: 'Hinglish'
});
expect(component.languageChoices).toContain({
id: 'az',
language: 'Azerbaijani (Azeri)'
});
}));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ export class ContributorAdminDashboardPageComponent implements OnInit {
languageItem => {
return {
id: languageItem.id,
language: languageItem.description
language:
this.putEnglishLanguageNameAtFront(languageItem.description),
};
}
);
Expand Down Expand Up @@ -207,6 +208,18 @@ export class ContributorAdminDashboardPageComponent implements OnInit {
return filteredTopic;
}

private putEnglishLanguageNameAtFront(language: string): string {
// Check if the language matches the expected format 'abc (something)'.
const pattern = /(.*)\s*\(([a-zA-Z ]+)\)/;
const match = language.match(pattern);
if (!match) {
return language;
}
const originalLanguageName = match[1].trim();
const englishLanguageName = match[2].trim();
return `${englishLanguageName} (${originalLanguageName})`;
}

toggleLanguageDropdown(): void {
this.languageDropdownShown = !this.languageDropdownShown;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ describe('Contributor Admin Dashboard', function() {
await contributorDashboardAdminPage.waitForLoadingMessageToDisappear();
await contributorDashboardAdminPage.expectNoStatsElement();

await contributorDashboardAdminPage.switchLanguage('shqip (Albanian)');
await contributorDashboardAdminPage.switchLanguage('Albanian (shqip)');
await contributorDashboardAdminPage.waitForLoadingMessageToDisappear();
await contributorDashboardAdminPage.expectStatsElementCountToBe(1);
await contributorDashboardAdminPage.expectStatsRowsAreExpanded();
Expand Down

0 comments on commit 6948ba9

Please sign in to comment.