-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: tup-414 help users "View all …" #317
Changes from all commits
790a6b8
dc93ae4
cf433fd
480afba
7cfe787
35d1b76
c4c7b41
6d62c21
06c791d
60e1141
9d52d3e
f6ff1bd
dca5566
62ccdca
8a801c7
fea9950
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ import { | |
} from '@tacc/core-components'; | ||
import styles from './UserNews.module.css'; | ||
|
||
const NEWS_DASHBOARD_DISPLAY_LIMIT = 3; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
const formatDate = (datestring: string): string => { | ||
const date = new Date(datestring); | ||
return date.toLocaleDateString('en-US', { | ||
|
@@ -27,13 +29,13 @@ const ViewAllUpdates = () => ( | |
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
View All Updates | ||
View all Updates | ||
</a> | ||
); | ||
|
||
const UserNews: React.FC = () => { | ||
const { data, isLoading } = useUserNews(); | ||
const maxItems = 5; | ||
const maxItems = NEWS_DASHBOARD_DISPLAY_LIMIT; | ||
|
||
if (isLoading) return <LoadingSpinner />; | ||
return ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ import { ProjectsAllocations, useProjects } from '@tacc/tup-hooks'; | |
import { Link } from 'react-router-dom'; | ||
import { EmptyTablePlaceholder } from '../utils'; | ||
|
||
const PROJECTS_DASHBOARD_DISPLAY_LIMIT = 7; | ||
|
||
const allocationDisplay = (allocations: ProjectsAllocations[]) => { | ||
return allocations.length | ||
? Array.from( | ||
|
@@ -18,9 +20,11 @@ const allocationDisplay = (allocations: ProjectsAllocations[]) => { | |
|
||
export const ProjectsTable: React.FC = () => { | ||
const { data, isLoading, error } = useProjects(); | ||
const projectData = data?.filter((prj) => | ||
prj.allocations?.some((alloc) => alloc.status === 'Active') | ||
); | ||
const projectData = data | ||
?.filter((prj) => | ||
prj.allocations?.some((alloc) => alloc.status === 'Active') | ||
) | ||
.slice(0, PROJECTS_DASHBOARD_DISPLAY_LIMIT); | ||
Comment on lines
+23
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
if (isLoading) { | ||
return <LoadingSpinner />; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.viewall-action { | ||
margin-left: auto; | ||
margin-right: 1em; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
import { SectionTableWrapper } from '@tacc/core-components'; | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import { SectionTableWrapper } from '@tacc/core-components'; | ||
import TicketCreateModal from './TicketCreateModal'; | ||
import { TicketsTable } from './TicketsTable'; | ||
|
||
import styles from './TicketsDashboard.module.css'; | ||
|
||
const TicketsDashboard: React.FC = () => { | ||
return ( | ||
<SectionTableWrapper | ||
header="My Tickets" | ||
headerActions={ | ||
<TicketCreateModal display="secondary" size="small"> | ||
+ New Ticket | ||
</TicketCreateModal> | ||
<> | ||
<Link to="/tickets" className={styles['viewall-action']}> | ||
View all Tickets | ||
</Link> | ||
Comment on lines
+15
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added link to "View all Tickets". |
||
<TicketCreateModal display="secondary" size="small"> | ||
+ New Ticket | ||
</TicketCreateModal> | ||
</> | ||
} | ||
contentShouldScroll | ||
> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix an unrelated Dashboard layout bug that I am sneaking in, because it has been a bane to the designers but I see how easy it has become to fix.