wip
parent
80e3efa37a
commit
719f296d2d
|
@ -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 = () => {
|
||||||
|
|
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue