Skip to content

feature/FOUR15685: Replace the Request for Cases #6874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions ProcessMaker/Http/Middleware/GenerateMenus.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public function handle(Request $request, Closure $next)
});
$menu->group(['prefix' => 'requests'], function ($request_items) {
$request_items->add(
__('Requests'),
['route' => 'requests.index', 'id' => 'requests']
__('Cases'),
['route' => 'cases.index', 'id' => 'requests']
)->active('requests/*');
});
//@TODO change the index to the correct blade
Expand Down Expand Up @@ -141,21 +141,21 @@ public function handle(Request $request, Closure $next)
});
Menu::make('sidebar_request', function ($menu) {
$submenu = $menu->add(__('Request'));
$submenu->add(__('My Requests'), [
'route' => ['requests_by_type', ''],
$submenu->add(__('My Cases'), [
'route' => ['cases_by_type', ''],
'icon' => 'fa-id-badge',
]);
$submenu->add(__('In Progress'), [
'route' => ['requests_by_type', 'in_progress'],
'route' => ['cases_by_type', 'in_progress'],
'icon' => 'fa-clipboard-list',
]);
$submenu->add(__('Completed'), [
'route' => ['requests_by_type', 'completed'],
'route' => ['cases_by_type', 'completed'],
'icon' => 'fa-clipboard-check',
]);
if (\Auth::check() && \Auth::user()->can('view-all_requests')) {
$submenu->add(__('All Requests'), [
'route' => ['requests_by_type', 'all'],
$submenu->add(__('All Cases'), [
'route' => ['cases_by_type', 'all'],
'icon' => 'fa-clipboard',
]);
}
Expand Down
8 changes: 8 additions & 0 deletions resources/img/cases-loading.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/js/components/requests/requestModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
</svg>
</div>
</div>
<h4>{{ $t('Finding Requests available to you...') }}</h4>
<h4>{{ $t('Finding Cases available to you...') }}</h4>
</div>

<pagination
Expand Down
56 changes: 42 additions & 14 deletions resources/js/processes-catalogue/components/DefaultTab.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<template>
<div class="d-flex align-items-center justify-content-center flex-column tab-container">
<img
:src="imageSrc"
:alt="altText"
/>
<div class="text-center">
<strong>{{ titleText }}</strong>
</div>
<div class="text-center">
{{ descriptionText }}
<div class="content-text">
<img
:src="imageSrc"
:alt="altText"
/>
<span class="title">{{ titleText }}</span>
<span class="title-section">{{ descriptionText }}</span>
</div>
</div>
</template>
Expand All @@ -18,7 +16,7 @@ export default {
props: {
imageSrc: {
type: String,
default: "/img/tasks-loading.svg",
default: "/img/cases-loading.svg",
},
altText: {
type: String,
Expand All @@ -38,8 +36,38 @@ export default {

<style scoped>
.tab-container {
width: auto;
height: 622px;
background-color: white;
}
width: auto;
height: 622px;
background-color: white;
}
.content-text .title,
.content-text .title-section {
line-height: 1.2;
}
.content-text {
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
}
.title {
color: var(--text-only, #556271);
text-align: center;
font-family: "Open Sans", sans-serif;
font-size: 24px;
font-style: normal;
font-weight: 600;
line-height: 38px; /* 158.333% */
letter-spacing: -0.96px;
}
.title-section {
color: var(--text-only, #556271);
text-align: center;
font-family: "Open Sans", sans-serif;
font-size: 15px;
font-style: normal;
font-weight: 400;
line-height: 27px; /* 180% */
letter-spacing: -0.3px;
}
</style>
2 changes: 1 addition & 1 deletion resources/js/processes-catalogue/components/ProcessTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
lazy
>
<b-tab
:title="$t('My Requests')"
:title="$t('My Cases')"
active
>
<request-tab
Expand Down
4 changes: 2 additions & 2 deletions resources/js/processes-catalogue/components/RequestTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<div v-else>
<default-tab
:alt-text="$t('No Image')"
:title-text="$t('You have made no requests of this process.')"
:description-text="$t('All your requests will be shown here')"
:title-text="$t('No items to show.')"
:description-text="$t('You have to start a Case of this process.')"
/>
</div>
</div>
Expand Down
6 changes: 2 additions & 4 deletions resources/js/processes-catalogue/components/TaskTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
<div v-else>
<default-tab
:alt-text="$t('No Image')"
:title-text="$t('You have no tasks from this process.')"
:description-text="
$t('All your tasks related to this process will be shown here')
"
:title-text="$t('No items to show.')"
:description-text="$t('You have to start a Case of this process.')"
/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/tasks/components/TasksList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export default {
},
{
value: "showRequestSummary",
content: "Open Request",
content: "Open Case",
icon: "fas fa-clipboard",
link: true,
href: "/requests/{{process_request.id}}",
Expand Down
9 changes: 7 additions & 2 deletions resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"Align Top": "Align Top",
"All {{assets}} will be included in this export.": "All {{assets}} will be included in this export.",
"All assignments were saved.": "All assignments were saved.",
"All Cases": "All Cases",
"All Clear": "All Clear",
"All elements related to this process will be imported.": "All elements related to this process will be imported.",
"All Notifications": "All Notifications",
Expand Down Expand Up @@ -251,7 +252,7 @@
"Call Activity": "Call Activity",
"Callback": "Callback",
"Can not assign this task because there is no previous user assigned before this task": "Can not assign this task because there is no previous user assigned before this task",
"Cancel Request": "Cancel Request",
"Cancel Case": "Cancel Case",
"Cancel Screen": "Cancel Screen",
"Cancel": "Cancel",
"Cancel And Go Back": "Cancel And Go Back",
Expand All @@ -262,6 +263,7 @@
"CAPTCHA controls cannot be placed within a Loop control.": "CAPTCHA controls cannot be placed within a Loop control.",
"Case": "Case",
"Case by Status": "Case by Status",
"Cases": "Cases",
"Cases Started": "Cases Started",
"Catch Events": "Catch Events",
"Categories are required to create a process": "Categories are required to create a process",
Expand Down Expand Up @@ -730,7 +732,7 @@
"Filter Controls": "Filter Controls",
"Filter the column:": "Filter the column:",
"Filter": "Filter",
"Finding Requests available to you...": "Finding Requests available to you...",
"Finding Cases available to you...": "Finding Cases available to you...",
"First Name": "First Name",
"Flow completed": "Flow completed",
"Flow in loop": "Flow in loop",
Expand Down Expand Up @@ -993,6 +995,7 @@
"Multi-Instance (Sequential)": "Multi-Instance (Sequential)",
"Multicolumn / Table": "Multicolumn / Table",
"Must be unique": "Must be unique",
"My Cases": "My Cases",
"My Bookmarks": "My Bookmarks",
"My Projects": "My Projects",
"My Requests": "My Requests",
Expand Down Expand Up @@ -1066,6 +1069,7 @@
"No elements found. Consider changing the search query.": "No elements found. Consider changing the search query.",
"No Errors": "No Errors",
"No files available for download": "No files available for download",
"No items to show.": "No items to show.",
"No Image": "No Image",
"No Loop Mode": "No Loop Mode",
"No new notifications at the moment.": "No new notifications at the moment.",
Expand Down Expand Up @@ -2108,6 +2112,7 @@
"You have {{ inOverDue }} overdue {{ taskText }} pending": "You have {{ inOverDue }} overdue {{ taskText }} pending",
"You have made no requests of this process.": "You have made no requests of this process.",
"You have no tasks from this process.": "You have no tasks from this process.",
"You have to start a Case of this process.": "You have to start a Case of this process.",
"You must authorize your account before configuring folders": "You must authorize your account before configuring folders",
"You must have your database credentials available in order to continue.": "You must have your database credentials available in order to continue.",
"You must select at least one day.": "You must select at least one day.",
Expand Down
9 changes: 7 additions & 2 deletions resources/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"After importing, you can reassign users and groups to your Process.": "Después de importar, puede reasignar usuarios y grupos a su Proceso.",
"After": "Después",
"All assignments were saved.": "Todas las tareas fueron guardadas.",
"All Cases": "Todos los casos",
"All Notifications": "Todas las notificaciones",
"All Requests": "Todas las solicitudes",
"All Rights Reserved": "Todos los derechos reservados",
Expand Down Expand Up @@ -113,7 +114,7 @@
"Calcs": "Calculadas",
"Calculated Properties": "Propiedades calculadas",
"Call Activity": "Actividad de llamadas",
"Cancel Request": "Cancelar solicitud",
"Cancel Case": "Cancelar solicitud",
"Cancel Screen": "Cancelar pantalla",
"Cancel": "Cancelar",
"Canceled": "Cancelado",
Expand Down Expand Up @@ -366,7 +367,7 @@
"Filter Controls": "Controles de filtro",
"Filter the column:": "Filtrar la columna:",
"Filter": "Filtrar",
"Finding Requests available to you...": "Buscando solicitudes disponibles para usted...",
"Finding Cases available to you...": "Buscando solicitudes disponibles para usted...",
"First Name": "Nombre de pila",
"Flow splits implicitly": "El flujo se divide implícitamente",
"Font Size": "Tamaño de fuente",
Expand Down Expand Up @@ -492,6 +493,7 @@
"Must be unique": "Debe ser único",
"Multi Column": "Múltiples columnas",
"Multicolumn / Table": "Columnas múltiples/tabla",
"My Cases": "Mis Casos",
"My Requests": "Mis solicitudes",
"Name must be unique": "El nombre debe ser único",
"Name of Variable to store the output": "Nombre de variable para almacenar la salida",
Expand Down Expand Up @@ -534,6 +536,7 @@
"No Data Found": "Ne se encontraron datos",
"No elements found. Consider changing the search query.": "No se encontraron elementos. Considere cambiar la consulta de búsqueda.",
"No Errors": "Sin errores",
"No items to show.": "No hay casos para mostrar.",
"No files available for download": "No hay archivos disponibles para descarga",
"No Notifications Found": "No se encontraron notificaciones",
"no problems to report": "sin problemas que reportar",
Expand Down Expand Up @@ -1006,6 +1009,7 @@
"You don't currently have any tasks assigned to you": "Actualmente no tiene tareas asignadas",
"You don't have any Processes.": "Usted no tiene ningún proceso.",
"You have {{ inOverDue }} overdue {{ taskText }} pending": "Tiene {{ inOverDue }} vencidos {{ taskText }} pendiente",
"You have to start a Case of this process.": "Usted tiene que iniciar un caso en este proceso",
"You must have your database credentials available in order to continue.": "Debe tener las credenciales de su base de datos disponibles para poder continuar.",
"Your account has been timed out for security.": "Se ha finalizado el tiempo de espera por motivos de seguridad.",
"Your password has been reset!": "¡Su contraseña ha sido restablecida!",
Expand Down Expand Up @@ -1302,6 +1306,7 @@
"Browser": "Navegador",
"Callback": "Devolución de llamada",
"Case": "Caso",
"Cases": "Casos",
"Catch Events": "Eventos de captura",
"Change Version Details": "Cambiar detalles de la versión",
"Check Flow": "Comprobar flujo",
Expand Down
4 changes: 2 additions & 2 deletions resources/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"Calcs": "Calculs",
"Calculated Properties": "Propriétés calculées",
"Call Activity": "Activité d'appel",
"Cancel Request": "Annuler la demande",
"Cancel Case": "Annuler la demande",
"Cancel Screen": "Annuler l'écran",
"Cancel": "Annuler",
"Canceled": "Annulé",
Expand Down Expand Up @@ -365,7 +365,7 @@
"Filter Controls": "Commandes de filtre",
"Filter the column:": "Filtrer la colonne:",
"Filter": "Filtrer",
"Finding Requests available to you...": "Trouver des demandes disponibles pour vous...",
"Finding Cases available to you...": "Trouver des demandes disponibles pour vous...",
"First Name": "Prénom",
"Flow splits implicitly": "Le flux se divise implicitement",
"Font Size": "Taille de police",
Expand Down
2 changes: 1 addition & 1 deletion resources/views/processes/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
</small>
</div>
<div class="form-group p-0">
{!! Form::label('cancelRequest', __('Cancel Request')) !!}
{!! Form::label('cancelRequest', __('Cancel Case')) !!}
<multiselect id="cancelRequest"
v-model="canCancel"
:options="activeUsersAndGroupsWithManager"
Expand Down
18 changes: 9 additions & 9 deletions resources/views/requests/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@section('breadcrumbs')
@include('shared.breadcrumbs', ['routes' => [
__('Requests') => route('requests.index'),
__('Cases') => route('requests.index'),
function() use ($title) { return [__($title), null]; }
]])
@endsection
Expand All @@ -22,31 +22,31 @@ function() use ($title) { return [__($title), null]; }
<counter-card
color="info"
icon="id-badge"
link="{{ route('requests_by_type', ['type' => '']) }}"
title="My Requests"
link="{{ route('cases_by_type', ['type' => '']) }}"
url='requests?total=true&pmql=(status = "In Progress") AND (requester = "{{ Auth::user()->username }}")'
:title="__('My Cases')"
></counter-card>
<counter-card
color="success"
icon="clipboard-list"
link="{{ route('requests_by_type', ['type' => 'in_progress']) }}"
title="In Progress"
link="{{ route('cases_by_type', ['type' => 'in_progress']) }}"
url='requests?total=true&pmql=(status = "In Progress")'
:title="__('In Progress')"
></counter-card>
<counter-card
color="primary"
icon="clipboard-check"
link="{{ route('requests_by_type', ['type' => 'completed']) }}"
title="Completed"
link="{{ route('cases_by_type', ['type' => 'completed']) }}"
url='requests?total=true&pmql=(status = "Completed")'
:title="__('Completed')"
></counter-card>
@can('view-all_requests')
<counter-card
color="secondary"
icon="clipboard"
link="{{ route('requests_by_type', ['type' => 'all']) }}"
title="All Requests"
link="{{ route('cases_by_type', ['type' => 'all']) }}"
url='requests?total=true'
:title="__('All Cases')"
></counter-card>
@endcan
</counter-card-group>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/requests/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class="btn d-block mr-0 ml-auto button-collapse"
<li class="list-group-item">
<button type="button" class="btn btn-outline-custom btn-block" @click="onCancel"
aria-haspopup="dialog">
{{ __('Cancel Request') }}
{{ __('Cancel Case') }}
</button>
</li>
@endif
Expand Down
2 changes: 2 additions & 0 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@
});
Route::get('/tasks/rule-execution-log', [InboxRulesController::class, 'executionLog'])->name('inboxrules.execution-log');

// Cases
Route::get('cases', [ProcessRequestController::class, 'index'])->name('cases.index');
// Requests
Route::get('requests', [ProcessRequestController::class, 'index'])->name('requests.index'); // Already filtered in controller
Route::get('requests/{process}/count', [ProcessRequestController::class, 'getCount'])->name('requests.count');
Expand Down
8 changes: 7 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,13 @@
Route::get('/redirect-to-intended', [HomeController::class, 'redirectToIntended'])->name('redirect_to_intended');

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');
// Requests
Route::get('requests/search', [RequestController::class, 'search'])->name('requests.search');
Route::get('requests/{type?}', [RequestController::class, 'index'])
->where('type', 'all|in_progress|completed')
Expand Down
Loading