From 790a6b830c76d43a575200bb670b33c8a1281f79 Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Thu, 7 Sep 2023 17:21:46 -0500 Subject: [PATCH 01/11] feat: add link in Dashboard to "View all tickets" --- .../src/tickets/TicketsDashboard.module.css | 4 ++++ libs/tup-components/src/tickets/TicketsDashboard.tsx | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 libs/tup-components/src/tickets/TicketsDashboard.module.css diff --git a/libs/tup-components/src/tickets/TicketsDashboard.module.css b/libs/tup-components/src/tickets/TicketsDashboard.module.css new file mode 100644 index 000000000..9e809aa8c --- /dev/null +++ b/libs/tup-components/src/tickets/TicketsDashboard.module.css @@ -0,0 +1,4 @@ +.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 ebb481610..c7195c095 100644 --- a/libs/tup-components/src/tickets/TicketsDashboard.tsx +++ b/libs/tup-components/src/tickets/TicketsDashboard.tsx @@ -1,14 +1,22 @@ -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 ( + New Ticket + <> + + View all tickets + + + New Ticket + } contentShouldScroll > From dc93ae4943d7bcd1b0063b1906aa477f554becd4 Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Thu, 7 Sep 2023 17:29:43 -0500 Subject: [PATCH 02/11] style: nx format:write --- libs/tup-components/src/tickets/TicketsDashboard.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/tup-components/src/tickets/TicketsDashboard.tsx b/libs/tup-components/src/tickets/TicketsDashboard.tsx index c7195c095..2a451d098 100644 --- a/libs/tup-components/src/tickets/TicketsDashboard.tsx +++ b/libs/tup-components/src/tickets/TicketsDashboard.tsx @@ -15,7 +15,9 @@ const TicketsDashboard: React.FC = () => { View all tickets - + New Ticket + + + New Ticket + } contentShouldScroll From cf433fde3fb8a3bf92ceaea2fc5e81ff037d0f80 Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Thu, 7 Sep 2023 17:43:06 -0500 Subject: [PATCH 03/11] enhance: show less tickets (to avoid scrollbar) Another PR may require this value to change further: https://github.com/TACC/tup-ui/pull/312 --- libs/tup-components/src/tickets/TicketsTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/tup-components/src/tickets/TicketsTable.tsx b/libs/tup-components/src/tickets/TicketsTable.tsx index 42326c88a..d1a407df5 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 = 12; +const TICKETS_DASHBOARD_DISPLAY_LIMIT = 8; export const getStatusText = (status: string) => { switch (status) { From 480afba7f835a2956c398d7259c2ee5bf5a25b69 Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Thu, 7 Sep 2023 17:47:48 -0500 Subject: [PATCH 04/11] enhance: show less news (to avoid scrollbar) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also, do so via— NEWS_DASHBOARD_DISPLAY_LIMIT —to mimic clarity of—TICKETS_DASHBOARD_DISPLAY_LIMIT --- libs/tup-components/src/news/UserNews.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/tup-components/src/news/UserNews.tsx b/libs/tup-components/src/news/UserNews.tsx index e6c21fade..c61843031 100644 --- a/libs/tup-components/src/news/UserNews.tsx +++ b/libs/tup-components/src/news/UserNews.tsx @@ -7,6 +7,8 @@ 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', { @@ -33,7 +35,7 @@ const ViewAllUpdates = () => ( const UserNews: React.FC = () => { const { data, isLoading } = useUserNews(); - const maxItems = 5; + const maxItems = NEWS_DASHBOARD_DISPLAY_LIMIT; if (isLoading) return ; return ( From 7cfe787145eb2985af37c9805d58387e757627b7 Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Thu, 7 Sep 2023 17:48:37 -0500 Subject: [PATCH 05/11] fix: consistent text casing for "view all" --- libs/tup-components/src/news/UserNews.tsx | 2 +- libs/tup-components/src/tickets/TicketsDashboard.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/tup-components/src/news/UserNews.tsx b/libs/tup-components/src/news/UserNews.tsx index c61843031..941de6e99 100644 --- a/libs/tup-components/src/news/UserNews.tsx +++ b/libs/tup-components/src/news/UserNews.tsx @@ -29,7 +29,7 @@ const ViewAllUpdates = () => ( target="_blank" rel="noopener noreferrer" > - View All Updates + View all Updates ); diff --git a/libs/tup-components/src/tickets/TicketsDashboard.tsx b/libs/tup-components/src/tickets/TicketsDashboard.tsx index 2a451d098..8746b9bf0 100644 --- a/libs/tup-components/src/tickets/TicketsDashboard.tsx +++ b/libs/tup-components/src/tickets/TicketsDashboard.tsx @@ -13,7 +13,7 @@ const TicketsDashboard: React.FC = () => { headerActions={ <> - View all tickets + View all Tickets + New Ticket From 35d1b766b9992c66b38768ff7c6641734527034a Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Thu, 7 Sep 2023 17:54:48 -0500 Subject: [PATCH 06/11] feat: limit projects on dash (to avoid scrollbar) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also, do so via— PROJECTS_DASHBOARD_DISPLAY_LIMIT —to mimic clarity of—TICKETS_DASHBOARD_DISPLAY_LIMIT --- libs/tup-components/src/projects/ProjectsTable.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/tup-components/src/projects/ProjectsTable.tsx b/libs/tup-components/src/projects/ProjectsTable.tsx index 5cfa4cbd8..b32b50917 100644 --- a/libs/tup-components/src/projects/ProjectsTable.tsx +++ b/libs/tup-components/src/projects/ProjectsTable.tsx @@ -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( @@ -20,7 +22,7 @@ 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); if (isLoading) { return ; From c4c7b413293473822f3bdae5b194e848fd89cb96 Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Thu, 7 Sep 2023 17:57:09 -0500 Subject: [PATCH 07/11] style: nx format:write --- libs/tup-components/src/projects/ProjectsTable.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/tup-components/src/projects/ProjectsTable.tsx b/libs/tup-components/src/projects/ProjectsTable.tsx index b32b50917..0c0d2d7cd 100644 --- a/libs/tup-components/src/projects/ProjectsTable.tsx +++ b/libs/tup-components/src/projects/ProjectsTable.tsx @@ -20,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') - ).slice(0, PROJECTS_DASHBOARD_DISPLAY_LIMIT); + const projectData = data + ?.filter((prj) => + prj.allocations?.some((alloc) => alloc.status === 'Active') + ) + .slice(0, PROJECTS_DASHBOARD_DISPLAY_LIMIT); if (isLoading) { return ; From 6d62c21f4e14af9312130bb1bfbcfcc26b0b9df0 Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Fri, 8 Sep 2023 10:36:04 -0500 Subject: [PATCH 08/11] fix: align "View all Tickets" vert. center --- libs/tup-components/src/tickets/TicketsDashboard.module.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/tup-components/src/tickets/TicketsDashboard.module.css b/libs/tup-components/src/tickets/TicketsDashboard.module.css index 9e809aa8c..6ed236d75 100644 --- a/libs/tup-components/src/tickets/TicketsDashboard.module.css +++ b/libs/tup-components/src/tickets/TicketsDashboard.module.css @@ -1,4 +1,6 @@ .viewall-action { + align-self: center; + margin-left: auto; margin-right: 1em; } From 06c791dcb1114774ed853e20c88781e0d7e75dbd Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Fri, 8 Sep 2023 12:23:15 -0500 Subject: [PATCH 09/11] Revert "fix: align "View all Tickets" vert. center" This reverts commit 6d62c21f4e14af9312130bb1bfbcfcc26b0b9df0. The alignment will not be an issue after new branch: enhance/tup-414-help-users-view-all-tickets--indirectly-support-small-size-button --- libs/tup-components/src/tickets/TicketsDashboard.module.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/libs/tup-components/src/tickets/TicketsDashboard.module.css b/libs/tup-components/src/tickets/TicketsDashboard.module.css index 6ed236d75..9e809aa8c 100644 --- a/libs/tup-components/src/tickets/TicketsDashboard.module.css +++ b/libs/tup-components/src/tickets/TicketsDashboard.module.css @@ -1,6 +1,4 @@ .viewall-action { - align-self: center; - margin-left: auto; margin-right: 1em; } From 9d52d3e651d1bad32b899dfeacc789b3b8744b67 Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Wed, 13 Sep 2023 10:49:39 -0500 Subject: [PATCH 10/11] fix: reduce dashboard display limit since #312 --- libs/tup-components/src/tickets/TicketsTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/tup-components/src/tickets/TicketsTable.tsx b/libs/tup-components/src/tickets/TicketsTable.tsx index f9a9f8a72..2a88a920e 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 = 8; +const TICKETS_DASHBOARD_DISPLAY_LIMIT = 7; export const getStatusText = (status: string) => { switch (status) { From 62ccdcac6eca6f1bc27e949368436af99d2a99ab Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Tue, 26 Sep 2023 16:46:34 -0500 Subject: [PATCH 11/11] fix: project ticket grid too much middle space MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Designers do not intend nor like big gap. It's been around since Portal. But it's been so difficult to fix… until `project-ticket-grid` came. I hadn't noticed the fix was possible until just now. --- apps/tup-ui/src/pages/Dashboard/Dashboard.module.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/tup-ui/src/pages/Dashboard/Dashboard.module.css b/apps/tup-ui/src/pages/Dashboard/Dashboard.module.css index 1dae32293..8cc385f38 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: 1fr 1fr; - grid-template-areas: + grid-template-rows: auto 1fr; + grid-template-areas: "projects" "tickets";