Skip to content

Commit

Permalink
Grayout "Edit Notebook Metadata" for other file formats. (#7265)
Browse files Browse the repository at this point in the history
* Grayed out edit-notebook-metadata

* Grayed out edit notebook metadata

* Added isVisible property for Edit notebook metadata

* Prettier code for Test Lint check

* Prettier code for Test Lint check
  • Loading branch information
itsmevichu authored Feb 19, 2024
1 parent f6f5a1f commit f9bddf9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/notebook-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ const editNotebookMetadata: JupyterFrontEndPlugin<void> = {
translator: ITranslator | null,
notebookTools: INotebookTools | null
) => {
const { commands } = app;
const { commands, shell } = app;
translator = translator ?? nullTranslator;
const trans = translator.load('notebook');

Expand Down Expand Up @@ -549,6 +549,9 @@ const editNotebookMetadata: JupyterFrontEndPlugin<void> = {
});
}
},
isVisible: () =>
shell.currentWidget !== null &&
shell.currentWidget instanceof NotebookPanel,
});

if (palette) {
Expand Down

0 comments on commit f9bddf9

Please sign in to comment.