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,
|
||||
(newValue, oldValue) => {
|
||||
if (oldValue !== newValue && newValue !== undefined) {
|
||||
this.notices = newValue.reverse()
|
||||
this.notices = newValue
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@ -348,9 +348,13 @@ const user = {
|
||||
if (noticeIdx === -1) {
|
||||
noticeArray.push(noticeJson)
|
||||
} else {
|
||||
const existingNotice = noticeArray[noticeIdx]
|
||||
noticeJson.timestamp = existingNotice.timestamp
|
||||
noticeArray[noticeIdx] = noticeJson
|
||||
}
|
||||
|
||||
noticeArray.sort(function (a, b) {
|
||||
return new Date(b.timestamp) - new Date(a.timestamp)
|
||||
})
|
||||
commit('SET_HEADER_NOTICES', noticeArray)
|
||||
},
|
||||
ProjectView ({ commit }, projectid) {
|
||||
|
||||
@ -65,7 +65,8 @@ export const pollJobPlugin = {
|
||||
key: jobId,
|
||||
title,
|
||||
description,
|
||||
status: 'progress'
|
||||
status: 'progress',
|
||||
timestamp: new Date()
|
||||
})
|
||||
|
||||
eventBus.on('update-job-details', (args) => {
|
||||
@ -107,7 +108,8 @@ export const pollJobPlugin = {
|
||||
title,
|
||||
description,
|
||||
status: 'done',
|
||||
duration: 2
|
||||
duration: 2,
|
||||
timestamp: new Date()
|
||||
})
|
||||
eventBus.emit('update-job-details', { jobId, resourceId })
|
||||
// Ensure we refresh on the same / parent page
|
||||
@ -157,7 +159,8 @@ export const pollJobPlugin = {
|
||||
title,
|
||||
description: desc,
|
||||
status: 'failed',
|
||||
duration: 2
|
||||
duration: 2,
|
||||
timestamp: new Date()
|
||||
})
|
||||
eventBus.emit('update-job-details', { jobId, resourceId })
|
||||
// Ensure we refresh on the same / parent page
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user