Skip to content

Commit

Permalink
nav sorting improved & systemchecker types
Browse files Browse the repository at this point in the history
  • Loading branch information
Cannonb4ll committed Jan 10, 2024
1 parent c7c4a93 commit ffcc2f9
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 7 deletions.
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
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: 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: 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
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

0 comments on commit ffcc2f9

Please sign in to comment.