Skip to content

Commit

Permalink
feat(analyses): add loading icon to proposals approve reject buttons …
Browse files Browse the repository at this point in the history
…build_image
  • Loading branch information
brucetony committed Aug 20, 2024
1 parent 22301e0 commit 004e961
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/projects/ApproveRejectButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ const props = defineProps({
});
const toast = useToastService();
const loading = ref(false);
const emit = defineEmits(["updatedRow"]);
async function onSubmitProjectApproval(isApproved: boolean) {
loading.value = true;
const { data: response, status } = await approveRejectProjectProposal(
isApproved,
props.projectId!,
Expand All @@ -22,6 +24,7 @@ async function onSubmitProjectApproval(isApproved: boolean) {
} else {
showFailedSubmission();
}
loading.value = false;
}
const showSuccessfulSubmission = (approval: boolean) => {
Expand Down Expand Up @@ -51,6 +54,7 @@ const showFailedSubmission = () => {
aria-label="Approve"
v-tooltip="'Send approval'"
severity="success"
:loading="loading"
style="margin-right: 10px"
@click="onSubmitProjectApproval(true)"
/>
Expand All @@ -59,6 +63,7 @@ const showFailedSubmission = () => {
aria-label="Reject"
v-tooltip="'Send rejection'"
severity="danger"
:loading="loading"
@click="onSubmitProjectApproval(false)"
/>
</div>
Expand Down

0 comments on commit 004e961

Please sign in to comment.