+ +
  • diff --git a/src/app/home/home.module.ts b/src/app/home/home.module.ts index 358bc25a4a..0c545ac7b2 100644 --- a/src/app/home/home.module.ts +++ b/src/app/home/home.module.ts @@ -15,6 +15,8 @@ import { PlanetDialogsModule } from '../shared/dialogs/planet-dialogs.module'; import { DashboardTileComponent } from '../dashboard/dashboard-tile.component'; import { NotificationsComponent } from '../notifications/notifications.component'; +import { PulsateIconDirective } from './pulsate-icon.directive'; + @NgModule({ imports: [ HomeRouterModule, @@ -33,7 +35,8 @@ import { NotificationsComponent } from '../notifications/notifications.component CommunityComponent, NationComponent, DashboardTileComponent, - NotificationsComponent + NotificationsComponent, + PulsateIconDirective ] }) export class HomeModule {} diff --git a/src/app/home/home.scss b/src/app/home/home.scss index 98465f1b01..d84323a38d 100644 --- a/src/app/home/home.scss +++ b/src/app/home/home.scss @@ -7,6 +7,33 @@ grid-template-areas: "header" "main"; height: 100vh; + mat-sidenav li { + a { + border-radius: 0; + } + + // takes the left sidenav and alters color of text, background and svg-fill on .active class + a.active { + background-color: $primary-text; + color: $primary; + transition: background-color 0.5s cubic-bezier(0, 0, 0.2, 1), + color 0.5s cubic-bezier(0, 0, 0.2, 1); // Linear out, slow in; + .mat-button-focus-overlay { + background-color: rgba(0, 0, 0, 0.06); + transition: background-color 1s ease-in; + } + } + + // Animates pulsating icon when navbar link clicked + a.pulsate mat-icon { + animation: pulsate 1000ms linear alternate-reverse infinite; + } + } + + @keyframes pulsate { + 100% { transform: scale(1.1) } + } + .header-nav { grid-area: header; position: relative; @@ -73,6 +100,7 @@ padding: 0 24px; label { + cursor: pointer; margin: 0 24px; } } diff --git a/src/app/home/pulsate-icon.directive.ts b/src/app/home/pulsate-icon.directive.ts new file mode 100644 index 0000000000..f636c64ed1 --- /dev/null +++ b/src/app/home/pulsate-icon.directive.ts @@ -0,0 +1,23 @@ +import { Directive, HostBinding, HostListener } from '@angular/core'; +import { timer } from 'rxjs/observable/timer'; + +@Directive({ + selector: '[planetPulsateIcon]' +}) +export class PulsateIconDirective { + + constructor() {} + + @HostBinding('class.pulsate') isPulsating = false; + + // On click, set class to pulsate for one second + // pulsate class triggers a one second animation (which will repeat if not removed) + @HostListener('click') onClick() { + this.isPulsating = true; + const sub = timer(1000).subscribe(() => { + this.isPulsating = false; + sub.unsubscribe(); + }); + } + +} From 0a519232cb78aeebd02ee8237a0a5e9f45800b82 Mon Sep 17 00:00:00 2001 From: Sahil Phule Date: Mon, 21 May 2018 15:29:03 -0500 Subject: [PATCH 27/64] update ubuntu package list (#1030) --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 515008911a..7fdd4502c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,7 @@ branches: - l10n_master addons: apt: + update: true packages: - docker-ce env: From d602c7c4502bf4fcb74b6fe7699b19d5dbf43578 Mon Sep 17 00:00:00 2001 From: dogi Date: Mon, 21 May 2018 16:29:45 -0400 Subject: [PATCH 28/64] Use treehouses/couchdb:2.1.1 (#1031) --- .travis/planet-travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/planet-travis.yml b/.travis/planet-travis.yml index 117c69d017..98b9ca4a8c 100644 --- a/.travis/planet-travis.yml +++ b/.travis/planet-travis.yml @@ -2,7 +2,7 @@ services: couchdb: expose: - 5984 - image: couchdb:2.1.1 + image: treehouses/couchdb:2.1.1 ports: - "5984:5984" - "5986:5986" From 39c2397bd983392d78c9046c3b04b0755fbf7961 Mon Sep 17 00:00:00 2001 From: Machhindra Neupane Date: Tue, 22 May 2018 05:03:00 +0545 Subject: [PATCH 29/64] Change add course text (fixes #1013) (#1017) --- src/app/exams/exams-add.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/exams/exams-add.component.html b/src/app/exams/exams-add.component.html index 4853054b46..218d024384 100644 --- a/src/app/exams/exams-add.component.html +++ b/src/app/exams/exams-add.component.html @@ -4,7 +4,7 @@
    @@ -26,9 +34,12 @@ export class ManagerDashboardComponent implements OnInit { displayDashboard = true; message = ''; planetType = this.userService.getConfig().planetType; + showResendConfiguration = false; constructor( - private userService: UserService + private userService: UserService, + private couchService: CouchService, + private planetMessageService: PlanetMessageService ) {} ngOnInit() { @@ -38,6 +49,39 @@ export class ManagerDashboardComponent implements OnInit { this.displayDashboard = false; this.message = 'Access restricted to admins'; } + // Check parent if configuration exists + this.couchService.post(`communityregistrationrequests/_find`, findOneDocument('name', this.userService.get().name), + { domain: this.userService.getConfig().parentDomain }).subscribe((data: any) => { + if (data.docs.length === 0) { + this.showResendConfiguration = true; + } + }); + } + + resendConfig() { + const { _id, _rev, ...config } = this.userService.getConfig(); + const { _rev: userRev, ...userDetail } = this.userService.get(); + return this.couchService.post('communityregistrationrequests', config, { domain: this.userService.getConfig().parentDomain }) + .pipe(switchMap((res: any) => { + userDetail.requestId = res.id; + return this.couchService.post(`_users/_find`, + { 'selector': { '_id': userDetail._id }, 'fields': [ '_id', '_rev' ] }, + { domain: this.userService.getConfig().parentDomain }); + }), switchMap((user) => { + if (user.docs[0]) { + userDetail._rev = user.docs[0]._rev; + } + userDetail.isUserAdmin = false; + return forkJoin([ + this.couchService.put('_users/org.couchdb.user:' + userDetail.name, + userDetail, { domain: this.userService.getConfig().parentDomain }), + this.couchService.put('shelf/org.couchdb.user:' + userDetail.name, + {}, { domain: this.userService.getConfig().parentDomain }) + ]); + })).subscribe((res: any) => { + this.planetMessageService.showMessage('Registration request has been sent successfully.'); + this.showResendConfiguration = false; + }, error => this.planetMessageService.showAlert('An error occurred please try again.')); } } From fb0afd62d7e0810f7b5153229470c6ce751acc3e Mon Sep 17 00:00:00 2001 From: Rupesh87 Date: Tue, 22 May 2018 05:57:04 +0545 Subject: [PATCH 31/64] Exam and resource buttons on step in course view (fixes #989) (#1009) --- .../courses/view-courses/courses-view.component.html | 4 ++++ .../courses/view-courses/courses-view.component.ts | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/app/courses/view-courses/courses-view.component.html b/src/app/courses/view-courses/courses-view.component.html index 8c781ca75e..fc7b331dd2 100644 --- a/src/app/courses/view-courses/courses-view.component.html +++ b/src/app/courses/view-courses/courses-view.component.html @@ -36,6 +36,10 @@ {{step.description}} + + View Resource + Take exam +
    diff --git a/src/app/courses/view-courses/courses-view.component.ts b/src/app/courses/view-courses/courses-view.component.ts index 622751cb23..cb412c8433 100644 --- a/src/app/courses/view-courses/courses-view.component.ts +++ b/src/app/courses/view-courses/courses-view.component.ts @@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common'; import { UserService } from '../../shared/user.service'; import { CoursesService } from '../courses.service'; import { Subject } from 'rxjs/Subject'; +import { environment } from '../../../environments/environment'; @Component({ templateUrl: './courses-view.component.html', @@ -62,4 +63,14 @@ export class CoursesViewComponent implements OnInit, OnDestroy { this.router.navigate([ './step/1' ], { relativeTo: this.route }); } + goToExam(stepNum) { + this.router.navigate([ './step/' + (stepNum + 1) + '/exam', 1 ], { relativeTo: this.route }); + } + + resourceUrl(stepDetail) { + if (Object.keys(stepDetail.attachment.doc._attachments)[0]) { + const filename = stepDetail.openWhichFile || Object.keys(stepDetail.attachment.doc._attachments)[0]; + return environment.couchAddress + 'resources/' + stepDetail.attachment.doc._id + '/' + filename; + } + } } From d64527d4062faf20aca5caa544a5d4a6c770ecdd Mon Sep 17 00:00:00 2001 From: Jingting Chen Date: Mon, 21 May 2018 19:38:08 -0500 Subject: [PATCH 32/64] Special characters not start username or planet name (fixes #959) (#979) --- src/app/configuration/configuration.component.ts | 5 +++-- src/app/login/login-form.component.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/configuration/configuration.component.ts b/src/app/configuration/configuration.component.ts index 0c56c248d1..32dfbd155d 100644 --- a/src/app/configuration/configuration.component.ts +++ b/src/app/configuration/configuration.component.ts @@ -45,7 +45,7 @@ export class ConfigurationComponent implements OnInit { ngOnInit() { this.loginForm = this.formBuilder.group({ - name: [ '', [ Validators.required, Validators.pattern(/^[a-z0-9_.-]+$/i) ] ], + name: [ '', [ Validators.required, Validators.pattern(/^[A-Za-z0-9][a-z0-9_.-]+$/i) ] ], password: [ '', Validators.compose([ @@ -66,7 +66,8 @@ export class ConfigurationComponent implements OnInit { localDomain: this.defaultLocal, name: [ '', - Validators.required, + [ Validators.required, + Validators.pattern(/^[A-Za-z0-9]/i) ], this.parentUniqueValidator('name') ], parentDomain: [ '', Validators.required ], diff --git a/src/app/login/login-form.component.ts b/src/app/login/login-form.component.ts index ced5d87edf..f98146a341 100644 --- a/src/app/login/login-form.component.ts +++ b/src/app/login/login-form.component.ts @@ -43,7 +43,7 @@ export class LoginFormComponent { private planetMessageService: PlanetMessageService, private validatorService: ValidatorService ) { - registerForm.name = [ '', [ Validators.required, Validators.pattern(/^[a-z0-9_.-]+$/i) ], + registerForm.name = [ '', [ Validators.required, Validators.pattern(/^[A-Za-z0-9][a-z0-9_.-]+$/i) ], ac => this.validatorService.isUnique$('_users', 'name', ac, {}) ]; const formObj = this.createMode ? registerForm : loginForm; this.userForm = this.formBuilder.group(formObj); From 16e3235840ffa06e7486403d1a34892d0ed3eed3 Mon Sep 17 00:00:00 2001 From: Machhindra Neupane Date: Tue, 22 May 2018 06:28:01 +0545 Subject: [PATCH 33/64] Fix FeedbackView Chrome scroll issue (fixes #948) (#984) --- src/app/feedback/feedback-view.component.html | 4 ++-- src/app/feedback/feedback-view.component.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/feedback/feedback-view.component.html b/src/app/feedback/feedback-view.component.html index 26d2a09c4c..65cd7575c8 100644 --- a/src/app/feedback/feedback-view.component.html +++ b/src/app/feedback/feedback-view.component.html @@ -32,12 +32,12 @@
    -
    +

    {{message.user}}

    {{message.time | date:'MMM d, y h:mm a'}}

    -
    {{message.message}}
    +
    {{message.message}}
    diff --git a/src/app/feedback/feedback-view.component.ts b/src/app/feedback/feedback-view.component.ts index cfd716a186..3b7c854051 100644 --- a/src/app/feedback/feedback-view.component.ts +++ b/src/app/feedback/feedback-view.component.ts @@ -107,4 +107,8 @@ export class FeedbackViewComponent implements OnInit, OnDestroy { this.chatListElement.nativeElement.scrollTo({ top: this.chatListElement.nativeElement.scrollHeight, behavior: 'smooth' }); } + feedbackTrackByFn(index, item) { + return item._id; + } + } From d20ce4ca6523a9640e134421cf3e5871b8ff2434 Mon Sep 17 00:00:00 2001 From: Laxman Maharjan Date: Tue, 22 May 2018 06:37:17 +0545 Subject: [PATCH 34/64] Parent online status (connects #998) (#1008) --- src/app/login/login.component.html | 1 + src/app/login/login.component.ts | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/app/login/login.component.html b/src/app/login/login.component.html index a2249801e0..04c024a329 100644 --- a/src/app/login/login.component.html +++ b/src/app/login/login.component.html @@ -5,6 +5,7 @@

    Planet Learning

    Version {{ version }}

    + {online, select, on {Connected} off {Offline}}