mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 18:22:34 -05:00
Toggle Trusted Button (#8569)
* Toggle Trusted Button * Persist Trusted information to Cache * Trusted toggle unit test fixed * Updated test comment
This commit is contained in:
@@ -106,7 +106,6 @@ export class TrustedAction extends ToggleableAction {
|
||||
// Constants
|
||||
private static readonly trustedLabel = localize('trustLabel', "Trusted");
|
||||
private static readonly notTrustedLabel = localize('untrustLabel', "Not Trusted");
|
||||
private static readonly alreadyTrustedMsg = localize('alreadyTrustedMsg', "Notebook is already trusted.");
|
||||
private static readonly baseClass = 'notebook-button';
|
||||
private static readonly trustedCssClass = 'icon-trusted';
|
||||
private static readonly notTrustedCssClass = 'icon-notTrusted';
|
||||
@@ -114,8 +113,7 @@ export class TrustedAction extends ToggleableAction {
|
||||
// Properties
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@INotificationService private _notificationService: INotificationService
|
||||
id: string
|
||||
) {
|
||||
super(id, {
|
||||
baseClass: TrustedAction.baseClass,
|
||||
@@ -138,14 +136,8 @@ export class TrustedAction extends ToggleableAction {
|
||||
let self = this;
|
||||
return new Promise<boolean>((resolve, reject) => {
|
||||
try {
|
||||
if (self.trusted) {
|
||||
const actions: INotificationActions = { primary: [] };
|
||||
self._notificationService.notify({ severity: Severity.Info, message: TrustedAction.alreadyTrustedMsg, actions });
|
||||
}
|
||||
else {
|
||||
self.trusted = !self.trusted;
|
||||
context.model.trustedMode = self.trusted;
|
||||
}
|
||||
self.trusted = !self.trusted;
|
||||
context.model.trustedMode = self.trusted;
|
||||
resolve(true);
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
|
||||
Reference in New Issue
Block a user