Skip to content

Commit

Permalink
[ADVAPP-917]: Improve the UI/UX design of the student profile page (#…
Browse files Browse the repository at this point in the history
…1060)

* init header and student profile section

* chore: fix enforcement of copyright on all files

* chore: fix code style

* add tables livewire component

* chore: fix enforcement of copyright on all files

* added relation manager tabs and other component (wip)

* chore: fix code style

* Remove unuse blade and convert managerecord to relation manage component and other changes

* Remove unuse code and comment

* chore: fix code style

* add access right in tab view and timeline (wip)

* student timeline section

* chore: fix enforcement of copyright on all files

* chore: fix code style

* remove unuse

* chore: fix code style

* Refactor classes and handle nullable things and dark mode

* refactor classes and other changes

* Fix test issue

* change refence route

* remove copy

* Fix the filament timeline modal

Signed-off-by: Kevin Ullyott <[email protected]>

* add parrent access and modal open issue

* change empty timeline message and remove border

* Fix the address call

Signed-off-by: Kevin Ullyott <[email protected]>

* fix the table height

* Update the font-weight of the student profile section

Signed-off-by: Kevin Ullyott <[email protected]>

* Fix access and write tests

Signed-off-by: Kevin Ullyott <[email protected]>

* chore: fix enforcement of copyright on all files

* More access tests

Signed-off-by: Kevin Ullyott <[email protected]>

* Test for last premium feature

Signed-off-by: Kevin Ullyott <[email protected]>

* make sure permissions are put in place to render the components properly

Signed-off-by: Kevin Ullyott <[email protected]>

* Delete the old ManageStudentInformation

Signed-off-by: Kevin Ullyott <[email protected]>

* Test for ProgramsRelationManager

Signed-off-by: Kevin Ullyott <[email protected]>

* Fix the test name

Signed-off-by: Kevin Ullyott <[email protected]>

* Add a test for EnrollmentsRelationManager

Signed-off-by: Kevin Ullyott <[email protected]>

* chore: fix code style

* Add test for StudentInteractionsRelationManager

Signed-off-by: Kevin Ullyott <[email protected]>

* Add test for StudentFilesRelationManager

Signed-off-by: Kevin Ullyott <[email protected]>

* chore: fix code style

* Add a test for and adjust permissions of StudentEngagementRelationManager

Signed-off-by: Kevin Ullyott <[email protected]>

* Remove unneeded permissions from tests

Signed-off-by: Kevin Ullyott <[email protected]>

* Fix unneeded items in tests

Signed-off-by: Kevin Ullyott <[email protected]>

* add test for StudentAlertsRelationManager

Signed-off-by: Kevin Ullyott <[email protected]>

* Test for StudentTasksRelationManager

Signed-off-by: Kevin Ullyott <[email protected]>

* Update tests

Signed-off-by: Kevin Ullyott <[email protected]>

* Remove files that are no longer needed

Signed-off-by: Kevin Ullyott <[email protected]>

* Just load to the first 10

Signed-off-by: Kevin Ullyott <[email protected]>

* Prevent loading of more than 10 records

Signed-off-by: Kevin Ullyott <[email protected]>

* Setup lazy loading

Signed-off-by: Kevin Ullyott <[email protected]>

* chore: fix code style

* Change the default record previews to only show 5

Signed-off-by: Kevin Ullyott <[email protected]>

* Make sure the timeline preview only ever shows 5

Signed-off-by: Kevin Ullyott <[email protected]>

* Hide columns by default in StudentAlertsRelationManager

Signed-off-by: Kevin Ullyott <[email protected]>

* Remove commented code

Signed-off-by: Kevin Ullyott <[email protected]>

---------

Signed-off-by: Kevin Ullyott <[email protected]>
Co-authored-by: amit-canyon <[email protected]>
Co-authored-by: joelicatajr <[email protected]>
Co-authored-by: Kevin Ullyott <[email protected]>
Co-authored-by: Orrison <[email protected]>
  • Loading branch information
5 people authored Oct 30, 2024
1 parent ec5d46e commit 02472c4
Show file tree
Hide file tree
Showing 36 changed files with 2,223 additions and 406 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
use AdvisingApp\Alert\Filament\Resources\AlertResource;
use AdvisingApp\Segment\Actions\TranslateSegmentFilters;
use AdvisingApp\StudentDataModel\Models\Scopes\EducatableSearch;
use AdvisingApp\StudentDataModel\Filament\Resources\StudentResource;
use AdvisingApp\Prospect\Filament\Resources\ProspectResource\Pages\ManageProspectAlerts;
use AdvisingApp\StudentDataModel\Filament\Resources\StudentResource\Pages\ManageStudentAlerts;

