From caa4a0bf6cb4c46791525028822e0d716433877e Mon Sep 17 00:00:00 2001 From: Shailesh Kala Date: Wed, 20 Mar 2024 14:29:47 +0530 Subject: [PATCH 1/4] fix(*): ui creation for hiring activity --- .../RecruitmentApplicationController.php | 59 +++++++++++++++ resources/js/app.js | 4 + .../Dashboard/UserDashboardHiringActivity.vue | 75 +++++++++++++++++++ resources/views/home.blade.php | 6 ++ 4 files changed, 144 insertions(+) create mode 100644 app/Http/Controllers/HR/Applications/RecruitmentApplicationController.php create mode 100644 resources/js/components/Dashboard/UserDashboardHiringActivity.vue diff --git a/app/Http/Controllers/HR/Applications/RecruitmentApplicationController.php b/app/Http/Controllers/HR/Applications/RecruitmentApplicationController.php new file mode 100644 index 0000000000..f5f092d070 --- /dev/null +++ b/app/Http/Controllers/HR/Applications/RecruitmentApplicationController.php @@ -0,0 +1,59 @@ + request()->get('status') ?: 'non-rejected', + 'job-type' => $this->getApplicationType(), + 'job' => request()->get('hr_job_id'), + 'name' => request()->get('search'), + ]; + $applications = Application::with(['applicant', 'job']) + ->applyFilter($filters) + ->latest() + ->paginate(config('constants.pagination_size')) + ->appends(Request::except('page')); + + $attr = [ + 'applications' => $applications, + 'status' => request()->get('status'), + 'volunteer_on_hold_count' => $this->getCount(['on-hold']), + 'sent_for_approval_count' => $this->getCount(['sent-for-approval']), + 'no_show_count' => $this->getCount(['no-show-reminded']), + 'closed_count' => $this->getCount(['rejected']), + 'open_count' => $this->getCount(['new', 'in-progress']), + 'job-type' => $this->getApplicationType(), + 'jobs' => Job::where('type', 'volunteer')->get(), + ]; + + return view('hr.application.volunteer.index')->with( + $attr + ); + } + + public function getCount($currentStatus) + { + return Application::whereHas('Job', function ($query) { + return $query->where('type', 'volunteer'); + }) + ->whereIn('status', $currentStatus) + ->count(); + } +} diff --git a/resources/js/app.js b/resources/js/app.js index a5c465a4d0..73c4abc5a8 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -83,6 +83,10 @@ Vue.component( "user-dashboard-library", require("./components/Dashboard/UserDashboardLibrary.vue").default ); +Vue.component( + "user-dashboard-hiring", + require("./components/Dashboard/UserDashboardHiringActivity.vue").default +); Vue.component( "user-dashboard-infrastructure", require("./components/Dashboard/UserDashboardInfrastructure.vue").default diff --git a/resources/js/components/Dashboard/UserDashboardHiringActivity.vue b/resources/js/components/Dashboard/UserDashboardHiringActivity.vue new file mode 100644 index 0000000000..b22e7b0c84 --- /dev/null +++ b/resources/js/components/Dashboard/UserDashboardHiringActivity.vue @@ -0,0 +1,75 @@ + + + + diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 9daf90c32e..6fd11cf145 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -45,6 +45,12 @@ @endcan + @if(Module::checkStatus('HR') && auth()->user()->can('hr_recruitment_jobs.view')) +
+ +
+ @endif + @can('projects.view')
From 62fcee0cf5ac96529cb9921c2f36f2f030cd428e Mon Sep 17 00:00:00 2001 From: Shailesh Kala Date: Wed, 20 Mar 2024 15:40:09 +0530 Subject: [PATCH 2/4] fix(*): hiring activity components for last week, month & quarter --- resources/js/app.js | 12 +++++ .../Dashboard/UserDashboardHiringActivity.vue | 24 ++++------ .../UserDashboardHiringLastMonth.vue | 47 +++++++++++++++++++ .../UserDashboardHiringLastQuarter.vue | 47 +++++++++++++++++++ .../Dashboard/UserDashboardHiringLastWeek.vue | 47 +++++++++++++++++++ 5 files changed, 162 insertions(+), 15 deletions(-) create mode 100644 resources/js/components/Dashboard/UserDashboardHiringLastMonth.vue create mode 100644 resources/js/components/Dashboard/UserDashboardHiringLastQuarter.vue create mode 100644 resources/js/components/Dashboard/UserDashboardHiringLastWeek.vue diff --git a/resources/js/app.js b/resources/js/app.js index 73c4abc5a8..c15de3c270 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -87,6 +87,18 @@ Vue.component( "user-dashboard-hiring", require("./components/Dashboard/UserDashboardHiringActivity.vue").default ); +Vue.component( + "user-hiring-last-week", + require("./components/Dashboard/UserDashboardHiringLastWeek.vue").default +); +Vue.component( + "user-hiring-last-month", + require("./components/Dashboard/UserDashboardHiringLastMonth.vue").default +); +Vue.component( + "user-hiring-last-quarter", + require("./components/Dashboard/UserDashboardHiringLastQuarter.vue").default +); Vue.component( "user-dashboard-infrastructure", require("./components/Dashboard/UserDashboardInfrastructure.vue").default diff --git a/resources/js/components/Dashboard/UserDashboardHiringActivity.vue b/resources/js/components/Dashboard/UserDashboardHiringActivity.vue index b22e7b0c84..5224c866ec 100644 --- a/resources/js/components/Dashboard/UserDashboardHiringActivity.vue +++ b/resources/js/components/Dashboard/UserDashboardHiringActivity.vue @@ -1,14 +1,14 @@