mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 09:35:38 -05:00
Fix/prev next links issue (#10523)
* intital test code * added tests * remove commented code * fix for failing tests * reuse exported enum * changes to address comments * add back onVisibility highlight * port highlight fix from Chris * fix tests
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Directive, Inject, HostListener, Input } from '@angular/core';
|
||||
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
|
||||
@@ -55,7 +55,6 @@ import { CodeCellComponent } from 'sql/workbench/contrib/notebook/browser/cellVi
|
||||
import { TextCellComponent } from 'sql/workbench/contrib/notebook/browser/cellViews/textCell.component';
|
||||
import { NotebookInput } from 'sql/workbench/contrib/notebook/browser/models/notebookInput';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
@@ -105,7 +104,6 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
@Inject(ICapabilitiesService) private capabilitiesService: ICapabilitiesService,
|
||||
@Inject(ITextFileService) private textFileService: ITextFileService,
|
||||
@Inject(ILogService) private readonly logService: ILogService,
|
||||
@Inject(ICommandService) private commandService: ICommandService,
|
||||
@Inject(IAdsTelemetryService) private adstelemetryService: IAdsTelemetryService,
|
||||
@Inject(IConfigurationService) private _configurationService: IConfigurationService
|
||||
) {
|
||||
@@ -516,8 +514,6 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
this._navProvider = this.notebookService.getNavigationProvider(this._notebookParams.notebookUri);
|
||||
|
||||
if (this.contextKeyService.getContextKeyValue('bookOpened') && this._navProvider) {
|
||||
// If there's a book opened but the current notebook isn't part of the book, this is a no-op
|
||||
this.commandService.executeCommand('notebook.command.revealInBooksViewlet', this._notebookParams.notebookUri, false);
|
||||
this._navProvider.getNavigation(this._notebookParams.notebookUri).then(result => {
|
||||
this.navigationResult = result;
|
||||
this.addButton(localize('previousButtonLabel', "< Previous"),
|
||||
|
||||
@@ -16,6 +16,7 @@ import { INotebookService } from 'sql/workbench/services/notebook/browser/notebo
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { NotebookProviderRegistration, INotebookProviderRegistry, Extensions } from 'sql/workbench/services/notebook/common/notebookRegistry';
|
||||
import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
|
||||
|
||||
suite('Notebook Service Tests', function (): void {
|
||||
let notebookService: INotebookService;
|
||||
@@ -31,6 +32,7 @@ suite('Notebook Service Tests', function (): void {
|
||||
const extensionService = new TestExtensionService();
|
||||
const fileService = new TestFileService();
|
||||
const logService = new NullLogService();
|
||||
const contextService = new MockContextKeyService();
|
||||
const queryManagementService = new NBTestQueryManagementService();
|
||||
|
||||
const instantiationService = new TestInstantiationService();
|
||||
@@ -47,7 +49,7 @@ suite('Notebook Service Tests', function (): void {
|
||||
instantiationService.stub(IExtensionManagementService, 'onDidUninstallExtension', didUninstallEvent.event);
|
||||
const extensionManagementService = instantiationService.get(IExtensionManagementService);
|
||||
|
||||
notebookService = new NotebookService(lifecycleService, storageService, extensionService, extensionManagementService, instantiationService, fileService, logService, queryManagementService);
|
||||
notebookService = new NotebookService(lifecycleService, storageService, extensionService, extensionManagementService, instantiationService, fileService, logService, queryManagementService, contextService);
|
||||
});
|
||||
|
||||
test('Validate default properties on create', async function (): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user