From b0381ed17f8948ae6e8564906f94211e58c679d3 Mon Sep 17 00:00:00 2001 From: Ivaschenko Christina Date: Tue, 3 Oct 2017 08:11:35 +0700 Subject: [PATCH 1/2] feat(vm-color-picker): Move VM color picker from bar to the VM name line --- .../color-picker/color-picker.component.html | 12 +++++++-- .../color-picker/color-picker.component.scss | 9 +++++++ .../color-picker/color-picker.component.ts | 1 + .../vm-sidebar/color/vm-color.component.html | 26 +++++++------------ .../vm-detail/vm-detail.component.html | 1 - .../vm/vm-sidebar/vm-sidebar.component.html | 6 ++++- src/app/vm/vm-sidebar/vm-sidebar.component.ts | 3 +++ src/style/app.scss | 4 +++ 8 files changed, 41 insertions(+), 21 deletions(-) diff --git a/src/app/shared/components/color-picker/color-picker.component.html b/src/app/shared/components/color-picker/color-picker.component.html index a4812b30ef..27c715413b 100644 --- a/src/app/shared/components/color-picker/color-picker.component.html +++ b/src/app/shared/components/color-picker/color-picker.component.html @@ -1,11 +1,18 @@
-
+
+
- +
; @Input() public colorsPerLine: number; @Input() public containerWidth = 256; + @Input() public hasColorField = true; @Output() public change = new EventEmitter(); @ViewChild(PopoverTriggerDirective) public popoverTrigger: PopoverTriggerDirective; public colorWidth: number; diff --git a/src/app/vm/vm-sidebar/color/vm-color.component.html b/src/app/vm/vm-sidebar/color/vm-color.component.html index 6ecc3ed094..e9c0e29c09 100644 --- a/src/app/vm/vm-sidebar/color/vm-color.component.html +++ b/src/app/vm/vm-sidebar/color/vm-color.component.html @@ -1,17 +1,9 @@ - - - -

{{ 'VM_PAGE.VM_DETAILS.COLOR' | translate }}

-
-
- - - -
+ diff --git a/src/app/vm/vm-sidebar/vm-detail/vm-detail.component.html b/src/app/vm/vm-sidebar/vm-detail/vm-detail.component.html index d37c995f6c..1d660fda56 100644 --- a/src/app/vm/vm-sidebar/vm-detail/vm-detail.component.html +++ b/src/app/vm/vm-sidebar/vm-detail/vm-detail.component.html @@ -1,6 +1,5 @@
-
-

{{ entity.displayName }}

+
+ +
+

+ {{ entity.displayName }}

diff --git a/src/app/shared/components/color-picker/color-picker.component.scss b/src/app/shared/components/color-picker/color-picker.component.scss index 8396528b96..5a38d74801 100644 --- a/src/app/shared/components/color-picker/color-picker.component.scss +++ b/src/app/shared/components/color-picker/color-picker.component.scss @@ -31,10 +31,6 @@ $input-margin: 10px; } } -.color-preview-no-field { - top: 4px; -} - :host md-form-field { width: 300px - $input-margin - $preview-width !important; margin-left: $input-margin; @@ -75,5 +71,5 @@ $input-margin: 10px; .color-picker-no-field { margin-left: 47%; - margin-top: 2%; + margin-top: 10px; } diff --git a/src/app/vm/vm-sidebar/color/vm-color.component.scss b/src/app/vm/vm-sidebar/color/vm-color.component.scss index 46ce4d7a77..bf8b54eefa 100644 --- a/src/app/vm/vm-sidebar/color/vm-color.component.scss +++ b/src/app/vm/vm-sidebar/color/vm-color.component.scss @@ -1,5 +1,5 @@ .color-picker { - margin: -20px 0; + margin-bottom: 14px; width: 330px; } diff --git a/src/app/vm/vm-sidebar/vm-sidebar.component.html b/src/app/vm/vm-sidebar/vm-sidebar.component.html index 17674db7b7..c7a89805bc 100644 --- a/src/app/vm/vm-sidebar/vm-sidebar.component.html +++ b/src/app/vm/vm-sidebar/vm-sidebar.component.html @@ -1,7 +1,7 @@
- +

{{ entity.displayName }}

diff --git a/src/app/vm/vm-sidebar/vm-sidebar.component.scss b/src/app/vm/vm-sidebar/vm-sidebar.component.scss index 6c91e46aef..a6f306043c 100644 --- a/src/app/vm/vm-sidebar/vm-sidebar.component.scss +++ b/src/app/vm/vm-sidebar/vm-sidebar.component.scss @@ -17,3 +17,7 @@ h4 { :host /deep/ .mat-tab-link { min-width: 83px !important; } + +.title-color-container { + width: 35px; +} diff --git a/src/app/vm/vm-sidebar/vm-sidebar.component.ts b/src/app/vm/vm-sidebar/vm-sidebar.component.ts index 407df1cef4..1123ac0a74 100644 --- a/src/app/vm/vm-sidebar/vm-sidebar.component.ts +++ b/src/app/vm/vm-sidebar/vm-sidebar.component.ts @@ -14,7 +14,6 @@ import { EntityDoesNotExistError } from '../../shared/components/sidebar/entity- styleUrls: ['vm-sidebar.component.scss'] }) export class VmSidebarComponent extends SidebarComponent { - public vm: VirtualMachine; constructor( protected vmService: VmService, @@ -29,7 +28,6 @@ export class VmSidebarComponent extends SidebarComponent { return this.vmService.getWithDetails(id) .switchMap(vm => { if (vm) { - this.vm = vm; return Observable.of(vm); } else { return Observable.throw(new EntityDoesNotExistError()); diff --git a/src/style/app.scss b/src/style/app.scss index abf9c43e32..3b19fed464 100644 --- a/src/style/app.scss +++ b/src/style/app.scss @@ -385,10 +385,6 @@ md-card-actions { align-items: center; } -.title-color-container { - width: 35px; -} - .details-header { width: 340px; white-space: nowrap;