Skip to content

Commit

Permalink
clean: removed nova (#717)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyrch authored Jul 29, 2024
1 parent e1b25f4 commit c02840a
Show file tree
Hide file tree
Showing 300 changed files with 309 additions and 16,688 deletions.
7 changes: 0 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,6 @@ MAIL_FROM_NAME="${APP_NAME}"
MAIL_SENDMAIL_PATH="/usr/sbin/sendmail -bs -i"
MAIL_LOG_CHANNEL=

# nova
NOVA_DOMAIN_NAME=null
NOVA_GUARD=null
NOVA_LICENSE_KEY=
NOVA_PASSWORDS=null
NOVA_PATH=/nova

# pennant
PENNANT_STORE=database

Expand Down
7 changes: 0 additions & 7 deletions .env.example-sail
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,6 @@ MAIL_FROM_NAME=AnimeThemes
MAIL_SENDMAIL_PATH="/usr/sbin/sendmail -bs -i"
MAIL_LOG_CHANNEL=

# nova
NOVA_DOMAIN_NAME=null
NOVA_GUARD=null
NOVA_LICENSE_KEY=
NOVA_PASSWORDS=null
NOVA_PATH=/admin

# pennant
PENNANT_STORE=database

Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ jobs:
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
env:
NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }}
NOVA_PASSWORD: ${{ secrets.NOVA_PASSWORD }}
run: |
composer config "http-basic.nova.laravel.com" "$NOVA_USERNAME" "$NOVA_PASSWORD"
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate key
run: php artisan key:generate
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ jobs:
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
env:
NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }}
NOVA_PASSWORD: ${{ secrets.NOVA_PASSWORD }}
run: |
composer config "http-basic.nova.laravel.com" "$NOVA_USERNAME" "$NOVA_PASSWORD"
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate key
run: php artisan key:generate
Expand Down
35 changes: 0 additions & 35 deletions app/Contracts/Events/NovaNotificationEvent.php

This file was deleted.

2 changes: 0 additions & 2 deletions app/Enums/Auth/SpecialPermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ enum SpecialPermission: string

case VIEW_HORIZON = 'view horizon';

case VIEW_NOVA = 'view nova';

case VIEW_TELESCOPE = 'view telescope';

case REVALIDATE_PAGES = 'revalidate pages';
Expand Down
55 changes: 4 additions & 51 deletions app/Events/Base/Wiki/WikiDeletedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use App\Constants\Config\ServiceConstants;
use App\Contracts\Events\FilamentNotificationEvent;
use App\Contracts\Events\NovaNotificationEvent;
use App\Enums\Auth\Role as RoleEnum;
use App\Events\Base\BaseDeletedEvent;
use App\Models\Auth\Role;
Expand All @@ -15,7 +14,6 @@
use Filament\Notifications\Notification;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Config;
use Laravel\Nova\Notifications\NovaNotification;

/**
* Class WikiDeletedEvent.
Expand All @@ -24,7 +22,7 @@
*
* @extends BaseDeletedEvent<TModel>
*/
abstract class WikiDeletedEvent extends BaseDeletedEvent implements NovaNotificationEvent, FilamentNotificationEvent
abstract class WikiDeletedEvent extends BaseDeletedEvent implements FilamentNotificationEvent
{
/**
* Get Discord channel the message will be sent to.
Expand All @@ -37,57 +35,12 @@ public function getDiscordChannel(): string
}

/**
* Determine if the notifications should be sent.
*
* @return bool
*/
public function shouldSendNovaNotification(): bool
{
$model = $this->getModel();

return !$model->isForceDeleting();
}

/**
* Get the nova notification.
*
* @return NovaNotification
*/
public function getNovaNotification(): NovaNotification
{
return NovaNotification::make()
->icon('flag')
->message($this->getNotificationMessage())
->type(NovaNotification::INFO_TYPE)
->url($this->getNovaNotificationUrl());
}

/**
* Get the users to notify.
*
* @return Collection
*/
public function getNovaNotificationRecipients(): Collection
{
return User::query()
->whereRelation(User::RELATION_ROLES, Role::ATTRIBUTE_NAME, RoleEnum::ADMIN->value)
->get();
}

/**
* Get the message for the nova/filament notification.
* Get the message for the filament notification.
*
* @return string
*/
abstract protected function getNotificationMessage(): string;

/**
* Get the URL for the nova notification.
*
* @return string
*/
abstract protected function getNovaNotificationUrl(): string;

/**
* Determine if the notifications should be sent.
*
Expand All @@ -101,7 +54,7 @@ public function shouldSendFilamentNotification(): bool
}

/**
* Get the nova notification.
* Get the filament notification.
*
* @return Notification
*/
Expand Down Expand Up @@ -134,7 +87,7 @@ public function getFilamentNotificationRecipients(): Collection
}

/**
* Get the URL for the nova notification.
* Get the URL for the filament notification.
*
* @return string
*/
Expand Down
15 changes: 1 addition & 14 deletions app/Events/Document/Page/PageDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use App\Events\Base\Wiki\WikiDeletedEvent;
use App\Filament\Resources\Document\Page as PageFilament;
use App\Models\Document\Page;
use App\Nova\Resources\Document\Page as PageResource;

