-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #653 from thepolicylab-projectportals/476-feat-add…
…-full-site-search-lunr feat: 476 add full site search
- Loading branch information
Showing
23 changed files
with
964 additions
and
32 deletions.
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
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,5 @@ | ||
{ | ||
"templateKey": "SearchPage", | ||
"title": "Search the Whole Site!", | ||
"image": "background.jpg" | ||
} |
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
16 changes: 16 additions & 0 deletions
16
packages/gatsby-theme-project-portal/src/components/Label.tsx
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,16 @@ | ||
import React, { FunctionComponent } from "react" | ||
|
||
interface LabelProps { | ||
id: string | ||
label: string | ||
} | ||
|
||
export const Label: FunctionComponent<LabelProps> = ({ id, label }) => { | ||
return ( | ||
<> | ||
<label id={`${id}-label`} className="font-bold p-1" htmlFor={id}> | ||
{label} | ||
</label> | ||
</> | ||
) | ||
} |
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 |
---|---|---|
|
@@ -58,6 +58,78 @@ export const Primary: Story = { | |
}, | ||
} | ||
|
||
export const LongTitle: Story = { | ||
args: { | ||
title: "completed 2", | ||
agency: "example agency", | ||
topics: [], | ||
slug: "project/completed-project", | ||
summary: "example project summary", | ||
statusOfData: "example statusOfData", | ||
status: "completed", | ||
startDate: new Date("2022-06-17"), | ||
requirement: "example requirement", | ||
question: | ||
"Hello world2 (from json)? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua?", | ||
purpose: "example purpose", | ||
projectTeam: ProjectTeamStories.Primary.args.contacts, | ||
priorResearch: null, | ||
opportunityCloses: new Date("2022-10-28"), | ||
mainContact: { | ||
name: "Contact Name", | ||
title: "Title", | ||
employer: "Employer", | ||
email: "[email protected]", | ||
image: contactImageYogi, | ||
}, | ||
fundingInfo: "example fundingInfo", | ||
expertise: "example expertise", | ||
faq: [ | ||
{ title: "Question 1?", text: "Answer 1!" }, | ||
{ | ||
title: "This is another different question?", | ||
text: "Here's an answer for that question! Yay!", | ||
}, | ||
], | ||
deliverable: "example deliverable", | ||
emailContent: "example emailContent", | ||
endDate: new Date("2016-12-15"), | ||
}, | ||
} | ||
|
||
export const NullValues: Story = { | ||
args: { | ||
title: "project completed 2", | ||
agency: "example agency", | ||
topics: [], | ||
slug: "project/completed-project2", | ||
summary: "", | ||
statusOfData: null, | ||
status: "completed", | ||
startDate: new Date("2022-06-17"), | ||
requirement: null, | ||
question: "", | ||
purpose: null, | ||
projectTeam: ProjectTeamStories.Primary.args.contacts, | ||
priorResearch: null, | ||
opportunityCloses: new Date("2022-10-28"), | ||
mainContact: { | ||
name: "Contact Name", | ||
title: "Title", | ||
employer: "Employer", | ||
email: "[email protected]", | ||
image: contactImageYogi, | ||
}, | ||
keyDates: null, | ||
fundingInfo: null, | ||
expertise: null, | ||
faq: null, | ||
deliverable: null, | ||
emailContent: null, | ||
endDate: new Date("2016-12-15"), | ||
}, | ||
} | ||
|
||
export const Open: Story = { | ||
args: { ...Primary.args, status: "open" }, | ||
} | ||
|
@@ -93,6 +165,58 @@ export const Minimum: Story = { | |
}, | ||
} | ||
|
||
export const Maximum: Story = { | ||
args: { | ||
question: "Is there a difference between brown sugar and white sugar?", | ||
summary: | ||
"Contrary to common belief, they are nutritionally similar. Nutritionally speaking, all natural sugars have relatively comparable nutritional value with approximately 15 calories per teaspoon (4.2 g).\n", | ||
title: "Sugar Investigations in the US", | ||
mainContact: { | ||
name: "Contact Name", | ||
title: "Title", | ||
employer: "Employer", | ||
email: "[email protected]", | ||
}, | ||
|
||
status: "open", | ||
opportunityCloses: new Date("2022-03-04"), | ||
startDate: new Date("2022-01-03"), | ||
endDate: new Date("2022-03-04"), | ||
agency: "Sugar Agency", | ||
topics: [ | ||
{ slug: "conspiracy", title: "conspiracy" }, | ||
{ slug: "investigation", title: "investigation" }, | ||
], | ||
lastModified: new Date("2022-05-27T16:34:04.000Z"), | ||
slug: "project/sugar-investigations", | ||
emailContent: | ||
"Dearest community, Are you interested in knowing about sugars? So are we! Join our search!", | ||
deliverable: | ||
"Analysis of existing sugars in the United States. Summary of and detailed recommendations and potential action steps to inform the public about the sugars they are consuming. \\n* See project summary for additional information.", | ||
purpose: | ||
"Results will be shared with the FDA and whoever else wants these results. We have no oversight and thus may do as we wish.", | ||
expertise: | ||
"While our team does not have previous experience in organic chemistry, we are committed to uncovering the truth.", | ||
requirement: "I do not understand this question. Next.", | ||
keyDates: "Publish data at some point in time.", | ||
priorResearch: "Prior research is published in many reputable journals.", | ||
statusOfData: "Data collection has not begun.", | ||
fundingInfo: | ||
"Our team will evaluate whether or not a project needs money, and we will most likely need the project team to figure out funding.", | ||
openText: "Are you interested in collaborating?", | ||
ongoingText: "This project is ongoing.", | ||
completeText: "This project is complete.", | ||
projectTeam: ProjectTeamStories.Primary.args.contacts, | ||
faq: [ | ||
{ title: "Question 1?", text: "Answer 1!" }, | ||
{ | ||
title: "This is another question?", | ||
text: "Here's an answer for that question! Yay!", | ||
}, | ||
], | ||
}, | ||
} | ||
|
||
export const TailwindXSWindow: Story = { | ||
args: Primary.args, | ||
parameters: { viewport: { defaultViewport: "tailwindXS" } }, | ||
|
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
Oops, something went wrong.