Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/app/contact/contact-form/contact-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export class ContactFormComponent implements OnInit {
this.setDefaultPublishSummary();
this.setIsPublish();
this.setIssueTypeIfNecessary();
this.setAuthoringFailedDefaultsIfNecessary();
}

private obtainRunIdOrProjectIdIfNecessary(): void {
Expand Down Expand Up @@ -202,6 +203,15 @@ export class ContactFormComponent implements OnInit {
});
}

private setAuthoringFailedDefaultsIfNecessary(): void {
this.route.queryParams.subscribe((params) => {
if (params['authoringFailed']) {
this.setControlFieldValue('issueType', 'PROJECT_PROBLEMS');
this.setControlFieldValue('summary', $localize`Unit failed to load in the Authoring Tool`);
}
});
}

async submit(): Promise<Subscription> {
this.isError = false;
const recaptchaResponse = await this.getRecaptchaResponse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
</button>
</div>
<ng-template #projectTemplate let-project="project">
<button class="projectItem" mat-list-item (click)="openProject(project.id)">
<button
class="projectItem"
mat-list-item
(click)="openProject(project.id, project.runId)"
>
<span class="flex items-center justify-between gap-2">
<span class="whitespace-normal">
<span>{{ project.id }} - {{ project.name }}</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { CommonModule } from '@angular/common';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ConfigService } from '../../services/configService';
import { CopyProjectService } from '../../services/copyProjectService';
import { DialogWithCloseComponent } from '../../directives/dialog-with-close/dialog-with-close.component';
import { DialogWithSpinnerComponent } from '../../directives/dialog-with-spinner/dialog-with-spinner.component';
import { MatButtonModule } from '@angular/material/button';
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
import { MatIconModule } from '@angular/material/icon';
import { MatListModule } from '@angular/material/list';
import { MatTabsModule } from '@angular/material/tabs';
import { MatTooltipModule } from '@angular/material/tooltip';
import { Router, RouterModule } from '@angular/router';
import { scrollToTopOfPage, temporarilyHighlightElement } from '../../common/dom/dom';
import { DialogWithSpinnerComponent } from '../../directives/dialog-with-spinner/dialog-with-spinner.component';
import { ConfigService } from '../../services/configService';
import { CopyProjectService } from '../../services/copyProjectService';
import { SessionService } from '../../services/sessionService';
import { MatTabsModule } from '@angular/material/tabs';
import { MatListModule } from '@angular/material/list';

