Skip to content
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

UHF-9911: React errors resolving #970

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dist/css/styles.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/district-and-project-search.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/health-station-search.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/job-search.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/maternity-and-child-health-clinic-search.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/news-archive.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/ploughing-schedule.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/school-search.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 21 additions & 20 deletions src/js/react/apps/job-search/containers/FormContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
} from '../store';
import type OptionType from '../types/OptionType';
import SelectionsContainer from './SelectionsContainer';
import { getInitialAreaFilter } from '../helpers/Areas';

const FormContainer = () => {
const formAction = drupalSettings?.helfi_rekry_job_search?.results_page_path || '';
Expand Down Expand Up @@ -177,9 +176,10 @@ const FormContainer = () => {
value={taskAreaInputValue}
name={SearchComponents.TASK_AREAS}
style={{ display: 'none' }}
onChange={() => {}}
>
{taskAreaInputValue.map((value: string) => (
<option aria-hidden key={value} value={value} selected />
<option aria-hidden key={value} value={value} />
))}
</select>
<select
Expand All @@ -188,9 +188,10 @@ const FormContainer = () => {
value={employmentInputValue}
name={SearchComponents.EMPLOYMENT}
style={{ display: 'none' }}
onChange={() => {}}
>
{employmentInputValue.map((value: string) => (
<option aria-hidden key={value} value={value} selected />
<option aria-hidden key={value} value={value} />
))}
</select>
</>
Expand Down Expand Up @@ -220,23 +221,23 @@ const FormContainer = () => {
</div>
<div className='job-search-form__filter job-search-form__dropdown--upper'>
<Select
clearButtonAriaLabel={Drupal.t('Clear @label selection', {'@label': areaFilterLabel}, { context: 'React search clear selection label' })}
className='job-search-form__dropdown'
clearable
multiselect
selectedItemRemoveButtonAriaLabel={Drupal.t(
'Remove item',
{},
{ context: 'Job search remove item aria label' }
)}
placeholder={Drupal.t('All areas', {}, { context: 'Location placeholder' })}
label={areaFilterLabel}
// @ts-ignore
options={areaFilterOptions}
value={areaFilterSelection}
id={SearchComponents.AREA_FILTER}
onChange={setAreaFilter}
/>
clearButtonAriaLabel={Drupal.t('Clear @label selection', {'@label': areaFilterLabel}, { context: 'React search clear selection label' })}
className='job-search-form__dropdown'
clearable
multiselect
selectedItemRemoveButtonAriaLabel={Drupal.t(
'Remove item',
{},
{ context: 'Job search remove item aria label' }
)}
placeholder={Drupal.t('All areas', {}, { context: 'Location placeholder' })}
label={areaFilterLabel}
// @ts-ignore
options={areaFilterOptions}
value={areaFilterSelection}
id={SearchComponents.AREA_FILTER}
onChange={setAreaFilter}
/>
</div>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/js/react/common/helpers/Sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const initSentry = () => {
dsn: drupalSettings?.helfi_react_search?.sentry_dsn_react,
// Setting ensures that 100% of transactions will be sent to Sentry, if it's too much it should be lowered.
tracesSampleRate: 1.0,
});
// Suppress the ResizeObserver loop limit exceeded error.
ignoreErrors: ['ResizeObserver loop limit exceeded']
});
};

export default initSentry;
Expand Down
15 changes: 14 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,20 @@ module.exports = (env, argv) => {
hints: false,
maxEntrypointSize: 512000,
maxAssetSize: 512000
}
},
// Suppress the ResizeObserver loop limit exceeded error.
devServer: {
client: {
overlay: {
runtimeErrors: (error) => {
if (error.message === 'ResizeObserver loop limit exceeded') {
return false;
}
return true;
},
},
},
},
};

if (argv.mode === 'production') {
Expand Down