From 0c30aafbcb7b992ae11197ed2aa56641563f3f63 Mon Sep 17 00:00:00 2001 From: Tyler Barna Date: Fri, 26 Apr 2024 13:45:57 -0400 Subject: [PATCH 1/3] redirect user to main circulars page if atempting to navigate to a circular that does not exist --- app/routes/circulars/circulars.server.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/routes/circulars/circulars.server.ts b/app/routes/circulars/circulars.server.ts index 08864b594..3f076e438 100644 --- a/app/routes/circulars/circulars.server.ts +++ b/app/routes/circulars/circulars.server.ts @@ -224,10 +224,9 @@ export async function get( ): Promise { const circularVersions = await getDynamoDBVersionAutoIncrement(circularId) const result = await circularVersions.get(version) - if (!result) - throw new Response(null, { - status: 404, - }) + if (!result) { + throw redirect('/circulars') + } return result as Circular } From 1bc9e2f74bc71056435548fb473a1525ae182a46 Mon Sep 17 00:00:00 2001 From: Tyler Barna Date: Fri, 26 Apr 2024 14:04:53 -0400 Subject: [PATCH 2/3] add navigation buttons in circular pages adds buttons to navigate to previous and next circular within a given circular page. Does not currently account for circulars that do not follow the integer numbering. --- .../route.tsx | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/routes/circulars.$circularId.($version)/route.tsx b/app/routes/circulars.$circularId.($version)/route.tsx index 0a17446a3..df53939e7 100644 --- a/app/routes/circulars.$circularId.($version)/route.tsx +++ b/app/routes/circulars.$circularId.($version)/route.tsx @@ -73,6 +73,12 @@ export default function () { const linkString = `/circulars/${circularId}${ !latest && version ? `/${version}` : '' }` + const previousCircularLinkString = `/circulars/${circularId - 1}${ + version ? `/${version}` : '' + }` + const nextCircularLinkString = `/circulars/${circularId + 1}${ + version ? `/${version}` : '' + }` return ( <> @@ -142,6 +148,26 @@ export default function () {

GCN Circular {circularId}

{body} + + +
+ +
+       Previous Circular + + +
+ +
+       Next Circular + +
) } From 80334085322e894af5650cc86f39646135391ed4 Mon Sep 17 00:00:00 2001 From: Tyler Barna Date: Fri, 26 Apr 2024 14:06:19 -0400 Subject: [PATCH 3/3] remove redundant styling for buttonGroup --- app/routes/circulars.$circularId.($version)/route.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routes/circulars.$circularId.($version)/route.tsx b/app/routes/circulars.$circularId.($version)/route.tsx index df53939e7..05d4471ad 100644 --- a/app/routes/circulars.$circularId.($version)/route.tsx +++ b/app/routes/circulars.$circularId.($version)/route.tsx @@ -148,7 +148,7 @@ export default function () {

GCN Circular {circularId}

{body} - +