Skip to content

Commit cb1b43d

Browse files
e-halinenjhanninenahjyrkia
authored
Prod release (#119)
* Add pikaratikka to the maps * Add icons and colors for pikaratikka * Fix typo on color code * Change pikaratikka to updated color * MM-523: Fix rendering error about minimum radius on circle vectors (#109) * #25217: Initialize this.root in component constructors * Cleanup * 25664: Prevent large generations timeout and left on pending state * Bump hsl-map-style version to 1.1.3 (#117) * AB#48634: Bump hsl-map-style version to 1.2.0 (#118) * zoneSymbol positioning fix (#115) --------- Co-authored-by: Juho Hänninen <juho.hanninen@cgi.com> Co-authored-by: Anton Jyrkiäinen <anton.jyrkiainen@helsinki.fi>
1 parent 9c1dab0 commit cb1b43d

5 files changed

Lines changed: 28 additions & 16 deletions

File tree

scripts/worker.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,14 @@ async function renderComponent(options) {
8989
timeout: 5 * 60000,
9090
};
9191

92-
const contents = await page.pdf(printOptions);
93-
94-
await fs.outputFile(pdfPath(id), contents);
95-
await page.close();
96-
await uploadPosterToCloud(pdfPath(id));
92+
try {
93+
const contents = await page.pdf(printOptions);
94+
await fs.outputFile(pdfPath(id), contents);
95+
await page.close();
96+
await uploadPosterToCloud(pdfPath(id));
97+
} catch (e) {
98+
throw new Error('PDF Generation failed', e);
99+
}
97100
}
98101

99102
async function renderComponentRetry(options) {

src/components/labelPlacement/itemFixed.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class ItemFixed extends Component {
66
super(props);
77
this.state = { top: props.top, left: props.left };
88
this.visible = true;
9+
this.root = React.createRef();
910
}
1011

1112
setPosition(top, left) {
@@ -46,10 +47,11 @@ class ItemFixed extends Component {
4647

4748
return (
4849
<div
49-
ref={ref => {
50+
ref={(ref) => {
5051
this.root = ref;
5152
}}
52-
style={style}>
53+
style={style}
54+
>
5355
{this.props.children}
5456
</div>
5557
);

src/components/labelPlacement/itemPositioned.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class ItemPositioned extends Component {
1010
left: props.x,
1111
visible: props.visible || !props.allowHidden,
1212
};
13+
this.root = React.createRef();
1314
}
1415

1516
setPosition(top, left, visible) {
@@ -59,10 +60,11 @@ class ItemPositioned extends Component {
5960
if (this.state.visible) {
6061
return (
6162
<div
62-
ref={ref => {
63+
ref={(ref) => {
6364
this.root = ref;
6465
}}
65-
style={style}>
66+
style={style}
67+
>
6668
{this.props.children}
6769
</div>
6870
);

src/components/routeMap/routeMap.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,16 @@ const RouteMap = (props) => {
188188
))}
189189
{projectedSymbols &&
190190
projectedSymbols.length > 0 &&
191-
projectedSymbols.map((symbol, index) => (
192-
<ItemFixed key={index} left={symbol.sy} top={symbol.sx}>
193-
<ZoneSymbol size={symbol.size} zone={symbol.zone} />
194-
</ItemFixed>
195-
))}
191+
projectedSymbols.map((symbol, index) => {
192+
const matchValues = symbol.size.match(/\d+/);
193+
const symbolSizeNumber = matchValues ? parseInt(matchValues[0], 10) : null;
194+
const offset = symbolSizeNumber ? symbolSizeNumber / 2 : 0;
195+
return (
196+
<ItemFixed key={index} left={symbol.sy - offset} top={symbol.sx - offset}>
197+
<ZoneSymbol size={symbol.size} zone={symbol.zone} />
198+
</ItemFixed>
199+
);
200+
})}
196201
{props.projectedTerminuses.map((terminus, index) => (
197202
<ItemPositioned
198203
key={index}

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4980,8 +4980,8 @@ hpack.js@^2.1.6:
49804980
wbuf "^1.1.0"
49814981

49824982
hsl-map-style@hsldevcom/hsl-map-style#master:
4983-
version "1.1.2"
4984-
resolved "https://codeload.github.com/hsldevcom/hsl-map-style/tar.gz/207a8de2664c9a50b5a5f886d30f5b1628f995c7"
4983+
version "1.2.0"
4984+
resolved "https://codeload.github.com/hsldevcom/hsl-map-style/tar.gz/68b1642ce364ebcea115bc3f20465d3c2ee83c0d"
49854985
dependencies:
49864986
lodash "^4.17.4"
49874987

0 commit comments

Comments
 (0)