-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(search): Strip HTML tags from search results #3776
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ce677d6
refactor: Unnest data map, set up fallthrough defaults
DafyddLlyr 022762e
feat: Map all display values
DafyddLlyr b515ad8
feat: Map all display values
DafyddLlyr 024cc34
chore: Drop feature flag
DafyddLlyr 11f6202
test(wip): Setup tests
DafyddLlyr b30344a
feat: Toggle headline variant
DafyddLlyr 7b4b85b
test: Update feature flag test
DafyddLlyr d126766
chore: Docs, tidy up, rename files
DafyddLlyr 74986d1
feat: Strip HTML tags from search results
DafyddLlyr 90a9dc8
test: Update existing mocks to match new type
DafyddLlyr 5223cac
fix: Search full strings
DafyddLlyr 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
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
116 changes: 0 additions & 116 deletions
116
...anx.uk/src/pages/FlowEditor/components/Sidebar/Search/SearchResultCard/DataDisplayMap.tsx
This file was deleted.
Oops, something went wrong.
99 changes: 99 additions & 0 deletions
99
...lanx.uk/src/pages/FlowEditor/components/Sidebar/Search/SearchResultCard/allFacets.test.ts
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,99 @@ | ||
import { useStore } from "pages/FlowEditor/lib/store"; | ||
|
||
import { mockFlow } from "../mocks/getDisplayDetailsForResult"; | ||
import { getDisplayDetailsForResult } from "./getDisplayDetailsForResult"; | ||
|
||
type Output = ReturnType<typeof getDisplayDetailsForResult>; | ||
|
||
// Setup flow so that it can be referenced by SearchResults (e.g. getting parent nodes) | ||
beforeAll(() => useStore.setState({ flow: mockFlow })); | ||
|
||
describe("Basic fields", () => { | ||
it.todo("renders data.text"); | ||
it.todo("renders data.title"); | ||
it.todo("renders data.description"); | ||
}); | ||
|
||
describe("More information fields", () => { | ||
it.todo("renders data.notes"); | ||
it.todo("renders data.howMeasured"); | ||
it.todo("renders data.policyRef"); | ||
it.todo("renders data.info"); | ||
}); | ||
|
||
describe("checklist fields", () => { | ||
it.todo("renders data.categories.title"); | ||
}); | ||
|
||
describe("nextSteps fields", () => { | ||
it.todo("renders data.steps.title"); | ||
it.todo("renders data.steps.description"); | ||
it.todo("renders data.steps.url"); | ||
}); | ||
|
||
describe("fileUploadAndLabel fields", () => { | ||
it.todo("renders data.fileTypes.name"); | ||
it.todo("renders data.fileTypes.moreInformation.notes"); | ||
it.todo("renders data.fileTypes.moreInformation.howMeasured"); | ||
it.todo("renders data.fileTypes.moreInformation.policyRef"); | ||
it.todo("renders data.fileTypes.moreInformation.info"); | ||
}); | ||
|
||
describe("schemaComponents fields", () => { | ||
it.todo("renders data.schema.fields.data.title"); | ||
it.todo("renders data.schema.fields.data.description"); | ||
it.todo("renders data.schema.fields.data.options.data.description"); | ||
it.todo("renders data.schema.fields.data.options.text"); | ||
}); | ||
|
||
describe("taskList fields", () => { | ||
it.todo("renders data.tasks.title"); | ||
it.todo("renders data.tasks.description"); | ||
}); | ||
|
||
// TODO: Flag tests | ||
// const result: SearchFacets = [ | ||
// ...flatFlags.flatMap(({ value }) => [ | ||
// `data.overrides.${value}.heading`, | ||
// `data.overrides.${value}.description`, | ||
// ]), | ||
// ]; | ||
|
||
describe("content fields", () => { | ||
it.todo("renders data.content"); | ||
}); | ||
|
||
describe("confirmation fields", () => { | ||
it.todo("renders data.heading"); | ||
it.todo("renders data.moreInfo"); | ||
it.todo("renders data.contactInfo"); | ||
it.todo("renders data.nextSteps.title"); | ||
it.todo("renders data.nextSteps.description"); | ||
}); | ||
|
||
describe("findProperty fields", () => { | ||
it.todo("renders data.newAddressTitle"); | ||
it.todo("renders data.newAddressDescription"); | ||
it.todo("renders data.newAddressDescriptionLabel"); | ||
}); | ||
|
||
describe("drawBoundary fields", () => { | ||
it.todo("renders data.titleForUploading"); | ||
it.todo("renders data.descriptionForUploading"); | ||
}); | ||
|
||
describe("planningConstraints fields", () => { | ||
it.todo("renders data.disclaimer"); | ||
}); | ||
|
||
describe("pay fields", () => { | ||
it.todo("renders data.bannerTitle"); | ||
it.todo("renders data.instructionsTitle"); | ||
it.todo("renders data.instructionsDescription"); | ||
it.todo("renders data.secondaryPageTitle"); | ||
it.todo("renders data.nomineeTitle"); | ||
it.todo("renders data.nomineeDescription"); | ||
it.todo("renders data.yourDetailsTitle"); | ||
it.todo("renders data.yourDetailsDescription"); | ||
it.todo("renders data.yourDetailsLabel"); | ||
}); |
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.
Oops, something went wrong.
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.
By default, just the first 60 characters are searched which was giving me some unexpected false negative results.
The testing I've done doesn't make this feel much slower performance-wise - will flag this when this PR is tested.
Docs: https://www.fusejs.io/api/options.html#ignorelocation