Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/oppia/oppia into SVS_arc…
Browse files Browse the repository at this point in the history
…hitecture
  • Loading branch information
Nik-09 committed Jun 12, 2021
2 parents 7a0c0da + 09f8d21 commit ccfc515
Show file tree
Hide file tree
Showing 51 changed files with 1,480 additions and 1,339 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"oppia/break-after-parens": "error",
"oppia/no-multiple-component": "error",
"oppia/no-multiline-disable": "error",
"oppia/directive-scope": "error",
"oppia/no-testonly": "error",
"oppia/sorted-dependencies": "error",
"oppia/test-message-style": "error",
Expand Down
2 changes: 0 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,6 @@
/core/templates/google-analytics.initializer.ts @jameesjohn @vojtechjelinek
/core/templates/base-components/ @jameesjohn @vojtechjelinek
/core/templates/pages/Base.ts @jameesjohn @vojtechjelinek
/core/templates/pages/oppia_footer_directive.html @jameesjohn @vojtechjelinek
/core/templates/pages/OppiaFooterDirective.ts @jameesjohn @vojtechjelinek
/core/templates/pages/footer_js_libs.html @jameesjohn @vojtechjelinek
/core/templates/pages/header_css_libs.html @jameesjohn @vojtechjelinek
/core/templates/pages/header_js_libs.html @jameesjohn @vojtechjelinek
Expand Down
3 changes: 0 additions & 3 deletions core/controllers/classroom.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ class ClassroomPage(base.BaseHandler):
def get(self, _):
"""Handles GET requests."""

if not config_domain.CLASSROOM_PAGE_IS_ACCESSIBLE.value:
raise self.PageNotFoundException

self.render_template('classroom-page.mainpage.html')


Expand Down
7 changes: 0 additions & 7 deletions core/controllers/classroom_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,8 @@ def test_redirect_to_default_classroom(self):
class ClassroomPageTests(BaseClassroomControllerTests):

def test_any_user_can_access_classroom_page(self):
config_property = config_domain.Registry.get_config_property(
'classroom_page_is_accessible')
config_property.set_value('committer_id', True)
response = self.get_html_response('/learn/math')
self.assertIn('<classroom-page></classroom-page>', response)
config_property.set_value('committer_id', False)

def test_get_fails_when_classroom_page_is_accessible_not_enabled(self):
self.get_html_response('/learn/math', expected_status_int=404)


class ClassroomDataHandlerTests(BaseClassroomControllerTests):
Expand Down
2 changes: 1 addition & 1 deletion core/controllers/profile_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_get_profile_page_of_existing_user(self):
self.signup(self.OWNER_EMAIL, self.OWNER_USERNAME)
response = self.get_html_response('/profile/%s' % self.OWNER_USERNAME)
self.assertIn(
'<profile-page></profile-page>', response.body)
'<oppia-profile-page></oppia-profile-page>', response.body)


class ProfileDataHandlerTests(test_utils.GenericTestBase):
Expand Down
5 changes: 1 addition & 4 deletions core/domain/config_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ class ConfigProperty(python_utils.OBJECT):
- before_end_body_tag_hook.
- before_end_head_tag_hook.
- carousel_slides_config.
- classroom_page_is_accessible.
- collection_editor_whitelist.
- contact_email_address.
- contribute_gallery_page_announcement.
Expand Down Expand Up @@ -408,10 +409,6 @@ def get_all_config_property_names(cls):
'Always ask learners for answer details. For testing -- do not use',
False)

CLASSROOM_PAGE_IS_ACCESSIBLE = ConfigProperty(
'classroom_page_is_accessible', BOOL_SCHEMA,
'Make classroom page accessible.', False)

CLASSROOM_PROMOS_ARE_ENABLED = ConfigProperty(
'classroom_promos_are_enabled', BOOL_SCHEMA,
'Show classroom promos.', False)
Expand Down
18 changes: 3 additions & 15 deletions core/templates/base-components/base-content.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@
*/

