Move project settings to team portal, remove project-level permissions

- Add Settings button to project cards in team dashboard
- Hide Settings button on ProjectPage for projects belonging to a team
- Remove AccessManagement section from ProjectSettingsPage
  (team membership now governs all access to team projects)
- Update project card layout with separate clickable area and actions
This commit is contained in:
Mondo Diaz
2026-01-28 15:19:41 +00:00
parent 60179e68fd
commit 69f3737303
4 changed files with 52 additions and 18 deletions

View File

@@ -211,7 +211,7 @@ function ProjectPage() {
</div> </div>
</div> </div>
<div className="page-header__actions"> <div className="page-header__actions">
{canAdmin && ( {canAdmin && !project.team_id && (
<button <button
className="btn btn-secondary" className="btn btn-secondary"
onClick={() => navigate(`/project/${projectName}/settings`)} onClick={() => navigate(`/project/${projectName}/settings`)}

View File

@@ -10,7 +10,6 @@ import {
ForbiddenError, ForbiddenError,
} from '../api'; } from '../api';
import { Breadcrumb } from '../components/Breadcrumb'; import { Breadcrumb } from '../components/Breadcrumb';
import { AccessManagement } from '../components/AccessManagement';
import { useAuth } from '../contexts/AuthContext'; import { useAuth } from '../contexts/AuthContext';
import './ProjectSettingsPage.css'; import './ProjectSettingsPage.css';
@@ -236,9 +235,6 @@ function ProjectSettingsPage() {
</form> </form>
</div> </div>
{/* Access Management Section */}
<AccessManagement projectName={projectName!} />
{/* Danger Zone Section */} {/* Danger Zone Section */}
<div className="project-settings-danger-zone"> <div className="project-settings-danger-zone">
<h2>Danger Zone</h2> <h2>Danger Zone</h2>

View File

@@ -94,9 +94,9 @@
background: var(--color-bg-secondary); background: var(--color-bg-secondary);
border: 1px solid var(--color-border); border: 1px solid var(--color-border);
border-radius: var(--radius-md); border-radius: var(--radius-md);
padding: 1rem;
cursor: pointer;
transition: all 0.15s ease; transition: all 0.15s ease;
display: flex;
flex-direction: column;
} }
.project-card:hover { .project-card:hover {
@@ -104,6 +104,26 @@
box-shadow: var(--shadow-sm); box-shadow: var(--shadow-sm);
} }
.project-card-clickable {
padding: 1rem;
cursor: pointer;
flex: 1;
}
.project-card-actions {
padding: 0.75rem 1rem;
border-top: 1px solid var(--color-border);
display: flex;
justify-content: flex-end;
gap: 0.5rem;
}
.project-card-actions .btn {
display: inline-flex;
align-items: center;
gap: 0.375rem;
}
.project-card-header { .project-card-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@@ -219,20 +219,38 @@ function TeamDashboardPage() {
<div <div
key={project.id} key={project.id}
className="project-card" className="project-card"
onClick={() => navigate(`/project/${project.name}`)}
> >
<div className="project-card-header"> <div className="project-card-clickable" onClick={() => navigate(`/project/${project.name}`)}>
<h3>{project.name}</h3> <div className="project-card-header">
<Badge variant={project.is_public ? 'public' : 'private'}> <h3>{project.name}</h3>
{project.is_public ? 'Public' : 'Private'} <Badge variant={project.is_public ? 'public' : 'private'}>
</Badge> {project.is_public ? 'Public' : 'Private'}
</Badge>
</div>
{project.description && (
<p className="project-card-description">{project.description}</p>
)}
<div className="project-card-meta">
<span>Created by {project.created_by}</span>
</div>
</div> </div>
{project.description && ( {isAdminOrOwner && (
<p className="project-card-description">{project.description}</p> <div className="project-card-actions">
<button
className="btn btn-sm btn-secondary"
onClick={(e) => {
e.stopPropagation();
navigate(`/project/${project.name}/settings`);
}}
>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<circle cx="12" cy="12" r="3"/>
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>
</svg>
Settings
</button>
</div>
)} )}
<div className="project-card-meta">
<span>Created by {project.created_by}</span>
</div>
</div> </div>
))} ))}
</div> </div>