Skip to content

Commit

Permalink
Merge pull request #14992 from influxdata/fix/bucket-order
Browse files Browse the repository at this point in the history
fix: move system buckets to end of list
  • Loading branch information
121watts authored Sep 5, 2019
2 parents cd2d9cb + a344305 commit e3f31a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion ui/src/timeMachine/actions/queryBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,15 @@ export const loadBuckets = () => async (
dispatch(setBuilderBucketsStatus(RemoteDataState.Loading))

try {
const buckets = await queryBuilderFetcher.findBuckets({
let buckets = await queryBuilderFetcher.findBuckets({
url: queryURL,
orgID,
})

const systemBuckets = buckets.filter(b => b.startsWith('_'))
const userBuckets = buckets.filter(b => !b.startsWith('_'))
buckets = [...userBuckets, ...systemBuckets]

const selectedBucket = getActiveQuery(getState()).builderConfig.buckets[0]

dispatch(setBuilderBuckets(buckets))
Expand Down
4 changes: 2 additions & 2 deletions ui/src/timeMachine/components/QueryBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface StateProps {
}

interface DispatchProps {
onLoadBuckets: () => Promise<void>
onLoadBuckets: typeof loadBuckets
onAddTagSelector: () => void
}

Expand Down Expand Up @@ -88,7 +88,7 @@ const mstp = (state: AppState): StateProps => {
}

const mdtp = {
onLoadBuckets: loadBuckets as any,
onLoadBuckets: loadBuckets,
onAddTagSelector: addTagSelector,
}

Expand Down

0 comments on commit e3f31a3

Please sign in to comment.