Skip to content
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

update trusted icons and make trusted icon appear on the editor title #4430

Merged
merged 7 commits into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,6 @@ module.exports = {
'src/client/common/utils/enum.ts',
'src/client/common/utils/async.ts',
'src/client/common/utils/text.ts',
'src/client/common/utils/localize.ts',
'src/client/common/utils/regexp.ts',
'src/client/common/utils/platform.ts',
'src/client/common/utils/multiStepInput.ts',
Expand Down Expand Up @@ -792,7 +791,6 @@ module.exports = {
'src/client/common/startPage/types.ts',
'src/client/common/startPage/startPageMessageListener.ts',
'src/client/common/application/customEditorService.ts',
'src/client/common/application/commands.ts',
'src/client/common/application/applicationShell.ts',
'src/client/common/application/languageService.ts',
'src/client/common/application/notebook.ts',
Expand Down Expand Up @@ -1037,11 +1035,9 @@ module.exports = {
'src/client/datascience/plotting/types.ts',
'src/client/datascience/plotting/plotViewer.ts',
'src/client/datascience/plotting/plotViewerProvider.ts',
'src/client/datascience/constants.ts',
'src/client/datascience/monacoMessages.ts',
'src/client/datascience/interactive-ipynb/nativeEditorRunByLineListener.ts',
'src/client/datascience/interactive-ipynb/nativeEditorViewTracker.ts',
'src/client/datascience/interactive-ipynb/trustCommandHandler.ts',
'src/client/datascience/interactive-ipynb/nativeEditorOldWebView.ts',
'src/client/datascience/interactive-ipynb/nativeEditorSynchronizer.ts',
'src/client/datascience/interactive-ipynb/nativeEditor.ts',
Expand Down
1 change: 1 addition & 0 deletions news/2 Fixes/4338.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update trust icons.
1 change: 1 addition & 0 deletions news/2 Fixes/4339.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Display trusted icon when a notebook is trusted.
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,16 @@
},
"enablement": "notebookViewType == jupyter-notebook && !jupyter.isnotebooktrusted && jupyter.trustfeatureenabled"
},
{
"command": "jupyter.notebookeditor.trusted",
"title": "%DataScience.notebookIsTrusted%",
"category": "Jupyter",
"icon": {
"light": "resources/light/trusted.svg",
"dark": "resources/dark/trusted.svg"
},
"enablement": "false"
},
{
"command": "jupyter.notebookeditor.runallcells",
"title": "%jupyter.command.jupyter.notebookeditor.runallcells.title%",
Expand Down Expand Up @@ -784,6 +794,12 @@
"group": "navigation@1",
"when": "resourceLangId == jupyter && notebookViewType == 'jupyter-notebook' && !jupyter.isnotebooktrusted && jupyter.trustfeatureenabled"
},
{
"command": "jupyter.notebookeditor.trusted",
"title": "%DataScience.notebookIsTrusted%",
"group": "navigation@1",
"when": "resourceLangId == jupyter && notebookViewType == 'jupyter-notebook' && jupyter.isnotebooktrusted && jupyter.trustfeatureenabled"
},
{
"command": "jupyter.notebookeditor.export",
"title": "%DataScience.notebookExportAs%",
Expand Down Expand Up @@ -1093,6 +1109,12 @@
"category": "Jupyter",
"when": "notebookEditorFocused && !jupyter.isnotebooktrusted && jupyter.trustfeatureenabled"
},
{
"command": "jupyter.notebookeditor.trusted",
"title": "%DataScience.notebookIsTrusted%",
"category": "Jupyter",
"when": "false"
},
{
"command": "jupyter.notebookeditor.runallcells",
"title": "%jupyter.command.jupyter.notebookeditor.runallcells.title%",
Expand Down
5 changes: 2 additions & 3 deletions resources/dark/trusted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions resources/dark/un-trusted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions resources/light/trusted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions resources/light/un-trusted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/client/common/application/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export interface ICommandNameArgumentTypeMapping extends ICommandNameWithoutArgu
[DSCommands.LatestExtension]: [string];
[DSCommands.EnableLoadingWidgetsFrom3rdPartySource]: [undefined | never];
[DSCommands.TrustNotebook]: [undefined | never | Uri];
[DSCommands.NotebookTrusted]: [];
[DSCommands.NotebookEditorExpandAllCells]: [];
[DSCommands.NotebookEditorCollapseAllCells]: [];
[DSCommands.CreateGitHubIssue]: [];
Expand Down
1 change: 1 addition & 0 deletions src/client/datascience/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export namespace Commands {
export const OpenNotebookNonCustomEditor = 'jupyter.notebookeditor.open';
export const LatestExtension = 'jupyter.latestExtension';
export const TrustNotebook = 'jupyter.notebookeditor.trust';
export const NotebookTrusted = 'jupyter.notebookeditor.trusted';
export const EnableLoadingWidgetsFrom3rdPartySource = 'jupyter.enableLoadingWidgetScriptsFromThirdPartySource';
export const NotebookEditorExpandAllCells = 'jupyter.notebookeditor.expandallcells';
export const NotebookEditorCollapseAllCells = 'jupyter.notebookeditor.collapseallcells';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export class TrustCommandHandler implements IExtensionSingleActivationService {
const context = new ContextKey('jupyter.trustfeatureenabled', this.commandManager);
context.set(true).ignoreErrors();
this.disposables.push(this.commandManager.registerCommand(Commands.TrustNotebook, this.onTrustNotebook, this));
this.disposables.push(this.commandManager.registerCommand(Commands.NotebookTrusted, () => noop(), this));
}
@swallowExceptions('Trusting notebook')
private async onTrustNotebook(uri?: Uri) {
Expand All @@ -64,7 +65,7 @@ export class TrustCommandHandler implements IExtensionSingleActivationService {
traceInfo(`Displayed prompt to trust notebook & selected ${selection}`);
switch (selection) {
case DataScience.trustAllNotebooks():
commands.executeCommand('workbench.action.openSettings', 'jupyter.alwaysTrustNotebooks');
void commands.executeCommand('workbench.action.openSettings', 'jupyter.alwaysTrustNotebooks');
sendTelemetryEvent(Telemetry.TrustAllNotebooks);
break;
case DataScience.trustNotebook():
Expand Down