Skip to content

Commit

Permalink
-[x] Send oldest dates in organization listing page
Browse files Browse the repository at this point in the history
-[x] Change text in organization listing page for date range type picker
  • Loading branch information
PG-Momik committed Jul 10, 2023
1 parent db3a7b4 commit c58e902
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
7 changes: 5 additions & 2 deletions app/Http/Controllers/SuperAdmin/SuperAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use App\Constants\Enums;
use App\Http\Controllers\Controller;
use App\IATI\Services\Dashboard\DashboardService;
use App\IATI\Services\Organization\OrganizationService;
use App\IATI\Services\User\UserService;
use App\IATI\Traits\DateRangeResolverTrait;
Expand All @@ -30,8 +31,9 @@ class SuperAdminController extends Controller
*
* @param OrganizationService $organizationService
* @param UserService $userService
* @param DashboardService $dashboardService
*/
public function __construct(public OrganizationService $organizationService, public UserService $userService)
public function __construct(public OrganizationService $organizationService, public UserService $userService, public DashboardService $dashboardService)
{
//
}
Expand All @@ -54,8 +56,9 @@ public function listOrganizations(): View|Factory|JsonResponse|Application
$registrationType = Enums::ORGANIZATION_REGISTRATION_METHOD;
$publisherType = getCodeList('OrganizationType', 'Organization');
$dataLicense = getCodeList('DataLicense', 'Activity', false);
$oldestDates = $this->dashboardService->getOldestDate();

return view('superadmin.organisationsList', compact('country', 'setupCompleteness', 'registrationType', 'publisherType', 'dataLicense'));
return view('superadmin.organisationsList', compact('country', 'setupCompleteness', 'registrationType', 'publisherType', 'dataLicense', 'oldestDates'));
} catch (Exception $e) {
logger()->error($e->getMessage());

Expand Down
5 changes: 5 additions & 0 deletions app/IATI/Services/Dashboard/DashboardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ public function resolveStartDateAndEndDate($request, array $params, string $tabl
return $params;
}

/**
* Returns oldest created_at date.
*
* @return array
*/
public function getOldestDate(): array
{
return [
Expand Down
8 changes: 4 additions & 4 deletions public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"/js/app.js": "/js/app.js?id=d61e6b288145cef77e210bf8a5a415cd",
"/js/app.js": "/js/app.js?id=767b05429c814c2589733ac24f9f6f13",
"/js/script.js": "/js/script.js?id=4920eb85d84da1e87cb71769c04a12a2",
"/js/webportal-script.js": "/js/webportal-script.js?id=f9c23d4bccd261db9414465886315f45",
"/js/formbuilder.js": "/js/formbuilder.js?id=96f1b9dd5890b8ff09e613117dd94592",
Expand Down
4 changes: 2 additions & 2 deletions resources/assets/js/views/superadmin/components/TableList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,8 @@ export default defineComponent({
let defaultValueStatus: boolean[] = reactive([]);
const showMultiSelectWithSearch = ref(false);
let dropdownRange = {
created_at: 'User registered date',
last_logged_in: 'Last logged in',
created_at: 'Registered date range',
last_logged_in: 'Last login date range',
};
const sortParams = ref({ orderBy: '', direction: '' });

Expand Down
1 change: 1 addition & 0 deletions resources/views/superadmin/organisationsList.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:registration-types='{{json_encode($registrationType)}}'
:publisher-types='{{json_encode($publisherType)}}'
:data-licenses='{{json_encode($dataLicense)}}'
:oldest-dates='{{json_encode($oldestDates)}}'
>
</organisation-list>
@endsection

0 comments on commit c58e902

Please sign in to comment.