Skip to content

Commit

Permalink
Added a validation for home_page value in collections
Browse files Browse the repository at this point in the history
  • Loading branch information
grafitto committed Feb 10, 2022
1 parent b4b9c52 commit df8a351
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/react/Settings/components/CollectionSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable max-statements */
/* eslint-disable max-lines */
import React from 'react';
import { Dispatch, bindActionCreators } from 'redux';
Expand All @@ -13,6 +14,7 @@ import { MultiSelect, Geolocation } from 'app/Forms';
import { RequestParams } from 'app/utils/RequestParams';
import SettingsAPI from 'app/Settings/SettingsAPI';
import { FeatureToggle } from 'app/components/Elements/FeatureToggle';
import { validateHomePageRoute } from 'app/utils/routeHelpers';
import { ToggleChildren } from './ToggleChildren';
import * as tips from './collectionSettingsTips';
import { SettingsFormElement } from './SettingsFormElement';
Expand Down Expand Up @@ -54,6 +56,9 @@ const CollectionSettings = ({
register('cookiepolicy');
register('newNameGeneration');
register('ocrServiceEnabled');
register('home_page', {
validate: (val: string) => validateHomePageRoute(val),
});

const save = async (newCollectionSettings: Settings) => {
const saveParameters = new RequestParams({
Expand Down

0 comments on commit df8a351

Please sign in to comment.