Skip to content

Commit

Permalink
Merge pull request #108 from LCOGT/update/hackathon-feedback
Browse files Browse the repository at this point in the history
Hackathon Feedback Changes
  • Loading branch information
LTDakin authored Oct 4, 2024
2 parents b90778f + cd4ba9d commit 71cb857
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
9 changes: 3 additions & 6 deletions src/components/DataSession/OperationPipeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,11 @@ async function pollOperationCompletion(operationID) {
// Success Callback for checking operation status
const updateOperationStatus = (response) => {
if(response){
const operationStatus = response.status
const percentCompletion = response.percent_completion
switch(operationStatus){
switch(response.status){
case 'PENDING':
break
case 'IN_PROGRESS':
operationPercentages.value[operationID] = percentCompletion * DEC_TO_PERCENT
operationPercentages.value[operationID] = response.operation_progress * DEC_TO_PERCENT
break
case 'COMPLETED':
operationPercentages.value[operationID] = COMPLETE_PERCENT
Expand All @@ -66,7 +63,7 @@ async function pollOperationCompletion(operationID) {
clearPolling(operationID)
break
default:
console.error('Unknown Operation Status:', operationStatus)
console.error('Unknown Operation Status:', response.status)
}
}
else{
Expand Down
2 changes: 1 addition & 1 deletion src/components/Global/AlertToast.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useAlertsStore } from '../../stores/alerts'
const alertStore = useAlertsStore()
const showAlert = ref(false)
watch(() => alertStore.alertText, () => {
watch(() => alertStore.alertTimeStamp, () => {
showAlert.value = true
setTimeout(() => {
showAlert.value = false
Expand Down
8 changes: 4 additions & 4 deletions src/stores/alerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import { defineStore } from 'pinia'
export const useAlertsStore = defineStore('alerts', {
state() {
return{
// The type of alert to display ('success', 'error', 'warning', 'info')
alertType: 'warning',
// The text to display in the alert
alertText: 'default alert text',
alertType: 'default', // alert type to display ('success', 'error', 'warning', 'info', 'loading')
alertText: 'default alert text', // text displayed in alert
alertTimeStamp: '0' // timestamp of the last alert, used for watching in AlertToast.vue
}
},
actions: {
setAlert(type, text, prefix = '') {
this.alertType = type
this.alertText = prefix ? prefix + ' ' + text : text
this.alertTimeStamp = Date.now()
}
}
})

0 comments on commit 71cb857

Please sign in to comment.