Skip to content

Commit 1bfebd5

Browse files
authored
ui: update project menu on projects change (apache#11369)
Fixes apache#11357 Signed-off-by: Abhishek Kumar <[email protected]>
1 parent 3850445 commit 1bfebd5

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

ui/src/components/header/ProjectMenu.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
<script>
3535
import InfiniteScrollSelect from '@/components/widgets/InfiniteScrollSelect'
36+
import eventBus from '@/config/eventBus'
3637
3738
export default {
3839
name: 'ProjectMenu',
@@ -42,7 +43,8 @@ export default {
4243
data () {
4344
return {
4445
selectedProjectId: null,
45-
loading: false
46+
loading: false,
47+
timestamp: new Date().getTime()
4648
}
4749
},
4850
created () {
@@ -59,7 +61,8 @@ export default {
5961
projectsApiParams () {
6062
return {
6163
details: 'min',
62-
listall: true
64+
listall: true,
65+
timestamp: this.timestamp
6366
}
6467
}
6568
},
@@ -70,6 +73,9 @@ export default {
7073
this.selectedProjectId = newId
7174
}
7275
)
76+
eventBus.on('projects-updated', (args) => {
77+
this.timestamp = new Date().getTime()
78+
})
7379
},
7480
beforeUnmount () {
7581
if (this.unwatchProject) {

ui/src/views/AutogenView.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,6 +1372,9 @@ export default {
13721372
if ('successMethod' in action) {
13731373
action.successMethod(this, result)
13741374
}
1375+
if (['createProject', 'updateProject', 'deleteProject'].includes(action.api)) {
1376+
eventBus.emit('projects-updated', { action: action.api, project: this.resource })
1377+
}
13751378
resolve(true)
13761379
},
13771380
errorMethod: () => {

0 commit comments

Comments
 (0)