Merge pull request #14200 from influxdata/tasks-token-update
Add the ability to update a task tokenpull/14215/head
commit
93a9f0e86d
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
1. [14130](https://github.com/influxdata/influxdb/pull/14130): Add static templates for system, docker, redis, kubernetes
|
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. [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]
|
## v2.0.0-alpha.12 [2019-06-13]
|
||||||
|
|
||||||
|
|
|
@ -394,13 +394,18 @@ export const cancel = () => async dispatch => {
|
||||||
export const updateScript = () => async (dispatch, getState: GetStateFunc) => {
|
export const updateScript = () => async (dispatch, getState: GetStateFunc) => {
|
||||||
try {
|
try {
|
||||||
const {
|
const {
|
||||||
tasks: {currentScript: script, currentTask: task, taskOptions},
|
tasks: {currentScript: script, currentTask: task, taskOptions, taskToken},
|
||||||
} = getState()
|
} = getState()
|
||||||
|
|
||||||
const updatedTask: Partial<Task> & {name: string; flux: string} = {
|
const updatedTask: Partial<Task> & {
|
||||||
|
name: string
|
||||||
|
flux: string
|
||||||
|
token: string
|
||||||
|
} = {
|
||||||
flux: script,
|
flux: script,
|
||||||
name: taskOptions.name,
|
name: taskOptions.name,
|
||||||
offset: taskOptions.offset,
|
offset: taskOptions.offset,
|
||||||
|
token: taskToken.token,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taskOptions.taskScheduleType === TaskSchedule.interval) {
|
if (taskOptions.taskScheduleType === TaskSchedule.interval) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ export default class TaskTokenDropdown extends PureComponent<Props> {
|
||||||
>
|
>
|
||||||
{tokens.map(t => (
|
{tokens.map(t => (
|
||||||
<Dropdown.Item id={t.id} key={t.id} value={t}>
|
<Dropdown.Item id={t.id} key={t.id} value={t}>
|
||||||
{t.description}
|
{t.description || 'Name this token'}
|
||||||
</Dropdown.Item>
|
</Dropdown.Item>
|
||||||
))}
|
))}
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|
Loading…
Reference in New Issue