@Component({
imports: [
Expand Down Expand Up @@ -105,9 +106,44 @@ export class ProjectListComponent implements OnInit, OnDestroy {
});
}

protected openProject(projectId: number): void {
protected openProject(projectId: number, runId?: number): void {
this.showMessageInModalDialog($localize`Loading Unit...`);
this.router.navigate([`/teacher/edit/unit/${projectId}`]);
const timer = this.startLoadUnitTimer(projectId, runId);
this.router.navigate([`/teacher/edit/unit/${projectId}`]).then((navigated) => {
if (navigated) {
clearInterval(timer);
this.dialog.closeAll();
}
});
}

private startLoadUnitTimer(projectId: number, runId?: number): NodeJS.Timeout {
let seconds = 10;
return setInterval(() => {
seconds--;
if (seconds === 0) {
this.dialog.closeAll();
this.openContactPageDialog(projectId, runId);
}
}, 1000);
}

private openContactPageDialog(projectId: number, runId?: number): void {
this.dialog.open(DialogWithCloseComponent, {
data: {
title: $localize`Trouble Loading Unit`,
content: `<p>${$localize`The unit is taking longer than expected to load.`}</p>
<p><a href="${this.getContactPageLink(projectId, runId)}">${$localize`Click here to contact WISE staff.`}</a></p>`
}
});
}

private getContactPageLink(projectId: number, runId?: number): string {
let link = `${this.configService.getWISEBaseURL()}/contact?authoringFailed=true&projectId=${projectId}`;
if (runId) {
link += `&runId=${runId}`;
}
return link;
}

protected previewProject(projectId: number): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<h2 mat-dialog-title [innerHTML]="dialogData.title"></h2>
@if (dialogData.scroll) {
<div mat-dialog-content class="dialog-content-scroll" [innerHTML]="dialogData.content"></div>
}
@if (!dialogData.scroll) {
<div mat-dialog-content>
<div class="info-block" [innerHTML]="dialogData.content"></div>
</div>
@if (dialogData.content) {
@if (dialogData.scroll) {
<div mat-dialog-content class="dialog-content-scroll" [innerHTML]="dialogData.content"></div>
} @else {
<div mat-dialog-content>
<div class="info-block" [innerHTML]="dialogData.content"></div>
</div>
}
}
<mat-dialog-actions align="end">
<button mat-button mat-dialog-close i18n>Close</button>
Expand Down
82 changes: 55 additions & 27 deletions src/messages.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/directives/dialog-with-close/dialog-with-close.component.html</context>
<context context-type="linenumber">11,13</context>
<context context-type="linenumber">12,14</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/directives/dialog-with-open-in-new-window/dialog-with-open-in-new-window.component.html</context>
Expand Down Expand Up @@ -1739,7 +1739,7 @@
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.html</context>
<context context-type="linenumber">46,48</context>
<context context-type="linenumber">50,52</context>
</context-group>
</trans-unit>
<trans-unit id="4794443509874758508" datatype="html">
Expand Down Expand Up @@ -2509,55 +2509,55 @@
<source>Trouble Signing In</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">162</context>
<context context-type="linenumber">163</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">170</context>
<context context-type="linenumber">171</context>
</context-group>
</trans-unit>
<trans-unit id="6892681827231609313" datatype="html">
<source>Need Help Using WISE</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">163</context>
<context context-type="linenumber">164</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">171</context>
<context context-type="linenumber">172</context>
</context-group>
</trans-unit>
<trans-unit id="2072690839988671006" datatype="html">
<source>Problems with a WISE Unit</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">164</context>
<context context-type="linenumber">165</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">172</context>
<context context-type="linenumber">173</context>
</context-group>
</trans-unit>
<trans-unit id="2959002981630304422" datatype="html">
<source>Feedback to WISE</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">165</context>
<context context-type="linenumber">166</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">176</context>
<context context-type="linenumber">177</context>
</context-group>
</trans-unit>
<trans-unit id="8693603235657020323" datatype="html">
<source>Other</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">166</context>
<context context-type="linenumber">167</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">177</context>
<context context-type="linenumber">178</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/domain/profile.constants.ts</context>
Expand All @@ -2568,7 +2568,7 @@
<source>Student Management</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">173</context>
<context context-type="linenumber">174</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/help/faq/teacher-faq/teacher-faq.component.html</context>
Expand All @@ -2583,21 +2583,28 @@
<source>Need Help with Authoring</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">174</context>
<context context-type="linenumber">175</context>
</context-group>
</trans-unit>
<trans-unit id="6193846139411583890" datatype="html">
<source>Publish Unit</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">175</context>
<context context-type="linenumber">176</context>
</context-group>
</trans-unit>
<trans-unit id="1936787644032074292" datatype="html">
<source>Publish my unit to the WISE Community Built library</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">186</context>
<context context-type="linenumber">187</context>
</context-group>
</trans-unit>
<trans-unit id="6993881133783105369" datatype="html">
<source>Unit failed to load in the Authoring Tool</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/contact/contact-form/contact-form.component.ts</context>
<context context-type="linenumber">210</context>
</context-group>
</trans-unit>
<trans-unit id="4340256332658641886" datatype="html">
Expand Down Expand Up @@ -6096,7 +6103,7 @@
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.html</context>
<context context-type="linenumber">27,28</context>
<context context-type="linenumber">31,32</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/themes/default/notebook/edit-notebook-item-dialog/edit-notebook-item-dialog.component.html</context>
Expand Down Expand Up @@ -6402,7 +6409,7 @@
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.html</context>
<context context-type="linenumber">36,37</context>
<context context-type="linenumber">40,41</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/classroomMonitor/dataExport/export-item/export-item.component.html</context>
Expand Down Expand Up @@ -9143,7 +9150,7 @@
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.html</context>
<context context-type="linenumber">19,20</context>
<context context-type="linenumber">23,24</context>
</context-group>
</trans-unit>
<trans-unit id="3570561190371217661" datatype="html">
Expand Down Expand Up @@ -13910,42 +13917,42 @@ The branches will be removed but the steps will remain in the unit.</source>
<source>You have no units</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.html</context>
<context context-type="linenumber">48,51</context>
<context context-type="linenumber">52,55</context>
</context-group>
</trans-unit>
<trans-unit id="9063616864663648521" datatype="html">
<source>Shared Units</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.html</context>
<context context-type="linenumber">60,62</context>
<context context-type="linenumber">64,66</context>
</context-group>
</trans-unit>
<trans-unit id="7727005768668091798" datatype="html">
<source>You have no shared units</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.html</context>
<context context-type="linenumber">62,65</context>
<context context-type="linenumber">66,69</context>
</context-group>
</trans-unit>
<trans-unit id="5269484094677699060" datatype="html">
<source>Copying Unit...</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.ts</context>
<context context-type="linenumber">62</context>
<context context-type="linenumber">63</context>
</context-group>
</trans-unit>
<trans-unit id="5317921744918848185" datatype="html">
<source>There was an error copying this unit. Please contact WISE staff.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.ts</context>
<context context-type="linenumber">69</context>
<context context-type="linenumber">70</context>
</context-group>
</trans-unit>
<trans-unit id="4550129747596313114" datatype="html">
<source> (Run ID: <x id="PH" equiv-text="project.runId"/>)</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.ts</context>
<context context-type="linenumber">84</context>
<context context-type="linenumber">85</context>
</context-group>
</trans-unit>
<trans-unit id="5435676366729047906" datatype="html">
Expand All @@ -13954,14 +13961,35 @@ The branches will be removed but the steps will remain in the unit.</source>
<x id="PH" equiv-text="projectInfo"/></source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.ts</context>
<context context-type="linenumber">86</context>
<context context-type="linenumber">87</context>
</context-group>
</trans-unit>
<trans-unit id="1460984918484282139" datatype="html">
<source>Loading Unit...</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.ts</context>
<context context-type="linenumber">109</context>
<context context-type="linenumber">110</context>
</context-group>
</trans-unit>
<trans-unit id="8572680220219165444" datatype="html">
<source>Trouble Loading Unit</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.ts</context>
<context context-type="linenumber">134</context>
</context-group>
</trans-unit>
<trans-unit id="6848192494939890612" datatype="html">
<source>The unit is taking longer than expected to load.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.ts</context>
<context context-type="linenumber">135</context>
</context-group>
</trans-unit>
<trans-unit id="780109974941677602" datatype="html">
<source>Click here to contact WISE staff.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-list/project-list.component.ts</context>
<context context-type="linenumber">136</context>
</context-group>
</trans-unit>
<trans-unit id="1278268521087394642" datatype="html">
Expand Down