feat: overhaul project workspace navigation
linter / quality (pull_request) Successful in 1m28s
tests / ci (8.4) (pull_request) Successful in 1m47s

This commit is contained in:
2026-07-18 17:52:25 +02:00
parent a46695c2eb
commit ff796aa10a
45 changed files with 1790 additions and 995 deletions
@@ -174,7 +174,7 @@ class ProjectControllerTest extends TestCase
$project = Project::query()->firstOrFail();
$response->assertRedirect(route('projects.show', $project));
$response->assertRedirect(route('projects.board.index', $project));
$this->assertDatabaseHas('projects', [
'name' => 'Kanban Foundation',
@@ -281,7 +281,7 @@ class ProjectControllerTest extends TestCase
$project = Project::query()->where('key', 'TMP1')->firstOrFail();
$response->assertRedirect(route('projects.show', $project));
$response->assertRedirect(route('projects.board.index', $project));
$project->refresh();
@@ -412,7 +412,7 @@ class ProjectControllerTest extends TestCase
$project = Project::query()->where('key', 'DUPE')->firstOrFail();
$response->assertRedirect(route('projects.show', $project));
$response->assertRedirect(route('projects.board.index', $project));
$this->assertSame('Duplicated Project', $project->name);
$this->assertFalse($project->show_author);
@@ -469,9 +469,9 @@ class ProjectControllerTest extends TestCase
}
/**
* Ensure authenticated users can view the project hub page.
* Ensure authenticated users enter a project through its board.
*/
public function test_authenticated_users_can_view_a_project_hub_page(): void
public function test_authenticated_users_are_redirected_to_the_project_board(): void
{
$user = User::factory()->create();
$project = Project::factory()->create([
@@ -482,13 +482,7 @@ class ProjectControllerTest extends TestCase
$this->actingAs($user)
->get(route('projects.show', $project))
->assertOk()
->assertInertia(fn (Assert $page) => $page
->component('projects/Show')
->where('canManageAccess', false)
->where('project.id', $project->id)
->where('project.key', 'CORE'),
);
->assertRedirect(route('projects.board.index', $project));
}
/**
@@ -507,11 +501,7 @@ class ProjectControllerTest extends TestCase
$this->actingAs($user)
->get(route('projects.show', $project))
->assertOk()
->assertInertia(fn (Assert $page) => $page
->component('projects/Show')
->where('project.id', $project->id),
);
->assertRedirect(route('projects.board.index', $project));
}
/**
@@ -544,14 +534,10 @@ class ProjectControllerTest extends TestCase
$this->actingAs($user)
->get(route('projects.access', $project))
->assertOk()
->assertInertia(fn (Assert $page) => $page
->component('projects/Access')
->where('project.id', $project->id)
->has('users', 1)
->has('teams', 1)
->where('permissionOptions.0.value', 'project:read'),
);
->assertRedirect(route('projects.settings.index', [
'project' => $project,
'section' => 'access',
]));
}
/**
@@ -566,12 +552,10 @@ class ProjectControllerTest extends TestCase
$this->actingAs($admin)
->get(route('projects.settings.general', $project))
->assertOk()
->assertInertia(fn (Assert $page) => $page
->component('projects/settings/General')
->where('project.id', $project->id)
->where('project.key', 'CORE'),
);
->assertRedirect(route('projects.settings.index', [
'project' => $project,
'section' => 'general',
]));
}
/**
@@ -588,11 +572,10 @@ class ProjectControllerTest extends TestCase
$this->actingAs($user)
->get(route('projects.settings.general', $project))
->assertOk()
->assertInertia(fn (Assert $page) => $page
->component('projects/settings/General')
->where('project.id', $project->id),
);
->assertRedirect(route('projects.settings.index', [
'project' => $project,
'section' => 'general',
]));
}
public function test_project_admins_can_switch_projects_to_another_template(): void
@@ -652,7 +635,10 @@ class ProjectControllerTest extends TestCase
'confirmation_key' => 'CORE',
'source_template_id' => $newTemplate->id,
])
->assertRedirect(route('projects.settings.general', $project))
->assertRedirect(route('projects.settings.index', [
'project' => $project,
'section' => 'general',
]))
->assertSessionHas('status', 'Core Platform now uses the Operations Template template.');
$project->refresh();
@@ -707,7 +693,10 @@ class ProjectControllerTest extends TestCase
->post(route('projects.settings.general.reset-template', $project), [
'confirmation_key' => 'CORE',
])
->assertRedirect(route('projects.settings.general', $project))
->assertRedirect(route('projects.settings.index', [
'project' => $project,
'section' => 'general',
]))
->assertSessionHas('status', 'Core Platform was reset to the Workflow Template template baseline.');
$project->refresh();
@@ -878,7 +867,10 @@ class ProjectControllerTest extends TestCase
->patch(route('projects.permissions.users.update', [$project, $member]), [
'permissions' => ['project:read', 'project:write'],
])
->assertRedirect(route('projects.access', $project))
->assertRedirect(route('projects.settings.index', [
'project' => $project,
'section' => 'access',
]))
->assertSessionHas('status', 'Regular User permissions were updated.');
$this->assertDatabaseHas('permission_assignments', [
@@ -917,7 +909,10 @@ class ProjectControllerTest extends TestCase
->patch(route('projects.permissions.teams.update', [$project, $team]), [
'permissions' => ['project:read', 'project:write'],
])
->assertRedirect(route('projects.access', $project))
->assertRedirect(route('projects.settings.index', [
'project' => $project,
'section' => 'access',
]))
->assertSessionHas('status', 'Delivery Team permissions were updated.');
$this->assertDatabaseHas('permission_assignments', [