Skip to content

Commit

Permalink
fix: hide verify button for attendee (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
keenthekeen committed Sep 16, 2024
1 parent 79ff0b7 commit 46f31d1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function show(Request $request, Project $project) {
);
$project->shouldVerify = (
$project->canVerify()
and $project->participants->where('user_id', Auth::id())->isNotEmpty()
and $project->participants->where('user_id', Auth::id())->where('type', '!=', 'attendee')->isNotEmpty()
and ($project->closure_status != ProjectClosureStatus::REJECTED_AND_RESUBMIT)
);

Expand Down
2 changes: 1 addition & 1 deletion resources/js/Components/ProjectClosureStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ const organizerPercentage = computed(() => {
});
const staff = computed(() => props.participants.filter(p => p.type === 'staff'));
const staffPercentage = computed(() => {
return Math.round(staff.filter(p => p.verify_status).length / staff.length * 100);
return Math.round(staff.value.filter(p => p.verify_status).length / staff.value.length * 100);
});
</script>
5 changes: 3 additions & 2 deletions resources/js/Pages/ProjectClosureVerify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
</div>
</div>
</div>
<ProjectClosureStatus v-if="isSubmitted" :participants="item.participants"/>
<ProjectClosureStatus :participants="item.participants"/>
<div class="bg-white shadow overflow-hidden sm:rounded-lg my-4">
<div class="px-4 py-5 sm:px-6">
<h3 class="text-lg leading-6 font-medium text-gray-900">
Expand Down Expand Up @@ -133,7 +133,8 @@
</div>
</div>
</div>
<div v-if="my_participant && !isSubmitted" class="bg-white shadow overflow-hidden sm:rounded-lg my-4">
<div v-if="my_participant && my_participant.type !== 'attendee' && !isSubmitted"
class="bg-white shadow overflow-hidden sm:rounded-lg my-4">
<div class="px-4 py-5 sm:px-6">
<h3 class="text-lg leading-6 font-medium text-gray-900">
กรุณาตรวจสอบรายชื่อนิสิตผู้เกี่ยวข้องข้างต้น
Expand Down

0 comments on commit 46f31d1

Please sign in to comment.