From 5dd1c706ec019a6f1b7fb3c688b0a69f13921004 Mon Sep 17 00:00:00 2001 From: Sandi Barr Date: Wed, 7 Apr 2021 14:02:07 -0500 Subject: [PATCH 01/12] feat: shows argument list and highlights changed and invalid fields in menu --- .../argument-list.component.html | 3 + .../argument-list.component.scss | 3 + .../argument-list.component.spec.ts | 25 ++++++ .../argument-list/argument-list.component.ts | 11 +++ .../autocomplete/autocomplete.component.scss | 1 + .../src/lib/checkbox/checkbox.component.scss | 1 + .../lib/field-tree/field-tree.component.html | 2 + .../lib/field-tree/field-tree.component.scss | 7 ++ .../lib/field-tree/field-tree.component.ts | 10 +++ .../src/lib/input/input.component.scss | 1 + .../multiple-select.component.scss | 1 + .../src/lib/select/select.component.scss | 1 + .../src/lib/vscode-ui-components.module.ts | 3 + .../lib/task-execution-form.component.html | 80 ++++++++++--------- .../lib/task-execution-form.component.scss | 3 +- .../src/lib/task-execution-form.component.ts | 49 ++++++++++++ libs/vscode-ui/styles/src/lib/_variables.scss | 2 + 17 files changed, 164 insertions(+), 39 deletions(-) create mode 100644 libs/vscode-ui/components/src/lib/argument-list/argument-list.component.html create mode 100644 libs/vscode-ui/components/src/lib/argument-list/argument-list.component.scss create mode 100644 libs/vscode-ui/components/src/lib/argument-list/argument-list.component.spec.ts create mode 100644 libs/vscode-ui/components/src/lib/argument-list/argument-list.component.ts diff --git a/libs/vscode-ui/components/src/lib/argument-list/argument-list.component.html b/libs/vscode-ui/components/src/lib/argument-list/argument-list.component.html new file mode 100644 index 0000000000..c50b2cb79f --- /dev/null +++ b/libs/vscode-ui/components/src/lib/argument-list/argument-list.component.html @@ -0,0 +1,3 @@ +
+ {{arg}} +
diff --git a/libs/vscode-ui/components/src/lib/argument-list/argument-list.component.scss b/libs/vscode-ui/components/src/lib/argument-list/argument-list.component.scss new file mode 100644 index 0000000000..cf06fdc32c --- /dev/null +++ b/libs/vscode-ui/components/src/lib/argument-list/argument-list.component.scss @@ -0,0 +1,3 @@ +div { + white-space: nowrap; +} diff --git a/libs/vscode-ui/components/src/lib/argument-list/argument-list.component.spec.ts b/libs/vscode-ui/components/src/lib/argument-list/argument-list.component.spec.ts new file mode 100644 index 0000000000..57a80fa0d9 --- /dev/null +++ b/libs/vscode-ui/components/src/lib/argument-list/argument-list.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ArgumentListComponent } from './argument-list.component'; + +describe('ArgumentListComponent', () => { + let component: ArgumentListComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ArgumentListComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ArgumentListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/libs/vscode-ui/components/src/lib/argument-list/argument-list.component.ts b/libs/vscode-ui/components/src/lib/argument-list/argument-list.component.ts new file mode 100644 index 0000000000..dd083bcb66 --- /dev/null +++ b/libs/vscode-ui/components/src/lib/argument-list/argument-list.component.ts @@ -0,0 +1,11 @@ +import { Component, Input, ChangeDetectionStrategy } from '@angular/core'; + +@Component({ + selector: 'nx-console-argument-list', + templateUrl: './argument-list.component.html', + styleUrls: ['./argument-list.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class ArgumentListComponent { + @Input() args: string[]; +} diff --git a/libs/vscode-ui/components/src/lib/autocomplete/autocomplete.component.scss b/libs/vscode-ui/components/src/lib/autocomplete/autocomplete.component.scss index bf70be3235..ec714e8e21 100644 --- a/libs/vscode-ui/components/src/lib/autocomplete/autocomplete.component.scss +++ b/libs/vscode-ui/components/src/lib/autocomplete/autocomplete.component.scss @@ -5,6 +5,7 @@ nx-console-autocomplete { margin: 0 0 0.5rem 0; user-select: text; white-space: normal; + width: $description-width; } .autocomplete-container { diff --git a/libs/vscode-ui/components/src/lib/checkbox/checkbox.component.scss b/libs/vscode-ui/components/src/lib/checkbox/checkbox.component.scss index eb04d95ab0..18c5ba14e4 100644 --- a/libs/vscode-ui/components/src/lib/checkbox/checkbox.component.scss +++ b/libs/vscode-ui/components/src/lib/checkbox/checkbox.component.scss @@ -5,6 +5,7 @@ nx-console-checkbox { margin: 0; user-select: text; white-space: normal; + width: $description-width } .bool-control { diff --git a/libs/vscode-ui/components/src/lib/field-tree/field-tree.component.html b/libs/vscode-ui/components/src/lib/field-tree/field-tree.component.html index 56a3525b56..d1cdef359f 100644 --- a/libs/vscode-ui/components/src/lib/field-tree/field-tree.component.html +++ b/libs/vscode-ui/components/src/lib/field-tree/field-tree.component.html @@ -3,6 +3,8 @@ *ngFor="let field of fields" (click)="scrollToField(field.name)" [class.active]="activeFieldName === field.name" + [class.valid]="isFieldValid(field.name)" + [class.error]="isFieldInvalid(field.name)" [id]="field.name + '-field-tree-item'" [style.display]="filteredFields.has(field.name) ? 'block' : 'none'" > diff --git a/libs/vscode-ui/components/src/lib/field-tree/field-tree.component.scss b/libs/vscode-ui/components/src/lib/field-tree/field-tree.component.scss index 8b92433be4..999f89c5c2 100644 --- a/libs/vscode-ui/components/src/lib/field-tree/field-tree.component.scss +++ b/libs/vscode-ui/components/src/lib/field-tree/field-tree.component.scss @@ -36,4 +36,11 @@ font-weight: 700; opacity: 1; } + + &.valid { + color: $modified-text-color; + } + &.error { + color: $error-text-color; + } } diff --git a/libs/vscode-ui/components/src/lib/field-tree/field-tree.component.ts b/libs/vscode-ui/components/src/lib/field-tree/field-tree.component.ts index 77c7cacc95..bf8413ce3e 100644 --- a/libs/vscode-ui/components/src/lib/field-tree/field-tree.component.ts +++ b/libs/vscode-ui/components/src/lib/field-tree/field-tree.component.ts @@ -19,6 +19,8 @@ export class FieldTreeComponent implements OnChanges { @Input() fields: Array