Skip to content

Commit

Permalink
feat(ui): Clone a task's labels when cloning the task
Browse files Browse the repository at this point in the history
Move task cloning logic to external client library
  • Loading branch information
ischolten committed Feb 22, 2019
1 parent ecb37d7 commit aba8b9e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 19 deletions.
47 changes: 33 additions & 14 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
},
"dependencies": {
"@influxdata/clockface": "0.0.5",
"@influxdata/influx": "0.2.15",
"@influxdata/influx": "0.2.16",
"@influxdata/react-custom-scrollbars": "4.3.8",
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
Expand Down
6 changes: 2 additions & 4 deletions ui/src/tasks/actions/v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,12 @@ export const deleteTask = (task: Task) => async dispatch => {

export const cloneTask = (task: Task, _) => async dispatch => {
try {
// const allTaskNames = tasks.map(t => t.name)
// const clonedName = incrementCloneName(allTaskNames, task.name)
await client.tasks.create(task.orgID, task.flux)
await client.tasks.clone(task.id)

dispatch(notify(taskCloneSuccess(task.name)))
dispatch(populateTasks())
} catch (e) {
console.error(e)
console.log(e)
const message = getErrorMessage(e)
dispatch(notify(taskCloneFailed(task.name, message)))
}
Expand Down

0 comments on commit aba8b9e

Please sign in to comment.