From 8b3578d094ab9fee339bb2c9e896b648293efb4a Mon Sep 17 00:00:00 2001 From: Jake Rosenberg Date: Thu, 5 Oct 2023 10:52:14 -0500 Subject: [PATCH] =?UTF-8?q?Revert=20"feat:=20tup-414=20help=20users=20"Vie?= =?UTF-8?q?w=20all=20=E2=80=A6"=20(#317)"=20(#330)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7482c88e9b6d5ba382792d9c727486fc813aff7f. --- .../src/pages/Dashboard/Dashboard.module.css | 4 ++-- libs/tup-components/src/news/UserNews.tsx | 6 ++---- .../src/projects/ProjectsTable.tsx | 10 +++------- .../src/tickets/TicketsDashboard.module.css | 4 ---- .../src/tickets/TicketsDashboard.tsx | 16 ++++------------ libs/tup-components/src/tickets/TicketsTable.tsx | 2 +- 6 files changed, 12 insertions(+), 30 deletions(-) delete mode 100644 libs/tup-components/src/tickets/TicketsDashboard.module.css diff --git a/apps/tup-ui/src/pages/Dashboard/Dashboard.module.css b/apps/tup-ui/src/pages/Dashboard/Dashboard.module.css index 8cc385f38..1dae32293 100644 --- a/apps/tup-ui/src/pages/Dashboard/Dashboard.module.css +++ b/apps/tup-ui/src/pages/Dashboard/Dashboard.module.css @@ -44,8 +44,8 @@ display: grid; gap: 25px; grid-template-columns: 1fr; - grid-template-rows: auto 1fr; - grid-template-areas: + grid-template-rows: 1fr 1fr; + grid-template-areas: "projects" "tickets"; diff --git a/libs/tup-components/src/news/UserNews.tsx b/libs/tup-components/src/news/UserNews.tsx index 941de6e99..e6c21fade 100644 --- a/libs/tup-components/src/news/UserNews.tsx +++ b/libs/tup-components/src/news/UserNews.tsx @@ -7,8 +7,6 @@ import { } from '@tacc/core-components'; import styles from './UserNews.module.css'; -const NEWS_DASHBOARD_DISPLAY_LIMIT = 3; - const formatDate = (datestring: string): string => { const date = new Date(datestring); return date.toLocaleDateString('en-US', { @@ -29,13 +27,13 @@ const ViewAllUpdates = () => ( target="_blank" rel="noopener noreferrer" > - View all Updates + View All Updates ); const UserNews: React.FC = () => { const { data, isLoading } = useUserNews(); - const maxItems = NEWS_DASHBOARD_DISPLAY_LIMIT; + const maxItems = 5; if (isLoading) return ; return ( diff --git a/libs/tup-components/src/projects/ProjectsTable.tsx b/libs/tup-components/src/projects/ProjectsTable.tsx index 0c0d2d7cd..5cfa4cbd8 100644 --- a/libs/tup-components/src/projects/ProjectsTable.tsx +++ b/libs/tup-components/src/projects/ProjectsTable.tsx @@ -4,8 +4,6 @@ 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( @@ -20,11 +18,9 @@ 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') - ) - .slice(0, PROJECTS_DASHBOARD_DISPLAY_LIMIT); + const projectData = data?.filter((prj) => + prj.allocations?.some((alloc) => alloc.status === 'Active') + ); if (isLoading) { return ; diff --git a/libs/tup-components/src/tickets/TicketsDashboard.module.css b/libs/tup-components/src/tickets/TicketsDashboard.module.css deleted file mode 100644 index 9e809aa8c..000000000 --- a/libs/tup-components/src/tickets/TicketsDashboard.module.css +++ /dev/null @@ -1,4 +0,0 @@ -.viewall-action { - margin-left: auto; - margin-right: 1em; -} diff --git a/libs/tup-components/src/tickets/TicketsDashboard.tsx b/libs/tup-components/src/tickets/TicketsDashboard.tsx index dc5500f54..0b7cf53ab 100644 --- a/libs/tup-components/src/tickets/TicketsDashboard.tsx +++ b/libs/tup-components/src/tickets/TicketsDashboard.tsx @@ -1,24 +1,16 @@ -import React from 'react'; -import { Link } from 'react-router-dom'; import { SectionTableWrapper } from '@tacc/core-components'; +import React from 'react'; import TicketCreateModal from './TicketCreateModal'; import { TicketsTable } from './TicketsTable'; -import styles from './TicketsDashboard.module.css'; - const TicketsDashboard: React.FC = () => { return ( - - View all Tickets - - - + New Ticket - - + + + New Ticket + } contentShouldScroll > diff --git a/libs/tup-components/src/tickets/TicketsTable.tsx b/libs/tup-components/src/tickets/TicketsTable.tsx index 2a88a920e..62c293370 100644 --- a/libs/tup-components/src/tickets/TicketsTable.tsx +++ b/libs/tup-components/src/tickets/TicketsTable.tsx @@ -6,7 +6,7 @@ import './TicketsTable.global.css'; import { formatDate } from '../utils/timeFormat'; import { EmptyTablePlaceholder } from '../utils'; -const TICKETS_DASHBOARD_DISPLAY_LIMIT = 7; +const TICKETS_DASHBOARD_DISPLAY_LIMIT = 12; export const getStatusText = (status: string) => { switch (status) {