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

@@ -52,6 +52,38 @@ export interface ColumnInfo {
}
/**
* LearnTransformationRequest
* Send this request to learn a transformation and preview it
*/
const learnTransformationRequestName = 'flatfile/learnTransformation';
export interface LearnTransformationParams {
columnNames: string[];
transformationExamples: string[];
transformationExampleRowIndices: number[];
}
export interface LearnTransformationResponse {
transformationPreview: string[];
}
/**
* SaveTransformationRequest
* Send this request to save a transformation to be applied on insertion into database
*/
const saveTransformationRequestName = 'flatfile/saveTransformation';
export interface SaveTransformationParams {
derivedColumnName: string;
}
export interface SaveTransformationResponse {
numTransformations: number;
}
/**
* PROSEDiscoveryRequest
* Send this request to create a new PROSE session with a new file and preview it
@@ -139,6 +171,14 @@ export namespace ChangeColumnSettingsRequest {
export const type = new RequestType<ChangeColumnSettingsParams, ChangeColumnSettingsResponse, void, void>(changeColumnSettingsRequestName);
}
export namespace LearnTransformationRequest {
export const type = new RequestType<LearnTransformationParams, LearnTransformationResponse, void, void>(learnTransformationRequestName);
}
export namespace SaveTransformationRequest {
export const type = new RequestType<SaveTransformationParams, SaveTransformationResponse, void, void>(saveTransformationRequestName);
}
export interface FlatFileProvider {
providerId?: string;
@@ -147,4 +187,6 @@ export interface FlatFileProvider {
sendInsertDataRequest(params: InsertDataParams): Thenable<InsertDataResponse>;
sendGetColumnInfoRequest(params: GetColumnInfoParams): Thenable<GetColumnInfoResponse>;
sendChangeColumnSettingsRequest(params: ChangeColumnSettingsParams): Thenable<ChangeColumnSettingsResponse>;
sendLearnTransformationRequest(params: LearnTransformationParams): Thenable<LearnTransformationResponse>;
sendSaveTransformationRequest(params: SaveTransformationParams): Thenable<SaveTransformationResponse>;
}

View File

@@ -85,12 +85,22 @@ export class FlatFileImportFeature extends SqlOpsFeature<undefined> {
return requestSender(Contracts.ChangeColumnSettingsRequest.type, params);
};
let sendLearnTransformationRequest = (params: Contracts.LearnTransformationParams): Thenable<Contracts.LearnTransformationResponse> => {
return requestSender(Contracts.LearnTransformationRequest.type, params);
};
let sendSaveTransformationRequest = (params: Contracts.SaveTransformationParams): Thenable<Contracts.SaveTransformationResponse> => {
return requestSender(Contracts.SaveTransformationRequest.type, params);
};
return managerInstance.registerApi<Contracts.FlatFileProvider>(ApiType.FlatFileProvider, {
providerId: client.providerId,
sendPROSEDiscoveryRequest,
sendChangeColumnSettingsRequest,
sendGetColumnInfoRequest,
sendInsertDataRequest
sendInsertDataRequest,
sendLearnTransformationRequest,
sendSaveTransformationRequest
});
}
}