class ListAlerts extends ListRecords
{
Expand All @@ -79,7 +79,7 @@ public function infolist(Infolist $infolist): Infolist
->label('Related To')
->getStateUsing(fn (Alert $record): ?string => $record->concern?->{$record->concern::displayNameKey()})
->url(fn (Alert $record) => match ($record->concern ? $record->concern::class : null) {
Student::class => ManageStudentAlerts::getUrl(['record' => $record->concern]),
Student::class => StudentResource::getUrl('view', ['record' => $record->concern]),
Prospect::class => ManageProspectAlerts::getUrl(['record' => $record->concern]),
default => null,
}),
Expand All @@ -99,7 +99,7 @@ public function table(Table $table): Table
->label('Related To')
->getStateUsing(fn (Alert $record): ?string => $record->concern?->{$record->concern::displayNameKey()})
->url(fn (Alert $record) => match ($record->concern ? $record->concern::class : null) {
Student::class => ManageStudentAlerts::getUrl(['record' => $record->concern]),
Student::class => StudentResource::getUrl('view', ['record' => $record->concern]),
Prospect::class => ManageProspectAlerts::getUrl(['record' => $record->concern]),
default => null,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ public function toDatabase(object $notifiable): array

$name = $concern->{$concern->displayNameKey()};

$target = match ($concern::class) {
Prospect::class => ProspectResource::class,
Student::class => StudentResource::class,
[$target, $targetRoute] = match ($concern::class) {
Prospect::class => [ProspectResource::class, 'manage-alerts'],
Student::class => [StudentResource::class, 'view'],
};

$alertUrl = $target::getUrl('manage-alerts', ['record' => $concern]);
$alertUrl = $target::getUrl($targetRoute, ['record' => $concern]);

$alertLink = new HtmlString("<a href='{$alertUrl}' target='_blank' class='underline'>alert</a>");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ public function toDatabase(object $notifiable): array

$name = $author->{$author->displayNameKey()};

$target = match ($author::class) {
Prospect::class => ProspectResource::class,
Student::class => StudentResource::class,
[$target, $targetRoute] = match ($author::class) {
Prospect::class => [ProspectResource::class, 'manage-application-submissions'],
Student::class => [StudentResource::class, 'view'],
};

$applicationSubmissionUrl = $target::getUrl('manage-application-submissions', ['record' => $author]);
$applicationSubmissionUrl = $target::getUrl($targetRoute, ['record' => $author]);

$applicationSubmissionLink = new HtmlString("<a href='{$applicationSubmissionUrl}' target='_blank' class='underline'>application submission</a>");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ protected function setUp(): void

public static function getDefaultName(): ?string
{
return 'requestFormSubmission';
return 'Request';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ public function toDatabase(object $notifiable): array

$name = $author->{$author->displayNameKey()};

$target = match ($author::class) {
Prospect::class => ProspectResource::class,
Student::class => StudentResource::class,
[$target, $targetRoute] = match ($author::class) {
Prospect::class => [ProspectResource::class, 'manage-form-submissions'],
Student::class => [StudentResource::class, 'view'],
};

$formSubmissionUrl = $target::getUrl('manage-form-submissions', ['record' => $author]);
$formSubmissionUrl = $target::getUrl($targetRoute, ['record' => $author]);

$formSubmissionLink = new HtmlString("<a href='{$formSubmissionUrl}' target='_blank' class='underline'>form submission</a>");

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{--
<COPYRIGHT>
Copyright © 2016-2024, Canyon GBS LLC. All rights reserved.
Advising App™ is licensed under the Elastic License 2.0. For more details,
see https://github.com/canyongbs/advisingapp/blob/main/LICENSE.
Notice:
- You may not provide the software to third parties as a hosted or managed
service, where the service provides users with access to any substantial set of
the features or functionality of the software.
- You may not move, change, disable, or circumvent the license key functionality
in the software, and you may not remove or obscure any functionality in the
software that is protected by the license key.
- You may not alter, remove, or obscure any licensing, copyright, or other notices
of the licensor in the software. Any use of the licensor’s trademarks is subject
to applicable law.
- Canyon GBS LLC respects the intellectual property rights of others and expects the
same in return. Canyon GBS™ and Advising App™ are registered trademarks of
Canyon GBS LLC, and we are committed to enforcing and protecting our trademarks
vigorously.
- The software solution, including services, infrastructure, and code, is offered as a
Software as a Service (SaaS) by Canyon GBS LLC.
- Use of this software implies agreement to the license terms and conditions as stated
in the Elastic License 2.0.
For more information or inquiries please visit our website at
https://www.canyongbs.com or contact us via email at [email protected].
</COPYRIGHT>
--}}
@props([
'actions' => [],
'breadcrumbs' => [],
'heading',
'subheading' => null,
])

<header {{ $attributes->class(['fi-header flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between']) }}>
<div>
@if ($breadcrumbs)
<x-filament::breadcrumbs
class="mb-2 hidden sm:block"
:breadcrumbs="$breadcrumbs"
/>
@endif
</div>

<div @class([
'flex shrink-0 items-center gap-3',
'sm:mt-7' => $breadcrumbs,
])>
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_HEADER_ACTIONS_BEFORE, scopes: $this->getRenderHookScopes()) }}

@if ($actions)
<x-filament::actions :actions="$actions" />
@endif

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_HEADER_ACTIONS_AFTER, scopes: $this->getRenderHookScopes()) }}
</div>
</header>
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{{--
<COPYRIGHT>
Copyright © 2016-2024, Canyon GBS LLC. All rights reserved.
Advising App™ is licensed under the Elastic License 2.0. For more details,
see https://github.com/canyongbs/advisingapp/blob/main/LICENSE.
Notice:
- You may not provide the software to third parties as a hosted or managed
service, where the service provides users with access to any substantial set of
the features or functionality of the software.
- You may not move, change, disable, or circumvent the license key functionality
in the software, and you may not remove or obscure any functionality in the
software that is protected by the license key.
- You may not alter, remove, or obscure any licensing, copyright, or other notices
of the licensor in the software. Any use of the licensor’s trademarks is subject
to applicable law.
- Canyon GBS LLC respects the intellectual property rights of others and expects the
same in return. Canyon GBS™ and Advising App™ are registered trademarks of
Canyon GBS LLC, and we are committed to enforcing and protecting our trademarks
vigorously.
- The software solution, including services, infrastructure, and code, is offered as a
Software as a Service (SaaS) by Canyon GBS LLC.
- Use of this software implies agreement to the license terms and conditions as stated
in the Elastic License 2.0.
For more information or inquiries please visit our website at
https://www.canyongbs.com or contact us via email at [email protected].
</COPYRIGHT>
--}}
@props([
'fullHeight' => false,
])

