diff --git a/src/admin/baseComponents/layouts/sidepanel/upload/SidePanelUploadLayout.jsx b/src/admin/baseComponents/layouts/sidepanel/upload/SidePanelUploadLayout.jsx index e4a19d70..2d440c7f 100644 --- a/src/admin/baseComponents/layouts/sidepanel/upload/SidePanelUploadLayout.jsx +++ b/src/admin/baseComponents/layouts/sidepanel/upload/SidePanelUploadLayout.jsx @@ -119,7 +119,7 @@ const SidePanelUploadLayout = ({ multiple: false, noClick: true, noKeyboard: true, - accept: 'image/jpeg, image/png', + accept: 'image/jpeg, image/png, image/svg+xml', maxSize: 10024 * 10024, }) diff --git a/src/admin/project/settings/event/ProjectSettingsForm.jsx b/src/admin/project/settings/event/ProjectSettingsForm.jsx index d8465838..b4aaef0e 100644 --- a/src/admin/project/settings/event/ProjectSettingsForm.jsx +++ b/src/admin/project/settings/event/ProjectSettingsForm.jsx @@ -18,7 +18,6 @@ import SidePanelUploadLayout from '../../../baseComponents/layouts/sidepanel/upl import { editProject } from '../../core/actions/editProject' import RestrictVoteRangeFields from './RestrictVoteRangeFields.jsx' import { SaveShortcut } from '../../../baseComponents/form/saveShortcut/SaveShortcut' -import { rURLWithLocalhostSupported } from '../../utils/rURLWithLocalhostSupported' const useStyles = makeStyles((theme) => ({ buttonContainer: { @@ -58,16 +57,8 @@ const ProjectSettingsForm = ({ project }) => { t('settingsEvent.fieldScheduleNotValid') ), logoUrl: string() - .matches( - rURLWithLocalhostSupported, - t('settingsEvent.fieldLogoUrlNotValid') - ) .required(t('settingsEvent.fieldLogoUrlRequired')), faviconUrl: string() - .matches( - rURLWithLocalhostSupported, - t('settingsEvent.fieldFaviconUrlNotValid') - ) .required(t('settingsEvent.fieldFaviconUrlRequired')), restrictVoteRange: boolean(), voteStartTime: string(), diff --git a/src/admin/project/utils/rURLWithLocalhostSupported.js b/src/admin/project/utils/rURLWithLocalhostSupported.js deleted file mode 100644 index 0343033b..00000000 --- a/src/admin/project/utils/rURLWithLocalhostSupported.js +++ /dev/null @@ -1,3 +0,0 @@ -// Regex from https://github.com/jquense/yup/issues/224#issuecomment-497775991 -// yup prevent localhost:3000 to be considered as a valid url -export const rURLWithLocalhostSupported = /^(?:([a-z0-9+.-]+):\/\/)(?:\S+(?::\S*)?@)?(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/ diff --git a/src/admin/translations/languages/en.admin.json b/src/admin/translations/languages/en.admin.json index 80314a70..23e8bf15 100644 --- a/src/admin/translations/languages/en.admin.json +++ b/src/admin/translations/languages/en.admin.json @@ -9,7 +9,7 @@ "search": "Search", "imageUrl": "Image URL", "uploadImage": "Upload image", - "imageHelp": "Image must be a jpeg or png image, less than 10MB" + "imageHelp": "Image must be a jpeg, png or svg image, less than 20MB" }, "common": { "back": "Back", diff --git a/src/admin/translations/languages/fr.admin.json b/src/admin/translations/languages/fr.admin.json index 4bf6d643..e3eb025b 100644 --- a/src/admin/translations/languages/fr.admin.json +++ b/src/admin/translations/languages/fr.admin.json @@ -9,7 +9,7 @@ "search": "Recherche", "imageUrl": "URL de l'image", "uploadImage": "Charger l'image", - "imageHelp": "L'image doit ĂȘtre au format png ou jpeg et faire moins de 10 Mo" + "imageHelp": "L'image doit ĂȘtre au format png, jpeg ou svg et faire moins de 20 Mo" }, "common": { "back": "Retour", diff --git a/src/superAdmin/SuperAdminProjects.tsx b/src/superAdmin/SuperAdminProjects.tsx index 33f9e474..c12feeca 100644 --- a/src/superAdmin/SuperAdminProjects.tsx +++ b/src/superAdmin/SuperAdminProjects.tsx @@ -104,7 +104,7 @@ export const SuperAdminProjects = () => { {range.name})} - +