pull/15058/head
Palak Bhojani 2019-09-06 17:51:06 -07:00
parent 80e3efa37a
commit 719f296d2d
2 changed files with 31 additions and 15 deletions

View File

@ -61,6 +61,18 @@ class BucketRow extends PureComponent<Props & WithRouterProps> {
onAddLineProtocol={this.handleAddLineProtocol} onAddLineProtocol={this.handleAddLineProtocol}
onAddScraper={this.handleAddScraper} onAddScraper={this.handleAddScraper}
/> />
{this.renameDeleteButtons}
</FlexBox>
</ResourceCard>
)
}
private renameDeleteButtons() {
const {bucket} = this.props
{
if (bucket.type === 'user') {
return (
<>
<Button <Button
text="Rename" text="Rename"
testID="bucket-rename" testID="bucket-rename"
@ -75,9 +87,10 @@ class BucketRow extends PureComponent<Props & WithRouterProps> {
onClick={this.handleDeleteData} onClick={this.handleDeleteData}
/> />
</FeatureFlag> </FeatureFlag>
</FlexBox> </>
</ResourceCard>
) )
} else return <></>
}
} }
private handleDeleteData = () => { private handleDeleteData = () => {

View File

@ -292,7 +292,10 @@ export const checkBucketLimits = () => async (
} = getState() } = getState()
const bucketsMax = extractBucketMax(limits) const bucketsMax = extractBucketMax(limits)
const bucketsCount = list.length const buckets = list.filter(function(bucket) {
return bucket.type == 'user'
})
const bucketsCount = buckets.length
if (bucketsCount >= bucketsMax) { if (bucketsCount >= bucketsMax) {
dispatch(setBucketLimitStatus(LimitStatus.EXCEEDED)) dispatch(setBucketLimitStatus(LimitStatus.EXCEEDED))