Skip to content

Commit

Permalink
Allow svg and remove url parsing check which was broken
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoGresse committed Nov 11, 2024
1 parent 7bf03f9 commit 5cb5759
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})

Expand Down
9 changes: 0 additions & 9 deletions src/admin/project/settings/event/ProjectSettingsForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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(),
Expand Down
3 changes: 0 additions & 3 deletions src/admin/project/utils/rURLWithLocalhostSupported.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/admin/translations/languages/en.admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/admin/translations/languages/fr.admin.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/superAdmin/SuperAdminProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const SuperAdminProjects = () => {
{range.name}</Button>)}
</Box>

<Box sx={{ height: "90vh" }}>
<Box sx={{ height: "90vh", width: "90vw" }}>
<DataGrid
rows={rows}
columns={columns}
Expand Down

0 comments on commit 5cb5759

Please sign in to comment.