Skip to content

Commit c1d556f

Browse files
Merge pull request #1038 from ibi-group/mtc-deploy-with-dev-isolate-mtc-features
Isolate MTC features
2 parents d82dd3d + 6e1e57b commit c1d556f

File tree

13 files changed

+179
-92
lines changed

13 files changed

+179
-92
lines changed

.github/workflows/node-ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ jobs:
1616
- uses: actions/setup-python@v2
1717
with:
1818
python-version: '3.x'
19-
- name: Install mkdocs
19+
- name: Install mkdocs and plugins
2020
run: |
2121
pip install Jinja2==3.0.3 mkdocs
2222
mkdocs --version
23+
pip install mkdocs-macros-plugin
2324
- name: Use Node.js 14.x
2425
uses: actions/setup-node@v1
2526
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ configurations/*
2222
!configurations/default
2323
!configurations/test
2424
!configurations/end-to-end
25+
!configurations/mtc-docs
2526
dist
2627
assets
2728

.readthedocs.yml renamed to .readthedocs.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ version: 2
88
build:
99
os: ubuntu-22.04
1010
tools:
11-
python: "3.11"
11+
python: "3.13"
12+
13+
# Install mkdocs macros and other plugins
14+
python:
15+
install:
16+
- requirements: docs/requirements.txt
1217

1318
mkdocs:
1419
configuration: mkdocs.yml
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Read the Docs configuration file for MkDocs projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the version of Python and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.13"
12+
13+
# Install mkdocs macros and other plugins
14+
# Per readthedocs: paths are relative to the root of the project.
15+
python:
16+
install:
17+
- requirements: docs/requirements.txt
18+
19+
mkdocs:
20+
configuration: configurations/mtc-docs/mkdocs-mtc.yml
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
INHERIT: ../../mkdocs.yml
2+
site_name: Transit Data Manager Docs
3+
docs_dir: ../../docs
4+
5+
extra:
6+
product_name: MTC Transit Data Manager (TDM)
7+
support_email: [email protected]
8+
9+
nav:
10+
- Home: 'index.md'
11+
- Data Manager:
12+
- 'Introduction': 'user/introduction.md'
13+
- 'Managing Projects & Feeds': 'user/managing-projects-feeds.md'
14+
- 'Publishing Feeds': 'user/publishing-feeds.md'
15+
- 'Merging Feeds': 'user/merging-feeds.md'
16+
- 'Feed Version Summary': 'user/feed-version-summary.md'
17+
- 'Managing Users': 'user/managing-users.md'
18+
- 'Service Alerts Manager': 'user/service-alerts.md'
19+
- 'Searching for Routes and Stops': 'user/searching-routes-stops.md'
20+
- 'GTFS+ Editor': 'user/gtfs-plus-editor.md'
21+
- 'GTFS Editor':
22+
- Getting Started: 'user/editor/getting-started.md'
23+
- Stops: 'user/editor/stops.md'
24+
- Routes: 'user/editor/routes.md'
25+
- Patterns: 'user/editor/patterns.md'
26+
- Schedules: 'user/editor/schedules.md'
27+
- Fares: 'user/editor/fares.md'
28+
- Appendices:
29+
- GTFS Validation Warnings: 'user/appendix-gtfs-warnings.md'

docs/index.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# MTC TRANSIT-data-tools
2-
3-
The MTC Transit Data Tools suite provides web-based tools for creating, managing, evaluating, and publishing transit data, specifically data stored in the General Transit Feed Specification (GTFS) format.
1+
# {{ product_name }}
2+
The {{ product_name }} suite provides web-based tools for creating, managing, evaluating, and publishing transit data, specifically data stored in the General Transit Feed Specification (GTFS) format.
43

54
![feed-profile](https://datatools-builds.s3.amazonaws.com/docs/intro/feed-profile.png)
65

76
To get started, click a topic from the table of contents on the left pane.
87

98
## Contact
10-
If users need to report bugs or require further assistance, please email [[email protected]](mailto:[email protected]).
9+
If users need to report bugs or require further assistance, please email [{{ support_email }}](mailto:{{ support_email }}).

docs/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Pin the mkdocs version so that readthedocs uses the same version as this repo's CI job.
22
# (Otherwise because the project is from before 2019, readthedocs uses a super old mkdocs 0.17.3.)
3-
mkdocs==1.3.0
3+
mkdocs==1.6.1
4+
mkdocs-macros-plugin

lib/editor/util/gtfs.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import {latLngBounds} from 'leaflet'
44

5-
import {getGtfsSpec} from '../../common/util/config'
5+
import {getGtfsSpec, isExtensionEnabled} from '../../common/util/config'
66
import {
77
generateUID,
88
generateRandomInt,
@@ -128,6 +128,13 @@ export const generateProps = (component: string, editorState: any): any => {
128128
const routeColor = feedInfo && feedInfo.default_route_color
129129
? feedInfo.default_route_color
130130
: generateRandomColor()
131+
let routePublic = 1 // public
132+
let routeStatus = 2 // approved
133+
if (isExtensionEnabled('mtc')) {
134+
// MTC has specific initial editor route states.
135+
routePublic = 0 // not public
136+
routeStatus = 0 // in progress
137+
}
131138
return {
132139
route_id: generateUID(),
133140
agency_id: agencyId,
@@ -136,8 +143,8 @@ export const generateProps = (component: string, editorState: any): any => {
136143
route_color: routeColor,
137144
route_text_color: idealTextColor(routeColor),
138145
// MTC-specific: When created, new routes are initially not approved/not public.
139-
publicly_visible: 0, // not public
140-
status: 0, // IN_PROGRESS
146+
publicly_visible: routePublic,
147+
status: routeStatus,
141148
route_type: feedInfo && feedInfo.default_route_type !== null
142149
? feedInfo.default_route_type
143150
: 3

lib/manager/components/CreateFeedSource.js

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import validator from 'validator'
2121
import {createFeedSource} from '../actions/feeds'
2222
import Loading from '../../common/components/Loading'
2323
import {FREQUENCY_INTERVALS} from '../../common/constants'
24-
import {isExtensionEnabled} from '../../common/util/config'
24+
import {isExtensionEnabled, isModuleEnabled} from '../../common/util/config'
2525
import {validationState} from '../util'
2626
import {isValidFilename} from '../util/validation'
2727
import type {FetchFrequency, NewFeed} from '../../types'
@@ -184,34 +184,36 @@ export default class CreateFeedSource extends Component<Props, State> {
184184
{!validation.name && <HelpBlock>Required</HelpBlock>}
185185
</FormGroup>
186186
</ListGroupItem>
187-
<ListGroupItem>
188-
<FormGroup>
189-
<Checkbox
190-
checked={model.deployable}
191-
onChange={this._toggleCheckBox('deployable')}
192-
>
193-
<strong>Make feed source deployable</strong>
194-
</Checkbox>
195-
<small>
196-
Enable this feed source to be deployed to an
197-
OpenTripPlanner (OTP) instance (defined in organization
198-
settings) as part of a collection of feed sources or
199-
individually.
200-
</small>
201-
</FormGroup>
202-
<FormGroup validationState={validationState(validation.filename)}>
203-
<ControlLabel>Override filename for bundle (optional)</ControlLabel>
204-
<FormControl
205-
disabled={!model.deployable}
206-
name={'filename'}
207-
onChange={this._onInputChange('filename')}
208-
placeholder='e.g., agency_bundle'
209-
value={model.filename}
210-
/>
211-
<FormControl.Feedback />
212-
{!validation.filename && <HelpBlock>Invalid filename</HelpBlock>}
213-
</FormGroup>
214-
</ListGroupItem>
187+
{isModuleEnabled('deployment') && (
188+
<ListGroupItem>
189+
<FormGroup>
190+
<Checkbox
191+
checked={model.deployable}
192+
onChange={this._toggleCheckBox('deployable')}
193+
>
194+
<strong>Make feed source deployable</strong>
195+
</Checkbox>
196+
<small>
197+
Enable this feed source to be deployed to an
198+
OpenTripPlanner (OTP) instance (defined in organization
199+
settings) as part of a collection of feed sources or
200+
individually.
201+
</small>
202+
</FormGroup>
203+
<FormGroup validationState={validationState(validation.filename)}>
204+
<ControlLabel>Override filename for bundle (optional)</ControlLabel>
205+
<FormControl
206+
disabled={!model.deployable}
207+
name={'filename'}
208+
onChange={this._onInputChange('filename')}
209+
placeholder='e.g., agency_bundle'
210+
value={model.filename}
211+
/>
212+
<FormControl.Feedback />
213+
{!validation.filename && <HelpBlock>Invalid filename</HelpBlock>}
214+
</FormGroup>
215+
</ListGroupItem>
216+
)}
215217
</ListGroup>
216218
</Panel>
217219
<Panel>

lib/manager/components/FeedSourceSettings.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,19 @@ export default class FeedSourceSettings extends Component<Props> {
135135
{/* Side panel */}
136136
<Panel>
137137
<ListGroup>
138-
{tabs.map((tab, index) => {
139-
return (
140-
<LinkContainer
141-
active={resourceType === tab.subPath}
142-
key={index}
143-
to={`/feed/${feedSource.id}/settings${tab.subPath === '' ? '' : `/${tab.subPath}`}`}
144-
>
145-
<ListGroupItem>{tab.title}</ListGroupItem>
146-
</LinkContainer>
147-
)
148-
})}
138+
{tabs
139+
.filter((tab) => tab.condition)
140+
.map((tab, index) => {
141+
return (
142+
<LinkContainer
143+
active={resourceType === tab.subPath}
144+
key={index}
145+
to={`/feed/${feedSource.id}/settings${tab.subPath === '' ? '' : `/${tab.subPath}`}`}
146+
>
147+
<ListGroupItem>{tab.title}</ListGroupItem>
148+
</LinkContainer>
149+
)
150+
})}
149151
</ListGroup>
150152
</Panel>
151153
</Col>

0 commit comments

Comments
 (0)