Merge pull request #14200 from influxdata/tasks-token-update

Add the ability to update a task token
pull/14215/head
Palakp41 2019-06-26 10:01:01 -07:00 committed by GitHub
commit 93a9f0e86d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -15,6 +15,7 @@
1. [14130](https://github.com/influxdata/influxdb/pull/14130): Add static templates for system, docker, redis, kubernetes
1. [14189] (https://github.com/influxdata/influxdb/pull/14189): Add option to select a token when creating a task
1. [14200] (https://github.com/influxdata/influxdb/pull/14200): Add the ability to update a token when updating a task
## v2.0.0-alpha.12 [2019-06-13]

View File

@ -394,13 +394,18 @@ export const cancel = () => async dispatch => {
export const updateScript = () => async (dispatch, getState: GetStateFunc) => {
try {
const {
tasks: {currentScript: script, currentTask: task, taskOptions},
tasks: {currentScript: script, currentTask: task, taskOptions, taskToken},
} = getState()
const updatedTask: Partial<Task> & {name: string; flux: string} = {
const updatedTask: Partial<Task> & {
name: string
flux: string
token: string
} = {
flux: script,
name: taskOptions.name,
offset: taskOptions.offset,
token: taskToken.token,
}
if (taskOptions.taskScheduleType === TaskSchedule.interval) {

View File

@ -26,7 +26,7 @@ export default class TaskTokenDropdown extends PureComponent<Props> {
>
{tokens.map(t => (
<Dropdown.Item id={t.id} key={t.id} value={t}>
{t.description}
{t.description || 'Name this token'}
</Dropdown.Item>
))}
</Dropdown>