forked from ITxPT/DATA4PTTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: minor refactor from prev api changes
- Loading branch information
Showing
5 changed files
with
67 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ const ruleOptions = [ | |
label: 'Every stop place is referenced', | ||
}, | ||
{ | ||
value: 'everyStopPointHaveAnArrivalAndDepartureTime', | ||
value: 'everyStopPointHaveArrivalAndDepartureTime', | ||
label: 'Every stop point have an arrival and departure time', | ||
}, | ||
{ | ||
|
@@ -90,14 +90,14 @@ type ValidationConfigProps = { | |
|
||
const ValidationConfig = (props: ValidationConfigProps) => { | ||
const { session, onValidate } = props; | ||
const [schema, setSchema] = React.useState<string>('netex'); | ||
const [schema, setSchema] = React.useState<string>('netex@1.2'); | ||
const [rules, setRules] = React.useState<string[]>([ | ||
'everyLineIsReferenced', | ||
'everyScheduledStopPointHasAName', | ||
'everyStopPlaceHasACorrectStopPlaceType', | ||
'everyStopPlaceHasAName', | ||
'everyStopPlaceIsReferenced', | ||
'everyStopPointHaveAnArrivalAndDepartureTime', | ||
'everyStopPointHaveArrivalAndDepartureTime', | ||
'frameDefaultsHaveALocaleAndTimeZone', | ||
'locationsAreReferencingTheSamePoint', | ||
'passingTimesHaveIncreasingTimes', | ||
|
@@ -180,6 +180,12 @@ const ValidationConfig = (props: ValidationConfigProps) => { | |
} | ||
} | ||
|
||
React.useState(() => { | ||
if (session.files.length) { | ||
setCanValidate(true); | ||
} | ||
}, [session, setCanValidate]); | ||
|
||
return ( | ||
<Stack spacing={4}> | ||
<Stack spacing={1} direction="row"> | ||
|
@@ -204,9 +210,10 @@ const ValidationConfig = (props: ValidationConfigProps) => { | |
value={schema} | ||
onChange={handleSelectChange} | ||
> | ||
<MenuItem key="netex" value="netex">NeTEx</MenuItem> | ||
<MenuItem key="netex-light" value="netex-light">NeTEx Light</MenuItem> | ||
<MenuItem key="epip" value="epip">EPIP</MenuItem> | ||
<MenuItem key="netex" value="[email protected]">NeTEx (v1.2)</MenuItem> | ||
<MenuItem key="netex-light" value="[email protected]">NeTEx Light (v1.2)</MenuItem> | ||
<MenuItem key="epip" value="[email protected]">EPIP (v1.1.1)</MenuItem> | ||
<MenuItem key="epip-light" value="[email protected]">EPIP Light (v1.1.1)</MenuItem> | ||
</Select> | ||
</FormControl> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters