Open a TaskStream board from the panel's project form
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>
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Resources\Projects\Schemas;
|
||||
|
||||
use App\Actions\Projects\OpenInTaskStream;
|
||||
use App\Enums\ProjectStatus;
|
||||
use App\Filament\Resources\Projects\ProjectResource;
|
||||
use App\Filament\Support\TranslatableTabs;
|
||||
@@ -221,6 +222,27 @@ class ProjectForm
|
||||
->label(__('panel.projects.fields.needs_help'))
|
||||
->helperText(__('panel.projects.fields.needs_help_hint')),
|
||||
]),
|
||||
|
||||
// Only when creating: CreateProject opens the board before
|
||||
// saving, so a refusal there leaves nothing half made here.
|
||||
Section::make(__('panel.projects.taskstream.section'))
|
||||
->description(__('panel.projects.taskstream.section_hint'))
|
||||
->visibleOn('create')
|
||||
->columns(2)
|
||||
->schema([
|
||||
Toggle::make('taskstream')
|
||||
->label(__('panel.projects.taskstream.toggle'))
|
||||
->live(),
|
||||
|
||||
TextInput::make('taskstream_key')
|
||||
->label(__('panel.projects.taskstream.key'))
|
||||
->helperText(__('panel.projects.taskstream.key_hint'))
|
||||
->placeholder(fn (callable $get) => app(OpenInTaskStream::class)
|
||||
->keyFrom((string) $get('slug.'.config('locales.default'))))
|
||||
->maxLength(10)
|
||||
->regex('/^[A-Za-z][A-Za-z0-9]{1,9}$/')
|
||||
->visible(fn (callable $get) => (bool) $get('taskstream')),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user