+
+ + + + + + + + + +
+
- -
- -
-
- {{decorator.id}} - {{decorator.state}} -
-
-
- Pool: {{job.poolId}} - -
+ {{decorator.id}} + {{decorator.state}} + Pool: {{job.poolId}} +
- - -
- - - - - - - - +
+ +
diff --git a/app/components/job/home/job-home.html b/app/components/job/home/job-home.html index 57b6aeaef3..13dda39be1 100644 --- a/app/components/job/home/job-home.html +++ b/app/components/job/home/job-home.html @@ -1,8 +1,7 @@
- + +
diff --git a/app/components/node/details/node-details.html b/app/components/node/details/node-details.html index db3add65d4..44dc876c77 100644 --- a/app/components/node/details/node-details.html +++ b/app/components/node/details/node-details.html @@ -1,23 +1,17 @@
- -
+
+ -
-
- {{node.id}} - {{node.state}} -
- - + + +
+
+ {{node.id}} + {{node.state}}

Pool: {{poolId}}

- - - - +
diff --git a/app/components/pool/details/pool-details.html b/app/components/pool/details/pool-details.html index f801a98d83..4ae8e67a41 100644 --- a/app/components/pool/details/pool-details.html +++ b/app/components/pool/details/pool-details.html @@ -1,29 +1,25 @@
- -
+
+ -
-
- {{pool.id}} - {{pool.vmSize}}, {{pool.allocationState}} -
-
- -
- - + + + + + +
+
+ {{pool.id}} + {{pool.vmSize}}, {{pool.allocationState}}

Last resized {{poolDecorator.lastResized}}

{{poolDecorator.poolOs}}

