-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #400 from canyongbs/feature/advapp-124-creating-sc…
…heduling-events [ADVAPP-124]: Creating and Scheduling Events
- Loading branch information
Showing
21 changed files
with
824 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
app-modules/meeting-center/database/factories/EventFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
/* | ||
<COPYRIGHT> | ||
Copyright © 2022-2023, 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 legal@canyongbs.com. | ||
</COPYRIGHT> | ||
*/ | ||
|
||
namespace AdvisingApp\MeetingCenter\Database\Factories; | ||
|
||
use Illuminate\Support\Carbon; | ||
use AdvisingApp\MeetingCenter\Models\Event; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
/** | ||
* @extends Factory<Event> | ||
*/ | ||
class EventFactory extends Factory | ||
{ | ||
/** | ||
* @return array<string, mixed> | ||
*/ | ||
public function definition(): array | ||
{ | ||
return [ | ||
'title' => fake()->catchPhrase(), | ||
'description' => fake()->optional()->paragraphs(asText: true), | ||
'location' => fake()->address(), | ||
'capacity' => fake()->numberBetween(1, 5000), | ||
'starts_at' => fake()->dateTimeBetween('-1 week', '+1 week'), | ||
'ends_at' => fn (array $attributes) => Carbon::parse($attributes['starts_at'])->add('1 hour'), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
app-modules/meeting-center/database/migrations/2023_12_22_211834_create_events_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
/* | ||
<COPYRIGHT> | ||
Copyright © 2022-2023, 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 legal@canyongbs.com. | ||
</COPYRIGHT> | ||
*/ | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
return new class () extends Migration { | ||
public function up(): void | ||
{ | ||
Schema::create('events', function (Blueprint $table) { | ||
$table->uuid('id')->primary(); | ||
|
||
$table->string('title'); | ||
$table->text('description')->nullable(); | ||
$table->text('location')->nullable(); | ||
$table->integer('capacity')->nullable(); | ||
|
||
$table->timestamp('starts_at'); | ||
$table->timestamp('ends_at'); | ||
|
||
$table->timestamps(); | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,8 +40,5 @@ | |
|
||
class CalendarEventSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
*/ | ||
public function run(): void {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,8 +40,5 @@ | |
|
||
class CalendarSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
*/ | ||
public function run(): void {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 131 additions & 0 deletions
131
app-modules/meeting-center/resources/views/filament/pages/list-calendar-events.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
{{-- | ||
<COPYRIGHT> | ||
Copyright © 2022-2023, 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 legal@canyongbs.com. | ||
</COPYRIGHT> | ||
--}} | ||
@php | ||
use Filament\Support\Facades\FilamentView; | ||
use Filament\Support\Facades\FilamentAsset; | ||
use AdvisingApp\MeetingCenter\Filament\Widgets\CalendarEventWidget; | ||
@endphp | ||
<x-filament-panels::page @class([ | ||
'fi-resource-list-records-page', | ||
'fi-resource-' . str_replace('/', '-', $this->getResource()::getSlug()), | ||
])> | ||
{{-- TODO: Determine the best way to check if calendar is set up --}} | ||
@empty(auth()->user()->calendar?->oauth_token) | ||
<div wire:init="mountAction('setupCalendarProviderAction')"> | ||
</div> | ||
@endempty | ||
|
||
@if (auth()->user()->calendar?->oauth_token && !auth()->user()->calendar?->provider_id) | ||
<div wire:init="mountAction('selectCalendarAction')"> | ||
</div> | ||
@endif | ||
|
||
<div class="flex w-full justify-start"> | ||
<div | ||
class="grid max-w-xs grid-cols-2 gap-1 rounded-lg bg-gray-100 p-1 dark:bg-gray-800" | ||
role="group" | ||
> | ||
<button | ||
type="button" | ||
@class([ | ||
'px-5 py-1.5 text-xs font-medium rounded-lg', | ||
'text-white bg-gray-900 dark:bg-gray-300 dark:text-gray-900' => | ||
$viewType === 'table', | ||
'text-gray-900 hover:bg-gray-200 dark:text-white dark:hover:bg-gray-700' => | ||
$viewType !== 'table', | ||
]) | ||
wire:click="setViewType('table')" | ||
> | ||
<x-filament::icon | ||
class="h-6 w-6" | ||
icon="heroicon-m-table-cells" | ||
/> | ||
</button> | ||
<button | ||
type="button" | ||
@class([ | ||
'px-5 py-1.5 text-xs font-medium rounded-lg', | ||
'text-white bg-gray-900 dark:bg-gray-300 dark:text-gray-900' => | ||
$viewType === 'calendar', | ||
'text-gray-900 hover:bg-gray-200 dark:text-white dark:hover:bg-gray-700' => | ||
$viewType !== 'calendar', | ||
]) | ||
wire:click="setViewType('calendar')" | ||
> | ||
<x-filament::icon | ||
class="h-6 w-6" | ||
icon="heroicon-m-calendar-days" | ||
/> | ||
</button> | ||
</div> | ||
</div> | ||
@if ($viewType === 'table') | ||
<div class="flex flex-col gap-y-6"> | ||
@if (count($tabs = $this->getTabs())) | ||
<x-filament::tabs> | ||
{{ FilamentView::renderHook('panels::resource.pages.list-records.tabs.start', scopes: $this->getRenderHookScopes()) }} | ||
|
||
@foreach ($tabs as $tabKey => $tab) | ||
@php | ||
$activeTab = strval($activeTab); | ||
$tabKey = strval($tabKey); | ||
@endphp | ||
|
||
<x-filament::tabs.item | ||
:active="$activeTab === $tabKey" | ||
:badge="$tab->getBadge()" | ||
:icon="$tab->getIcon()" | ||
:icon-position="$tab->getIconPosition()" | ||
:wire:click="'$set(\'activeTab\', ' . (filled($tabKey) ? ('\'' . $tabKey . '\'') : 'null') . ')'" | ||
> | ||
{{ $tab->getLabel() ?? $this->generateTabLabel($tabKey) }} | ||
</x-filament::tabs.item> | ||
@endforeach | ||
|
||
{{ FilamentView::renderHook('panels::resource.pages.list-records.tabs.end', scopes: $this->getRenderHookScopes()) }} | ||
</x-filament::tabs> | ||
@endif | ||
|
||
{{ FilamentView::renderHook('panels::resource.pages.list-records.table.before', scopes: $this->getRenderHookScopes()) }} | ||
|
||
{{ $this->table }} | ||
|
||
{{ FilamentView::renderHook('panels::resource.pages.list-records.table.after', scopes: $this->getRenderHookScopes()) }} | ||
</div> | ||
@elseif($viewType === 'calendar') | ||
<div> | ||
@livewire(CalendarEventWidget::class) | ||
</div> | ||
@endif | ||
</x-filament-panels::page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.