diff --git a/src/frontend/src/components/organisation/OrganisationAddForm.tsx b/src/frontend/src/components/organisation/OrganisationAddForm.tsx deleted file mode 100644 index 868a4f748c..0000000000 --- a/src/frontend/src/components/organisation/OrganisationAddForm.tsx +++ /dev/null @@ -1,205 +0,0 @@ -import React from 'react'; -import CoreModules from '@/shared/CoreModules.js'; -import useForm from '@/hooks/useForm.js'; -import OrganisationAddValidation from '@/components/organisation/Validation/OrganisationAddValidation.js'; -import { MenuItem, Select } from '@mui/material'; -import { OrganisationService } from '@/api/OrganisationService'; - -const formData = {}; -const organisationTypeList = ['FREE', 'DISCOUNTED', 'FULL_FEE']; -const organisationDataList = organisationTypeList.map((item, index) => ({ label: item, value: index + 1 })); -const OrganisationAddForm = () => { - const dispatch = CoreModules.useAppDispatch(); - const defaultTheme: any = CoreModules.useAppSelector((state) => state.theme.hotTheme); - - const submission = () => { - // eslint-disable-next-line no-use-before-define - // submitForm(); - dispatch(OrganisationService(`${import.meta.env.VITE_API_URL}/organisation/`, values)); - }; - const { handleSubmit, handleCustomChange, values, errors }: any = useForm( - formData, - submission, - OrganisationAddValidation, - ); - const inputFormStyles = () => { - return { - style: { - color: defaultTheme.palette.error.main, - fontFamily: defaultTheme.typography.fontFamily, - fontSize: defaultTheme.typography.fontSize, - }, // or className: 'your-class' - }; - }; - return ( -
- ); -}; - -OrganisationAddForm.propTypes = {}; - -export default OrganisationAddForm; diff --git a/src/frontend/src/components/organisation/Validation/OrganisationAddValidation.tsx b/src/frontend/src/components/organisation/Validation/OrganisationAddValidation.tsx deleted file mode 100644 index bbd4935658..0000000000 --- a/src/frontend/src/components/organisation/Validation/OrganisationAddValidation.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { isValidUrl } from '@/utilfunctions/urlChecker'; - -interface OrganisationValues { - logo: string; - name: string; - description: string; - url: string; - type: number; - odk_central_url: string; - odk_central_user: string; - odk_central_password: string; -} -interface ValidationErrors { - logo?: string; - name?: string; - description?: string; - url?: string; - type?: string; - odk_central_url?: string; - odk_central_user?: string; - odk_central_password?: string; -} - -function OrganisationAddValidation(values: OrganisationValues) { - const errors: ValidationErrors = {}; - - if (!values?.name) { - errors.name = 'Name is Required.'; - } - - if (!values?.description) { - errors.description = 'Description is Required.'; - } - - if (!values?.url) { - errors.url = 'Organization Url is Required.'; - } else if (!isValidUrl(values.url)) { - errors.url = 'Invalid URL.'; - } - - if (values?.odk_central_url && !isValidUrl(values.odk_central_url)) { - errors.odk_central_url = 'Invalid URL.'; - } - - // if (!values?.logo) { - // errors.logo = 'Logo is Required.'; - // } - - return errors; -} - -export default OrganisationAddValidation; diff --git a/src/frontend/src/routes.jsx b/src/frontend/src/routes.jsx index 4666843eeb..338b0e8ec8 100755 --- a/src/frontend/src/routes.jsx +++ b/src/frontend/src/routes.jsx @@ -6,7 +6,6 @@ import MainView from '@/views/MainView'; import ProtectedRoute from '@/utilities/ProtectedRoute'; import NotFoundPage from '@/views/NotFound404'; import Organisation from '@/views/Organisation'; -import CreateOrganisation from '@/views/CreateOrganisation'; import CreateEditOrganization from '@/views/CreateEditOrganization'; import ApproveOrganization from '@/views/ApproveOrganization'; import Authorized from '@/views/Authorized'; @@ -41,14 +40,6 @@ const routes = createBrowserRouter([ ), }, - { - path: '/createOrganisation', - element: ( -