diff --git a/app/Http/Controllers/QuickSearchController.php b/app/Http/Controllers/QuickSearchController.php
index acebfdc..a9f8e7a 100644
--- a/app/Http/Controllers/QuickSearchController.php
+++ b/app/Http/Controllers/QuickSearchController.php
@@ -4,9 +4,10 @@ namespace App\Http\Controllers;
use App\Enums\PbgTaskApplicationTypes;
use App\Enums\PbgTaskStatus;
+use App\Http\Resources\TaskAssignmentsResource;
use App\Models\PbgTask;
+use App\Models\TaskAssignment;
use Illuminate\Http\Request;
-use function Illuminate\Log\log;
class QuickSearchController extends Controller
{
@@ -66,4 +67,21 @@ class QuickSearchController extends Controller
return response()->view('pages.404', [], 500); // Optional: create `resources/views/errors/500.blade.php`
}
}
+
+ public function task_assignments(Request $request, $uuid){
+ try{
+ $query = TaskAssignment::query()
+ ->where('pbg_task_uid', $uuid)
+ ->orderBy('id', 'desc');
+
+ if ($request->filled('search')) {
+ $query->where('name', 'like', "%{$request->get('search')}%")
+ ->orWhere('email', 'like', "%{$request->get('search')}%");
+ }
+
+ return TaskAssignmentsResource::collection($query->paginate(config('app.paginate_per_page', 50)));
+ }catch(\Exception $exception){
+ return response()->json(['message' => $exception->getMessage()], 500);
+ }
+ }
}
diff --git a/resources/js/quick-search/detail.js b/resources/js/quick-search/detail.js
index e69de29..55ad8a8 100644
--- a/resources/js/quick-search/detail.js
+++ b/resources/js/quick-search/detail.js
@@ -0,0 +1,70 @@
+import { Grid } from "gridjs";
+class QuickSearchDetail {
+ init() {
+ this.initTablePbgTaskAssignments();
+ }
+
+ initTablePbgTaskAssignments() {
+ let tableContainer = document.getElementById(
+ "table-pbg-task-assignments"
+ );
+
+ let url_task_assignments = document.getElementById(
+ "url_task_assignments"
+ ).value;
+
+ new Grid({
+ columns: [
+ "ID",
+ "Nama",
+ "Email",
+ "Nomor Telepon",
+ "Keahlian",
+ "Status",
+ ],
+ search: {
+ server: {
+ url: (prev, keyword) => `${prev}?search=${keyword}`,
+ },
+ debounceTimeout: 1000,
+ },
+ pagination: {
+ limit: 15,
+ server: {
+ url: (prev, page) =>
+ `${prev}${prev.includes("?") ? "&" : "?"}page=${
+ page + 1
+ }`,
+ },
+ },
+ sort: true,
+ server: {
+ url: `${url_task_assignments}`,
+ then: (data) => {
+ return data.data.map((item) => {
+ const expertiseArray =
+ typeof item.expertise === "string"
+ ? JSON.parse(item.expertise)
+ : item.expertise;
+
+ return [
+ item.id,
+ item.name,
+ item.email,
+ item.phone_number,
+ Array.isArray(expertiseArray)
+ ? expertiseArray.map((e) => e.name).join(", ")
+ : "-",
+ item.status_name,
+ ];
+ });
+ },
+ total: (data) => data.meta.total,
+ },
+ }).render(tableContainer);
+ }
+}
+
+document.addEventListener("DOMContentLoaded", function (e) {
+ new QuickSearchDetail().init();
+});
diff --git a/resources/js/quick-search/result.js b/resources/js/quick-search/result.js
index 7b824e7..8c291bf 100644
--- a/resources/js/quick-search/result.js
+++ b/resources/js/quick-search/result.js
@@ -4,13 +4,56 @@ class QuickSearchResult {
constructor() {
this.table = null;
const baseInput = document.getElementById("base_url_datatable");
- this.datatableUrl = baseInput ? baseInput.value : "";
+ this.baseUrl = baseInput ? baseInput.value.split("?")[0] : "";
+ this.keywordInput = document.getElementById("search_input");
+ this.searchButton = document.getElementById("search_button");
+
+ this.datatableUrl = this.buildUrl(this.keywordInput.value);
}
init() {
+ this.bindSearchButton();
this.initDatatable();
}
+ bindSearchButton() {
+ const handleSearch = () => {
+ const newKeyword = this.keywordInput.value.trim();
+ if (newKeyword !== "") {
+ // 1. Update datatable URL and reload
+ this.datatableUrl = this.buildUrl(newKeyword);
+ this.initDatatable();
+
+ // 2. Update URL query string (without reloading the page)
+ const newUrl = `${
+ window.location.pathname
+ }?keyword=${encodeURIComponent(newKeyword)}`;
+ window.history.pushState({ path: newUrl }, "", newUrl);
+
+ // 3. Update visible keyword text in {{ $keyword }}>
+ const keywordDisplay = document.querySelector(".qs-header em");
+ if (keywordDisplay) {
+ keywordDisplay.textContent = newKeyword;
+ }
+ }
+ };
+
+ this.searchButton.addEventListener("click", handleSearch);
+
+ this.keywordInput.addEventListener("keydown", (event) => {
+ if (event.key === "Enter") {
+ event.preventDefault();
+ handleSearch();
+ }
+ });
+ }
+
+ buildUrl(keyword) {
+ const url = new URL(this.baseUrl, window.location.origin);
+ url.searchParams.set("search", keyword);
+ return url.toString();
+ }
+
initDatatable() {
const tableContainer = document.getElementById(
"datatable-quick-search-result"
@@ -73,7 +116,12 @@ class QuickSearchResult {
};
if (this.table) {
- this.table = this.table.updateConfig(config).forceRender();
+ this.table
+ .updateConfig({
+ ...config,
+ server: { ...config.server, url: this.datatableUrl },
+ })
+ .forceRender();
} else {
tableContainer.innerHTML = "";
this.table = new Grid(config).render(tableContainer);
diff --git a/resources/scss/pages/quick-search/detail.scss b/resources/scss/pages/quick-search/detail.scss
new file mode 100644
index 0000000..0b3c2eb
--- /dev/null
+++ b/resources/scss/pages/quick-search/detail.scss
@@ -0,0 +1,73 @@
+.qs-detail-container {
+ color: #000; // black text
+ font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
+
+ .card {
+ background-color: #fff;
+
+ .card-header {
+ background-color: #f5f5f5;
+ font-weight: bold;
+ color: #000;
+ }
+
+ .card-body {
+ dt {
+ font-weight: 600;
+ color: #000;
+ }
+
+ dd {
+ margin-bottom: 10px;
+ color: #000;
+ }
+
+ .nav-tabs {
+ border-bottom: 1px solid #000;
+
+ .nav-link {
+ color: #000;
+ border: 1px solid transparent;
+ border-top-left-radius: 0.25rem;
+ border-top-right-radius: 0.25rem;
+ font-weight: 500;
+
+ &.active {
+ background-color: #e0e0e0;
+ border-color: #000 #000 #fff;
+ }
+
+ &:hover {
+ color: #000;
+ }
+ }
+ }
+
+ .tab-content {
+ padding: 1rem;
+ }
+
+ .mb-3 {
+ dt {
+ font-weight: bold;
+ }
+
+ dd {
+ margin-left: 0;
+ }
+ }
+
+ .border {
+ border-color: #000 !important;
+ }
+
+ .shadow-sm {
+ box-shadow: none !important;
+ }
+
+ .rounded {
+ border-radius: 4px !important;
+ }
+ }
+ }
+}
diff --git a/resources/scss/pages/quick-search/result.scss b/resources/scss/pages/quick-search/result.scss
index 7578421..4eea864 100644
--- a/resources/scss/pages/quick-search/result.scss
+++ b/resources/scss/pages/quick-search/result.scss
@@ -1,11 +1,52 @@
.qs-wrapper {
- padding: 30px 15px;
- max-width: 1200px;
+ width: 100%;
margin: 0 auto;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
color: #2c3e50;
}
+.qs-toolbar {
+ border-bottom: 1px solid #e0e0e0;
+ margin-bottom: 1.5rem;
+}
+
+.qs-search-form {
+ width: 100%;
+ .gsp-input {
+ width: 100%;
+ height: 44px;
+ font-size: 16px;
+ padding: 0 20px;
+ border-radius: 24px;
+ border: 1px solid #dfe1e5;
+ background-color: #fff;
+ box-shadow: none;
+ transition: box-shadow 0.2s ease-in-out, border-color 0.2s;
+
+ &:focus {
+ border-color: transparent;
+ box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
+ outline: none;
+ }
+ }
+
+ .gsp-btn {
+ height: 44px;
+ padding: 0 24px;
+ font-size: 16px;
+ border: none;
+ border-radius: 24px;
+ background-color: #1a73e8;
+ color: white;
+ cursor: pointer;
+ transition: background-color 0.2s ease-in-out;
+
+ &:hover {
+ background-color: #1558d6;
+ }
+ }
+}
+
.qs-header {
margin-bottom: 30px;
text-align: center;
@@ -30,7 +71,6 @@
.qs-table-wrapper {
background-color: #fff;
border-radius: 10px;
- padding: 20px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
overflow-x: auto; // allow horizontal scroll on small screens
}
diff --git a/resources/views/auth/signin.blade.php b/resources/views/auth/signin.blade.php
index 35ce76a..5475ea7 100755
--- a/resources/views/auth/signin.blade.php
+++ b/resources/views/auth/signin.blade.php
@@ -21,8 +21,8 @@ class="authentication-bg"
-
Sign in to your account to continue
+Masuk kedalam akun untuk melihat lebih lanjut