This repository has been archived by the owner on Jul 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(uploader): handle compilation errors, make log downloadable (fixes
#117)
- Loading branch information
1 parent
6a2f937
commit ac8dc9e
Showing
11 changed files
with
106 additions
and
8 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
src/app/editor/uploader/uploader-compilation-error/uploader-compilation-error.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<h1 mat-dialog-title>Compilation Error</h1> | ||
<div mat-dialog-content> | ||
<p>We ran into a problem compiling your controls. You can <a class="body-link" (click)="saveConsole()">save the compilation output</a>, which should contain more details about what went wrong.</p> | ||
</div> | ||
<div mat-dialog-actions> | ||
<span class="flex-fill"></span> | ||
<button mat-button (click)="dialogRef.close()" cdkFocusInitial>Close</button> | ||
</div> |
29 changes: 29 additions & 0 deletions
29
src/app/editor/uploader/uploader-compilation-error/uploader-compilation-error.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
import { Store } from '@ngrx/store'; | ||
|
||
import { MatDialogRef } from '@angular/material'; | ||
import * as fromRoot from '../../bedrock.reducers'; | ||
import * as forUploader from '../uploader.actions'; | ||
|
||
/** | ||
* Presented after uploading has compelted. | ||
*/ | ||
@Component({ | ||
selector: 'uploader-compilation-error', | ||
templateUrl: './uploader-compilation-error.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
styles: [':host { max-width: 500px; display: block }'], | ||
}) | ||
export class UploaderCompilationErrorComponent { | ||
constructor( | ||
private readonly store: Store<fromRoot.IState>, | ||
public readonly dialogRef: MatDialogRef<any>, | ||
) {} | ||
|
||
/** | ||
* Saves the data the webpack console emitted. | ||
*/ | ||
public saveConsole() { | ||
this.store.dispatch(new forUploader.SaveConsoleOutput()); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
src/app/editor/uploader/uploader-completed/uploader-completed.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters