Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update batch tables to match design + make titles selectable #295

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions canopeum_frontend/src/assets/styles/GlobalStyles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ body {
background-image: url('@assets/images/TreeBackground.png');
}

.text-small {
font-size: 90%;
// Named after https://getbootstrap.com/docs/5.2/utilities/text/#font-size
.fs-small {
font-size: 0.875rem;
}

.text-ellipsis {
Expand Down
2 changes: 1 addition & 1 deletion canopeum_frontend/src/components/social/PostComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const PostComment = ({ comment, onDelete, siteId }: Props) => {

<div className='d-flex flex-column'>
<span className='fw-bold'>{comment.authorUsername}</span>
<span className='text-muted text-small'>
<span className='text-muted s fs-small'>
Samuel-Therrien-Beslogic marked this conversation as resolved.
Show resolved Hide resolved
{formatDate(comment.createdAt, { dateStyle: 'short' })}
</span>
</div>
Expand Down
30 changes: 18 additions & 12 deletions canopeum_frontend/src/pages/Analytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,29 +142,31 @@

return (
<div className='accordion-item mb-3 rounded' key={site.id}>
<h2 className='accordion-header rounded' id={`heading-${site.id}`}>
<button
<h3 className='accordion-header rounded' id={`heading-${site.id}`}>
{/* We use a div so the text stays selectable, but this is really used like a button */}
{/* eslint-disable-next-line jsx-a11y/prefer-tag-over-role -- see above */}
<div
aria-controls={`collapse-${site.id}`}
aria-expanded='true'
className='accordion-button collapsed rounded'
data-bs-target={`#collapse-${site.id}`}
data-bs-toggle='collapse'
type='button'
role='button'
>
<div className='d-flex justify-content-between w-100 pe-3 fs-5'>
<div className='d-flex justify-content-between align-items-center w-100 pe-3 fs-5'>
<span>{site.name}</span>
<span style={{ opacity: .5 }}>
<small className='fw-bold text-muted fs-small'>
{translate('analytics.last-update')}: {lastModifiedBatchDate
? formatDate(lastModifiedBatchDate)
: 'N/A'}
</span>
</small>
<span className='text-capitalize'>
{site.batches.length}{' '}
{translate('analytics.batch', { count: site.batches.length })}
</span>
</div>
</button>
</h2>
</div>
</h3>

<div
aria-labelledby={`heading-${site.id}`}
Expand Down Expand Up @@ -221,14 +223,18 @@
</div>

<div className='mt-4'>
<div className='card p-3 px-4'>
<div className='d-flex justify-content-between'>
<div className='fs-5'>{translate('analytics.batch-tracking')}</div>
{
// TODO: Implement batch search/filtering, in the mean time we show a simple title

Check warning on line 227 in canopeum_frontend/src/pages/Analytics.tsx

View workflow job for this annotation

GitHub Actions / Lint-Autofixes

Unexpected 'TODO' comment: 'TODO: Implement batch search/filtering,...'
/* <div className='card p-3'>
<div className='d-flex justify-content-between align-items-center'>
<h2 className='fs-5'>{translate('analytics.batch-tracking')}</h2>
<div>
<span>TODO: Filters Go Here</span>
</div>
</div>
</div>
</div> */
}
<h2 className='text-light'>{translate('analytics.batch-tracking')}</h2>

<div className='accordion mt-4' id='accordion-batches'>
{renderBatches()}
Expand Down
Loading