Skip to content

Commit

Permalink
Merge branch 'release-5.18.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokiterashima committed Nov 17, 2020
2 parents 78ada2b + c668d86 commit 9e00e9c
Show file tree
Hide file tree
Showing 66 changed files with 844 additions and 573 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wise",
"version": "5.18.3",
"version": "5.18.4",
"description": "Web-based Inquiry Science Environment",
"main": "app.js",
"browserslist": [
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<artifactId>wise</artifactId>
<packaging>war</packaging>
<name>Web-based Inquiry Science Environment</name>
<version>5.18.3</version>
<version>5.18.4</version>
<url>http://wise5.org</url>
<licenses>
<license>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ protected HashMap<String, Object> getConfig(HttpServletRequest request) {
config.put("isGoogleClassroomEnabled", isGoogleClassroomEnabled());
config.put("logOutURL", contextPath + "/logout");
config.put("recaptchaPublicKey", appProperties.get("recaptcha_public_key"));
config.put("wiseHostname", appProperties.get("wise.hostname"));
config.put("wise4Hostname", appProperties.get("wise4.hostname"));
return config;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.18.3
5.18.4
3 changes: 3 additions & 0 deletions src/main/webapp/site/src/app/common-hybrid-angular.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatSelectModule } from '@angular/material/select';
import { HelpIconComponent } from '../../../wise5/themes/default/themeComponents/helpIcon/help-icon.component';
import { NodeStatusIcon } from '../../../wise5/themes/default/themeComponents/nodeStatusIcon/node-status-icon.component';
import { MomentModule } from 'ngx-moment';

@Component({template: ``})
export class EmptyComponent {}
Expand All @@ -75,6 +76,7 @@ export class EmptyComponent {}
MatListModule,
MatSelectModule,
MatTooltipModule,
MomentModule,
ReactiveFormsModule,
RouterModule.forChild([
{path: '**', component: EmptyComponent}
Expand Down Expand Up @@ -127,6 +129,7 @@ export class EmptyComponent {}
MatListModule,
MatSelectModule,
MatTooltipModule,
MomentModule,
NodeIconComponent,
ReactiveFormsModule
]
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/site/src/app/domain/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ export class Config {
recaptchaPublicKey?: string;
logOutURL: string;
currentTime: number;
wiseHostname?: string;
wise4Hostname?: string;
}
4 changes: 0 additions & 4 deletions src/main/webapp/site/src/app/features/features.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,3 @@
margin-left: -16%;
}
}

