diff --git a/packages/web-app/src/components/DipMap.js b/packages/web-app/src/components/DipMap.js index 30cb4eed..6e398c38 100644 --- a/packages/web-app/src/components/DipMap.js +++ b/packages/web-app/src/components/DipMap.js @@ -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; @@ -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) { @@ -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; diff --git a/packages/web-app/src/helpers.js b/packages/web-app/src/helpers.js index fb81982d..1a6e7300 100644 --- a/packages/web-app/src/helpers.js +++ b/packages/web-app/src/helpers.js @@ -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) {