Skip to content

Commit

Permalink
Merge pull request #34 from bcgov/status-message-page
Browse files Browse the repository at this point in the history
Allow moving published form versions to archived
  • Loading branch information
kiiskila-bcgov authored Nov 20, 2024
2 parents ffad410 + a2ea01e commit 7ccbae7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions app/Filament/Fodig/Resources/SystemMessageResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class SystemMessageResource extends Resource

protected static ?string $navigationGroup = 'Successor System';

protected static ?string $label = 'All Messages';

public static function form(Form $form): Form
{
return $form
Expand Down
26 changes: 13 additions & 13 deletions app/Filament/Forms/Resources/FormVersionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public static function form(Form $form): Form
return [
'form_field_id' => $field->id,
'label' => $field->label,
'data_binding_path'=> $field->data_binding_path,
'data_binding_path' => $field->data_binding_path,
'data_binding' => $field->data_binding,
'conditional_logic' => $field->conditional_logic,
'styles' => $field->styles,
Expand Down Expand Up @@ -295,18 +295,6 @@ public static function table(Table $table): Table
Tables\Columns\TextColumn::make('deployed_at')
->date('M j, Y')
->sortable(),
Tables\Columns\TextColumn::make('form_requester_name')
->searchable(),
Tables\Columns\TextColumn::make('form_requester_email')
->searchable(),
Tables\Columns\TextColumn::make('form_developer_name')
->searchable(),
Tables\Columns\TextColumn::make('form_developer_email')
->searchable(),
Tables\Columns\TextColumn::make('form_approver_name')
->searchable(),
Tables\Columns\TextColumn::make('form_approver_email')
->searchable(),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
Expand All @@ -323,9 +311,21 @@ public static function table(Table $table): Table
Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make()
->visible(fn($record) => (in_array($record->status, ['draft', 'testing'])) && Gate::allows('form-developer')),
Tables\Actions\Action::make('archive')
->label('Archive')
->icon('heroicon-o-archive-box-arrow-down')
->visible(fn($record) => $record->status === 'published')
->action(function ($record) {
$record->update(['status' => 'archived']);
})
->requiresConfirmation()
->color('danger')
->tooltip('Archive this form version'),
Tables\Actions\Action::make('Create New Version')
->label('Create New Version')
->icon('heroicon-o-document-plus')
->requiresConfirmation()
->tooltip('Create a new version from this version')
->visible(fn($record) => (Gate::allows('form-developer') && in_array($record->status, ['published', 'archived'])))
->action(function ($record, $livewire) {
$newVersion = $record->replicate();
Expand Down

0 comments on commit 7ccbae7

Please sign in to comment.