.mat-divider {
margin: 16px 0;
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { Component, OnInit, Inject } from '@angular/core';
import { Component, Inject } from '@angular/core';
import { LibraryProjectDetailsComponent } from "../library-project-details/library-project-details.component";
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import { finalize } from 'rxjs/operators';
import { LibraryProject } from "../libraryProject";
import { LibraryService } from "../../../services/library.service";
import { MatSnackBar } from '@angular/material/snack-bar';
import { Subscription } from 'rxjs';

@Component({
selector: 'app-copy-project-dialog',
templateUrl: './copy-project-dialog.component.html',
styleUrls: ['./copy-project-dialog.component.scss']
})
export class CopyProjectDialogComponent implements OnInit {
export class CopyProjectDialogComponent {

isCopying: boolean = false;

Expand All @@ -20,15 +21,11 @@ export class CopyProjectDialogComponent implements OnInit {
@Inject(MAT_DIALOG_DATA) public data: any,
private libraryService: LibraryService,
private snackBar: MatSnackBar) {

this.libraryService.newProjectSource$.subscribe(() => {
this.dialog.closeAll();
});
}

ngOnInit() {
}

copy() {
this.isCopying = true;
this.libraryService.copyProject(this.data.project.id)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core';
import { Component, Input } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { Project } from '../../../domain/project';
import { TeacherService } from '../../../teacher/teacher.service';
Expand All @@ -13,7 +13,7 @@ import { EditRunWarningDialogComponent } from '../../../teacher/edit-run-warning
templateUrl: './library-project-menu.component.html',
styleUrls: ['./library-project-menu.component.scss']
})
export class LibraryProjectMenuComponent implements OnInit {
export class LibraryProjectMenuComponent {
@Input()
project: Project;

Expand All @@ -27,10 +27,10 @@ export class LibraryProjectMenuComponent implements OnInit {
isChild: boolean = false;

constructor(
public dialog: MatDialog,
public teacherService: TeacherService,
public userService: UserService,
public configService: ConfigService
private dialog: MatDialog,
private teacherService: TeacherService,
private userService: UserService,
private configService: ConfigService
) {}

ngOnInit() {
Expand Down Expand Up @@ -59,10 +59,7 @@ export class LibraryProjectMenuComponent implements OnInit {
}

copyProject() {
this.dialog.open(CopyProjectDialogComponent, {
data: { project: this.project },
panelClass: 'mat-dialog--sm'
});
this.teacherService.copyProject(this.project, this.dialog);
}

editProject() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
margin-right: 8px;
}
}

.mat-divider {
margin: 0;
}
}

.library__header {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { LibraryProject } from "../libraryProject";
import { LibraryService } from "../../../services/library.service";
import { LibraryComponent } from "../library/library.component";
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Subscription } from 'rxjs';

@Component({
selector: 'app-personal-library',
Expand All @@ -15,20 +16,27 @@ export class PersonalLibraryComponent extends LibraryComponent {
filteredProjects: LibraryProject[] = [];
personalProjects: LibraryProject[] = [];
sharedProjects: LibraryProject[] = [];
personalLibraryProjectsSourceSubscription: Subscription;
sharedLibraryProjectsSourceSubscription: Subscription;
newProjectSourceSubscription: Subscription;

constructor(libraryService: LibraryService, public dialog: MatDialog) {
constructor(libraryService: LibraryService, private dialog: MatDialog) {
super(libraryService);
this.libraryService = libraryService;
}

this.libraryService.personalLibraryProjectsSource$.subscribe((personalProjects: LibraryProject[]) => {
ngOnInit() {
this.personalLibraryProjectsSourceSubscription =
this.libraryService.personalLibraryProjectsSource$.subscribe((personalProjects: LibraryProject[]) => {
this.personalProjects = personalProjects;
this.updateProjects();
});
this.libraryService.sharedLibraryProjectsSource$.subscribe((sharedProjects: LibraryProject[]) => {
this.sharedLibraryProjectsSourceSubscription =
this.libraryService.sharedLibraryProjectsSource$.subscribe((sharedProjects: LibraryProject[]) => {
this.sharedProjects = sharedProjects;
this.updateProjects();
});
this.libraryService.newProjectSource$.subscribe(project => {
this.newProjectSourceSubscription = this.libraryService.newProjectSource$.subscribe(project => {
if (project) {
project.isHighlighted = true;
this.projects.unshift(project);
Expand All @@ -37,7 +45,10 @@ export class PersonalLibraryComponent extends LibraryComponent {
});
}

ngOnInit() {
ngOnDestroy() {
this.personalLibraryProjectsSourceSubscription.unsubscribe();
this.sharedLibraryProjectsSourceSubscription.unsubscribe();
this.newProjectSourceSubscription.unsubscribe();
}

combinePersonalAndSharedProjects() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ <h2 class="mat-dialog-title" i18n>Share Unit</h2>
<p class="mat-subheading-1 accent-1">
{{ project.name }} <span class="mat-caption" i18n>(Unit ID: {{ project.id }})</span>
</p>
<p><strong i18n>Sharing a curriculum unit allows other WISE teachers to use it with their own students and optionally edit the unit's content.</strong></p>
<p i18n>Shared units appear in a teacher's "My Units" library.</p>
<mat-divider></mat-divider>
<mat-form-field appearance="fill">
<mat-label i18n>Enter teacher username</mat-label>
<mat-label i18n>Find a teacher</mat-label>
<mat-icon matPrefix>search</mat-icon>
<input id="share-project-dialog-search"
type="text"
Expand Down
4 changes: 4 additions & 0 deletions src/main/webapp/site/src/app/services/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ export class ConfigService {
return this.config$.getValue().recaptchaPublicKey;
}

getWISEHostname() {
return this.config$.getValue().wiseHostname;
}

getWISE4Hostname() {
return this.config$.getValue().wise4Hostname;
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/webapp/site/src/app/student-hybrid-angular.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ import { MatButtonModule } from '@angular/material/button';
import { MatListModule } from '@angular/material/list';
import { DataService } from './services/data.service';
import { AngularJSModule } from './common-hybrid-angular.module';
import { ComponentAnnotationsComponent } from '../../../wise5/directives/componentAnnotations/component-annotations.component';
import { MomentModule } from 'ngx-moment';

@NgModule({
declarations: [
ComponentAnnotationsComponent,
PossibleScoreComponent
],
imports: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,6 @@ <h2 class="mat-dialog-title" i18n>Team Sign In</h2>
</mat-dialog-content>
<mat-dialog-actions fxLayoutAlign="end" fxLayoutGap="8px">
<button mat-button mat-dialog-close i18n>Cancel</button>
<button mat-flat-button (click)="launchRun()" [disabled]="!isCanLaunch()" i18n>Launch Unit</button>
<button mat-flat-button color="primary" (click)="launchRun()" [disabled]="!isCanLaunch()"
i18n>Launch Unit</button>
</mat-dialog-actions>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
display: block !important;
}

.mat-divider {
margin: 16px 0 16px;
}

.mat-form-field {
display: block;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/webapp/site/src/app/teacher-hybrid-angular.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { StatusIconComponent } from './classroom-monitor/status-icon/status-icon
import { AngularJSModule } from './common-hybrid-angular.module';
import { NodeAdvancedJsonAuthoringComponent } from '../../../wise5/authoringTool/node/advanced/json/node-advanced-json-authoring.component';
import { WorkgroupInfoComponent } from '../../../wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroupInfo/workgroup-info.component';
import { NodeAdvancedGeneralAuthoringComponent } from '../../../wise5/authoringTool/node/advanced/general/node-advanced-general-authoring.component';

@NgModule({
declarations: [
Expand All @@ -37,6 +38,7 @@ import { WorkgroupInfoComponent } from '../../../wise5/classroomMonitor/classroo
ComponentNewWorkBadgeComponent,
ManageStudentsComponent,
MilestoneReportDataComponent,
NodeAdvancedGeneralAuthoringComponent,
NodeAdvancedJsonAuthoringComponent,
StatusIconComponent,
WorkgroupInfoComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.mat-divider {
margin: 20px 0 16px;
}

.period-select {
margin-right: 24px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
'~style/abstracts/variables',
'~style/abstracts/mixins';

.mat-divider {
margin: 20px 0 16px;
}

h2 {
.mat-icon {
@include mat-icon-size(mat-font-size($config, display-1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@
<span i18n>Unit Info</span>
</a>
<a mat-menu-item (click)="shareRun()" *ngIf="canShare() && run.project.wiseVersion !== 4">
<mat-icon>share</mat-icon>
<span i18n>Share</span>
</a>
<a mat-menu-item (click)="checkClassroomAuthorization()"
*ngIf="isGoogleUser() && isGoogleClassroomEnabled() && !isRunCompleted() && run.project.wiseVersion !== 4">
<mat-icon svgIcon="google-classroom"></mat-icon>
<span i18n>Share to Google Classroom</span>
<mat-icon>supervised_user_circle</mat-icon>
<span i18n>Share Access</span>
</a>
<a mat-menu-item (click)="editContent()" *ngIf="canEdit() && run.project.wiseVersion !== 4">
<mat-icon>edit</mat-icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { TeacherRun } from '../teacher-run';
import { ConfigService } from '../../services/config.service';
import { RunSettingsDialogComponent } from '../run-settings-dialog/run-settings-dialog.component';
import { EditRunWarningDialogComponent } from '../edit-run-warning-dialog/edit-run-warning-dialog.component';
import { ListClassroomCoursesDialogComponent } from '../list-classroom-courses-dialog/list-classroom-courses-dialog.component';
import { Router } from '@angular/router';

@Component({
Expand Down Expand Up @@ -45,36 +44,6 @@ export class RunMenuComponent implements OnInit {
});
}

checkClassroomAuthorization() {
this.teacherService
.getClassroomAuthorizationUrl(this.userService.getUser().getValue().username)
.subscribe(({ authorizationUrl }) => {
if (authorizationUrl == null) {
this.getClassroomCourses();
} else {
const authWindow = window.open(authorizationUrl, 'authorize', 'width=600,height=800');
const timer = setInterval(() => {
if (authWindow.closed) {
clearInterval(timer);
this.checkClassroomAuthorization();
}
}, 1000);
}
});
}

getClassroomCourses() {
this.teacherService
.getClassroomCourses(this.userService.getUser().getValue().username)
.subscribe(courses => {
const panelClass = courses.length ? 'mat-dialog--md' : '';
this.dialog.open(ListClassroomCoursesDialogComponent, {
data: { run: this.run, courses },
panelClass: panelClass
});
});
}

showUnitDetails() {
const project = this.run.project;
this.dialog.open(LibraryProjectDetailsComponent, {
Expand All @@ -95,14 +64,6 @@ export class RunMenuComponent implements OnInit {
return this.run.isOwner(this.userService.getUserId());
}

isGoogleUser() {
return this.userService.isGoogleUser();
}

isGoogleClassroomEnabled() {
return this.configService.isGoogleClassroomEnabled();
}

isRunCompleted() {
return this.run.isCompleted(this.configService.getCurrentServerTime());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.mat-divider {
margin: 20px 0 16px;
}

.info-block {
margin-bottom: 16px;
padding: 4px;
Expand Down
Loading

0 comments on commit 9e00e9c

Please sign in to comment.