Change: departureuser4 to work correctly and updated UI for disruptions

This commit is contained in:
williameriksson126 2020-12-10 11:01:43 +01:00
parent 19282607ba
commit 2b8c08e082
3 changed files with 10 additions and 11 deletions

View File

@ -3,7 +3,7 @@
"noNamespaceSchemaLocation": "http://api.vasttrafik.se/v1/hafasRestDepartureBoard.xsd", "noNamespaceSchemaLocation": "http://api.vasttrafik.se/v1/hafasRestDepartureBoard.xsd",
"servertime": "10:11", "servertime": "10:11",
"serverdate": "2020-12-10", "serverdate": "2020-12-10",
"Departure": [ "Departure":
{ {
"name": "Buss 928", "name": "Buss 928",
"sname": "928", "sname": "928",
@ -26,6 +26,5 @@
"ref": "https://api.vasttrafik.se/bin/rest.exe/v2/journeyDetail?ref=261732%2F87569%2F149176%2F12656%2F80%3Fdate%3D2020-12-10%26station_evaId%3D14225001%26station_type%3Ddep%26format%3Djson%26" "ref": "https://api.vasttrafik.se/bin/rest.exe/v2/journeyDetail?ref=261732%2F87569%2F149176%2F12656%2F80%3Fdate%3D2020-12-10%26station_evaId%3D14225001%26station_type%3Ddep%26format%3Djson%26"
} }
} }
]
} }
} }

View File

@ -16,7 +16,7 @@ class DisruptionButton extends Button {
genDisrupt = () => { genDisrupt = () => {
this.state.disruption = "" this.state.disruption = undefined
if(this.state.jsonLocation === "ex1"){ if(this.state.jsonLocation === "ex1"){
for (let stopPoint of ex1.affectedStopPoints) { for (let stopPoint of ex1.affectedStopPoints) {
if(stopPoint.gid === globData.user.stoppointgid){ if(stopPoint.gid === globData.user.stoppointgid){

View File

@ -9,7 +9,7 @@ import Button from './Button.js';
import './css/NavigationDrawer.css'; import './css/NavigationDrawer.css';
import userIcon from '../img/user.svg'; import userIcon from '../img/user.svg';
import FindStops from './FindStops.js'; import { glob } from 'glob';
class NavigationDrawer extends Component { class NavigationDrawer extends Component {
@ -44,6 +44,10 @@ class NavigationDrawer extends Component {
showPopup = () => { showPopup = () => {
this.popupElem.current.show(); this.popupElem.current.show();
}; };
updatePage = () => {
globalData.currentPage.render();
}
render() { render() {
return ( return (
@ -51,10 +55,8 @@ class NavigationDrawer extends Component {
<Popup ref={this.popupElem}> <Popup ref={this.popupElem}>
<h3>Välj hållplats:</h3> <h3>Välj hållplats:</h3>
<ul> <ul>
<li><Button>Hållplats 1</Button></li> <li><DisruptionButton path={"ex1"} onClick={[]}>Störnings Scenario 1</DisruptionButton></li>
<li><Button>Hållplats 2</Button></li> <li><DisruptionButton path={"ex2"} onClick={[]}>Störnings Scenario 2</DisruptionButton></li>
<li><Button>Hållplats 3</Button></li>
<li><Button>Hållplats 4</Button></li>
</ul> </ul>
</Popup> </Popup>
@ -69,9 +71,7 @@ class NavigationDrawer extends Component {
<SelectUserButton path={"user2"} username="user2"/> <SelectUserButton path={"user2"} username="user2"/>
<SelectUserButton path={"user3"} username="user3"/> <SelectUserButton path={"user3"} username="user3"/>
<SelectUserButton path={"user4"} username="user4"/> <SelectUserButton path={"user4"} username="user4"/>
<FindStops/> <Button onClick={[this.showPopup, this.close]}><span>Generera Störning</span></Button>
<DisruptionButton path={"ex1"} onClick={[this.showPopup, this.close]} />
<DisruptionButton path={"ex2"} onClick={[this.showPopup, this.close]} />
</div> </div>
<hr /> <hr />
<span id="version">Projektgrupp 3 - Utmaning 7</span> <span id="version">Projektgrupp 3 - Utmaning 7</span>