Skip to content

Commit

Permalink
chore: add attachments being archived to the summary page
Browse files Browse the repository at this point in the history
  • Loading branch information
mikevespi committed May 22, 2024
1 parent a58d853 commit 3c965ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/components/Attachment/AttachmentTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface Props {
formChangeRowId: number;
hideDelete?: boolean;
isFirstRevision: boolean;
operation?: string;
}

const AttachmentTableRow: React.FC<Props> = ({
Expand All @@ -21,6 +22,7 @@ const AttachmentTableRow: React.FC<Props> = ({
formChangeRowId,
hideDelete,
isFirstRevision,
operation,
}) => {
const [
discardProjectAttachmentFormChange,
Expand Down Expand Up @@ -65,6 +67,9 @@ const AttachmentTableRow: React.FC<Props> = ({
return (
<>
<tr>
{operation && (
<td>{operation.charAt(0).toUpperCase() + operation.slice(1).toLowerCase()}</td>
)}
<td>{fileName}</td>
<td>{fileType}</td>
<td>{fileSize}</td>
Expand Down
3 changes: 2 additions & 1 deletion app/components/Form/ProjectAttachmentsFormSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { FormNotAddedOrUpdated } from "./SummaryFormCommonComponents";
import { useEffect, useMemo } from "react";

const tableFilters = [
new TextFilter("Operation", "operation"),
new TextFilter("File Name", "fileName"),
new TextFilter("Type", "type"),
new TextFilter("Size", "size"),
Expand Down Expand Up @@ -36,7 +37,6 @@ const ProjectAttachmentsFormSummary: React.FC<Props> = ({
summaryProjectAttachmentFormChanges: formChangesFor(
first: 500
formDataTableName: "project_attachment"
filter: { operation: { notEqualTo: ARCHIVE } }
) @connection(key: "connection_summaryProjectAttachmentFormChanges") {
__id
totalCount
Expand Down Expand Up @@ -115,6 +115,7 @@ const ProjectAttachmentsFormSummary: React.FC<Props> = ({
({ node }) => (
<AttachmentTableRow
key={node.id}
operation={node.operation}
attachment={node.asProjectAttachment.attachmentByAttachmentId}
formChangeRowId={node.rowId}
connectionId={revision.summaryProjectAttachmentFormChanges.__id}
Expand Down

0 comments on commit 3c965ea

Please sign in to comment.