diff --git a/extensions/import/README.md b/extensions/import/README.md index 154df058a1..33aa21c8e3 100644 --- a/extensions/import/README.md +++ b/extensions/import/README.md @@ -1,6 +1,15 @@ # Microsoft SQL Server Import for SQL Operations Studio --- + + Import Flat File Wizard is a simple way to copy data from a flat file (.csv, .txt) to a destination. This overview describes the reasons for using this wizard, how to find this wizard, and a simple example to follow. + + ![image](https://user-images.githubusercontent.com/30873802/43433347-c958ed28-942b-11e8-8bbc-f4f2529c3978.png) + + ## Why would I use this wizard? + This wizard was created to improve the current import experience leveraging an intelligent framework known as Program Synthesis using Examples ([PROSE](https://microsoft.github.io/prose/)). For a user without specialized domain knowledge, importing data can often be a complex, error prone, and tedious task. This wizard streamlines the import process as simple as selecting an input file and unique table name, and the PROSE framework handles the rest. + + PROSE analyzes data patterns in your input file to infer column names, types, delimiters, and more. This framework learns the structure of the file and does all of the hard work so users don't have to. + ## Code of Conduct This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/extensions/import/src/wizard/flatFileWizard.ts b/extensions/import/src/wizard/flatFileWizard.ts index baab7f3c91..386740028a 100644 --- a/extensions/import/src/wizard/flatFileWizard.ts +++ b/extensions/import/src/wizard/flatFileWizard.ts @@ -133,6 +133,11 @@ export class FlatFileWizard { this.wizard.registerNavigationValidator(validator); } + public changeNextButtonLabel(label: string) { + this.wizard.nextButton.label = label; + } + + } diff --git a/extensions/import/src/wizard/pages/fileConfigPage.ts b/extensions/import/src/wizard/pages/fileConfigPage.ts index 482c2ae2c2..e333008869 100644 --- a/extensions/import/src/wizard/pages/fileConfigPage.ts +++ b/extensions/import/src/wizard/pages/fileConfigPage.ts @@ -83,7 +83,9 @@ export class FileConfigPage extends ImportPage { } private async createServerDropdown(): Promise { - this.serverDropdown = this.view.modelBuilder.dropDown().component(); + this.serverDropdown = this.view.modelBuilder.dropDown().withProperties({ + required: true + }).component(); // Handle server changes this.serverDropdown.onValueChanged(async (params) => { @@ -163,7 +165,9 @@ export class FileConfigPage extends ImportPage { } private async createDatabaseDropdown(): Promise { - this.databaseDropdown = this.view.modelBuilder.dropDown().component(); + this.databaseDropdown = this.view.modelBuilder.dropDown().withProperties({ + required: true + }).component(); // Handle database changes this.databaseDropdown.onValueChanged(async (db) => { @@ -226,7 +230,9 @@ export class FileConfigPage extends ImportPage { } private async createFileBrowser(): Promise { - this.fileTextBox = this.view.modelBuilder.inputBox().component(); + this.fileTextBox = this.view.modelBuilder.inputBox().withProperties({ + required: true + }).component(); this.fileButton = this.view.modelBuilder.button().withProperties({ label: localize('flatFileImport.browseFiles', 'Browse'), }).component(); @@ -295,6 +301,8 @@ export class FileConfigPage extends ImportPage { } return true; + }).withProperties({ + required: true, }).component(); this.tableNameTextBox.onTextChanged((tableName) => { @@ -309,7 +317,9 @@ export class FileConfigPage extends ImportPage { private async createSchemaDropdown(): Promise { - this.schemaDropdown = this.view.modelBuilder.dropDown().component(); + this.schemaDropdown = this.view.modelBuilder.dropDown().withProperties({ + required: true + }).component(); this.schemaLoader = this.view.modelBuilder.loadingComponent().withItem(this.schemaDropdown).component(); this.schemaDropdown.onValueChanged(() => { diff --git a/extensions/import/src/wizard/pages/modifyColumnsPage.ts b/extensions/import/src/wizard/pages/modifyColumnsPage.ts index 00608fc007..c48bb99cda 100644 --- a/extensions/import/src/wizard/pages/modifyColumnsPage.ts +++ b/extensions/import/src/wizard/pages/modifyColumnsPage.ts @@ -107,17 +107,20 @@ export class ModifyColumnsPage extends ImportPage { async onPageEnter(): Promise { this.loading.loading = true; await this.populateTable(); + this.instance.changeNextButtonLabel(localize('flatFileImport.importData', 'Import Data')); this.loading.loading = false; return true; } async onPageLeave(): Promise { + this.instance.changeNextButtonLabel(localize('flatFileImport.next', 'Next')); return undefined; } async cleanup(): Promise { delete this.model.proseColumns; + this.instance.changeNextButtonLabel(localize('flatFileImport.next', 'Next')); return true; } @@ -127,6 +130,7 @@ export class ModifyColumnsPage extends ImportPage { return !this.loading.loading; }); } + private async populateTable() { let data: any[][] = []; diff --git a/extensions/import/src/wizard/pages/summaryPage.ts b/extensions/import/src/wizard/pages/summaryPage.ts index 7b6e740faa..d43e782c2f 100644 --- a/extensions/import/src/wizard/pages/summaryPage.ts +++ b/extensions/import/src/wizard/pages/summaryPage.ts @@ -68,6 +68,7 @@ export class SummaryPage extends ImportPage { return !this.loading.loading; }); } + private populateTable() { this.table.updateProperties({ data: [