Cleanup Notebook actions (#23368)

* Cleanup Notebook actions

* Comments
This commit is contained in:
Charles Gagnon
2023-06-09 12:48:38 -07:00
committed by GitHub
parent 54b12da330
commit 80b733ebe0
5 changed files with 95 additions and 43 deletions

View File

@@ -59,8 +59,13 @@ export const noParameterCell: string = localize('noParametersCell', "This notebo
export const noParametersInCell: string = localize('noParametersInCell', "This notebook cannot run with parameters until there are parameters added to the parameter cell. [Learn more](https://docs.microsoft.com/sql/azure-data-studio/notebooks/notebooks-parameterization).");
export const untitledNotSupported: string = localize('untitledNotSupported', "Run with parameters is not supported for Untitled notebooks. Please save the notebook before continuing. [Learn more](https://docs.microsoft.com/sql/azure-data-studio/notebooks/notebooks-parameterization).");
// Action to add a cell to notebook based on cell type(code/markdown).
export class AddCellAction extends Action {
export class ToggleAddCellDropdownAction extends Action {
constructor() {
super('notebook.toggleAddCell', localize('codeCellsPreview', "Add cell"))
}
}
export abstract class AddCellAction extends Action {
public cellType: CellType;
constructor(
@@ -95,6 +100,28 @@ export class AddCellAction extends Action {
}
}
/**
* Action to add a new Text cell to a Notebook
*/
export class AddTextCellAction extends AddCellAction {
public override cellType: CellType = 'markdown';
constructor(@INotebookService notebookService: INotebookService) {
super('notebook.AddTextCell', localize('textPreview', "Text cell"), 'masked-pseudo markdown', notebookService);
}
}
/**
* Action to add a new Code cell to a Notebook
*/
export class AddCodeCellAction extends AddCellAction {
public override cellType: CellType = 'code';
constructor(@INotebookService notebookService: INotebookService) {
super('notebook.AddCodeCell', localize('codePreview', "Code cell"), 'masked-pseudo code', notebookService);
}
}
export interface ITooltipState {
label: string;
baseClass: string;