From b441c9350bd33db10eaae5e5e1fe226c8073d76e Mon Sep 17 00:00:00 2001 From: khalil Abu jayab <74875624+khalilJayab@users.noreply.github.com> Date: Tue, 18 Jul 2023 00:44:02 +0300 Subject: [PATCH 1/5] add filter to journal --- app/Http/Controllers/JournalController.php | 20 ++++- .../js/components/journal/JournalList.vue | 85 ++++++++++++++----- resources/lang/ar/journal.php | 7 ++ resources/lang/cs/journal.php | 7 ++ resources/lang/da/journal.php | 7 ++ resources/lang/de/journal.php | 7 ++ resources/lang/el/journal.php | 7 ++ resources/lang/en-GB/journal.php | 7 ++ resources/lang/en/journal.php | 7 ++ resources/lang/es/journal.php | 7 ++ resources/lang/fa/journal.php | 7 ++ resources/lang/fi/journal.php | 7 ++ resources/lang/fr/journal.php | 7 ++ resources/lang/he/journal.php | 7 ++ resources/lang/hr/journal.php | 7 ++ resources/lang/id/journal.php | 7 ++ resources/lang/it/journal.php | 7 ++ resources/lang/ja/journal.php | 7 ++ resources/lang/nl/journal.php | 7 ++ resources/lang/no/journal.php | 7 ++ resources/lang/pt-BR/journal.php | 7 ++ resources/lang/pt/journal.php | 7 ++ resources/lang/ru/journal.php | 7 ++ resources/lang/sv/journal.php | 7 ++ resources/lang/tr/journal.php | 7 ++ resources/lang/uk/journal.php | 7 ++ resources/lang/vi/journal.php | 7 ++ resources/lang/zh-TW/journal.php | 7 ++ resources/lang/zh/journal.php | 7 ++ 29 files changed, 273 insertions(+), 21 deletions(-) diff --git a/app/Http/Controllers/JournalController.php b/app/Http/Controllers/JournalController.php index ccd03e930eb..95fc52e8c39 100644 --- a/app/Http/Controllers/JournalController.php +++ b/app/Http/Controllers/JournalController.php @@ -28,10 +28,26 @@ public function index() * * @return array */ - public function list() + public function list(Request $request) { + + $startDate = $request->input('start_date'); + $endDate = $request->input('end_date'); + $sortBy = $request->input('sort_by', 'created_at'); + $sortOrder = $request->input('sort_order', 'desc'); + $perPage = $request->input('per_page', 30); + $entries = collect([]); - $journalEntries = auth()->user()->account->journalEntries()->paginate(30); + + $journalEntriesQuery = auth()->user()->account->journalEntries(); + + if ($startDate && $endDate) { + $journalEntriesQuery->whereDate('date', '>=', $startDate) + ->whereDate('date', '<=', $endDate); + } + $journalEntries = $journalEntriesQuery->orderBy($sortBy, $sortOrder) + ->paginate($perPage); + // this is needed to determine if we need to display the calendar // (month + year) next to the journal entry diff --git a/resources/js/components/journal/JournalList.vue b/resources/js/components/journal/JournalList.vue index a8c4932df71..826a7b69038 100644 --- a/resources/js/components/journal/JournalList.vue +++ b/resources/js/components/journal/JournalList.vue @@ -1,29 +1,63 @@ - + + + + + + + {{ $t('journal.start_date') }}: + + + + {{ $t('journal.end_date') }}: + + + + {{ $t('journal.per_page') }}: + + + + {{ $t('journal.sort_order') }}: + + {{ $t('journal.ascending') }} + {{ $t('journal.descending') }} + + + + {{ $t('journal.apply_filter') }} + + + - - - - - - - + + + + + + + - + {{ $t('app.load_more') }} @@ -34,7 +68,8 @@ - + @@ -46,7 +81,7 @@ - + {{ $t('journal.journal_add') }} @@ -68,7 +103,11 @@ export default { showSadSmileyColor: false, showHappySmileyColor: false, loadingMore: false, - + startDate: '', + endDate: '', + sortBy: 'created_at', // Specify the field to sort by (e.g., 'created_at', 'updated_at') + sortOrder: 'desc', // Specify the sort order ('asc' or 'desc') + perPage: 30, // Specify the number of entries per page }; }, @@ -76,7 +115,7 @@ export default { dirltr() { return this.$root.htmldir === 'ltr'; }, - hasMorePage: function() { + hasMorePage: function () { var total = this.journalEntries.per_page * this.journalEntries.current_page; if (total >= this.journalEntries.total) { @@ -97,7 +136,15 @@ export default { }, getEntries() { - axios.get('journal/entries') + axios.get('journal/entries', { + params: { + start_date: this.startDate, + end_date: this.endDate, + per_page: this.perPage, + sort_order: this.sortOrder, + sort_by: this.sortBy, + }, + }) .then(response => { this.journalEntries = response.data; this.journalEntries.current_page = response.data.current_page; @@ -109,22 +156,22 @@ export default { }, // This event is omited from the child component - deleteJournalEntry: function($journalEntryId) { + deleteJournalEntry: function ($journalEntryId) { // check if the deleted entry date is today. If that's the case // we need to put back the Rate box. This is only necessary if // the user does all his actions on the same page without ever // reloading the page. - this.journalEntries.data.filter(function(obj) { + this.journalEntries.data.filter(function (obj) { return obj.id === $journalEntryId; }); // Filter out the array without the deleted Journal Entry - this.journalEntries.data = this.journalEntries.data.filter(function(element) { + this.journalEntries.data = this.journalEntries.data.filter(function (element) { return element.id !== $journalEntryId; }); }, - hasRated: function(journalObject) { + hasRated: function (journalObject) { this.journalEntries.data.unshift(journalObject); }, diff --git a/resources/lang/ar/journal.php b/resources/lang/ar/journal.php index 23c5f8b0384..8b0e368b859 100644 --- a/resources/lang/ar/journal.php +++ b/resources/lang/ar/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'قم بتدوين مذكرتك الأولى', 'journal_blank_description' => 'المذكرة تدَعُك تدون الأحداث التي حصلت لك، لتتذكرها.', 'delete_confirmation' => 'هل أنت متأكد من حذف تدوين هذه المذكرة؟', + 'apply_filter' => 'طبق الفلترة', + "start_date" => "تاريخ البدء" , + "end_date" => "تاريخ الانتهاء" , + "per_page" => "لكل صفحة" , + 'Sort_order' => 'ترتيب الفرز' , + "ascending" => "تصاعدي" , + "descending" => "تنازلي" , ]; diff --git a/resources/lang/cs/journal.php b/resources/lang/cs/journal.php index c58d5dd17b9..93034fdf71c 100644 --- a/resources/lang/cs/journal.php +++ b/resources/lang/cs/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Přidej svůj první deníkový záznam', 'journal_blank_description' => 'Deník umožňuje zaznamenávání událostí které se staly a ulehčuje jejich zapamatování.', 'delete_confirmation' => 'Opravdu chcete smazat tento deníkový záznam?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/da/journal.php b/resources/lang/da/journal.php index 1ba36527c7e..8ac84ebfbe5 100644 --- a/resources/lang/da/journal.php +++ b/resources/lang/da/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Add your first journal entry', 'journal_blank_description' => 'The journal lets you write events that happened to you, and remember them.', 'delete_confirmation' => 'Are you sure you want to delete this journal entry?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/de/journal.php b/resources/lang/de/journal.php index d63237d46d0..220bb9bdb1e 100644 --- a/resources/lang/de/journal.php +++ b/resources/lang/de/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Schreibe deinen ersten Eintrag', 'journal_blank_description' => 'Im Tagebuch kannst du deine Erlebnisse festhalten und dich später an sie erinnern.', 'delete_confirmation' => 'Willst du diesen Eintrag wirklich löschen?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/el/journal.php b/resources/lang/el/journal.php index 34237121017..492b0a1500b 100644 --- a/resources/lang/el/journal.php +++ b/resources/lang/el/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Προσθέστε την πρώτη καταχώρηση ημερολογίου', 'journal_blank_description' => 'Το ημερολόγιο σας επιτρέπει να γράφετε γεγονότα που σας συνέβησαν και να τα θυμάστε.', 'delete_confirmation' => 'Είστε βέβαιοι ότι θέλετε να διαγράψετε αυτή την καταχώρηση ημερολογίου;', + 'Apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/en-GB/journal.php b/resources/lang/en-GB/journal.php index db52e861f10..4d1b4f5b990 100644 --- a/resources/lang/en-GB/journal.php +++ b/resources/lang/en-GB/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Add your first journal entry', 'journal_blank_description' => 'The journal lets you write events that happened to you, and remember them.', 'delete_confirmation' => 'Are you sure you want to delete this journal entry?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/en/journal.php b/resources/lang/en/journal.php index db52e861f10..4d1b4f5b990 100644 --- a/resources/lang/en/journal.php +++ b/resources/lang/en/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Add your first journal entry', 'journal_blank_description' => 'The journal lets you write events that happened to you, and remember them.', 'delete_confirmation' => 'Are you sure you want to delete this journal entry?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/es/journal.php b/resources/lang/es/journal.php index 586e2fc9630..e2390cbde5c 100644 --- a/resources/lang/es/journal.php +++ b/resources/lang/es/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Añade tu primera entrada de diario', 'journal_blank_description' => 'El diario te permite escribir eventos que te han pasado y recordarlos.', 'delete_confirmation' => '¿Seguro que deseas eliminar esta entrada de tu diario?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/fa/journal.php b/resources/lang/fa/journal.php index db52e861f10..4d1b4f5b990 100644 --- a/resources/lang/fa/journal.php +++ b/resources/lang/fa/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Add your first journal entry', 'journal_blank_description' => 'The journal lets you write events that happened to you, and remember them.', 'delete_confirmation' => 'Are you sure you want to delete this journal entry?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/fi/journal.php b/resources/lang/fi/journal.php index db52e861f10..4d1b4f5b990 100644 --- a/resources/lang/fi/journal.php +++ b/resources/lang/fi/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Add your first journal entry', 'journal_blank_description' => 'The journal lets you write events that happened to you, and remember them.', 'delete_confirmation' => 'Are you sure you want to delete this journal entry?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/fr/journal.php b/resources/lang/fr/journal.php index db9d6c50e2d..e0515d46e5a 100644 --- a/resources/lang/fr/journal.php +++ b/resources/lang/fr/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Ajouter votre première entrée dans le journal', 'journal_blank_description' => 'Le journal vous permet de vous rappeler d’évènements passés, ou à venir.', 'delete_confirmation' => 'Êtes-vous sûr de vouloir supprimer cette entrée ?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/he/journal.php b/resources/lang/he/journal.php index 5d7818fed26..7e7f7b6e3ce 100644 --- a/resources/lang/he/journal.php +++ b/resources/lang/he/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'ניתן להוסיף את רשומת היומן הראשונה שלך', 'journal_blank_description' => 'היומן מאפשר לך לכתוב אירועים שעברו עליך ולזכור אותם.', 'delete_confirmation' => 'למחוק את הרשומה הזאת ביומן?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/hr/journal.php b/resources/lang/hr/journal.php index db52e861f10..4d1b4f5b990 100644 --- a/resources/lang/hr/journal.php +++ b/resources/lang/hr/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Add your first journal entry', 'journal_blank_description' => 'The journal lets you write events that happened to you, and remember them.', 'delete_confirmation' => 'Are you sure you want to delete this journal entry?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/id/journal.php b/resources/lang/id/journal.php index 5ff53ceefc2..d3c07e80eef 100644 --- a/resources/lang/id/journal.php +++ b/resources/lang/id/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Tambahkan entri jurnal pertama Anda', 'journal_blank_description' => 'Jurnal memungkinkan Anda menulis peristiwa yang terjadi pada Anda, dan mengingatnya.', 'delete_confirmation' => 'Apakah Anda yakin ingin menghapus entri jurnal ini?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/it/journal.php b/resources/lang/it/journal.php index b7fa7e59bbc..9e3d7a67674 100644 --- a/resources/lang/it/journal.php +++ b/resources/lang/it/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Scrivi qualcosa nel diario', 'journal_blank_description' => 'Il diario ti permette di appuntare cose che ti succedono, e ricordarle.', 'delete_confirmation' => 'Sei sicuro di voler rimuovere questa pagina dal diario?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/ja/journal.php b/resources/lang/ja/journal.php index db52e861f10..4d1b4f5b990 100644 --- a/resources/lang/ja/journal.php +++ b/resources/lang/ja/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Add your first journal entry', 'journal_blank_description' => 'The journal lets you write events that happened to you, and remember them.', 'delete_confirmation' => 'Are you sure you want to delete this journal entry?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/nl/journal.php b/resources/lang/nl/journal.php index c2bf6404588..4ba4a0e8274 100644 --- a/resources/lang/nl/journal.php +++ b/resources/lang/nl/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Voeg je eerst dagboek-invoer toe', 'journal_blank_description' => 'Het dagboek laat je gebeurtenissen registreren, zodat je ze kunt onthouden.', 'delete_confirmation' => 'Weet je zeker dat je deze dagboek-invoer wilt verwijderen?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/no/journal.php b/resources/lang/no/journal.php index 4145ad1b36a..e4213665bfb 100644 --- a/resources/lang/no/journal.php +++ b/resources/lang/no/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Legg til din første journaloppføring', 'journal_blank_description' => 'Journalen lar deg skrive innlegg slik at du husker hva som skjer i løpet av en dag.', 'delete_confirmation' => 'Er du sikker på at du vil slette denne journaloppføringen?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/pt-BR/journal.php b/resources/lang/pt-BR/journal.php index 9605334bd4e..2c7a38c1f92 100644 --- a/resources/lang/pt-BR/journal.php +++ b/resources/lang/pt-BR/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Adicione sua primeira informação no diário', 'journal_blank_description' => 'O diário permite que você escreva eventos que aconteceram com você para que lembre-se deles.', 'delete_confirmation' => 'Tem certeza que deseja excluir este registro do diário?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/pt/journal.php b/resources/lang/pt/journal.php index 49e609388ff..7e86021f782 100644 --- a/resources/lang/pt/journal.php +++ b/resources/lang/pt/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Adicione seu primeiro registro no diário', 'journal_blank_description' => 'O diário permite que você escreva eventos que aconteceram com você, para te lembrar.', 'delete_confirmation' => 'Tem certeza que quer apagar esta entrada de diário?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/ru/journal.php b/resources/lang/ru/journal.php index 80d38a1a8e7..00d8a667e05 100644 --- a/resources/lang/ru/journal.php +++ b/resources/lang/ru/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Добавить вашу первую запись в журнал', 'journal_blank_description' => 'В журнал вы можете добавлять записи о событиях в вашей жизни, чтобы сохранить их.', 'delete_confirmation' => 'Вы уверены что хотите удалить эту запись?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/sv/journal.php b/resources/lang/sv/journal.php index ce3042986ec..2e705ce32c1 100644 --- a/resources/lang/sv/journal.php +++ b/resources/lang/sv/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Lägg till din första journalpost', 'journal_blank_description' => 'Tidskriften låter dig skriva händelser som hände dig, och kom ihåg dem.', 'delete_confirmation' => 'Är du säker på att du vill ta bort denna journalpost?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/tr/journal.php b/resources/lang/tr/journal.php index 44ef6df330d..734ed095d01 100644 --- a/resources/lang/tr/journal.php +++ b/resources/lang/tr/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'İlk günlük içeriğini yaz', 'journal_blank_description' => 'Günlük başından geçen olayları yazmanı ve onları tekrar hatırlamanı sağlar.', 'delete_confirmation' => 'Bu girdiyi silmek istediğinizden emin misiniz?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/uk/journal.php b/resources/lang/uk/journal.php index db52e861f10..4d1b4f5b990 100644 --- a/resources/lang/uk/journal.php +++ b/resources/lang/uk/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Add your first journal entry', 'journal_blank_description' => 'The journal lets you write events that happened to you, and remember them.', 'delete_confirmation' => 'Are you sure you want to delete this journal entry?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/vi/journal.php b/resources/lang/vi/journal.php index b1eac09fb0d..21451d2b003 100644 --- a/resources/lang/vi/journal.php +++ b/resources/lang/vi/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => 'Thêm mục nhật ký đầu tiên của bạn', 'journal_blank_description' => 'Nhật ký cho phép bạn viết sự kiện đã xảy ra với bạn, và ghi nhớ chúng.', 'delete_confirmation' => 'Bạn chắc chắn muốn xóa mục nhật ký này?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/zh-TW/journal.php b/resources/lang/zh-TW/journal.php index 14d4328977a..2315a820c64 100644 --- a/resources/lang/zh-TW/journal.php +++ b/resources/lang/zh-TW/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => '新增您的第一個記錄條目', 'journal_blank_description' => '記錄允許您編寫發生在您身上的事件, 並記住它們。', 'delete_confirmation' => '您確定要刪除此條目嗎?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; diff --git a/resources/lang/zh/journal.php b/resources/lang/zh/journal.php index d06b274ad6f..240350a08e9 100644 --- a/resources/lang/zh/journal.php +++ b/resources/lang/zh/journal.php @@ -28,4 +28,11 @@ 'journal_blank_cta' => '添加您的第一个记录条目', 'journal_blank_description' => '记录允许您编写发生在您身上的事件, 并记住它们。', 'delete_confirmation' => '您确定要删除此条目吗?', + 'apply_filter' => 'Apply filter', + 'start_date' => 'Start Date', + 'end_date' => 'End Date', + 'per_page' => 'Per Page', + 'sort_order' => 'Sort Order', + 'ascending' => 'Ascending', + 'descending' => 'Descending', ]; From 0c69d70405e636592a5b948cb52c5dbc8b9b7457 Mon Sep 17 00:00:00 2001 From: khalil Abu jayab <74875624+khalilJayab@users.noreply.github.com> Date: Tue, 18 Jul 2023 00:54:41 +0300 Subject: [PATCH 2/5] chore: Change 'Apply_filter' to 'apply_filter' in EL lang --- resources/lang/el/journal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/el/journal.php b/resources/lang/el/journal.php index 492b0a1500b..c7d8bfd3d96 100644 --- a/resources/lang/el/journal.php +++ b/resources/lang/el/journal.php @@ -28,7 +28,7 @@ 'journal_blank_cta' => 'Προσθέστε την πρώτη καταχώρηση ημερολογίου', 'journal_blank_description' => 'Το ημερολόγιο σας επιτρέπει να γράφετε γεγονότα που σας συνέβησαν και να τα θυμάστε.', 'delete_confirmation' => 'Είστε βέβαιοι ότι θέλετε να διαγράψετε αυτή την καταχώρηση ημερολογίου;', - 'Apply_filter' => 'Apply filter', + 'apply_filter' => 'Apply filter', 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', From 70ba46ed0b3a59209deecd7a29c37522750c26d6 Mon Sep 17 00:00:00 2001 From: khalil Abu jayab <74875624+khalilJayab@users.noreply.github.com> Date: Tue, 18 Jul 2023 10:58:40 +0300 Subject: [PATCH 3/5] fix: add params with paginate page --- resources/js/components/journal/JournalList.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/js/components/journal/JournalList.vue b/resources/js/components/journal/JournalList.vue index 826a7b69038..9dc453756e3 100644 --- a/resources/js/components/journal/JournalList.vue +++ b/resources/js/components/journal/JournalList.vue @@ -177,7 +177,15 @@ export default { loadMore() { this.loadingMore = true; - axios.get('journal/entries?page=' + (this.journalEntries.current_page + 1)) + axios.get('journal/entries?page=' + (this.journalEntries.current_page + 1),{ + params: { + start_date: this.startDate, + end_date: this.endDate, + per_page: this.perPage, + sort_order: this.sortOrder, + sort_by: this.sortBy, + }, + }) .then(response => { this.journalEntries.current_page = response.data.current_page; this.journalEntries.next_page_url = response.data.next_page_url; From 89f2dc79d9f5a025738442316aed115ce6e0292d Mon Sep 17 00:00:00 2001 From: khalil Abu jayab <74875624+khalilJayab@users.noreply.github.com> Date: Thu, 5 Oct 2023 15:24:37 +0300 Subject: [PATCH 4/5] add sort_by_created_at label --- resources/js/components/journal/JournalList.vue | 2 +- resources/lang/ar/journal.php | 2 +- resources/lang/cs/journal.php | 2 +- resources/lang/da/journal.php | 2 +- resources/lang/de/journal.php | 2 +- resources/lang/el/journal.php | 2 +- resources/lang/en-GB/journal.php | 2 +- resources/lang/en/journal.php | 2 +- resources/lang/es/journal.php | 2 +- resources/lang/fa/journal.php | 2 +- resources/lang/fi/journal.php | 2 +- resources/lang/fr/journal.php | 2 +- resources/lang/he/journal.php | 2 +- resources/lang/hr/journal.php | 2 +- resources/lang/id/journal.php | 2 +- resources/lang/it/journal.php | 2 +- resources/lang/ja/journal.php | 2 +- resources/lang/nl/journal.php | 2 +- resources/lang/no/journal.php | 2 +- resources/lang/pt-BR/journal.php | 2 +- resources/lang/pt/journal.php | 2 +- resources/lang/ru/journal.php | 2 +- resources/lang/sv/journal.php | 2 +- resources/lang/tr/journal.php | 2 +- resources/lang/uk/journal.php | 2 +- resources/lang/vi/journal.php | 2 +- resources/lang/zh-TW/journal.php | 2 +- resources/lang/zh/journal.php | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/resources/js/components/journal/JournalList.vue b/resources/js/components/journal/JournalList.vue index 9dc453756e3..184c5182914 100644 --- a/resources/js/components/journal/JournalList.vue +++ b/resources/js/components/journal/JournalList.vue @@ -26,7 +26,7 @@ - {{ $t('journal.sort_order') }}: + {{ $t('journal.sort_order') }} : {{ $t('journal.ascending') }} {{ $t('journal.descending') }} diff --git a/resources/lang/ar/journal.php b/resources/lang/ar/journal.php index 8b0e368b859..e52934e9021 100644 --- a/resources/lang/ar/journal.php +++ b/resources/lang/ar/journal.php @@ -32,7 +32,7 @@ "start_date" => "تاريخ البدء" , "end_date" => "تاريخ الانتهاء" , "per_page" => "لكل صفحة" , - 'Sort_order' => 'ترتيب الفرز' , + 'Sort_order' => 'فرز حسب تاريخ الإنشاء', "ascending" => "تصاعدي" , "descending" => "تنازلي" , ]; diff --git a/resources/lang/cs/journal.php b/resources/lang/cs/journal.php index 93034fdf71c..84242f18112 100644 --- a/resources/lang/cs/journal.php +++ b/resources/lang/cs/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/da/journal.php b/resources/lang/da/journal.php index 8ac84ebfbe5..d0c90ed8c57 100644 --- a/resources/lang/da/journal.php +++ b/resources/lang/da/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/de/journal.php b/resources/lang/de/journal.php index 220bb9bdb1e..7d7046de625 100644 --- a/resources/lang/de/journal.php +++ b/resources/lang/de/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/el/journal.php b/resources/lang/el/journal.php index c7d8bfd3d96..50b4d51b44e 100644 --- a/resources/lang/el/journal.php +++ b/resources/lang/el/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/en-GB/journal.php b/resources/lang/en-GB/journal.php index 4d1b4f5b990..9b1f0bed1eb 100644 --- a/resources/lang/en-GB/journal.php +++ b/resources/lang/en-GB/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/en/journal.php b/resources/lang/en/journal.php index 4d1b4f5b990..9b1f0bed1eb 100644 --- a/resources/lang/en/journal.php +++ b/resources/lang/en/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/es/journal.php b/resources/lang/es/journal.php index e2390cbde5c..d0e63b08cee 100644 --- a/resources/lang/es/journal.php +++ b/resources/lang/es/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/fa/journal.php b/resources/lang/fa/journal.php index 4d1b4f5b990..9b1f0bed1eb 100644 --- a/resources/lang/fa/journal.php +++ b/resources/lang/fa/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/fi/journal.php b/resources/lang/fi/journal.php index 4d1b4f5b990..9b1f0bed1eb 100644 --- a/resources/lang/fi/journal.php +++ b/resources/lang/fi/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/fr/journal.php b/resources/lang/fr/journal.php index e0515d46e5a..097b39d398d 100644 --- a/resources/lang/fr/journal.php +++ b/resources/lang/fr/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/he/journal.php b/resources/lang/he/journal.php index 7e7f7b6e3ce..bb79a391c21 100644 --- a/resources/lang/he/journal.php +++ b/resources/lang/he/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/hr/journal.php b/resources/lang/hr/journal.php index 4d1b4f5b990..9b1f0bed1eb 100644 --- a/resources/lang/hr/journal.php +++ b/resources/lang/hr/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/id/journal.php b/resources/lang/id/journal.php index d3c07e80eef..6cd1469de96 100644 --- a/resources/lang/id/journal.php +++ b/resources/lang/id/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/it/journal.php b/resources/lang/it/journal.php index 9e3d7a67674..22e5d16516a 100644 --- a/resources/lang/it/journal.php +++ b/resources/lang/it/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/ja/journal.php b/resources/lang/ja/journal.php index 4d1b4f5b990..9b1f0bed1eb 100644 --- a/resources/lang/ja/journal.php +++ b/resources/lang/ja/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/nl/journal.php b/resources/lang/nl/journal.php index 4ba4a0e8274..804b4cd5dab 100644 --- a/resources/lang/nl/journal.php +++ b/resources/lang/nl/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/no/journal.php b/resources/lang/no/journal.php index e4213665bfb..36d631e8302 100644 --- a/resources/lang/no/journal.php +++ b/resources/lang/no/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/pt-BR/journal.php b/resources/lang/pt-BR/journal.php index 2c7a38c1f92..8838af3b97b 100644 --- a/resources/lang/pt-BR/journal.php +++ b/resources/lang/pt-BR/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/pt/journal.php b/resources/lang/pt/journal.php index 7e86021f782..5f1ad8cb7a3 100644 --- a/resources/lang/pt/journal.php +++ b/resources/lang/pt/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/ru/journal.php b/resources/lang/ru/journal.php index 00d8a667e05..0509c503ecf 100644 --- a/resources/lang/ru/journal.php +++ b/resources/lang/ru/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/sv/journal.php b/resources/lang/sv/journal.php index 2e705ce32c1..40640ab0d10 100644 --- a/resources/lang/sv/journal.php +++ b/resources/lang/sv/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/tr/journal.php b/resources/lang/tr/journal.php index 734ed095d01..d005d37d889 100644 --- a/resources/lang/tr/journal.php +++ b/resources/lang/tr/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/uk/journal.php b/resources/lang/uk/journal.php index 4d1b4f5b990..9b1f0bed1eb 100644 --- a/resources/lang/uk/journal.php +++ b/resources/lang/uk/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/vi/journal.php b/resources/lang/vi/journal.php index 21451d2b003..9b1960ffaf9 100644 --- a/resources/lang/vi/journal.php +++ b/resources/lang/vi/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/zh-TW/journal.php b/resources/lang/zh-TW/journal.php index 2315a820c64..e7657972dcf 100644 --- a/resources/lang/zh-TW/journal.php +++ b/resources/lang/zh-TW/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; diff --git a/resources/lang/zh/journal.php b/resources/lang/zh/journal.php index 240350a08e9..30750a62af5 100644 --- a/resources/lang/zh/journal.php +++ b/resources/lang/zh/journal.php @@ -32,7 +32,7 @@ 'start_date' => 'Start Date', 'end_date' => 'End Date', 'per_page' => 'Per Page', - 'sort_order' => 'Sort Order', + 'sort_order' => 'Sort By Created At', 'ascending' => 'Ascending', 'descending' => 'Descending', ]; From ddf98cda80ccff6a92c22d790fc60ffa031cfd2e Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 6 Nov 2023 19:25:25 +0100 Subject: [PATCH 5/5] lint fix --- .../js/components/journal/JournalList.vue | 44 ++++++++++++------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/resources/js/components/journal/JournalList.vue b/resources/js/components/journal/JournalList.vue index 184c5182914..c5e0868a553 100644 --- a/resources/js/components/journal/JournalList.vue +++ b/resources/js/components/journal/JournalList.vue @@ -9,31 +9,36 @@ - {{ $t('journal.start_date') }}: - + {{ $t('journal.end_date') }}: - + {{ $t('journal.per_page') }}: - + {{ $t('journal.sort_order') }} : - - {{ $t('journal.ascending') }} - {{ $t('journal.descending') }} + + + {{ $t('journal.ascending') }} + + + {{ $t('journal.descending') }} + - - {{ $t('journal.apply_filter') }} + + + {{ $t('journal.apply_filter') }} + @@ -42,22 +47,28 @@ + :cy-object-items="journalEntries.data.map(j => j.object.id)" + > + v-cy-name="'entry-body-' + journalEntry.id" class="cf" + > + :journal-entry="journalEntry" @deleteJournalEntry="deleteJournalEntry" + /> + :journal-entry="journalEntry" + /> + :journal-entry="journalEntry" @deleteJournalEntry="deleteJournalEntry" + /> + class="br3 ba b--gray-monica bg-white pr3 pb3 pt3 mb3 tc" + > {{ $t('app.load_more') }} @@ -69,7 +80,8 @@ + class="br3 ba b--gray-monica bg-white pr3 pb3 pt3 mb3 tc" + >
{{ $t('app.load_more') }} @@ -34,7 +68,8 @@
{{ $t('app.load_more') }} @@ -69,7 +80,8 @@