@php
use Filament\Pages\SubNavigationPosition;
$subNavigation = $this->getCachedSubNavigation();
$subNavigationPosition = $this->getSubNavigationPosition();
$widgetData = $this->getWidgetData();
@endphp

<div {{ $attributes->class(['fi-page', 'h-full' => $fullHeight]) }}>
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_START, scopes: $this->getRenderHookScopes()) }}

<section @class(['flex flex-col gap-y-8 py-8', 'h-full' => $fullHeight])>
@if ($header = $this->getHeader())
{{ $header }}
@elseif ($heading = $this->getHeading())
@php
$subheading = $this->getSubheading();
@endphp

<x-student-data-model::header
:actions="$this->getCachedHeaderActions()"
:breadcrumbs="filament()->hasBreadcrumbs() ? $this->getBreadcrumbs() : []"
>
</x-student-data-model::header>
@endif

<div @class([
'flex flex-col gap-8' => $subNavigation,
match ($subNavigationPosition) {
SubNavigationPosition::Start,
SubNavigationPosition::End
=> 'md:flex-row md:items-start',
default => null,
} => $subNavigation,
'h-full' => $fullHeight,
])>
@if ($subNavigation)
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_SELECT_BEFORE, scopes: $this->getRenderHookScopes()) }}

<x-filament-panels::page.sub-navigation.select :navigation="$subNavigation" />

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_SELECT_AFTER, scopes: $this->getRenderHookScopes()) }}

@if ($subNavigationPosition === SubNavigationPosition::Start)
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_START_BEFORE, scopes: $this->getRenderHookScopes()) }}

<x-filament-panels::page.sub-navigation.sidebar :navigation="$subNavigation" />

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_START_AFTER, scopes: $this->getRenderHookScopes()) }}
@endif

@if ($subNavigationPosition === SubNavigationPosition::Top)
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_TOP_BEFORE, scopes: $this->getRenderHookScopes()) }}

<x-filament-panels::page.sub-navigation.tabs :navigation="$subNavigation" />

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_TOP_AFTER, scopes: $this->getRenderHookScopes()) }}
@endif
@endif

