Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/web-app/src/components/DipMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default class DipMap extends React.Component {
this.svgSerializer = new XMLSerializer();
this.lastSnapshottedSVGHash = 0;
this.mapDims = [null, null];
this.allSCs = null;
this.map = null;
this.orderDialog = null;
this.firstLoadFinished = false;
Expand Down Expand Up @@ -139,6 +140,11 @@ export default class DipMap extends React.Component {
infoClicked(prov) {
prov = prov.split("/")[0];
let info = helpers.provName(this.props.variant, prov);
if (this.allSCs instanceof Set) {
if (this.allSCs.has(prov)) {
info += "*"
}
}
if (this.state.phase.Properties.SupplyCenters) {
const owner = this.state.phase.Properties.SupplyCenters[prov];
if (owner) {
Expand Down Expand Up @@ -649,6 +655,9 @@ export default class DipMap extends React.Component {
this.debugCount("updateMap/hasSVGs");
const phaseHash = helpers.hash(JSON.stringify(this.state.phase));
const nodes = this.state.variant.Properties.Graph.Nodes;
if (this.allSCs === null) {
this.allSCs = helpers.getAllSCs(nodes);
}

if (phaseHash !== this.lastRenderedPhaseHash) {
this.lastRenderedPhaseHash = phaseHash;
Expand Down
11 changes: 11 additions & 0 deletions packages/web-app/src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2202,6 +2202,17 @@ export function provName(variant, prov) {
return prov;
}

export function getAllSCs(nodes) {
const allSCs = new Set();
for (let prov in nodes) {
const node = nodes[prov];
if (node.SC !== null) {
allSCs.add(node.Name);
}
}
return allSCs;
}

export function humanizeOrder(variant, parts, nextType = null) {
const types = parts.map((part) => {
switch (part) {
Expand Down