diff --git a/web-app/public/locales/en/common.json b/web-app/public/locales/en/common.json
index 49fe2127b..3ed83d14a 100644
--- a/web-app/public/locales/en/common.json
+++ b/web-app/public/locales/en/common.json
@@ -23,5 +23,12 @@
"apiKey": "API Key",
"httpHeader": "HTTP Header",
"back": "Back",
- "and": "and"
+ "and": "and",
+ "next": "Next",
+ "form": {
+ "yes": "Yes",
+ "no": "No",
+ "required": "This field is required",
+ "submit": "Submit"
+ }
}
\ No newline at end of file
diff --git a/web-app/public/locales/en/feeds.json b/web-app/public/locales/en/feeds.json
index abef49fcb..c4de38b15 100644
--- a/web-app/public/locales/en/feeds.json
+++ b/web-app/public/locales/en/feeds.json
@@ -2,6 +2,7 @@
"feeds": "Feeds",
"dataType": "Data Format",
"transitProvider": "Transit Provider",
+ "transitProviderName": "Transit Provider Name",
"location": "Location",
"feedDescription": "Description",
"searchFor": "Search For",
@@ -21,7 +22,12 @@
"addOrUpdateFeed": "Add or Update a Feed",
"signUp": "Sign up for a Mobility Database account or login to add or update a GTFS feed.",
"signUpAction": "Sign up for an account",
- "loginSuccess": "You were successfully logged in, you can now add or update a feed."
+ "loginSuccess": "You were successfully logged in, you can now add or update a feed.",
+ "dataTypeRequired": "Data format required",
+ "feedLinkRequired": "Feed link required",
+ "oldFeedLinkRequired": "Old feed link required",
+ "dataProducerEmailRequired": "Data producer email required",
+ "contactEmailRequired": "Contact email required"
},
"seeFullList": "See full list",
"hideFullList": "Hide full list",
@@ -38,5 +44,18 @@
"downloadLatest": "Download Latest",
"seeLicense": "See License",
"boundingBoxTitle": "Bounding box from stops.txt",
- "unableToGenerateBoundingBox": "Unable to generate bounding box."
+ "unableToGenerateBoundingBox": "Unable to generate bounding box.",
+ "areYouOfficialProducer": "Are you the official producer or transit agency responsible for this data ?",
+ "feedLink": "Feed Link",
+ "areYouUpdatingFeed": "Are you updating a feed?",
+ "oldFeedLink": "Old Feed Link",
+ "dataProducerEmail": "Data Producer Email",
+ "dataProducerEmailDetails": "This is an official email that consumers of the feed can contact to ask questions.",
+ "interestedInDataAudit": "Are you interested in a data quality audit?",
+ "interestedInDataAuditDetails": "This is a 1 time meeting with MobilityData to review your GTFS validation report and discuss possible improvements.",
+ "dataAuditContactEmail": "Data quality audit contact email",
+ "hasLogoPermission": "Do we have your permission to use your logo?",
+ "hasLogoPermissionDetails": "This would be would be used to display your logo on the Mobilitydatabase website",
+ "whatToolsCreateGtfs": "What tools do you use to create GTFS data?",
+ "whatToolsCreateGtfsDetails": "Could include open source librareis, vendor serviecs, or other applications."
}
diff --git a/web-app/src/app/screens/FeedSubmission/FeedSubmissionStepper.tsx b/web-app/src/app/screens/FeedSubmission/FeedSubmissionStepper.tsx
deleted file mode 100644
index b908fcf74..000000000
--- a/web-app/src/app/screens/FeedSubmission/FeedSubmissionStepper.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import * as React from 'react';
-import Box from '@mui/material/Box';
-import Stepper from '@mui/material/Stepper';
-import Step from '@mui/material/Step';
-import StepLabel from '@mui/material/StepLabel';
-import FeedSubmissionForm from './Form';
-import { useNavigate } from 'react-router-dom';
-
-const steps = ['', '', ''];
-
-export default function FeedSubmissionStepper(): React.ReactElement {
- const [activeStep, setActiveStep] = React.useState(0);
- const navigateTo = useNavigate();
-
- const handleNext = (): void => {
- const nextStep = activeStep + 1;
- setActiveStep(nextStep);
- if (nextStep === steps.length) {
- navigateTo('/contribute/submitted');
- }
- };
-
- const handleBack = (): void => {
- setActiveStep((prevActiveStep) => prevActiveStep - 1);
- };
-
- return (
-
-
- {steps.map((label, index) => {
- const stepProps: { completed?: boolean } = {};
- const labelProps: {
- optional?: React.ReactNode;
- } = {};
- return (
-
- {label}
-
- );
- })}
-
-
-
-
- );
-}
diff --git a/web-app/src/app/screens/FeedSubmission/Form/FirstStep.tsx b/web-app/src/app/screens/FeedSubmission/Form/FirstStep.tsx
index 29a97824d..720a63c17 100644
--- a/web-app/src/app/screens/FeedSubmission/Form/FirstStep.tsx
+++ b/web-app/src/app/screens/FeedSubmission/Form/FirstStep.tsx
@@ -12,89 +12,98 @@ import {
FormHelperText,
} from '@mui/material';
-import { type SubmitHandler, Controller, useForm } from 'react-hook-form';
-import { type FeedSubmissionFormFormInput } from '.';
+import {
+ type SubmitHandler,
+ Controller,
+ useForm,
+ useWatch,
+} from 'react-hook-form';
+import { type YesNoFormInput, type FeedSubmissionFormFormInput } from '.';
+import { useEffect } from 'react';
+import { useTranslation } from 'react-i18next';
export interface FeedSubmissionFormFormInputFirstStep {
- name: string;
- isOfficialProducer: string;
+ isOfficialProducer: YesNoFormInput;
dataType: string;
- transitProviderName: string;
- feedLink: string;
- licensePath: string;
+ transitProviderName?: string;
+ feedLink?: string;
+ oldFeedLink?: string;
+ isUpdatingFeed?: YesNoFormInput;
}
interface FormFirstStepProps {
initialValues: FeedSubmissionFormFormInput;
submitFormData: (formData: Partial) => void;
+ setNumberOfSteps: (numberOfSteps: YesNoFormInput) => void;
}
export default function FormFirstStep({
initialValues,
submitFormData,
+ setNumberOfSteps,
}: FormFirstStepProps): React.ReactElement {
+ const { t } = useTranslation('feeds');
const {
control,
handleSubmit,
formState: { errors },
} = useForm({
defaultValues: {
- name: initialValues.name,
isOfficialProducer: initialValues.isOfficialProducer,
dataType: initialValues.dataType,
transitProviderName: initialValues.transitProviderName,
feedLink: initialValues.feedLink,
- licensePath: initialValues.licensePath,
+ oldFeedLink: initialValues.oldFeedLink,
+ isUpdatingFeed: initialValues.isUpdatingFeed,
},
});
const onSubmit: SubmitHandler = (
data,
): void => {
+ if (data.dataType === 'gtfs_rt') {
+ delete data.isUpdatingFeed;
+ delete data.feedLink;
+ delete data.oldFeedLink;
+ }
+
+ if (data.dataType === 'gtfs' && data.isUpdatingFeed === 'no') {
+ delete data.oldFeedLink;
+ }
submitFormData(data);
};
+
+ const dataType = useWatch({
+ control,
+ name: 'dataType',
+ });
+
+ const isUpdatingFeed = useWatch({
+ control,
+ name: 'isUpdatingFeed',
+ });
+
+ const isOfficialProducer = useWatch({
+ control,
+ name: 'isOfficialProducer',
+ });
+
+ useEffect(() => {
+ setNumberOfSteps(isOfficialProducer);
+ }, [isOfficialProducer]);
+
return (
<>
{/* eslint-disable-next-line @typescript-eslint/no-misused-promises */}