Skip to content

Commit

Permalink
Merge pull request #193 from GeOsmFamily:dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
BorisGautier authored Oct 6, 2023
2 parents 3788f6b + efd1e2a commit 99da41c
Show file tree
Hide file tree
Showing 1,270 changed files with 60,717 additions and 9,521 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ APP_FRONTEND=
SCOUT_DRIVER=meilisearch
MEILISEARCH_HOST=http://ifdd-app-meilisearch:7700
MEILISEARCH_KEY=

ANALYTICS_PROPERTY_ID=
2 changes: 1 addition & 1 deletion .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: "8.0"
php-version: "8.1"
- uses: actions/checkout@v2
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
Expand Down
Binary file modified .rnd
Binary file not shown.
2 changes: 2 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class Kernel extends ConsoleKernel
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')->hourly();
$schedule->command('backup:clean')->daily()->at('05:00');
$schedule->command('backup:run')->daily()->at('05:30');
}

/**
Expand Down
15 changes: 15 additions & 0 deletions app/Filament/Pages/BackupPage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace App\Filament\Pages;

use Filament\Pages\Page;

use ShuvroRoy\FilamentSpatieLaravelBackup\Pages\Backups as BaseBackupsCheckResults;

class BackupPage extends BaseBackupsCheckResults
{
public static function shouldRegisterNavigation(): bool
{
return auth()->user()->role == 1;
}
}
13 changes: 13 additions & 0 deletions app/Filament/Pages/HealthPage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Filament\Pages;

use ShuvroRoy\FilamentSpatieLaravelHealth\Pages\HealthCheckResults as BaseHealthCheckResults;

class HealthPage extends BaseHealthCheckResults
{
public static function shouldRegisterNavigation(): bool
{
return auth()->user()->role == 1;
}
}
71 changes: 42 additions & 29 deletions app/Filament/Resources/CategorieOddResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,34 @@
use App\Filament\Resources\CategorieOddResource\RelationManagers;
use App\Models\CategorieOdd;
use Filament\Forms;
use Filament\Forms\Components\Select;
use Filament\Resources\Form;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Resources\Table;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;

use pxlrbt\FilamentExcel\Actions\Tables\ExportBulkAction;

class CategorieOddResource extends Resource
{
protected static ?string $model = CategorieOdd::class;

protected static ?string $navigationIcon = 'heroicon-o-collection';
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

protected static ?string $title = 'Cibles des ODDs';
protected static ?string $navigationLabel = 'Cibles des Objectifs';

protected static ?string $navigationLabel = 'Cibles des Objectifs';
protected static ?string $navigationGroup = 'Objectifs';

public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('category_number')
Forms\Components\TextInput::make('category_number')
->required()
->maxLength(255),
Forms\Components\TextInput::make('intitule')
->required()
->maxLength(255),
Select::make('id_odd')
Forms\Components\Select::make('id_odd')
->relationship('odd', 'name')
->required(),
]);
Expand All @@ -46,11 +43,25 @@ public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('category_number'),
Tables\Columns\TextColumn::make('intitule'),
Tables\Columns\TextColumn::make('id_odd'),


Tables\Columns\TextColumn::make('category_number')
->searchable(),
Tables\Columns\TextColumn::make('intitule')
->searchable(),
Tables\Columns\TextColumn::make('id_odd')
->numeric()
->sortable(),
Tables\Columns\TextColumn::make('deleted_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
Tables\Filters\TrashedFilter::make(),
Expand All @@ -60,20 +71,24 @@ public static function table(Table $table): Table
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
ExportBulkAction::make()
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
])
->emptyStateActions([
Tables\Actions\CreateAction::make(),
]);
}

public static function getRelations(): array
{
return [
//
];
}

public static function getPages(): array
{
return [
Expand All @@ -82,8 +97,8 @@ public static function getPages(): array
'view' => Pages\ViewCategorieOdd::route('/{record}'),
'edit' => Pages\EditCategorieOdd::route('/{record}/edit'),
];
}

}
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()
Expand All @@ -92,10 +107,8 @@ public static function getEloquentQuery(): Builder
]);
}

public function getTableBulkActions()
{
return [
ExportBulkAction::make()
];
}
public static function getNavigationBadge(): ?string
{
return static::getModel()::count();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Filament\Resources\CategorieOddResource\Pages;

use App\Filament\Resources\CategorieOddResource;
use Filament\Pages\Actions;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;

class CreateCategorieOdd extends CreateRecord
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
namespace App\Filament\Resources\CategorieOddResource\Pages;

use App\Filament\Resources\CategorieOddResource;
use Filament\Pages\Actions;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

class EditCategorieOdd extends EditRecord
{
protected static string $resource = CategorieOddResource::class;


protected function getActions(): array
protected function getHeaderActions(): array
{
return [
Actions\ViewAction::make(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
namespace App\Filament\Resources\CategorieOddResource\Pages;

use App\Filament\Resources\CategorieOddResource;
use Filament\Pages\Actions;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

class ListCategorieOdds extends ListRecords
{
protected static string $resource = CategorieOddResource::class;

protected static ?string $title = 'Cibles de ODDs';

protected function getActions(): array
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
namespace App\Filament\Resources\CategorieOddResource\Pages;

use App\Filament\Resources\CategorieOddResource;
use Filament\Pages\Actions;
use Filament\Actions;
use Filament\Resources\Pages\ViewRecord;

class ViewCategorieOdd extends ViewRecord
{
protected static string $resource = CategorieOddResource::class;

protected static ?string $title = 'Cibles de ODDs';

protected function getActions(): array
protected function getHeaderActions(): array
{
return [
Actions\EditAction::make(),
Expand Down
Loading

0 comments on commit 99da41c

Please sign in to comment.