Make sql master link clickable that opens connection (#6982)

* Make sql master link clickable that opens connection

* Improve comments and fix break

* Show error message if failed to connect and clear username

* Remove key handler - text doesn't even get focus currently so this isn't doing anything
This commit is contained in:
Charles Gagnon
2019-08-27 17:39:05 -07:00
committed by GitHub
parent 4e25bc9396
commit 99350210d7
5 changed files with 74 additions and 5 deletions

View File

@@ -12,13 +12,13 @@ import {
import * as azdata from 'azdata';
import { ComponentBase } from 'sql/workbench/browser/modelComponents/componentBase';
import { IComponent, IComponentDescriptor, IModelStore } from 'sql/workbench/browser/modelComponents/interfaces';
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/workbench/browser/modelComponents/interfaces';
import { SafeHtml, DomSanitizer } from '@angular/platform-browser';
@Component({
selector: 'modelview-text',
template: `
<p [style.width]="getWidth()" [innerHTML]="getValue()" [ngStyle]="this.CSSStyles"></p>`
<p [style.width]="getWidth()" [innerHTML]="getValue()" [ngStyle]="this.CSSStyles" (click)="onClick()"></p>`
})
export default class TextComponent extends ComponentBase implements IComponent, OnDestroy, AfterViewInit {
@Input() descriptor: IComponentDescriptor;
@@ -69,4 +69,11 @@ export default class TextComponent extends ComponentBase implements IComponent,
}
return text;
}
private onClick() {
this.fireEvent({
eventType: ComponentEventType.onDidClick,
args: undefined
});
}
}