-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ui): resolved telegraf bucket dropdown bug and undefined token issue #17363
Conversation
f7337a6
to
45b2e34
Compare
try { | ||
const state = getState() | ||
const org = getOrg(state) | ||
const telegraf = get(state, `resources.telegrafs.byID.${configID}`, '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already a selector for this getByID<Telegraf>(state, id)
const org = getOrg(state) | ||
const telegraf = get(state, `resources.telegrafs.byID.${configID}`, '') | ||
const bucketName = get(telegraf, 'metadata.buckets[0]', '') | ||
const bucket = getBucketByName(state, bucketName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should handle no bucket name being on the telegraf config.
import {isSystemBucket} from 'src/buckets/selectors' | ||
|
||
// Utils | ||
import {isSystemBucket} from 'src/buckets/constants/index' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import {isSystemBucket} from 'src/buckets/constants/index' | |
import {isSystemBucket} from 'src/buckets/constants' |
state: AppState, | ||
bucketName: string | ||
): Bucket => { | ||
const buckets = state.resources.buckets.byID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's already a selector for this also which will get all buckets and return them in a list for you 😄
} | ||
|
||
return auth.token | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
const config = { | ||
...tc, | ||
labels: [label], | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Closes #17118
Problem
Solution
After speaking with @alexpaxton, it became clear that having a button underneath the code snippet made more sense to include rather than having a small button on the same line as the code