-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: shows argument list and highlights changed and invalid fields in menu #1059
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5dd1c70
feat: shows argument list and highlights changed and invalid fields i…
878e7d9
row-reverse to improve semantic layout and allow selection of command…
27d69bc
style and formatting to allow for long arguments
8b69ae0
argument list lib
51d071f
feat: copy nx task command to clipboard
6f00cdb
fix: update args on form reset
d303e73
format
2382291
allow longer description to push arguments right
65ca46a
fix: codicon.css dependency
484ab19
flex layout fields and argument list
597108e
fixes #1022 higher content density
26bf6f5
vscode-codicons import
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
@import 'flex'; | ||
@import 'variables'; | ||
@import '~vscode-codicons/dist/codicon'; | ||
|
||
html, | ||
body { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"extends": ["../../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts"], | ||
"extends": [ | ||
"plugin:@nrwl/nx/angular", | ||
"plugin:@angular-eslint/template/process-inline-templates" | ||
], | ||
"parserOptions": { | ||
"project": ["libs/vscode-ui/argument-list/tsconfig.*?.json"] | ||
}, | ||
"rules": { | ||
"@angular-eslint/directive-selector": [ | ||
"error", | ||
{ "type": "attribute", "prefix": "nx-console", "style": "camelCase" } | ||
], | ||
"@angular-eslint/component-selector": [ | ||
"error", | ||
{ "type": "element", "prefix": "nx-console", "style": "kebab-case" } | ||
] | ||
} | ||
}, | ||
{ | ||
"files": ["*.html"], | ||
"extends": ["plugin:@nrwl/nx/angular-template"], | ||
"rules": {} | ||
} | ||
] | ||
} |
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,23 @@ | ||
module.exports = { | ||
displayName: 'vscode-ui-argument-list', | ||
preset: '../../../jest.preset.js', | ||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'], | ||
globals: { | ||
'ts-jest': { | ||
tsConfig: '<rootDir>/tsconfig.spec.json', | ||
stringifyContentPathRegex: '\\.(html|svg)$', | ||
astTransformers: { | ||
before: [ | ||
'jest-preset-angular/build/InlineFilesTransformer', | ||
'jest-preset-angular/build/StripStylesTransformer', | ||
], | ||
}, | ||
}, | ||
}, | ||
coverageDirectory: '../../../coverage/libs/vscode-ui/argument-list', | ||
snapshotSerializers: [ | ||
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', | ||
'jest-preset-angular/build/AngularSnapshotSerializer.js', | ||
'jest-preset-angular/build/HTMLCommentSerializer.js', | ||
], | ||
}; |
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 @@ | ||
export * from './lib/argument-list.module'; |
1 change: 1 addition & 0 deletions
1
libs/vscode-ui/argument-list/src/lib/argument-list.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 @@ | ||
<div *ngFor="let arg of args" [innerHtml]="arg"></div> |
5 changes: 5 additions & 0 deletions
5
libs/vscode-ui/argument-list/src/lib/argument-list.component.scss
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,5 @@ | ||
div { | ||
overflow-wrap: break-word; | ||
margin-left: 1em; | ||
text-indent: -1em; | ||
} |
34 changes: 34 additions & 0 deletions
34
libs/vscode-ui/argument-list/src/lib/argument-list.component.spec.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,34 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ArgumentListComponent } from './argument-list.component'; | ||
|
||
describe('ArgumentListComponent', () => { | ||
let component: ArgumentListComponent; | ||
let fixture: ComponentFixture<ArgumentListComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ArgumentListComponent], | ||
}).compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ArgumentListComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
|
||
it('should format arguments for multiline break-word', () => { | ||
component.args = [ | ||
'--some-arg=withalistofoptions,that-may-not-fit-on-a-single-line', | ||
]; | ||
fixture.detectChanges(); | ||
expect(component.args).toEqual([ | ||
'--some-arg=<wbr>withalistofoptions,that-may-not-fit-on-a-single-line', | ||
]); | ||
}); | ||
}); |
36 changes: 36 additions & 0 deletions
36
libs/vscode-ui/argument-list/src/lib/argument-list.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,36 @@ | ||
import { | ||
Component, | ||
Input, | ||
ChangeDetectionStrategy, | ||
SecurityContext, | ||
} from '@angular/core'; | ||
import { DomSanitizer } from '@angular/platform-browser'; | ||
|
||
@Component({ | ||
selector: 'nx-console-argument-list', | ||
templateUrl: './argument-list.component.html', | ||
styleUrls: ['./argument-list.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class ArgumentListComponent { | ||
private _formattedArgs: string[]; | ||
@Input() | ||
get args(): string[] { | ||
return this._formattedArgs; | ||
} | ||
set args(values: string[]) { | ||
this._formattedArgs = | ||
values && | ||
values.map( | ||
(value) => | ||
this.domSanitizer.sanitize( | ||
SecurityContext.HTML, | ||
this.domSanitizer.bypassSecurityTrustHtml( | ||
value.replace('=', '=<wbr>') | ||
) | ||
) || '' | ||
); | ||
} | ||
|
||
constructor(private readonly domSanitizer: DomSanitizer) {} | ||
} |
11 changes: 11 additions & 0 deletions
11
libs/vscode-ui/argument-list/src/lib/argument-list.module.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,11 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { ArgumentListComponent } from './argument-list.component'; | ||
|
||
@NgModule({ | ||
imports: [CommonModule], | ||
declarations: [ArgumentListComponent], | ||
exports: [ArgumentListComponent], | ||
}) | ||
export class ArgumentListModule {} |
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 @@ | ||
import 'jest-preset-angular'; |
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,13 @@ | ||
{ | ||
"extends": "../../../tsconfig.base.json", | ||
"files": [], | ||
"include": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.lib.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
] | ||
} |
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,19 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../../dist/out-tsc", | ||
"target": "es2015", | ||
"declaration": true, | ||
"declarationMap": true, | ||
"inlineSources": true, | ||
"types": [], | ||
"lib": ["dom", "es2018"] | ||
}, | ||
"angularCompilerOptions": { | ||
"skipTemplateCodegen": true, | ||
"strictMetadataEmit": true, | ||
"enableResourceInlining": true | ||
}, | ||
"exclude": ["src/test-setup.ts", "**/*.spec.ts"], | ||
"include": ["**/*.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,10 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../../dist/out-tsc", | ||
"module": "commonjs", | ||
"types": ["jest", "node"] | ||
}, | ||
"files": ["src/test-setup.ts"], | ||
"include": ["**/*.spec.ts", "**/*.d.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
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
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
38 changes: 38 additions & 0 deletions
38
libs/vscode-ui/feature-task-execution-form/src/lib/format-task/format-task.pipe.spec.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,38 @@ | ||
import { FormatTaskPipe } from './format-task.pipe'; | ||
|
||
describe('FormatTaskPipe', () => { | ||
const pipe = new FormatTaskPipe(); | ||
|
||
it('should reformat workspace generator commands', () => { | ||
expect( | ||
pipe.transform({ | ||
name: '', | ||
cliName: 'ng', | ||
description: '', | ||
options: [], | ||
command: 'generate', | ||
positional: 'workspace-schematic:xyz-name', | ||
}) | ||
).toEqual('nx workspace-schematic xyz-name'); | ||
expect( | ||
pipe.transform({ | ||
name: '', | ||
cliName: 'ng', | ||
description: '', | ||
options: [], | ||
command: 'generate', | ||
positional: 'workspace-generator:xyz-name', | ||
}) | ||
).toEqual('nx workspace-generator xyz-name'); | ||
expect( | ||
pipe.transform({ | ||
name: '', | ||
cliName: 'ng', | ||
description: '', | ||
options: [], | ||
command: 'generate', | ||
positional: '@nrwl/angular:library', | ||
}) | ||
).toEqual('ng generate @nrwl/angular:library'); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pipe is used over in the parent form, and it needs to call the formatTask function directly now as well for the copy to clipboard functionality, so I moved it into that lib.