ui: update project menu on projects change (#11369)

Fixes #11357

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2025-08-01 17:41:02 +05:30 committed by GitHub
parent 3850445b50
commit 1bfebd550c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -33,6 +33,7 @@
<script>
import InfiniteScrollSelect from '@/components/widgets/InfiniteScrollSelect'
import eventBus from '@/config/eventBus'
export default {
name: 'ProjectMenu',
@ -42,7 +43,8 @@ export default {
data () {
return {
selectedProjectId: null,
loading: false
loading: false,
timestamp: new Date().getTime()
}
},
created () {
@ -59,7 +61,8 @@ export default {
projectsApiParams () {
return {
details: 'min',
listall: true
listall: true,
timestamp: this.timestamp
}
}
},
@ -70,6 +73,9 @@ export default {
this.selectedProjectId = newId
}
)
eventBus.on('projects-updated', (args) => {
this.timestamp = new Date().getTime()
})
},
beforeUnmount () {
if (this.unwatchProject) {

View File

@ -1372,6 +1372,9 @@ export default {
if ('successMethod' in action) {
action.successMethod(this, result)
}
if (['createProject', 'updateProject', 'deleteProject'].includes(action.api)) {
eventBus.emit('projects-updated', { action: action.api, project: this.resource })
}
resolve(true)
},
errorMethod: () => {