A "TaskStream" section on the create form (toggle and optional key, suggested from the slug) opens the board before saving, as the person signed in, with the Pireon token of their session. A refusal shows on the key field and a TaskStream outage as a notification; either way nothing is saved. The created notification carries the link, and the edit page has an "Open in TaskStream" button. Documented in the user manual (and its PDF) and the README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lines
1.3 KiB
PHP
41 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Resources\Projects\Pages;
|
|
|
|
use App\Filament\Concerns\WarnsOfConcurrentEditing;
|
|
use App\Filament\Resources\Projects\ProjectResource;
|
|
use App\Filament\Support\DuplicateAction;
|
|
use App\Filament\Support\PreviewAction;
|
|
use App\Filament\Support\TranslateAction;
|
|
use App\Services\TaskStream\TaskStreamClient;
|
|
use Filament\Actions\Action;
|
|
use Filament\Actions\DeleteAction;
|
|
use Filament\Resources\Pages\EditRecord;
|
|
|
|
class EditProject extends EditRecord
|
|
{
|
|
use WarnsOfConcurrentEditing;
|
|
|
|
protected static string $resource = ProjectResource::class;
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
// Seeing it on the real site without leaving the form.
|
|
PreviewAction::for('project'),
|
|
Action::make('taskstream')
|
|
->label(__('panel.projects.taskstream.open'))
|
|
->icon('heroicon-o-arrow-top-right-on-square')
|
|
->color('gray')
|
|
->url(fn () => app(TaskStreamClient::class)->projectUrl((string) $this->record->taskstream_key))
|
|
->openUrlInNewTab()
|
|
->visible(fn () => filled($this->record->taskstream_key)),
|
|
DuplicateAction::make(),
|
|
TranslateAction::make(),
|
|
DeleteAction::make(),
|
|
];
|
|
}
|
|
}
|