From 9a86895728cb5b1ae50d6b383a654b9789611497 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Wed, 29 May 2024 17:33:27 -0400 Subject: [PATCH 1/5] FOUR-16305 --- routes/web.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/routes/web.php b/routes/web.php index 317bb87eb6..121eadd537 100644 --- a/routes/web.php +++ b/routes/web.php @@ -141,16 +141,14 @@ ->where('type', 'all|in_progress|completed') ->middleware('no-cache'); // Requests - Route::get('requests/search', [RequestController::class, 'search'])->name('requests.search'); + Route::get('requests', [RequestController::class, 'index'])->name('requests.index')->middleware('no-cache'); + Route::get('requests/{request}', [RequestController::class, 'show'])->name('requests.show'); Route::get('requests/{type?}', [RequestController::class, 'index']) ->where('type', 'all|in_progress|completed') ->name('requests_by_type') ->middleware('no-cache'); Route::get('request/{request}/files/{media}', [RequestController::class, 'downloadFiles'])->middleware('can:view,request'); - Route::get('requests', [RequestController::class, 'index']) - ->name('requests.index') - ->middleware('no-cache'); - Route::get('requests/{request}', [RequestController::class, 'show'])->name('requests.show'); + Route::get('requests/search', [RequestController::class, 'search'])->name('requests.search'); Route::get('requests/mobile/{request}', [RequestController::class, 'show'])->name('requests.showMobile'); Route::get('requests/{request}/task/{task}/screen/{screen}', [RequestController::class, 'screenPreview'])->name('requests.screen-preview'); From 133e85f8e1029cc1a18557d16ae1124756fbdc00 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Wed, 29 May 2024 17:34:20 -0400 Subject: [PATCH 2/5] FOUR-16305: adding redirect to cases --- routes/web.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/routes/web.php b/routes/web.php index 121eadd537..9b190fd6b3 100644 --- a/routes/web.php +++ b/routes/web.php @@ -141,12 +141,15 @@ ->where('type', 'all|in_progress|completed') ->middleware('no-cache'); // Requests - Route::get('requests', [RequestController::class, 'index'])->name('requests.index')->middleware('no-cache'); - Route::get('requests/{request}', [RequestController::class, 'show'])->name('requests.show'); - Route::get('requests/{type?}', [RequestController::class, 'index']) - ->where('type', 'all|in_progress|completed') - ->name('requests_by_type') - ->middleware('no-cache'); + Route::get('requests', function () { + return redirect()->route('cases.index'); + })->name('requests.index')->middleware('no-cache'); + Route::get('requests/{request}', function () { + return redirect()->route('cases.show'); + })->name('requests.show'); + Route::get('requests/{type?}', function ($type = null) { + return redirect()->route('cases_by_type', ['type' => $type]); + })->where('type', 'all|in_progress|completed')->name('requests_by_type')->middleware('no-cache'); Route::get('request/{request}/files/{media}', [RequestController::class, 'downloadFiles'])->middleware('can:view,request'); Route::get('requests/search', [RequestController::class, 'search'])->name('requests.search'); Route::get('requests/mobile/{request}', [RequestController::class, 'show'])->name('requests.showMobile'); From 976ae15da482632b2776766246a164a868cbde82 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Fri, 31 May 2024 14:53:02 -0400 Subject: [PATCH 3/5] Adding changes --- resources/js/tasks/components/TasksList.vue | 2 +- routes/web.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/resources/js/tasks/components/TasksList.vue b/resources/js/tasks/components/TasksList.vue index 8f43156949..b27f874437 100644 --- a/resources/js/tasks/components/TasksList.vue +++ b/resources/js/tasks/components/TasksList.vue @@ -310,7 +310,7 @@ export default { }, { value: "showRequestSummary", - content: "Open Case", + content: "Open Request", icon: "fas fa-clipboard", link: true, href: "/requests/{{process_request.id}}", diff --git a/routes/web.php b/routes/web.php index 9b190fd6b3..b95bd9e0c6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -136,7 +136,6 @@ Route::post('/keep-alive', [LoginController::class, 'keepAlive'])->name('keep-alive'); // Cases Route::get('cases', [RequestController::class, 'index'])->name('cases.index')->middleware('no-cache'); - Route::get('cases/{request}', [RequestController::class, 'show'])->name('cases.show'); Route::get('cases/{type?}', [RequestController::class, 'index'])->name('cases_by_type') ->where('type', 'all|in_progress|completed') ->middleware('no-cache'); @@ -144,12 +143,11 @@ Route::get('requests', function () { return redirect()->route('cases.index'); })->name('requests.index')->middleware('no-cache'); - Route::get('requests/{request}', function () { - return redirect()->route('cases.show'); - })->name('requests.show'); Route::get('requests/{type?}', function ($type = null) { return redirect()->route('cases_by_type', ['type' => $type]); })->where('type', 'all|in_progress|completed')->name('requests_by_type')->middleware('no-cache'); + + Route::get('requests/{request}', [RequestController::class, 'show'])->name('requests.show'); Route::get('request/{request}/files/{media}', [RequestController::class, 'downloadFiles'])->middleware('can:view,request'); Route::get('requests/search', [RequestController::class, 'search'])->name('requests.search'); Route::get('requests/mobile/{request}', [RequestController::class, 'show'])->name('requests.showMobile'); From f7e8ddd0968e5eb0773bccef8afccd18f2209dd0 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Fri, 31 May 2024 16:22:47 -0400 Subject: [PATCH 4/5] Solving issues with test --- tests/Feature/RedirectTest.php | 6 +++--- tests/Feature/RequestTest.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Feature/RedirectTest.php b/tests/Feature/RedirectTest.php index 0da2c3e6b3..eabc218948 100644 --- a/tests/Feature/RedirectTest.php +++ b/tests/Feature/RedirectTest.php @@ -24,11 +24,11 @@ public function test401RedirectsToLogin() 'is_administrator' => false, ]); Auth::login($user); - $response = $this->get('/requests'); + $response = $this->get('/cases'); $response->assertStatus(200); - $response->assertViewIs('requests.index'); + $response->assertViewIs('cases.index'); Auth::logoutCurrentDevice(); - $response = $this->get('/requests'); + $response = $this->get('/cases'); //302 because we want to make sure they are being redirected $response->assertStatus(302); } diff --git a/tests/Feature/RequestTest.php b/tests/Feature/RequestTest.php index f39421c5ec..0388169ace 100644 --- a/tests/Feature/RequestTest.php +++ b/tests/Feature/RequestTest.php @@ -45,10 +45,10 @@ class RequestTest extends TestCase public function testIndexRoute() { // get the URL - $response = $this->webCall('GET', '/requests'); + $response = $this->webCall('GET', '/cases'); $response->assertStatus(200); // check the correct view is called - $response->assertViewIs('requests.index'); + $response->assertViewIs('cases.index'); } /** From 310c5dc9eba17891f57dbb994bab514cb8572bb3 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Mon, 3 Jun 2024 17:25:35 -0400 Subject: [PATCH 5/5] solving test --- tests/Feature/RedirectTest.php | 2 +- tests/Feature/RequestTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Feature/RedirectTest.php b/tests/Feature/RedirectTest.php index eabc218948..f595a5100b 100644 --- a/tests/Feature/RedirectTest.php +++ b/tests/Feature/RedirectTest.php @@ -26,7 +26,7 @@ public function test401RedirectsToLogin() Auth::login($user); $response = $this->get('/cases'); $response->assertStatus(200); - $response->assertViewIs('cases.index'); + $response->assertViewIs('requests.index'); Auth::logoutCurrentDevice(); $response = $this->get('/cases'); //302 because we want to make sure they are being redirected diff --git a/tests/Feature/RequestTest.php b/tests/Feature/RequestTest.php index 0388169ace..ee2138d301 100644 --- a/tests/Feature/RequestTest.php +++ b/tests/Feature/RequestTest.php @@ -48,7 +48,7 @@ public function testIndexRoute() $response = $this->webCall('GET', '/cases'); $response->assertStatus(200); // check the correct view is called - $response->assertViewIs('cases.index'); + $response->assertViewIs('requests.index'); } /**