-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue #2622] Update opp page for ISR #2724
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
12aab7f
Update opp page for ISR
acouch 08cd014
Merge branch 'main' into acouch/opp-page-isr
acouch bfe025c
Update opp page.tsx to reduce cache lifetime
acouch fca9dc2
Update ci-frontend-a11y.yml
acouch 060650e
Add e2e test
acouch d6eed6e
Remove file
acouch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ import NotFound from "src/app/[locale]/not-found"; | |
import fetchers from "src/app/api/Fetchers"; | ||
import { OPPORTUNITY_CRUMBS } from "src/constants/breadcrumbs"; | ||
import { ApiRequestError, parseErrorStatus } from "src/errors"; | ||
import withFeatureFlag from "src/hoc/search/withFeatureFlag"; | ||
import { Opportunity } from "src/types/opportunity/opportunityResponseTypes"; | ||
|
||
import { getTranslations } from "next-intl/server"; | ||
|
@@ -20,6 +19,8 @@ import OpportunityIntro from "src/components/opportunity/OpportunityIntro"; | |
import OpportunityLink from "src/components/opportunity/OpportunityLink"; | ||
import OpportunityStatusWidget from "src/components/opportunity/OpportunityStatusWidget"; | ||
|
||
export const revalidate = 600; // invalidate ten minutes | ||
|
||
export async function generateMetadata({ params }: { params: { id: string } }) { | ||
const t = await getTranslations({ locale: "en" }); | ||
const id = Number(params.id); | ||
|
@@ -41,6 +42,10 @@ export async function generateMetadata({ params }: { params: { id: string } }) { | |
return meta; | ||
} | ||
|
||
export function generateStaticParams() { | ||
return []; | ||
} | ||
|
||
function emptySummary() { | ||
return { | ||
additional_info_url: null, | ||
|
@@ -77,7 +82,11 @@ function emptySummary() { | |
}; | ||
} | ||
|
||
async function OpportunityListing({ params }: { params: { id: string } }) { | ||
export default async function OpportunityListing({ | ||
params, | ||
}: { | ||
params: { id: string }; | ||
}) { | ||
const id = Number(params.id); | ||
const breadcrumbs = Object.assign([], OPPORTUNITY_CRUMBS); | ||
// Opportunity id needs to be a number greater than 1 | ||
|
@@ -127,5 +136,3 @@ async function OpportunityListing({ params }: { params: { id: string } }) { | |
</div> | ||
); | ||
} | ||
|
||
export default withFeatureFlag(OpportunityListing, "showSearchV0"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when we merge, worth noting in the commit that this change is also included in case anyone wants to track it down later |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* eslint-disable testing-library/prefer-screen-queries */ | ||
import { expect, test } from "@playwright/test"; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto("/opportunity/1"); | ||
}); | ||
|
||
test.afterEach(async ({ context }) => { | ||
await context.close(); | ||
}); | ||
|
||
test("has title", async ({ page }) => { | ||
await expect(page).toHaveTitle(/^Opportunity Listing - */); | ||
}); | ||
|
||
test("has page attributes", async ({ page }) => { | ||
await expect(page.getByText("Forecasted")).toBeVisible(); | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok so this seems to be the configuration that this change sets up:
Is that right? Is the idea to try this out and evaluate how it works, or are there plans for next steps, such as as generating a list of all current opportunities at build time and pre-caching? Is the 10 minute window a ballpark estimate at this point that we will analyze in some way after launch and adjust, or is that based on data that leads us to believe it should be a pretty solid permanent setting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. We could certainly to that in the future. We don't have a good way of getting all of the opp ids. We might want an API for that in the future.
The file links refresh every 30 mins, so that is the higher end. The 10 mins is something we can test and adjust in the future.