-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
Updated fancy input #1493
Merged
Merged
Updated fancy input #1493
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions
13
packages/altair-app/src/app/components/fancy-input-marker/fancy-input-marker.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,13 @@ | ||
<mark | ||
[ngClass]="{ 'fancy-input-marker__invalid': !resolvedValue }" | ||
>{{ section.content }}</mark> | ||
<div | ||
*ngIf="resolvedValue" | ||
class="value-indicator__wrapper" | ||
>. | ||
<div | ||
nz-tooltip | ||
[nzTooltipTitle]="resolvedValue" | ||
class="value-indicator" | ||
></div> | ||
</div> |
38 changes: 38 additions & 0 deletions
38
...ges/altair-app/src/app/components/fancy-input-marker/fancy-input-marker.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,38 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { Store } from '@ngrx/store'; | ||
import { SharedModule } from 'app/modules/shared/shared.module'; | ||
import { MockModule } from 'ng-mocks'; | ||
import { mockStoreFactory } from '../../../testing'; | ||
|
||
import { FancyInputMarkerComponent } from './fancy-input-marker.component'; | ||
|
||
describe('FancyInputMarkerComponent', () => { | ||
let component: FancyInputMarkerComponent; | ||
let fixture: ComponentFixture<FancyInputMarkerComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ FancyInputMarkerComponent ], | ||
imports: [ | ||
MockModule(SharedModule), | ||
], | ||
providers: [ | ||
{ | ||
provide: Store, | ||
useValue: mockStoreFactory(), | ||
} | ||
] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(FancyInputMarkerComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
32 changes: 32 additions & 0 deletions
32
packages/altair-app/src/app/components/fancy-input-marker/fancy-input-marker.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,32 @@ | ||
import { ChangeDetectionStrategy, Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; | ||
import { IDictionary } from 'app/interfaces/shared'; | ||
import { EnvironmentService, VARIABLE_REGEX } from 'app/services/environment/environment.service'; | ||
import { HighlightSection } from '../fancy-input/fancy-input.component'; | ||
|
||
@Component({ | ||
selector: 'app-fancy-input-marker', | ||
templateUrl: './fancy-input-marker.component.html', | ||
styles: [ | ||
], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
preserveWhitespaces: false, | ||
}) | ||
export class FancyInputMarkerComponent implements OnInit, OnChanges { | ||
|
||
@Input() section: HighlightSection = { content: '' }; | ||
@Input() activeEnvironment: IDictionary = {}; | ||
|
||
resolvedValue = ''; | ||
|
||
constructor( | ||
private environmentService: EnvironmentService, | ||
) { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
ngOnChanges(changes: SimpleChanges) { | ||
this.resolvedValue = this.environmentService.hydrate(this.section.content); | ||
} | ||
|
||
} |
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 |
---|---|---|
|
@@ -7,6 +7,11 @@ exports[`FancyInputComponent should render the highlights correctly based on the | |
<div | ||
class="fancy-input-container" | ||
> | ||
<input | ||
class="fancy-input-content fancy-input-element ng-untouched ng-valid ng-dirty" | ||
placeholder="" | ||
type="text" | ||
/> | ||
<div | ||
class="fancy-input-backdrop" | ||
> | ||
|
@@ -24,9 +29,14 @@ exports[`FancyInputComponent should render the highlights correctly based on the | |
|
||
|
||
|
||
<mark> | ||
{{variable1}} | ||
</mark> | ||
<app-fancy-input-marker> | ||
<mark | ||
class="fancy-input-marker__invalid" | ||
> | ||
{{variable1}} | ||
</mark> | ||
|
||
</app-fancy-input-marker> | ||
|
||
|
||
|
||
|
@@ -38,9 +48,14 @@ exports[`FancyInputComponent should render the highlights correctly based on the | |
|
||
|
||
|
||
<mark> | ||
{{variable2}} | ||
</mark> | ||
<app-fancy-input-marker> | ||
<mark | ||
class="fancy-input-marker__invalid" | ||
> | ||
{{variable2}} | ||
</mark> | ||
|
||
</app-fancy-input-marker> | ||
|
||
|
||
|
||
|
@@ -51,11 +66,6 @@ exports[`FancyInputComponent should render the highlights correctly based on the | |
|
||
</div> | ||
</div> | ||
<input | ||
class="fancy-input-content fancy-input-element ng-untouched ng-valid ng-dirty" | ||
placeholder="" | ||
type="text" | ||
/> | ||
</div> | ||
</div> | ||
`; | ||
|
@@ -67,6 +77,11 @@ exports[`FancyInputComponent should set component value when input value changes | |
<div | ||
class="fancy-input-container" | ||
> | ||
<input | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control. |
||
class="fancy-input-content fancy-input-element ng-untouched ng-valid ng-dirty" | ||
placeholder="" | ||
type="text" | ||
/> | ||
<div | ||
class="fancy-input-backdrop" | ||
> | ||
|
@@ -83,11 +98,6 @@ exports[`FancyInputComponent should set component value when input value changes | |
|
||
</div> | ||
</div> | ||
<input | ||
class="fancy-input-content fancy-input-element ng-untouched ng-valid ng-dirty" | ||
placeholder="" | ||
type="text" | ||
/> | ||
</div> | ||
</div> | ||
`; |
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
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.
Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control.