diff --git a/src/app/components/projects/import-project-dialog/import-project-confirmation-dialog/import-project-confirmation-dialog.component.html b/src/app/components/projects/import-project-dialog/import-project-confirmation-dialog/import-project-confirmation-dialog.component.html index 10cac4c9..6d10a1db 100644 --- a/src/app/components/projects/import-project-dialog/import-project-confirmation-dialog/import-project-confirmation-dialog.component.html +++ b/src/app/components/projects/import-project-dialog/import-project-confirmation-dialog/import-project-confirmation-dialog.component.html @@ -1,8 +1,8 @@ {{confirmationMessage}} -
+
-
+
diff --git a/src/app/components/projects/import-project-dialog/import-project-dialog.component.css b/src/app/components/projects/import-project-dialog/import-project-dialog.component.css index b47db760..6d26582e 100644 --- a/src/app/components/projects/import-project-dialog/import-project-dialog.component.css +++ b/src/app/components/projects/import-project-dialog/import-project-dialog.component.css @@ -4,24 +4,26 @@ .file-button{ height: 50px; - width: 120px; + width: 20%; margin-top: 10px; + padding: 0px; } .file-name-form { float: right; + width: 100%; } .file-name-form-field { - margin-left: 10px; - margin-right: 10px; - width:250px; + margin-left: 5%; + width: 65%; } .delete-button { background: transparent; border: none; - outline: 0 + outline: 0; + width: 10%; } .delete-icon { @@ -30,4 +32,9 @@ .result-message-box { margin-top: 10px; + text-align: center; +} + +.progress-bar { + background-color : #0097a7; } diff --git a/src/app/components/projects/import-project-dialog/import-project-dialog.component.html b/src/app/components/projects/import-project-dialog/import-project-dialog.component.html index b27d2c13..99fe4238 100644 --- a/src/app/components/projects/import-project-dialog/import-project-dialog.component.html +++ b/src/app/components/projects/import-project-dialog/import-project-dialog.component.html @@ -2,32 +2,32 @@
- -
+ + Project name is required Project name is incorrect - -
+ +
-
+
-
+
{{resultMessage}}
-
+
diff --git a/src/app/components/projects/import-project-dialog/import-project-dialog.component.spec.ts b/src/app/components/projects/import-project-dialog/import-project-dialog.component.spec.ts index e89c30fd..5c32d7e1 100644 --- a/src/app/components/projects/import-project-dialog/import-project-dialog.component.spec.ts +++ b/src/app/components/projects/import-project-dialog/import-project-dialog.component.spec.ts @@ -205,4 +205,31 @@ describe('ImportProjectDialogComponent', () => { expect(component.openConfirmationDialog).toHaveBeenCalled(); }); + + it('should show delete button after selecting project', () => { + let fileItem = new FileItem(fileSelectDirective.uploader, new File([],"fileName"),{}); + fileSelectDirective.uploader.queue.push(fileItem); + let event = { + target: { + files: [ {name : "uploadedFile"} ] + } + }; + component.uploadProjectFile(event); + + expect(component.isDeleteVisible).toBe(true); + }); + + it('should hide delete button after deselecting project', () => { + let fileItem = new FileItem(fileSelectDirective.uploader, new File([],"fileName"),{}); + fileSelectDirective.uploader.queue.push(fileItem); + let event = { + target: { + files: [ {name : "uploadedFile"} ] + } + }; + component.uploadProjectFile(event); + component.onDeleteClick(); + + expect(component.isDeleteVisible).toBe(false); + }); }); diff --git a/src/app/components/projects/import-project-dialog/import-project-dialog.component.ts b/src/app/components/projects/import-project-dialog/import-project-dialog.component.ts index e2ff62f1..9995299b 100644 --- a/src/app/components/projects/import-project-dialog/import-project-dialog.component.ts +++ b/src/app/components/projects/import-project-dialog/import-project-dialog.component.ts @@ -11,7 +11,7 @@ import { ServerResponse } from '../../../models/serverResponse'; export class Validator { static projectNameValidator(projectName) { - var pattern = new RegExp(/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/); + var pattern = new RegExp(/[~`!#$%\^&*+=\[\]\\';,/{}|\\":<>\?]/); if(!pattern.test(projectName.value)) { return null; @@ -31,6 +31,7 @@ export class ImportProjectDialogComponent implements OnInit { server : Server; isImportEnabled : boolean = false; isFinishEnabled : boolean = false; + isDeleteVisible : boolean = false; resultMessage : string = "The project is being imported... Please wait"; projectNameForm: FormGroup; submitted: boolean = false; @@ -71,6 +72,7 @@ export class ImportProjectDialogComponent implements OnInit { uploadProjectFile(event) : void{ this.projectNameForm.controls['projectName'].setValue(event.target.files[0].name.split(".")[0]); this.isImportEnabled = true; + this.isDeleteVisible = true; } onImportClick() : void{ @@ -135,6 +137,7 @@ export class ImportProjectDialogComponent implements OnInit { onDeleteClick() : void{ this.uploader.queue.pop(); this.isImportEnabled = false; + this.isDeleteVisible = false; this.projectNameForm.controls['projectName'].setValue(""); } @@ -143,4 +146,3 @@ export class ImportProjectDialogComponent implements OnInit { return `http://${this.server.ip}:${this.server.port}/v2/projects/${uuid()}/import?name=${projectName}`; } } - \ No newline at end of file diff --git a/src/app/components/projects/projects.component.css b/src/app/components/projects/projects.component.css index 6884375a..d49aad69 100644 --- a/src/app/components/projects/projects.component.css +++ b/src/app/components/projects/projects.component.css @@ -1,3 +1,4 @@ .import-button { - margin-right:10px -} \ No newline at end of file + height: 40px; + margin: 20px; +} diff --git a/src/app/components/projects/projects.component.html b/src/app/components/projects/projects.component.html index 4ec801cc..e14ad2d6 100644 --- a/src/app/components/projects/projects.component.html +++ b/src/app/components/projects/projects.component.html @@ -1,6 +1,9 @@
-

Projects

+
+

Projects

+ +
@@ -33,9 +36,5 @@
- -
- -