Skip to content

Commit

Permalink
Added emulators button
Browse files Browse the repository at this point in the history
  • Loading branch information
IKCAP committed Nov 5, 2019
1 parent c38337e commit f7c25b0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/app/actions.ts
Expand Up @@ -262,6 +262,13 @@ const loadPage: ActionCreator<ThunkResult> =
}
});
break;
case 'emulators':
import('../screens/emulators/emulators-home').then((_module) => {
if(params.length > 0) {
//store.dispatch(queryRegionDetail(params[0]));
}
});
break;
case 'analysis':
if (subpage == 'home') {
import('../screens/analysis/analysis-home').then((_module) => {
Expand Down
12 changes: 12 additions & 0 deletions src/app/mint-app.ts
Expand Up @@ -29,6 +29,7 @@ import '../screens/models/models-home';
import '../screens/analysis/analysis-home';
import '../screens/variables/variables-home';
import '../screens/messages/messages-home';
import '../screens/emulators/emulators-home';

import { SharedStyles } from '../styles/shared-styles';
import { showDialog, hideDialog, formElementsComplete } from '../util/ui_functions';
Expand Down Expand Up @@ -209,6 +210,16 @@ export class MintApp extends connect(store)(LitElement) {
<wl-button flat inverted class="message-button ${this._page == 'messages' ? 'selected' : ''}" @click="${() => goToPage('messages')}">
Messages <wl-icon style="margin-left: 4px;">message</wl-icon>
</wl-button>
${this._selectedRegion ?
html`
&nbsp;
<wl-button flat inverted class="message-button ${this._page == 'emulators' ? 'selected' : ''}" @click="${() => goToPage('emulators')}">
Emulators <wl-icon style="margin-left: 4px;">settings</wl-icon>
</wl-button>
` : ""
}
<wl-button flat inverted @click="${signOut}">
LOGOUT ${this.user.email}
</wl-button>
Expand All @@ -231,6 +242,7 @@ export class MintApp extends connect(store)(LitElement) {
<modeling-home class="page fullpage" ?active="${this._page == 'modeling'}"></modeling-home>
<analysis-home class="page fullpage" ?active="${this._page == 'analysis'}"></analysis-home>
<messages-home class="page fullpage" ?active="${this._page == 'messages'}"></messages-home>
<emulators-home class="page fullpage" ?active="${this._page == 'emulators'}"></emulators-home>
</div>
</div>
</div>
Expand Down
9 changes: 8 additions & 1 deletion src/screens/home/app-home.ts
Expand Up @@ -14,6 +14,7 @@ import "../../thirdparty/google-map/src/google-map";
import "../../components/google-map-custom";
import { selectTopRegion } from '../../app/ui-actions';
import { GoogleMapCustom } from 'components/google-map-custom';
import { BASE_HREF } from 'app/actions';

@customElement('app-home')
export class AppHome extends connect(store)(PageViewElement) {
Expand Down Expand Up @@ -125,7 +126,13 @@ export class AppHome extends connect(store)(PageViewElement) {
}

protected regionSelected(regionid: string) {
store.dispatch(selectTopRegion(regionid));
if(regionid) {
store.dispatch(selectTopRegion(regionid));

let url = BASE_HREF + regionid;
console.log(regionid);
window.history.pushState({}, "Home", url);
}
}

private _addRegions() {
Expand Down

0 comments on commit f7c25b0

Please sign in to comment.