-
Notifications
You must be signed in to change notification settings - Fork 156
[DO NOT MERGE] Delete smart contracts package #66
Conversation
client/src/commands/commandsUtil.ts
Outdated
static async showSmartContractPackagesQuickPickBox(prompt: string): Promise<string | undefined> { | ||
const blockchainPackageExplorerProvider = myExtension.getBlockchainPackageExplorerProvider(); | ||
|
||
const projects: Array<PackageTreeItem> = await blockchainPackageExplorerProvider.getChildren(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be calling your new function
client/src/commands/commandsUtil.ts
Outdated
placeHolder: prompt | ||
}; | ||
|
||
const projectNames = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a type
} | ||
|
||
const blockchainPackageExplorerProvider = myExtension.getBlockchainPackageExplorerProvider(); | ||
const packages: Array<PackageTreeItem> = await blockchainPackageExplorerProvider.getChildren(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be calling this it should use the new function
vscode.window.showErrorMessage('Issue reading smart contract package folder:' + this.packageDir); | ||
return; | ||
} | ||
} | ||
this.tree = await this.createPackageTree(this.packageArray as Array<PackageTreeItem>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.packageArray isn't an array of packageTreeItems
client/src/util/CommandUtil.ts
Outdated
import * as child_process from 'child_process'; | ||
import stripAnsi = require('strip-ansi'); | ||
|
||
import * as childProcessPromise from 'child-process-promise'; | ||
import { ConsoleOutputAdapter } from '../logging/ConsoleOutputAdapter'; | ||
import { OutputAdapter } from '../logging/OutputAdapter'; | ||
import * as fs from 'fs-extra'; | ||
import * as homeDir from 'home-dir'; | ||
import { PackageTreeItem } from '../explorer/model/PackageTreeItem'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't used, if it is and i'm blind you shouldn't be creating packageTreeItems in here it should do this in the packageProvider
@@ -126,4 +128,28 @@ describe('Commands Utility Function Tests', () => { | |||
}); | |||
}); | |||
|
|||
describe('getPackages', () => { | |||
// Should move and rewrite aspects of 'getChildren' tests from blockchainPackageExplorer and move them here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you still need this comment?
await fs.remove(packageDir + '/' + packages[index].name); | ||
|
||
} | ||
return blockchainPackageExplorerProvider.refresh(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should call the refresh command eg vscode.commands.execute('blockchainAPackageExplorer.refreshEntry')
1f901e8
to
0b3ae63
Compare
packageToDelete = await UserInputUtil.showSmartContractPackagesQuickPickBox('Choose the smart contract package that you want to delete'); | ||
} | ||
|
||
const packages: any[] = await CommandUtil.getPackages(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the type string here if so we should change it to be string
client/src/util/CommandUtil.ts
Outdated
|
||
public static async getPackages(): Promise<string[]> { | ||
console.log('CommandUtils: getPackages'); | ||
let packageArray: Array<any> = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an array of strings
0b3ae63
to
c474908
Compare
c474908
to
11d8670
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
11d8670
to
40d75d6
Compare
40d75d6
to
e96b18d
Compare
Closes IBM-Blockchain#9 Signed-off-by: Jakeeyturner <jaketurner25@live.com>
e96b18d
to
1af57f4
Compare
Closes #9
Signed-off-by: Jakeeyturner jaketurner25@live.com