- - - - - - - +
+
+ +
diff --git a/app/components/pool/home/pool-home.html b/app/components/pool/home/pool-home.html index 98dee76a51..bd0fea300c 100644 --- a/app/components/pool/home/pool-home.html +++ b/app/components/pool/home/pool-home.html @@ -1,8 +1,7 @@
- + +
diff --git a/app/components/task/action/add/task-create-basic-dialog.component.ts b/app/components/task/action/add/task-create-basic-dialog.component.ts index c719e5a4ef..518cfabb1f 100644 --- a/app/components/task/action/add/task-create-basic-dialog.component.ts +++ b/app/components/task/action/add/task-create-basic-dialog.component.ts @@ -29,7 +29,7 @@ export class TaskCreateBasicDialogComponent extends DynamicForm, + public sidebarRef: SidebarRef, protected taskService: TaskService, private notificationService: NotificationService) { super(TaskCreateDto); diff --git a/app/components/task/details/task-details.html b/app/components/task/details/task-details.html index bdb2a971f1..28b9f922d3 100644 --- a/app/components/task/details/task-details.html +++ b/app/components/task/details/task-details.html @@ -4,29 +4,22 @@
-
-
- -
- -
-
- {{task.id}} - {{task.displayName}} - {{task.state}} -
-
- -

Job: {{jobId}}

-
-
+
+ + + + + + +
+
+ {{task.id}} - {{task.displayName}} + {{task.state}} +

Job: {{jobId}}

+
+
- - - - - - diff --git a/app/components/task/home/task-home.html b/app/components/task/home/task-home.html index 1cea5f363c..d1ef08bc89 100644 --- a/app/components/task/home/task-home.html +++ b/app/components/task/home/task-home.html @@ -1,8 +1,7 @@
- + +
diff --git a/app/styles/base/layout.scss b/app/styles/base/layout.scss index de6acf1da2..c7fa123774 100644 --- a/app/styles/base/layout.scss +++ b/app/styles/base/layout.scss @@ -219,8 +219,7 @@ footer { .context-button-bar { position: relative !important; - margin-top: -34px !important; - margin-right: 10px !important; + margin: -34px 10px 0 !important; float: right; button { diff --git a/app/styles/job/details.scss b/app/styles/job/details.scss index 3ebd6cc37e..913e51f8b2 100644 --- a/app/styles/job/details.scss +++ b/app/styles/job/details.scss @@ -1,12 +1,19 @@ -bl-job-details { - .overview > .main-content { - display: flex; +md-card.overview { + padding: 0 !important; + display: flex; - > .info { - flex: 1; - } + > .actions { + width: $action-btn-size + 1; } + > .content { + padding: 18px; + flex: 1; + } + + > .tile { + border-left: 1px solid #d5d5d5; + } } bl-job-progress-status { diff --git a/app/styles/variables.scss b/app/styles/variables.scss index bbdc52c100..6ad570ab37 100644 --- a/app/styles/variables.scss +++ b/app/styles/variables.scss @@ -134,3 +134,7 @@ $listview-header-height : 90px; $footer-height : 0; $content-top-position : $header-height; $contentview-height : calc(100vh - #{$header-height}); + + +// Base component dimensions +$action-btn-size: 32px; diff --git a/app/styles/vendor/material-theme.scss b/app/styles/vendor/material-theme.scss index 5d92612c93..8441e06c68 100644 --- a/app/styles/vendor/material-theme.scss +++ b/app/styles/vendor/material-theme.scss @@ -99,21 +99,6 @@ md-card { } } - &.overview { - padding: 18px !important; - - md-card-actions { - margin-left: -10px !important; - margin-right: -10px !important; - padding-top: 4px !important; - } - - md-card-actions:last-child { - margin-bottom: -10px !important; - padding-bottom: 0 !important; - } - } - &.details { margin-top:8px !important; padding:0 !important; diff --git a/test/app/components/application/errors/application-error-display.component.spec.ts b/test/app/components/application/errors/application-error-display.component.spec.ts index 6f55549a5d..d3bb300b45 100644 --- a/test/app/components/application/errors/application-error-display.component.spec.ts +++ b/test/app/components/application/errors/application-error-display.component.spec.ts @@ -4,11 +4,11 @@ import { By } from "@angular/platform-browser"; import { BehaviorSubject } from "rxjs"; import { ApplicationErrorDisplayComponent } from "app/components/application/errors"; +import { SidebarManager } from "app/components/base/sidebar"; import { AccountResource, Application } from "app/models"; import { AccountService } from "app/services"; import * as Fixtures from "test/fixture"; import { BannerMockComponent } from "test/utils/mocks/components"; -import { SidebarManager } from "app/components/base/sidebar"; @Component({ template: ``, diff --git a/test/app/components/base/buttons/action-button.component.spec.ts b/test/app/components/base/buttons/action-button.component.spec.ts new file mode 100644 index 0000000000..e8715fe7f8 --- /dev/null +++ b/test/app/components/base/buttons/action-button.component.spec.ts @@ -0,0 +1,98 @@ +import { Component, DebugElement, NO_ERRORS_SCHEMA } from "@angular/core"; +import { ComponentFixture, TestBed } from "@angular/core/testing"; +import { By } from "@angular/platform-browser"; + +import { MaterialModule, MdTooltip } from "@angular/material"; +import { ActionButtonComponent } from "app/components/base/buttons/action-button.component"; +import { click } from "test/utils/helpers"; + +@Component({ + template: ` + + + `, +}) +class TestComponent { + public disabled: boolean = false; + + public onAction: jasmine.Spy; + + public color = "primary"; + constructor() { + this.onAction = jasmine.createSpy("onAction"); + } +} + +describe("ActionButton", () => { + let fixture: ComponentFixture; + let testComponent: TestComponent; + let component: ActionButtonComponent; + let de: DebugElement; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [MaterialModule], + declarations: [ActionButtonComponent, TestComponent], + schemas: [NO_ERRORS_SCHEMA], + }); + fixture = TestBed.createComponent(TestComponent); + testComponent = fixture.componentInstance; + de = fixture.debugElement.query(By.css("bl-action-btn")); + component = de.componentInstance; + fixture.detectChanges(); + }); + + it("should have the icon specified", () => { + const icon = de.query(By.css("i.fa.fa-stop")); + expect(icon).not.toBeFalsy(); + }); + + it("Should have the tooltip specified with title", () => { + const el = de.query(By.css(".action-btn")); + const tooltip = el.injector.get(MdTooltip); + expect(tooltip.message).toBe("Stop"); + }); + + it("should change color", () => { + expect(de.attributes["color"]).toBe("primary"); + + testComponent.color = "warn"; + fixture.detectChanges(); + expect(de.attributes["color"]).toBe("warn"); + + }); + + describe("when disabled", () => { + beforeEach(() => { + testComponent.disabled = true; + fixture.detectChanges(); + }); + + it("should have the disabled class", () => { + expect(de.classes["disabled"]).toBe(true); + }); + + it("should not trigger the event on click", () => { + click(de); + fixture.detectChanges(); + expect(testComponent.onAction).not.toHaveBeenCalled(); + }); + }); + + describe("when enabled", () => { + beforeEach(() => { + testComponent.disabled = false; + fixture.detectChanges(); + }); + + it("should have NOT the disabled class", () => { + expect(de.classes["disabled"]).toBe(false); + }); + + it("should trigger the event on click", () => { + click(de); + fixture.detectChanges(); + expect(testComponent.onAction).toHaveBeenCalledOnce(); + }); + }); +}); diff --git a/test/app/memory-leak/mem-leak.spec.ts b/test/app/memory-leak/mem-leak.spec.ts index 684a0b335a..fad8c731c4 100644 --- a/test/app/memory-leak/mem-leak.spec.ts +++ b/test/app/memory-leak/mem-leak.spec.ts @@ -5,6 +5,7 @@ import { TestBed, async } from "@angular/core/testing"; import { TaskDetailsModule } from "app/components/task/details"; export function main() { + // tslint:disable-next-line:ban fdescribe("Memory leak Testing", () => { for (let i = 0; i < 100000; i++) { describe(`${i}`, () => {