@@ -98,11 +98,6 @@ $(function () {
9898 . filter ( bus => bus . attributes . route_name . includes ( 'JT' ) )
9999 . map ( bus => bus . attributes ) ;
100100 } else if ( action === 'Mark a bus as arrived or on time' ) {
101- < << << << HEAD
102- << << << < HEAD
103- << << << < HEAD
104- = = === ==
105- >>> >>> > 443647ab (feat(bus): option to mark bus as delayed)
106101 busList = routeList . map ( bus => {
107102 if ( ( bus . attributes . status === 'a' || bus . attributes . status === 'd' ) && ! bus . attributes . route_name . includes ( 'JT' ) ) {
108103 let attr = JSON . parse ( JSON . stringify ( bus . attributes ) ) ;
@@ -127,39 +122,6 @@ $(function () {
127122
128123 }
129124 } ) . flat ( ) . filter ( ( element ) => element != null ) ;
130- === === =
131- << << << < HEAD
132- = === ===
133- >>> >>> > dcacb3b1 (feat(bus): mark a bus as delayed in afternoon menu)
134- =======
135- >>> >>> > 443647 ab ( feat ( bus ) : option to mark bus as delayed )
136- busList = routeList . filter ( bus => bus . attributes . route_name . includes ( '') )
137- . map ( bus => {
138- if ( bus . attributes . status === 'a' || bus . attributes . status === 'd' ) {
139- // TODO: less hacky deep copy
140- let attr = JSON . parse ( JSON . stringify ( bus . attributes ) ) ;
141- attr . route_name = `Mark ${ bus . attributes . route_name } as on time` ;
142- return attr ;
143- }
144- //Adds two elements, one for marking delayed one for arrived
145- //.flat() so that the added array gets convereted to two elements
146- else if (bus.attributes.status === 'o') {
147- let attr = JSON . parse ( JSON . stringify ( bus . attributes ) ) ;
148- let attr2 = JSON . parse ( JSON . stringify ( bus . attributes ) ) ;
149- attr . route_name = `Mark ${ bus . attributes . route_name } as delayed` ;
150- attr2 . route_name = `Mark ${ bus . attributes . route_name } as arrived` ;
151- return [ attr , attr2 ]
152- } else {
153- return bus . attributes ;
154- }
155- } ) . flat ( ) ;
156- << << << < HEAD
157- << << << < HEAD
158- > >>> >>> dcacb3b1 ( feat ( bus ) : mark a bus as delayed in afternoon menu )
159- === = ===
160- = === = ==
161- > >>> > >> 443647 ab ( feat ( bus ) : option to mark bus as delayed )
162- >>> > >>> dcacb3b1 ( feat ( bus ) : mark a bus as delayed in afternoon menu )
163125 } else if ( action === 'Assign a bus to this space' ) {
164126 busList = routeList . filter ( bus => bus . attributes . status !== 'a' )
165127 . map ( bus => bus . attributes ) ;
@@ -209,50 +171,18 @@ $(function () {
209171 } else if ( this . action === 'Mark a bus as arrived or on time' ) {
210172 let route_name = '' ;
211173 let st = '' ;
212- < << << << HEAD
213174 if ( e . target . value . includes ( 'on' ) ) {
214175 route_name = e . target . value . split ( ' ' ) [ 1 ] ;
215176
216- = === ===
217- // TODO: this is also super hacky
218- // Essentially, this checks if the selected route has "Mark"
219- // at the beginning, implying that it's to be marked on time.
220- if ( e . target . value . includes ( 'on time' ) ) {
221- route_name = e . target . value . split ( ' ' ) [ 1 ] ;
222- alert ( route_name ) ;
223- < << << << HEAD
224- << << << < HEAD
225- > >>> >>> dcacb3b1 ( feat ( bus ) : mark a bus as delayed in afternoon menu )
226- === = ===
227- === = ===
228- > >>> > >> 443647 ab ( feat ( bus ) : option to mark bus as delayed )
229- >>> > >>> dcacb3b1 ( feat ( bus ) : mark a bus as delayed in afternoon menu )
230177 st = 'o' ;
231178 }
232179 else if ( e . target . value . includes ( 'delayed' ) ) {
233180 route_name = e . target . value . split ( ' ' ) [ 1 ] ;
234- < << << << HEAD
235- << << << < HEAD
236- << << << < HEAD
237- = = === ==
238- >>> >>> > 443647ab (feat(bus): option to mark bus as delayed)
239181
240182 st = 'd' ;
241183 }
242184 else {
243185 route_name = e . target . value . split ( ' ' ) [ 1 ] ;
244- === = ===
245- < << << < < HEAD
246- = === = ==
247- > >>> > >> dcacb3b1 ( feat ( bus ) : mark a bus as delayed in afternoon menu )
248- === = ===
249- >>> > >>> 443647 ab ( feat ( bus ) : option to mark bus as delayed )
250- alert ( route_name ) ;
251- st = 'd' ;
252- }
253- else {
254- route_name = e . target . value ;
255- >>> > >>> dcacb3b1 ( feat ( bus ) : mark a bus as delayed in afternoon menu )
256186 st = 'a' ;
257187 }
258188 let route = this . model . findWhere ( { route_name : route_name } ) . attributes ;
0 commit comments