mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 09:35:38 -05:00
UI Component for Parameterized Notebook (#13021)
* Backend work for Parameterization + Tests * address comments * Add Parameters Tag upon state change * Edit CSS Styling for accessibility * more generic tag names
This commit is contained in:
@@ -13,5 +13,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<collapse-component *ngIf="cellModel.cellType === 'code' && cellModel.source && cellModel.source.length > 1" [cellModel]="cellModel" [activeCellId]="activeCellId"></collapse-component>
|
||||
<div #parameter class="parameter" *ngIf="cellModel.cellType === 'code' && cellModel.isParameter">
|
||||
<span>{{parametersText}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -35,6 +35,7 @@ import { SimpleProgressIndicator } from 'sql/workbench/services/progress/browser
|
||||
import { notebookConstants } from 'sql/workbench/services/notebook/browser/interfaces';
|
||||
import { tryMatchCellMagic } from 'sql/workbench/services/notebook/browser/utils';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { localize } from 'vs/nls';
|
||||
|
||||
export const CODE_SELECTOR: string = 'code-component';
|
||||
const MARKDOWN_CLASS = 'markdown';
|
||||
@@ -144,6 +145,10 @@ export class CodeComponent extends CellView implements OnInit, OnChanges {
|
||||
return this.cellModel.cellGuid;
|
||||
}
|
||||
|
||||
get parametersText(): string {
|
||||
return localize('parametersText', "Parameters");
|
||||
}
|
||||
|
||||
private updateConnectionState(shouldConnect: boolean) {
|
||||
if (this.isSqlCodeCell()) {
|
||||
let cellUri = this.cellModel.cellUri.toString();
|
||||
|
||||
@@ -108,3 +108,16 @@ code-component .hide-component-button {
|
||||
background-position: center;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
code-component .parameter {
|
||||
bottom: 0;
|
||||
margin-right: 15px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
code-component .parameter span {
|
||||
display: inline-block;
|
||||
padding: 3px 7px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -55,6 +55,9 @@ export class CodeCellComponent extends CellView implements OnInit, OnChanges {
|
||||
this._register(this.cellModel.onCollapseStateChanged((state) => {
|
||||
this._changeRef.detectChanges();
|
||||
}));
|
||||
this._register(this.cellModel.onParameterStateChanged((state) => {
|
||||
this._changeRef.detectChanges();
|
||||
}));
|
||||
this._register(this.cellModel.onOutputsChanged(() => {
|
||||
this._changeRef.detectChanges();
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user