Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
roper79 committed Nov 9, 2019
1 parent b2dcaf5 commit 904ccb5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .ignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
app/assets
package-lock.json
flow-typed
package-lock.json
2 changes: 1 addition & 1 deletion app/panels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export function disposeDialogSim(): void {
// Messages

const closeButton = `
<button type="button" class="close" aria-label="Close" onclick="$("#${messageId}").hide()"}>
<button type="button" class="close" aria-label="Close" onclick="$('#${messageId}').hide()"}>
<span aria-hidden="true">&times;</span>
</button>`;

Expand Down
10 changes: 5 additions & 5 deletions app/simulation/machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ export function getFiredEvents(): UfobEvent[] {
(res: UfobEvent[], evi: UfobEventInst) => {
const mev = ufobDB.getUfobEventById(evi.evi_ev_id);
if (mev) {
return [ ...res, mev ];
return [ ...res, mev ];
} else {
console.error(new Error("getFiredEvents: non-existent event in an instance"));
return res;
console.error(new Error("getFiredEvents: non-existent event in an instance"));
return res;
}
},
[]
Expand Down Expand Up @@ -194,7 +194,7 @@ export function getMissingAIs(insts: EntityInst[], presentAIs: AssocInst[]): Ass
const e2Insts = insts.filter((ei) => ei.ei_e_id === a.a_connection2.e_id);
const cartesian = product(e1Insts, e2Insts);
const aisPossible: AssocInst[] = cartesian.map(
([e1Inst, e2Inst]: [EntityInst, EntityInst]) => ufoaInstMeta.newAssocInst(a, e1Inst, e2Inst)
([e1Inst, e2Inst]: [EntityInst, EntityInst]) => ufoaInstMeta.newAssocInst(a, e1Inst, e2Inst)
);
const ais = aisPossible.filter((ai: AssocInst) => rules.checkAIrules(insts, presentAIs, ai));
return resAIs.concat(ais);
Expand Down Expand Up @@ -323,6 +323,6 @@ export function moveToCurrent(): UfobEventInst[] {
const l = simState.sim_snapshots.length;
const i = simState.sim_currentEventIdx;
const dropped = _.takeRight(simState.sim_snapshots, l - i);
simState.sim_snapshots = _.dropRight(simState.sim_snapshots, l - i);
simState.sim_snapshots = _.dropRight(simState.sim_snapshots, l - i - 1);
return dropped.map((sn) => sn.sn_evInst);
}
7 changes: 4 additions & 3 deletions app/simulation/view/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ class SimulationBox extends panels.PaneDialog<{}, State> {
<ul key={s.s_id} className="list-group list-group-flush">
<li className={"list-group-item pr-0 pt-0 pb-0" + (!isCurrent ? " clickable-log" : "")}
onClick={() => {
//TODO
this.switchCurrentSituation(s);
this.forceUpdate();
if (!isCurrent) { // Prevent event propagation from MoveTo button below
this.switchCurrentSituation(s);
this.forceUpdate();
}
}}
>
{(() => {
Expand Down
1 change: 0 additions & 1 deletion server/app/views/blocks/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Marrow Donor Registry UFO Simulator</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="css/all.min.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
Expand Down
4 changes: 2 additions & 2 deletions server/app/views/blocks/navbar.ejs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<nav class="navbar navbar-expand-lg fixed-top wmda-color" id="navbar-main" style="padding-right: 10px">
<a class="navbar-brand" href="#">Marrow Donor Registry Simulator v2.4.1</a>
<a class="navbar-brand" href="#">Marrow Donor Registry Simulator v2.4.2</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<div class="navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item <%= page === 'model' ? 'active' : '' %>" id="model-mi">
<a class="nav-link" href="/">Model</a>
Expand Down

0 comments on commit 904ccb5

Please sign in to comment.