Skip to content

Commit

Permalink
fix(KP-347): input component is now updated, beta text is added to he…
Browse files Browse the repository at this point in the history
…ader of landing and result page and one error message is updated
  • Loading branch information
amirhossein-haerian committed Sep 6, 2024
1 parent c16740b commit ff2a2f6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions i18n/messages.en.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,12 @@ const messages = {
},
errorOverflow: {
header: 'There were too many results',
text: 'There are too many courses that match your search critera. Please specify more characters/digits in the course name or course code (example of course code: SF1624).',
text: 'There are too many courses that match your search critera. Please specify more characters/digits in the course name or course code (example of course code: SF1624)',
help: 'For help, see the link below: Instructions for searching',
},
errorOverflowBeta: {
header: 'Sökningen gav för många träffar',
text: 'Det finns för många kurser som matchar det du sökt på. Ange fler bokstäver/siffror i kursnamn eller kurskod (exempel på kurskod: SF1624).',
header: 'There were too many results',
text: 'There are too many courses that match your search critera. Please specify more characters/digits in the course name or course code (example of course code: SF1624)',
// we don't have this link anymore so we should decide what we are going to show as a help text
},
noQueryProvided: {
Expand Down
4 changes: 3 additions & 1 deletion public/js/app/components/SearchInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ const SearchInput: React.FC<SearchInputProps> = ({ caption, onSubmit, disabled }
}, [courseSearchParams])

const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
setInputText(e.target.value)
const { value } = e.target
const cleanTextPattern = value ? value.replace(/['"<>$]+/g, '') : ''
setInputText(cleanTextPattern)
}

const handleSubmit = (e: FormEvent<HTMLFormElement>) => {
Expand Down
2 changes: 1 addition & 1 deletion public/js/app/pages/NewSearchLandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const NewSearchLandingPage: React.FC<SearchPageProps> = ({ searchMode = SEARCH_M

return (
<div className="search-landing-page">
<PageHeading>{searchHeading}</PageHeading>
<PageHeading>{`${searchHeading} (beta)`}</PageHeading>
<Lead text={leadIntro} />
<SearchInput caption={searchButton} onSubmit={handleSubmit} />
<SearchFilters
Expand Down
2 changes: 1 addition & 1 deletion public/js/app/pages/NewSearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const NewSearchPage: React.FC<SearchPageProps> = ({ searchMode = SEARCH_MODES.de
/>
</SidebarFilters>
<MainContent>
<PageHeading>{resultsHeading}</PageHeading>
<PageHeading>{`${resultsHeading} (beta)`}</PageHeading>
<SearchInput caption={searchButton} onSubmit={handlePatternChange} disabled={searchStatus === STATUS.pending} />
<NewSearchResultDisplay resultsState={state as KoppsCourseSearchResultState} />
</MainContent>
Expand Down

0 comments on commit ff2a2f6

Please sign in to comment.