import { DOCUMENT } from '@angular/common';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { AlertMessageComponent } from 'components/common-layout-directives/common-elements/alert-message.component';
import { PromoBarComponent } from 'components/common-layout-directives/common-elements/promo-bar.component';
import { SideNavigationBarComponent } from 'components/common-layout-directives/navigation-bars/side-navigation-bar.component';
import { TopNavigationBarDirective } from 'components/common-layout-directives/navigation-bars/top-navigation-bar.directive';
import { LimitToPipe } from 'filters/limit-to.pipe';
import { OppiaFooterDirective } from 'pages/OppiaFooterDirective';
import { Observable, of } from 'rxjs';
import { BottomNavbarStatusService } from 'services/bottom-navbar-status.service';
import { UrlService } from 'services/contextual/url.service';
Expand All @@ -35,8 +31,6 @@ import { SidebarStatusService } from 'services/sidebar-status.service';
import { BackgroundMaskService } from 'services/stateful/background-mask.service';
import { MockTranslatePipe } from 'tests/unit-test-utils';
import { BaseContentComponent } from './base-content.component';
import { LoadingMessageComponent } from './loading-message.component';
import { WarningsAndAlertsComponent } from './warnings-and-alerts.component';

describe('Base Content Component', () => {
let fixture: ComponentFixture<BaseContentComponent>;
Expand Down Expand Up @@ -90,14 +84,7 @@ describe('Base Content Component', () => {
TestBed.configureTestingModule({
declarations: [
BaseContentComponent,
OppiaFooterDirective,
LoadingMessageComponent,
WarningsAndAlertsComponent,
PromoBarComponent,
TopNavigationBarDirective,
SideNavigationBarComponent,
MockTranslatePipe,
AlertMessageComponent,
LimitToPipe
],
providers: [
Expand All @@ -121,7 +108,8 @@ describe('Base Content Component', () => {
useClass: MockPageTitleService
},
SidebarStatusService
]
],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,104 +2,104 @@
<div class="oppia-footer-container">
<div class="row row-cols-2">
<div class="col">
<h3 translate="I18N_FOOTER_ABOUT_ALL_CAPS"></h3>
<h3 [innerHTML]="'I18N_FOOTER_ABOUT_ALL_CAPS' | translate"></h3>
<ul>
<li>
<a href="/about"
translate="I18N_FOOTER_ABOUT">
[innerHTML]="'I18N_FOOTER_ABOUT' | translate">
</a>
</li>
<li>
<a href="http://oppiafoundation.org/"
translate="I18N_FOOTER_OPPIA_FOUNDATION">
[innerHTML]="'I18N_FOOTER_OPPIA_FOUNDATION' | translate">
</a>
</li>
<li>
<a href="https://medium.com/oppia-org"
translate="I18N_TOPNAV_BLOG">
[innerHTML]="'I18N_TOPNAV_BLOG' | translate">
</a>
</li>
<li>
<a href="/about#credits"
translate="I18N_FOOTER_CREDITS">
[innerHTML]="'I18N_FOOTER_CREDITS' | translate">
</a>
</li>
<li>
<a href="https://groups.google.com/forum/?place=forum/oppia#!forum/oppia"
translate="I18N_FOOTER_FORUM">
[innerHTML]="'I18N_FOOTER_FORUM' | translate">
</a>
</li>
</ul>

</div>
<div class="col">
<h3 translate="I18N_FOOTER_TEACH_LEARN_ALL_CAPS"></h3>
<h3 [innerHTML]="'I18N_FOOTER_TEACH_LEARN_ALL_CAPS' | translate"></h3>
<ul>
<li>
<a href="/get-started"
class="protractor-test-get-started-link"
translate="I18N_FOOTER_GET_STARTED">
[innerHTML]="'I18N_FOOTER_GET_STARTED' | translate">
</a>
</li>
<li>
<a href="/creator-guidelines"
translate="I18N_PLAYBOOK_HEADING">
[innerHTML]="'I18N_PLAYBOOK_HEADING' | translate">
</a>
</li>
<li>
<a href="/teach"
translate="I18N_FOOTER_TEACH_PAGE">
[innerHTML]="'I18N_FOOTER_TEACH_PAGE' | translate">
</a>
</li>
<li>
<a href="/community-library"
translate="I18N_FOOTER_BROWSE_LIBRARY">
[innerHTML]="'I18N_FOOTER_BROWSE_LIBRARY' | translate">
</a>
</li>
<li>
<a href="/contact"
translate="I18N_FOOTER_CONTACT_US">
[innerHTML]="'I18N_FOOTER_CONTACT_US' | translate">
</a>
</li>
</ul>
</div>
<div class="col">
<h3 translate="I18N_FOOTER_CONTRIBUTE_ALL_CAPS"></h3>
<h3 [innerHTML]="'I18N_FOOTER_CONTRIBUTE_ALL_CAPS' | translate"></h3>
<ul>
<li>
<a href="https://oppiafoundation.org/volunteer"
translate="I18N_HEADING_VOLUNTEER">
[innerHTML]="'I18N_HEADING_VOLUNTEER' | translate">
</a>
</li>
<li ng-if="$ctrl.siteFeedbackFormUrl">
<a ng-href="<[$ctrl.siteFeedbackFormUrl]>"
<li *ngIf="siteFeedbackFormUrl">
<a [href]="siteFeedbackFormUrl"
target="_blank"
rel="noopener"
translate="I18N_SPLASH_SITE_FEEDBACK" >
[innerHTML]="'I18N_SPLASH_SITE_FEEDBACK' | translate " >
</a>
</li>
<li>
<a href="/donate"
class="protractor-test-donate-link"
translate="I18N_FOOTER_DONATE">
[innerHTML]="'I18N_FOOTER_DONATE' | translate">
</a>
</li>
<li>
<a href="/terms"
class="protractor-test-terms-link"
translate="I18N_FOOTER_TERMS_OF_SERVICE">
[innerHTML]="'I18N_FOOTER_TERMS_OF_SERVICE' | translate">
</a>
</li>
<li>
<a href="/privacy-policy"
class="protractor-test-privacy-policy-link"
translate="I18N_FOOTER_PRIVACY_POLICY">
[innerHTML]="'I18N_FOOTER_PRIVACY_POLICY' | translate">
</a>
</li>
</ul>
</div>
<div class="col">
<h3><span translate="I18N_LANGUAGE_FOOTER_VIEW_IN"></span></h3>
<h3><span [innerHTML]="'I18N_LANGUAGE_FOOTER_VIEW_IN' | translate"></span></h3>
<oppia-i18n-language-selector></oppia-i18n-language-selector>
<oppia-social-buttons></oppia-social-buttons>
</div>
Expand Down
34 changes: 34 additions & 0 deletions core/templates/base-components/oppia-footer.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2019 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
* @fileoverview Component for the footer.
*/

import { Component } from '@angular/core';
import { downgradeComponent } from '@angular/upgrade/static';
import { AppConstants } from 'app.constants';

@Component({
selector: 'oppia-footer',
templateUrl: './oppia-footer.component.html'
})
export class OppiaFooterComponent {
siteFeedbackFormUrl: string = AppConstants.SITE_FEEDBACK_FORM_URL;
}

angular.module('oppia').directive('oppiaFooter',
downgradeComponent({
component: OppiaFooterComponent
}) as angular.IDirectiveFactory);
5 changes: 4 additions & 1 deletion core/templates/components/oppia-angular-root.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
import { TranslateService } from '@ngx-translate/core';
import { TranslateCacheService } from 'ngx-translate-cache';

import { Component, Output, AfterViewInit, EventEmitter, Injector } from '@angular/core';
import { Component, Output, AfterViewInit, EventEmitter, Injector, NgZone } from '@angular/core';
import { AdminBackendApiService } from
'domain/admin/admin-backend-api.service';
import { AdminDataService } from
Expand Down Expand Up @@ -613,6 +613,7 @@ export class OppiaAngularRootComponent implements AfterViewInit {
static musicNotesInputRulesService: MusicNotesInputRulesService;
static musicNotesInputValidationService: MusicNotesInputValidationService;
static musicPhrasePlayerService: MusicPhrasePlayerService;
static ngZone: NgZone;
static normalizeWhitespacePipe: NormalizeWhitespacePipe;
static normalizeWhitespacePunctuationAndCasePipe:
NormalizeWhitespacePunctuationAndCasePipe;
Expand Down Expand Up @@ -898,6 +899,7 @@ private multipleChoiceInputValidationService:
private musicNotesInputRulesService: MusicNotesInputRulesService,
private musicNotesInputValidationService: MusicNotesInputValidationService,
private musicPhrasePlayerService: MusicPhrasePlayerService,
private ngZone: NgZone,
private normalizeWhitespacePipe: NormalizeWhitespacePipe,
private normalizeWhitespacePunctuationAndCasePipe:
NormalizeWhitespacePunctuationAndCasePipe,
Expand Down Expand Up @@ -1262,6 +1264,7 @@ private injector: Injector
this.musicNotesInputValidationService);
OppiaAngularRootComponent.musicPhrasePlayerService = (
this.musicPhrasePlayerService);
OppiaAngularRootComponent.ngZone = this.ngZone;
OppiaAngularRootComponent.normalizeWhitespacePipe = (
this.normalizeWhitespacePipe);
OppiaAngularRootComponent.normalizeWhitespacePunctuationAndCasePipe = (
Expand Down
11 changes: 8 additions & 3 deletions core/templates/components/shared-component.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import { SummaryListHeaderComponent } from './state-directives/answer-group-edit
import { LearnerDashboardIconsComponent } from 'pages/learner-dashboard-page/learner-dashboard-icons.component';
import { OutcomeFeedbackEditorComponent } from './state-directives/outcome-editor/outcome-feedback-editor.component';
import { OnScreenKeyboardComponent } from './on-screen-keyboard/on-screen-keyboard.component';
import { OppiaFooterComponent } from '../base-components/oppia-footer.component';
import { RubricsEditorComponent } from './rubrics-editor/rubrics-editor.component';
import { CreateNewSkillModalComponent } from 'pages/topics-and-skills-dashboard-page/create-new-skill-modal.component';
import { PromoBarComponent } from './common-layout-directives/common-elements/promo-bar.component';
Expand All @@ -83,6 +84,7 @@ import { BaseContentComponent } from '../base-components/base-content.component'
import { PreviewThumbnailComponent } from 'pages/topic-editor-page/modal-templates/preview-thumbnail.component';
import { InputResponsePairComponent } from 'pages/exploration-player-page/learner-experience/input-response-pair.component';
import { I18nLanguageSelectorComponent } from '../base-components/i18n-language-selector.component';
import { StorySummaryTileComponent } from './summary-tile/story-summary-tile.component';
import { ExplorationFooterComponent } from 'pages/exploration-player-page/layout-directives/exploration-footer.component';
import { DisplaySolutionModalComponent } from 'pages/exploration-player-page/modals/display-solution-modal.component';
import { DisplaySolutionInterstititalModalComponent } from 'pages/exploration-player-page/modals/display-solution-interstitial-modal.component';
Expand All @@ -91,7 +93,6 @@ import { HintAndSolutionButtonsComponent } from './button-directives/hint-and-so


// Directives.
import { StorySummaryTileDirective } from './summary-tile/story-summary-tile.directive';
import { SubtopicSummaryTileDirective } from './summary-tile/subtopic-summary-tile.directive';


Expand Down Expand Up @@ -251,6 +252,7 @@ const toastrConfig = {
LimitToPipe,
LoadingMessageComponent,
OnScreenKeyboardComponent,
OppiaFooterComponent,
OutcomeFeedbackEditorComponent,
PreviewThumbnailComponent,
ProfileLinkImageComponent,
Expand All @@ -265,7 +267,7 @@ const toastrConfig = {
SkillMasteryViewerComponent,
StateSkillEditorComponent,
SocialButtonsComponent,
StorySummaryTileDirective,
StorySummaryTileComponent,
SubtopicSummaryTileDirective,
SummaryListHeaderComponent,
TakeBreakModalComponent,
Expand Down Expand Up @@ -319,10 +321,12 @@ const toastrConfig = {
InputResponsePairComponent,
KeyboardShortcutHelpModalComponent,
I18nLanguageSelectorComponent,
OppiaFooterComponent,
PreviewThumbnailComponent,
PromoBarComponent,
RubricsEditorComponent,
SideNavigationBarComponent,
StorySummaryTileComponent,
SideNavigationBarWrapperComponent,
SummaryListHeaderComponent,
ThumbnailDisplayComponent,
Expand Down Expand Up @@ -381,6 +385,7 @@ const toastrConfig = {
RubricsEditorComponent,
FilterForMatchingSubstringPipe,
OnScreenKeyboardComponent,
OppiaFooterComponent,
OutcomeFeedbackEditorComponent,
SideNavigationBarWrapperComponent,
StateSkillEditorComponent,
Expand All @@ -389,7 +394,7 @@ const toastrConfig = {
SharingLinksComponent,
SkillSelectorComponent,
SocialButtonsComponent,
StorySummaryTileDirective,
StorySummaryTileComponent,
SubtopicSummaryTileDirective,
SummaryListHeaderComponent,
TakeBreakModalComponent,
Expand Down
Loading

0 comments on commit ccfc515

Please sign in to comment.