Skip to content

Commit

Permalink
Merge pull request #257 from ploi/package-updates
Browse files Browse the repository at this point in the history
Package updates, formatting & fixes
  • Loading branch information
Cannonb4ll authored Jan 10, 2024
2 parents 4956b2b + ffcc2f9 commit d38ce38
Show file tree
Hide file tree
Showing 28 changed files with 417 additions and 611 deletions.
2 changes: 1 addition & 1 deletion app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Exceptions;

use Sentry\Laravel\Integration;
use Throwable;
use Sentry\Laravel\Integration;
use Illuminate\Routing\Exceptions\InvalidSignatureException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

Expand Down
6 changes: 4 additions & 2 deletions app/Filament/Pages/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function form(Form $form): Form
{
return $form->schema([
Tabs::make('main')
->persistTabInQueryString()
->schema([
Tabs\Tab::make('General')
->schema([
Expand Down Expand Up @@ -129,10 +130,9 @@ public function form(Form $form): Form
->options(InboxWorkflow::getSelectOptions())
->default(InboxWorkflow::WithoutBoardAndProject)
->helperText('This allows you to change which items show up in the inbox in the sidebar.'),
TextInput::make('password')->helperText('Entering a password here will ask your users to enter a password before entering the roadmap.'),
]),

TextInput::make('password')->helperText('Entering a password here will ask your users to enter a password before entering the roadmap.'),

RichEditor::make('welcome_text')
->columnSpan(2)
->helperText('This content will show at the top of the dashboard for (for all users).'),
Expand Down Expand Up @@ -270,6 +270,8 @@ public function form(Form $form): Form
->schema([
Textarea::make('custom_scripts')
->label('Custom header script')
->rows(10)
->autosize()
->helperText('This allows you to add your own custom widget, or tracking tool. Code inside here will always be placed inside the head section.')
->columnSpan(2),
]),
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/CommentResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class CommentResource extends Resource

protected static ?string $navigationGroup = 'Manage';

protected static ?int $navigationSort = 104;

public static function form(Form $form): Form
{
return $form
Expand Down
1 change: 1 addition & 0 deletions app/Filament/Resources/InboxResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class InboxResource extends Resource
protected static ?string $navigationIcon = 'heroicon-o-inbox';

protected static ?string $navigationGroup = 'Manage';
protected static ?int $navigationSort = 100;

protected static ?string $label = 'Inbox';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

namespace App\Filament\Resources\InboxResource\RelationManagers;

use App\Filament\Resources\CommentResource;
use Closure;
use Filament\Tables;
use Filament\Forms\Form;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Model;
use App\Filament\Resources\CommentResource;
use Filament\Resources\RelationManagers\RelationManager;

class CommentsRelationManager extends RelationManager
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/ItemResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class ItemResource extends Resource

protected static ?string $recordTitleAttribute = 'title';

protected static ?int $navigationSort = 101;

public static function form(Form $form): Form
{
$gitHubService = (new GitHubService);
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Resources/ItemResource/Pages/EditItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use Filament\Actions\DeleteAction;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Toggle;
use Filament\Notifications\Notification;
use Filament\Support\Enums\Alignment;
use Illuminate\Support\Facades\Storage;
use App\Filament\Resources\ItemResource;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\EditRecord;

class EditItem extends EditRecord
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/ProjectResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class ProjectResource extends Resource

protected static ?string $navigationGroup = 'Manage';

protected static ?int $navigationSort = 103;

public static function form(Form $form): Form
{
$gitHubService = (new GitHubService);
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Resources/TagResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TagResource extends Resource

protected static ?string $navigationGroup = 'Manage';

protected static ?int $navigationSort = 1;
protected static ?int $navigationSort = 106;

public static function form(Form $form): Form
{
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Resources/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
use Filament\Tables\Table;
use Filament\Resources\Resource;
use App\Filament\Resources\UserResource\Pages;
use App\Filament\Resources\UserResource\RelationManagers;
use STS\FilamentImpersonate\Tables\Actions\Impersonate;
use App\Filament\Resources\UserResource\RelationManagers;

class UserResource extends Resource
{
Expand Down
4 changes: 2 additions & 2 deletions app/Filament/Resources/UserResource/Pages/EditUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Filament\Resources\UserResource\Pages;

use App\Filament\Resources\UserResource;
use Filament\Actions\DeleteAction;
use Filament\Resources\Pages\EditRecord;
use Filament\Support\Colors\Color;
use App\Filament\Resources\UserResource;
use Filament\Resources\Pages\EditRecord;
use STS\FilamentImpersonate\Pages\Actions\Impersonate;

class EditUser extends EditRecord
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Filament\Resources\UserResource\RelationManagers;

use App\Filament\Resources\ItemResource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Model;
use App\Filament\Resources\ItemResource;
use Filament\Resources\RelationManagers\RelationManager;

class ItemsRelationManager extends RelationManager
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/VoteResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class VoteResource extends Resource

protected static ?string $navigationGroup = 'Manage';

protected static ?int $navigationSort = 105;

public static function form(Form $form): Form
{
return $form
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/SitemapController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace App\Http\Controllers;

use App\Models\Board;
use App\Models\Item;
use App\Models\Board;
use App\Models\Project;
use Spatie\Sitemap\Sitemap;
use Spatie\Sitemap\SitemapIndex;
use Spatie\Sitemap\Tags\Url;
use Spatie\Sitemap\SitemapIndex;
use Spatie\Sitemap\Tags\Sitemap as TagSitemap;

class SitemapController extends Controller
Expand Down
4 changes: 2 additions & 2 deletions app/Livewire/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public function submitItemAction(): Action
if (app(GeneralSettings::class)->select_board_when_creating_item) {
$inputs[] = Select::make('board_id')
->label(trans('table.board'))
->visible(fn($get) => $get('project_id'))
->options(fn($get) => Project::find($get('project_id'))->boards()->where('can_users_create', true)->pluck('title', 'id'))
->visible(fn ($get) => $get('project_id'))
->options(fn ($get) => Project::find($get('project_id'))->boards()->where('can_users_create', true)->pluck('title', 'id'))
->required(app(GeneralSettings::class)->board_required_when_creating_item);
}

Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Item/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Livewire\Item;

use Filament\Notifications\Notification;
use function auth;
use function view;
use App\Models\Item;
Expand All @@ -12,6 +11,7 @@
use App\Settings\GeneralSettings;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Components\TextInput;
use Filament\Notifications\Notification;
use Filament\Forms\Components\MarkdownEditor;
use Filament\Forms\Concerns\InteractsWithForms;

Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Modals/Item/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function table(Table $table): Table
->paginated(false)
->query(Item::query()->limit(10))
->defaultSort('created_at', 'desc')
->recordUrl(fn(Item $record): string => route('items.show', $record->slug))
->recordUrl(fn (Item $record): string => route('items.show', $record->slug))
->columns([
TextColumn::make('title')->wrap()->searchable(),
TextColumn::make('votes_count')->counts('votes')->label(trans('table.total-votes')),
Expand Down
6 changes: 3 additions & 3 deletions app/Livewire/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function logoutAction(): Action
->modalAlignment(Alignment::Left)
->modalDescription('Are you sure you want to do this?')
->color(Color::Slate)
->action(fn() => $this->logout());
->action(fn () => $this->logout());
}

public function deleteAction(): Action
Expand All @@ -165,7 +165,7 @@ public function deleteAction(): Action
->helperText('Enter your account\'s email address to delete your account')
->in([auth()->user()->email])
])
->action(fn() => $this->delete());
->action(fn () => $this->delete());
}

public function delete()
Expand All @@ -182,7 +182,7 @@ public function getLocalesProperty(): array
$locales = ResourceBundle::getLocales('');

return collect($locales)
->mapWithKeys(fn($locale) => [$locale => $locale])
->mapWithKeys(fn ($locale) => [$locale => $locale])
->toArray();
}

Expand Down
4 changes: 1 addition & 3 deletions app/Models/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@

use App\Traits\Sluggable;
use App\Traits\HasOgImage;
use App\Traits\HasScopeChecks;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;

class Project extends Model
{
Expand Down
12 changes: 6 additions & 6 deletions app/Services/SystemChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

class SystemChecker
{
public $remoteVersion;
public $currentVersion;
public string|null $remoteVersion;
public string|null $currentVersion;

public string $cacheKeyCurrent = 'roadmap-current-version';
public string $cacheKeyRemote = 'roadmap-remote-version';
Expand All @@ -18,29 +18,29 @@ public function getVersions(): self
return $this;
}

public function getApplicationVersion()
public function getApplicationVersion(): string|null
{
return cache()->remember($this->cacheKeyCurrent, now()->addDay(), function () {
return shell_exec('git describe --tag --abbrev=0');
});
}

public function getRemoteVersion()
public function getRemoteVersion(): string|null
{
return cache()->remember($this->cacheKeyRemote, now()->addDay(), function () {
shell_exec('git fetch --tags');
return shell_exec('git describe --tags $(git rev-list --tags --max-count=1)');
});
}

public function isOutOfDate()
public function isOutOfDate(): bool
{
$this->getVersions();

return $this->currentVersion < $this->remoteVersion || $this->currentVersion != $this->remoteVersion;
}

public function flushVersionData()
public function flushVersionData(): void
{
try {
cache()->forget($this->cacheKeyCurrent);
Expand Down
2 changes: 1 addition & 1 deletion app/Settings/GeneralSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class GeneralSettings extends Settings
public bool $show_changelog_author;
public bool $show_changelog_related_items;
public bool $disable_file_uploads;
public bool $disable_user_registration;
public bool $disable_user_registration;
public array $excluded_matching_search_words;
public array $profanity_words;
public bool $show_github_link;
Expand Down
2 changes: 1 addition & 1 deletion app/Traits/HasUpvote.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

use App\Models\User;
use App\Models\Vote;
use Illuminate\Routing\Redirector;
use Illuminate\Http\RedirectResponse;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Routing\Redirector;

trait HasUpvote
{
Expand Down
Loading

0 comments on commit d38ce38

Please sign in to comment.