Change projects display to table view in team dashboard

This commit is contained in:
Mondo Diaz
2026-01-28 15:45:46 +00:00
parent 86f2f031db
commit 018e352820
2 changed files with 133 additions and 101 deletions

View File

@@ -84,74 +84,88 @@
font-size: 1.25rem;
}
.projects-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 1rem;
}
.project-card {
background: var(--color-bg-secondary);
/* Projects Table */
.projects-table-container {
background: var(--color-bg);
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
transition: all 0.15s ease;
display: flex;
flex-direction: column;
}
.project-card:hover {
border-color: var(--color-border-hover);
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 {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 0.75rem;
margin-bottom: 0.5rem;
}
.project-card-header h3 {
margin: 0;
font-size: 1rem;
font-weight: 600;
}
.project-card-description {
margin: 0 0 0.75rem;
font-size: 0.875rem;
color: var(--color-text-secondary);
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.project-card-meta {
font-size: 0.8125rem;
.projects-table {
width: 100%;
border-collapse: collapse;
}
.projects-table th {
text-align: left;
padding: 0.75rem 1rem;
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--color-text-muted);
background: var(--color-bg-secondary);
border-bottom: 1px solid var(--color-border);
}
.projects-table td {
padding: 0.75rem 1rem;
font-size: 0.875rem;
border-bottom: 1px solid var(--color-border);
vertical-align: middle;
}
.projects-table tbody tr:last-child td {
border-bottom: none;
}
.project-row {
cursor: pointer;
transition: background 0.1s ease;
}
.project-row:hover {
background: var(--color-bg-secondary);
}
.project-name-link {
font-weight: 500;
color: var(--color-text);
text-decoration: none;
}
.project-name-link:hover {
color: var(--color-primary);
}
.project-description-cell {
color: var(--color-text-secondary);
max-width: 300px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.text-muted {
color: var(--color-text-muted);
}
.actions-cell {
width: 48px;
text-align: right;
}
.btn-ghost {
background: transparent;
color: var(--color-text-muted);
border: none;
padding: 0.375rem;
}
.btn-ghost:hover {
background: var(--color-bg-tertiary);
color: var(--color-text);
}
.section-footer {

View File

@@ -214,45 +214,63 @@ function TeamDashboardPage() {
)}
</div>
) : (
<div className="projects-grid">
<div className="projects-table-container">
<table className="projects-table">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Visibility</th>
<th>Created By</th>
{isAdminOrOwner && <th></th>}
</tr>
</thead>
<tbody>
{projects?.items.map(project => (
<div
<tr
key={project.id}
className="project-card"
className="project-row"
onClick={() => navigate(`/project/${project.name}`)}
>
<div className="project-card-clickable" onClick={() => navigate(`/project/${project.name}`)}>
<div className="project-card-header">
<h3>{project.name}</h3>
<td>
<Link
to={`/project/${project.name}`}
className="project-name-link"
onClick={(e) => e.stopPropagation()}
>
{project.name}
</Link>
</td>
<td className="project-description-cell">
{project.description || <span className="text-muted"></span>}
</td>
<td>
<Badge variant={project.is_public ? 'public' : 'private'}>
{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>
</td>
<td className="text-muted">{project.created_by}</td>
{isAdminOrOwner && (
<div className="project-card-actions">
<td className="actions-cell">
<button
className="btn btn-sm btn-secondary"
className="btn btn-sm btn-ghost"
onClick={(e) => {
e.stopPropagation();
navigate(`/project/${project.name}/settings`);
}}
title="Settings"
>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<svg width="16" height="16" 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>
</td>
)}
</div>
</tr>
))}
</tbody>
</table>
</div>
)}