Adding Derived Columns to ADS Flatfile Import (#16795)

* Adding derived column boilerplate

* brandan preliminary frontend changes

* empty commit

* added new param

* updating contracts, dialogue changes

* utils changes, saving timeout attempt

* pushing for aasim

* Cleaning up code and fixing the issue in theory

* changing button, did not solve independent scroll

* Fixing the scroll bar issue

* updating flat file service

* adding override keyword to overrriden method

* improving UI

* pushing changes associated with resolved comments

* localizing strings, editing comments

* all comments resolved

* Fixing a test

* updating import package
Updating azure MFA bug

* Clearing navigation validator
Fixing broken table name change

* fixed prose test

* removing unused code from tests

* Fixed PR comments

* Fixing some PR comments

* WIP

* Fixing transformation code and create derived column dialog styling

* removing unused code

* Adding comment for console log

* fixed table styling

* Adding some aria labels

* Fixed some code cleanup issues

* update import service

Co-authored-by: Aasim Khan <aasimkhan30@gmail.com>
Co-authored-by: bnhoule <t-bhoule@microsoft.com>
This commit is contained in:
bnhoule
2021-09-21 17:11:00 -05:00
committed by GitHub
parent fad2963202
commit d3e163a1d7
15 changed files with 569 additions and 108 deletions

View File

@@ -6,7 +6,7 @@
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { ImportDataModel, ColumnMetadata } from '../wizard/api/models';
import { FlatFileProvider, PROSEDiscoveryParams, InsertDataParams, GetColumnInfoParams, ChangeColumnSettingsParams, PROSEDiscoveryResponse, InsertDataResponse, ChangeColumnSettingsResponse, GetColumnInfoResponse } from '../services/contracts';
import { FlatFileProvider, PROSEDiscoveryParams, InsertDataParams, GetColumnInfoParams, ChangeColumnSettingsParams, PROSEDiscoveryResponse, InsertDataResponse, ChangeColumnSettingsResponse, GetColumnInfoResponse, LearnTransformationParams, LearnTransformationResponse, SaveTransformationParams, SaveTransformationResponse } from '../services/contracts';
export class ImportTestUtils {
@@ -170,6 +170,10 @@ export class TestImportDataModel implements ImportDataModel {
schema: string;
filePath: string;
fileType: string;
transPreviews: string[][];
originalProseColumns: ColumnMetadata[];
derivedColumnName: string;
newFileSelected: boolean;
}
export class TestFlatFileProvider implements FlatFileProvider {
@@ -186,6 +190,12 @@ export class TestFlatFileProvider implements FlatFileProvider {
sendChangeColumnSettingsRequest(params: ChangeColumnSettingsParams): Thenable<ChangeColumnSettingsResponse> {
throw new Error('Method not implemented.');
}
sendLearnTransformationRequest(params: LearnTransformationParams): Thenable<LearnTransformationResponse> {
throw new Error('Method not implemented.');
}
sendSaveTransformationRequest(params: SaveTransformationParams): Thenable<SaveTransformationResponse> {
throw new Error('Method not implemented.');
}
}

View File

@@ -12,7 +12,6 @@ import { ImportDataModel } from '../../../wizard/api/models';
import { TestImportDataModel } from '../../utils.test';
import { ImportPage } from '../../../wizard/api/importPage';
import { ProsePreviewPage } from '../../../wizard/pages/prosePreviewPage';
describe('import extension prose preview tests', function () {
// declaring mock variables
@@ -44,10 +43,10 @@ describe('import extension prose preview tests', function () {
await new Promise<void>(function (resolve) {
page.registerContent(async (view) => {
prosePreviewPage = new ProsePreviewPage(mockFlatFileWizard.object, page, mockImportModel.object, view, TypeMoq.It.isAny());
mockFlatFileWizard.object.createDerivedColumnButton = azdata.window.createButton('TestButton');
pages.set(1, prosePreviewPage);
await prosePreviewPage.start();
prosePreviewPage.setupNavigationValidator();
await prosePreviewPage.onPageEnter();
resolve();
});
wizard.generateScriptButton.hidden = true;
@@ -57,7 +56,6 @@ describe('import extension prose preview tests', function () {
// checking if all the required components are correctly initialized
should.notEqual(prosePreviewPage.table, undefined, 'table should not be undefined');
should.notEqual(prosePreviewPage.refresh, undefined, 'refresh should not be undefined');
should.notEqual(prosePreviewPage.loading, undefined, 'loading should not be undefined');
should.notEqual(prosePreviewPage.form, undefined, 'form should not be undefined');
should.notEqual(prosePreviewPage.resultTextComponent, undefined, 'resultTextComponent should not be undefined');