Skip to content

Commit

Permalink
Revert "feat: tup-414 help users "View all …" (#317)" (#330)
Browse files Browse the repository at this point in the history
This reverts commit 7482c88.
  • Loading branch information
jarosenb authored Oct 5, 2023
1 parent 7482c88 commit 8b3578d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 30 deletions.
4 changes: 2 additions & 2 deletions apps/tup-ui/src/pages/Dashboard/Dashboard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
6 changes: 2 additions & 4 deletions libs/tup-components/src/news/UserNews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand All @@ -29,13 +27,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 = NEWS_DASHBOARD_DISPLAY_LIMIT;
const maxItems = 5;

if (isLoading) return <LoadingSpinner />;
return (
Expand Down
10 changes: 3 additions & 7 deletions libs/tup-components/src/projects/ProjectsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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 <LoadingSpinner />;
Expand Down
4 changes: 0 additions & 4 deletions libs/tup-components/src/tickets/TicketsDashboard.module.css

This file was deleted.

16 changes: 4 additions & 12 deletions libs/tup-components/src/tickets/TicketsDashboard.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<SectionTableWrapper
header="My Tickets"
headerActions={
<>
<Link to="/tickets" className={styles['viewall-action']}>
View all Tickets
</Link>
<TicketCreateModal display="secondary" size="small">
+ New Ticket
</TicketCreateModal>
</>
<TicketCreateModal display="secondary" size="small">
+ New Ticket
</TicketCreateModal>
}
contentShouldScroll
>
Expand Down
2 changes: 1 addition & 1 deletion libs/tup-components/src/tickets/TicketsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8b3578d

Please sign in to comment.