<div @class(['grid flex-1 auto-cols-fr gap-y-8', 'h-full' => $fullHeight])>
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_HEADER_WIDGETS_BEFORE, scopes: $this->getRenderHookScopes()) }}

@if ($headerWidgets = $this->getVisibleHeaderWidgets())
<x-filament-widgets::widgets
class="fi-page-header-widgets"
:columns="$this->getHeaderWidgetsColumns()"
:data="$widgetData"
:widgets="$headerWidgets"
/>
@endif

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_HEADER_WIDGETS_AFTER, scopes: $this->getRenderHookScopes()) }}

{{ $slot }}

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_FOOTER_WIDGETS_BEFORE, scopes: $this->getRenderHookScopes()) }}

@if ($footerWidgets = $this->getVisibleFooterWidgets())
<x-filament-widgets::widgets
class="fi-page-footer-widgets"
:columns="$this->getFooterWidgetsColumns()"
:data="$widgetData"
:widgets="$footerWidgets"
/>
@endif

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_FOOTER_WIDGETS_AFTER, scopes: $this->getRenderHookScopes()) }}
</div>

@if ($subNavigation && $subNavigationPosition === SubNavigationPosition::End)
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_END_BEFORE, scopes: $this->getRenderHookScopes()) }}

<x-filament-panels::page.sub-navigation.sidebar :navigation="$subNavigation" />

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_END_AFTER, scopes: $this->getRenderHookScopes()) }}
@endif
</div>

@if ($footer = $this->getFooter())
{{ $footer }}
@endif
</section>

@if (!($this instanceof \Filament\Tables\Contracts\HasTable))
<x-filament-actions::modals />
@elseif ($this->isTableLoaded() && filled($this->defaultTableAction))
<div
wire:init="mountTableAction(@js($this->defaultTableAction), @if (filled($this->defaultTableActionRecord))
@js($this->defaultTableActionRecord)
@else
{{ 'null' }}
@endif @if (filled($this->defaultTableActionArguments))
, @js($this->defaultTableActionArguments)
@endif)">
</div>
@endif

@if (filled($this->defaultAction))
<div wire:init="mountAction(@js($this->defaultAction) @if (filled($this->defaultActionArguments))
, @js($this->defaultActionArguments)
@endif)">
</div>
@endif

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_END, scopes: $this->getRenderHookScopes()) }}

<x-filament-panels::unsaved-action-changes-alert />
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{{--
<COPYRIGHT>
Copyright © 2016-2024, Canyon GBS LLC. All rights reserved.
Advising App™ is licensed under the Elastic License 2.0. For more details,
see https://github.com/canyongbs/advisingapp/blob/main/LICENSE.
Notice:
- You may not provide the software to third parties as a hosted or managed
service, where the service provides users with access to any substantial set of
the features or functionality of the software.
- You may not move, change, disable, or circumvent the license key functionality
in the software, and you may not remove or obscure any functionality in the
software that is protected by the license key.
- You may not alter, remove, or obscure any licensing, copyright, or other notices
of the licensor in the software. Any use of the licensor’s trademarks is subject
to applicable law.
- Canyon GBS LLC respects the intellectual property rights of others and expects the
same in return. Canyon GBS™ and Advising App™ are registered trademarks of
Canyon GBS LLC, and we are committed to enforcing and protecting our trademarks
vigorously.
- The software solution, including services, infrastructure, and code, is offered as a
Software as a Service (SaaS) by Canyon GBS LLC.
- Use of this software implies agreement to the license terms and conditions as stated
in the Elastic License 2.0.
For more information or inquiries please visit our website at
https://www.canyongbs.com or contact us via email at [email protected].
</COPYRIGHT>
--}}
<div>
@if ($this->table->getColumns())
<div class="flex flex-col gap-y-6">
<x-filament-panels::resources.tabs />

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::RESOURCE_PAGES_MANAGE_RELATED_RECORDS_TABLE_BEFORE, scopes: $this->getRenderHookScopes()) }}

{{ $this->table }}

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::RESOURCE_PAGES_MANAGE_RELATED_RECORDS_TABLE_AFTER, scopes: $this->getRenderHookScopes()) }}
</div>
@endif

@if (count($relationManagers = $this->getRelationManagers()))
<x-filament-panels::resources.relation-managers
:active-locale="isset($activeLocale) ? $activeLocale : null"
:active-manager="$this->activeRelationManager ?? array_key_first($relationManagers)"
:managers="$relationManagers"
:owner-record="$record"
:page-class="static::class"
/>
@endif
</div>
Loading

0 comments on commit 02472c4

Please sign in to comment.