Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Suggest transaction_data folders in open workspaces when associating directories #1892

Merged
merged 2 commits into from
Feb 12, 2020

Conversation

erin-hughes
Copy link
Contributor

@erin-hughes erin-hughes commented Feb 10, 2020

Closes #1855 and contributes to #1155

Signed-off-by: Erin Hughes Erin.Hughes@ibm.com

@erin-hughes erin-hughes marked this pull request as ready for review February 11, 2020 16:25
@@ -65,7 +67,18 @@ export async function associateTransactionDataDirectory(chaincode?: Instantiated

gateway = await FabricGatewayConnectionManager.instance().getGatewayRegistryEntry();

const quickPickItems: string[] = [UserInputUtil.BROWSE_LABEL];
const quickPickItems: Array<{ label: string, description: string }> = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be of type IBlockchainQuickPickItem then you can put the path as the data even if you also have the path as the description too

@@ -74,11 +88,12 @@ export async function associateTransactionDataDirectory(chaincode?: Instantiated
filters: undefined
};

const transactionDataPath: string = await UserInputUtil.browse(`Choose a directory to associate with ${chaincodeLabel}`, quickPickItems, openDialogOptions) as string;
if (!transactionDataPath) {
const chosenDirectory: string | { label: string, description: string } = await UserInputUtil.browseWithOptions(`Choose a directory to associate with ${chaincodeLabel}`, quickPickItems, openDialogOptions) as string | {label: string, description: string };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the return type should be a string or a IBlockchainQuickPickItem

Signed-off-by: Erin Hughes <Erin.Hughes@ibm.com>
Copy link
Contributor

@cazfletch cazfletch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sonarcloud
Copy link

sonarcloud bot commented Feb 12, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
40.3% 40.3% Duplication

@cazfletch cazfletch merged commit 48b4ece into IBM-Blockchain:master Feb 12, 2020
@erin-hughes erin-hughes deleted the suggest-dirs-1855 branch February 13, 2020 16:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggest transaction data folders in open projects when associating a test data directory
2 participants