From df19b14c3b9d61487609ef5b846e8418e74cd9a3 Mon Sep 17 00:00:00 2001 From: Palak Bhojani Date: Thu, 17 Jan 2019 14:28:59 -0800 Subject: [PATCH] Create the scraper for the bucket selected in dropdown --- .../components/configureStep/Scraping.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ui/src/onboarding/components/configureStep/Scraping.tsx b/ui/src/onboarding/components/configureStep/Scraping.tsx index d2f7ed5097..56fe1d63c6 100644 --- a/ui/src/onboarding/components/configureStep/Scraping.tsx +++ b/ui/src/onboarding/components/configureStep/Scraping.tsx @@ -14,6 +14,7 @@ import { setScraperTargetURL, saveScraperTarget, } from 'src/onboarding/actions/dataLoaders' +import {setBucketInfo} from 'src/onboarding/actions/steps' // Types import {Bucket} from 'src/api' @@ -30,6 +31,7 @@ interface DispatchProps { onSetScraperTargetBucket: typeof setScraperTargetBucket onSetScraperTargetURL: typeof setScraperTargetURL onSaveScraperTarget: typeof saveScraperTarget + onSetBucketInfo: typeof setBucketInfo } interface StateProps { @@ -101,7 +103,15 @@ export class Scraping extends PureComponent { } private handleSelectBucket = (bucket: string) => { - this.props.onSetScraperTargetBucket(bucket) + const {buckets, onSetScraperTargetBucket, onSetBucketInfo} = this.props + + const findBucket = buckets.find(b => b.name === bucket) + const bucketID = findBucket.id + const org = findBucket.organization + const orgID = findBucket.organizationID + + onSetBucketInfo(org, orgID, bucket, bucketID) + onSetScraperTargetBucket(bucket) } private handleSubmit = async () => { @@ -128,6 +138,7 @@ const mdtp: DispatchProps = { onSetScraperTargetBucket: setScraperTargetBucket, onSetScraperTargetURL: setScraperTargetURL, onSaveScraperTarget: saveScraperTarget, + onSetBucketInfo: setBucketInfo, } export default connect(