Skip to content

Commit

Permalink
feat: added support notice for flex feeds (#1861)
Browse files Browse the repository at this point in the history
  • Loading branch information
cka-y authored Oct 3, 2024
1 parent b03bc03 commit c3714ff
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ public String getFeatureName() {
return featureName;
}

public String getFeatureGroup() {
return featureGroup;
}

public String getDocUrl() {
String formattedFeatureName = featureName.toLowerCase().replace(' ', '-');
String formattedFeatureGroup = featureGroup.toLowerCase().replace(' ', '_');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,4 +590,13 @@ public void setFilenames(ImmutableSortedSet<String> filenames) {
public ImmutableSortedSet<String> getFilenames() {
return filenames;
}

public Boolean hasFlexFeatures() {
return specFeatures.keySet().stream()
.anyMatch(
feature ->
feature.getFeatureGroup() != null
&& feature.getFeatureGroup().equals("Flexible Services")
&& specFeatures.get(feature));
}
}
13 changes: 13 additions & 0 deletions main/src/main/resources/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@
align-content: center;
flex-wrap: wrap;
}

.warning-display {
padding: 10px;
border: solid 2px orange;
border-radius: 11px;
width: fit-content;
font-weight: bold;
}
</style>

</head>
Expand All @@ -239,6 +247,11 @@ <h1>GTFS Schedule Validation Report</h1>

<p>Use this report alongside our <a href="https://gtfs-validator.mobilitydata.org/rules.html">documentation</a>.</p>

<p class="warning-display" th:if="${metadata.hasFlexFeatures}">
&#9888; This feed contains GTFS Flex features. Please note that GTFS Flex validation support is still in development.
You can manually review all the validation rules for Flex data <a href="https://docs.google.com/document/d/1QABoIeOdR6lAB7A6_X6WIbZwC7EnAIZvm_hRNwNQeoI/edit#heading=h.mky28yjwt08z">here</a>.
</p>

<p class="version-update" th:if="${summary.newVersionOfValidatorAvailable}">A new version of the <a
href="https://github.com/MobilityData/gtfs-validator/releases">Canonical GTFS Schedule validator</a> is available!
Please update to get the latest/best validation results.</p>
Expand Down

0 comments on commit c3714ff

Please sign in to comment.