Skip to content

Commit

Permalink
byzer-org#92 Add param uniq when creating notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
wangcheng15 committed Feb 28, 2022
1 parent 79d14f5 commit 6a0f31d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
7 changes: 5 additions & 2 deletions src/components/CreateNoteBook/CreateNoteBook.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,13 @@ export default class CreateNoteBookModal extends Vue {
} else {
res = await this.createNotebook(params)
}
const type = this.form.type.includes('notebook') ? 'notebook' : 'workflow'
const id = res.data.id
const newNotobookInfo = {
id: res.data.id,
id,
name: this.form.name.trim(),
type: this.form.type.includes('notebook') ? 'notebook' : 'workflow'
type,
uniq: type + '_' + id
}
this.callback({ isSubmit: true, newNotobookInfo })
Expand Down
11 changes: 4 additions & 7 deletions src/page/Workspace/Wrapper/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ export default {
type: 'success',
message: this.$t('workspace.createSuccess')
})
this.changeTabList(newNotobookInfo)
}
},
Expand Down Expand Up @@ -440,12 +439,10 @@ export default {
openedList.push(v)
}
})
const toSaveList = openedList.map(v => {
return {
...v,
active: v.uniq === activeNotebook.uniq
}
})
const toSaveList = openedList.map(v => ({
...v,
active: v.uniq === activeNotebook.uniq
}))
await this.saveOpenedNotebook({list: toSaveList})
notNeedGet ? this.getNotebookTab() : this.fetchNotebookList()
} catch (e){
Expand Down

0 comments on commit 6a0f31d

Please sign in to comment.