/**
* Class PageDeleted.
Expand Down Expand Up @@ -47,7 +46,7 @@ protected function getDiscordMessageDescription(): string
}

/**
* Get the message for the nova notification.
* Get the message for the filament notification.
*
* @return string
*/
Expand All @@ -56,18 +55,6 @@ protected function getNotificationMessage(): string
return "Page '{$this->getModel()->getName()}' has been deleted. It will be automatically pruned in one week. Please review.";
}

/**
* Get the URL for the nova notification.
*
* @return string
*/
protected function getNovaNotificationUrl(): string
{
$uriKey = PageResource::uriKey();

return "/resources/$uriKey/{$this->getModel()->getKey()}";
}

/**
* Get the URL for the Filament notification.
*
Expand Down
15 changes: 1 addition & 14 deletions app/Events/Wiki/Anime/AnimeDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use App\Events\Base\Wiki\WikiDeletedEvent;
use App\Filament\Resources\Wiki\Anime as AnimeFilament;
use App\Models\Wiki\Anime;
use App\Nova\Resources\Wiki\Anime as AnimeResource;

/**
* Class AnimeDeleted.
Expand Down Expand Up @@ -47,7 +46,7 @@ protected function getDiscordMessageDescription(): string
}

/**
* Get the message for the nova notification.
* Get the message for the filament notification.
*
* @return string
*/
Expand All @@ -56,18 +55,6 @@ protected function getNotificationMessage(): string
return "Anime '{$this->getModel()->getName()}' has been deleted. It will be automatically pruned in one week. Please review.";
}

/**
* Get the URL for the nova notification.
*
* @return string
*/
protected function getNovaNotificationUrl(): string
{
$uriKey = AnimeResource::uriKey();

return "/resources/$uriKey/{$this->getModel()->getKey()}";
}

/**
* Get the URL for the Filament notification.
*
Expand Down
15 changes: 1 addition & 14 deletions app/Events/Wiki/Anime/Synonym/SynonymDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use App\Models\Wiki\Anime\AnimeTheme;
use App\Models\Wiki\Anime\Theme\AnimeThemeEntry;
use App\Models\Wiki\Video;
use App\Nova\Resources\Wiki\Anime\Synonym as SynonymResource;

/**
* Class SynonymDeleted.
Expand Down Expand Up @@ -60,7 +59,7 @@ protected function getDiscordMessageDescription(): string
}

/**
* Get the message for the nova notification.
* Get the message for the filament notification.
*
* @return string
*/
Expand All @@ -69,18 +68,6 @@ protected function getNotificationMessage(): string
return "Synonym '{$this->getModel()->getName()}' has been deleted for Anime '{$this->anime->getName()}'. It will be automatically pruned in one week. Please review.";
}

/**
* Get the URL for the nova notification.
*
* @return string
*/
protected function getNovaNotificationUrl(): string
{
$uriKey = SynonymResource::uriKey();

return "/resources/$uriKey/{$this->getModel()->getKey()}";
}

/**
* Get the URL for the Filament notification.
*
Expand Down
15 changes: 1 addition & 14 deletions app/Events/Wiki/Anime/Theme/Entry/EntryDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use App\Filament\Resources\Wiki\Anime\Theme\Entry as EntryFilament;
use App\Models\Wiki\Anime\Theme\AnimeThemeEntry;
use App\Models\Wiki\Video;
use App\Nova\Resources\Wiki\Anime\Theme\Entry as EntryResource;

/**
* Class EntryDeleted.
Expand Down Expand Up @@ -49,7 +48,7 @@ protected function getDiscordMessageDescription(): string
}

/**
* Get the message for the nova notification.
* Get the message for the filament notification.
*
* @return string
*/
Expand All @@ -58,18 +57,6 @@ protected function getNotificationMessage(): string
return "Entry '{$this->getModel()->getName()}' has been deleted. It will be automatically pruned in one week. Please review.";
}

/**
* Get the URL for the nova notification.
*
* @return string
*/
protected function getNovaNotificationUrl(): string
{
$uriKey = EntryResource::uriKey();

return "/resources/$uriKey/{$this->getModel()->getKey()}";
}

/**
* Get the URL for the Filament notification.
*
Expand Down
15 changes: 1 addition & 14 deletions app/Events/Wiki/Anime/Theme/ThemeDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use App\Filament\Resources\Wiki\Anime\Theme as ThemeFilament;
use App\Models\Wiki\Anime;
use App\Models\Wiki\Anime\AnimeTheme;
use App\Nova\Resources\Wiki\Anime\Theme as ThemeResource;

/**
* Class ThemeDeleted.
Expand Down Expand Up @@ -56,7 +55,7 @@ protected function getDiscordMessageDescription(): string
}

/**
* Get the message for the nova notification.
* Get the message for the filament notification.
*
* @return string
*/
Expand All @@ -65,18 +64,6 @@ protected function getNotificationMessage(): string
return "Theme '{$this->getModel()->getName()}' has been deleted for Anime '{$this->anime->getName()}'. It will be automatically pruned in one week. Please review.";
}

/**
* Get the URL for the nova notification.
*
* @return string
*/
protected function getNovaNotificationUrl(): string
{
$uriKey = ThemeResource::uriKey();

return "/resources/$uriKey/{$this->getModel()->getKey()}";
}

/**
* Get the URL for the Filament notification.
*
Expand Down
Loading

0 comments on commit c02840a

Please sign in to comment.