fix: make project template inheritance granular and safe
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace Tests\Feature\Projects;
|
||||
|
||||
use App\Actions\ProjectTicketMetadata\InitializeProjectTicketMetadata;
|
||||
use App\Actions\Projects\DuplicateProjectConfiguration;
|
||||
use App\Actions\ProjectTicketMetadata\InitializeProjectTicketMetadata;
|
||||
use App\Models\BoardColumn;
|
||||
use App\Models\Project;
|
||||
use App\Models\ProjectTemplate;
|
||||
@@ -54,7 +54,9 @@ class ProjectBoardSettingsControllerTest extends TestCase
|
||||
->where('boardColumns.0.name', 'Todo')
|
||||
->where('ticketStatuses.0.name', 'Backlog')
|
||||
->where('templateState.templateName', 'Starter Workflow')
|
||||
->where('templateState.inheritedAreas.0.value', DuplicateProjectConfiguration::COPY_BOARD_WORKFLOW),
|
||||
->where('templateState.inheritedAreas.0.value', DuplicateProjectConfiguration::COPY_BOARD_COLUMNS)
|
||||
->where('templateState.inheritedAreas.1.value', DuplicateProjectConfiguration::COPY_TICKET_STATUSES)
|
||||
->where('templateState.inheritedAreas.2.value', DuplicateProjectConfiguration::COPY_STATUS_TRANSITIONS),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -308,6 +310,9 @@ class ProjectBoardSettingsControllerTest extends TestCase
|
||||
$otherProject = Project::factory()->create([
|
||||
'key' => 'EXT',
|
||||
]);
|
||||
$sharedTemplate = ProjectTemplate::factory()->create();
|
||||
$project->forceFill(['project_template_id' => $sharedTemplate->id])->saveQuietly();
|
||||
$otherProject->forceFill(['project_template_id' => $sharedTemplate->id])->saveQuietly();
|
||||
$this->syncProjectPermissions($project, $user, ['edit']);
|
||||
|
||||
$sourceStatus = TicketStatus::factory()->for($project)->create([
|
||||
|
||||
Reference in New Issue
Block a user