-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tree based import UI, import NOT YET WORKING
- Loading branch information
Showing
10 changed files
with
265 additions
and
37 deletions.
There are no files selected for viewing
6 changes: 5 additions & 1 deletion
6
frontend/src/app/shared/upload-json-button/upload-json-button.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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
<button mat-button (click)="fileInput.click()"> | ||
<button *ngIf="!inline" mat-button (click)="fileInput.click()"> | ||
<mat-icon style="vertical-align: middle">cloud_upload</mat-icon> {{ name }} | ||
</button> | ||
|
||
<button *ngIf="inline" mat-button (click)="fileInput.click()"> | ||
<mat-icon>cloud_upload</mat-icon> {{ name }} | ||
</button> | ||
<input type="file" hidden #fileInput id="fileInput" name="fileInput" (change)="onFileSelected()" /> |
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
9 changes: 9 additions & 0 deletions
9
.../template-builder/components/template-import-dialog/template-import-dialog.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,9 @@ | ||
<h1 mat-dialog-title>Import {{title()}}</h1> | ||
<div mat-dialog-content> | ||
<app-template-import-tree #templateImportTree [templates]="data.templates" [branches]="data.branches"> | ||
</app-template-import-tree> | ||
</div> | ||
<div mat-dialog-actions> | ||
<button mat-button (click)="close()">Cancel</button> | ||
<button mat-button (click)="save()" cdkfocusinitial>Import</button> | ||
</div> |
Empty file.
56 changes: 56 additions & 0 deletions
56
...te/template-builder/components/template-import-dialog/template-import-dialog.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,56 @@ | ||
import { Component, Inject, ViewChild } from "@angular/core"; | ||
import { ApiEvaluationTemplate } from "../../../../../../openapi"; | ||
import { TemplateImportTreeBranch, TemplateImportTreeComponent } from "../template-import-tree/template-import-tree.component"; | ||
import { MAT_DIALOG_DATA, MatDialogRef } from "@angular/material/dialog"; | ||
|
||
export interface TemplateImportDialogData{ | ||
templates: ApiEvaluationTemplate[]; | ||
branches: TemplateImportTreeBranch; | ||
} | ||
|
||
@Component({ | ||
selector: 'app-template-import-dialog', | ||
templateUrl: './template-import-dialog.component.html', | ||
styleUrls: ['./template-import-dialog.component.scss'] | ||
}) | ||
export class TemplateImportDialogComponent { | ||
|
||
@ViewChild('templateImportTree',{static: true}) importTree: TemplateImportTreeComponent | ||
|
||
constructor( | ||
public dialogRef: MatDialogRef<TemplateImportDialogComponent>, | ||
@Inject(MAT_DIALOG_DATA) public data: TemplateImportDialogData | ||
) { | ||
} | ||
|
||
title(){ | ||
switch(this.data.branches){ | ||
case TemplateImportTreeBranch.NONE: | ||
return "---NONE -- Programmer's Error---"; | ||
case TemplateImportTreeBranch.TASK_TYPES: | ||
return "Task Types" | ||
case TemplateImportTreeBranch.TASK_GROUPS: | ||
return "Task Groups" | ||
case TemplateImportTreeBranch.TASK_TEMPLATES: | ||
return "Task Templates" | ||
case TemplateImportTreeBranch.TEAMS: | ||
return "Teams" | ||
case TemplateImportTreeBranch.TEAM_GROUPS: | ||
return "Team Groups" | ||
case TemplateImportTreeBranch.JUDGES: | ||
return "Judges" | ||
case TemplateImportTreeBranch.ALL: | ||
return "Evaluation Templates" | ||
} | ||
} | ||
|
||
public save(){ | ||
this.dialogRef.close(this.importTree.getImportTemplate()) | ||
} | ||
|
||
public close(){ | ||
this.dialogRef.close(); | ||
} | ||
|
||
|
||
} |
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
Oops, something went wrong.