mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
ui: fix notification list reordering intermittently (#7609)
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
a0702279aa
commit
8ad1009ad2
@ -109,7 +109,7 @@ export default {
|
|||||||
(state, getters) => getters.headerNotices,
|
(state, getters) => getters.headerNotices,
|
||||||
(newValue, oldValue) => {
|
(newValue, oldValue) => {
|
||||||
if (oldValue !== newValue && newValue !== undefined) {
|
if (oldValue !== newValue && newValue !== undefined) {
|
||||||
this.notices = newValue.reverse()
|
this.notices = newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@ -348,9 +348,13 @@ const user = {
|
|||||||
if (noticeIdx === -1) {
|
if (noticeIdx === -1) {
|
||||||
noticeArray.push(noticeJson)
|
noticeArray.push(noticeJson)
|
||||||
} else {
|
} else {
|
||||||
|
const existingNotice = noticeArray[noticeIdx]
|
||||||
|
noticeJson.timestamp = existingNotice.timestamp
|
||||||
noticeArray[noticeIdx] = noticeJson
|
noticeArray[noticeIdx] = noticeJson
|
||||||
}
|
}
|
||||||
|
noticeArray.sort(function (a, b) {
|
||||||
|
return new Date(b.timestamp) - new Date(a.timestamp)
|
||||||
|
})
|
||||||
commit('SET_HEADER_NOTICES', noticeArray)
|
commit('SET_HEADER_NOTICES', noticeArray)
|
||||||
},
|
},
|
||||||
ProjectView ({ commit }, projectid) {
|
ProjectView ({ commit }, projectid) {
|
||||||
|
|||||||
@ -65,7 +65,8 @@ export const pollJobPlugin = {
|
|||||||
key: jobId,
|
key: jobId,
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
status: 'progress'
|
status: 'progress',
|
||||||
|
timestamp: new Date()
|
||||||
})
|
})
|
||||||
|
|
||||||
eventBus.on('update-job-details', (args) => {
|
eventBus.on('update-job-details', (args) => {
|
||||||
@ -107,7 +108,8 @@ export const pollJobPlugin = {
|
|||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
status: 'done',
|
status: 'done',
|
||||||
duration: 2
|
duration: 2,
|
||||||
|
timestamp: new Date()
|
||||||
})
|
})
|
||||||
eventBus.emit('update-job-details', { jobId, resourceId })
|
eventBus.emit('update-job-details', { jobId, resourceId })
|
||||||
// Ensure we refresh on the same / parent page
|
// Ensure we refresh on the same / parent page
|
||||||
@ -157,7 +159,8 @@ export const pollJobPlugin = {
|
|||||||
title,
|
title,
|
||||||
description: desc,
|
description: desc,
|
||||||
status: 'failed',
|
status: 'failed',
|
||||||
duration: 2
|
duration: 2,
|
||||||
|
timestamp: new Date()
|
||||||
})
|
})
|
||||||
eventBus.emit('update-job-details', { jobId, resourceId })
|
eventBus.emit('update-job-details', { jobId, resourceId })
|
||||||
// Ensure we refresh on the same / parent page
|
// Ensure we refresh on the same / parent page
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user