Skip to content

Commit 70f1ebe

Browse files
authored
Merge branch 'master' into deps/lodash-es
2 parents 8d1dab2 + e89f95f commit 70f1ebe

6 files changed

Lines changed: 614 additions & 235 deletions

File tree

.github/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ template: |
7373
In this case:
7474
- release the `examples` repository first
7575
- add a link to the RN https://github.com/$OWNER/bpmn-visualization-examples/releases/tag/v0.34.0
76-
Optional: add link to sthe live tatically.io environment including the tag (not the `master` branch)
76+
Optional: add link to the live statically.io environment including the tag (not the `master` branch)
7777
7878
# What's Changed
7979

dev/ts/main.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,21 @@ function configureStyleFromParameters(parameters: URLSearchParams): void {
239239
}
240240

241241
// Collect style properties to update them later with the bpmn-visualization API
242-
// The implementation will be generalized when more properties will be supported (in particular, the query parameter name)
243-
// For example, we could extract all query params starting with style.api, then rebuild the StyleUpdate from the extracted params
244-
style = { stroke: {}, font: {}, fill: {} };
245-
246-
parameters.get('style.api.stroke.color') && (style.stroke.color = parameters.get('style.api.stroke.color'));
247-
parameters.get('style.api.font.color') && (style.font.color = parameters.get('style.api.font.color'));
248-
parameters.get('style.api.font.opacity') && (style.font.opacity = Number(parameters.get('style.api.font.opacity')));
249-
parameters.get('style.api.fill.color') && (style.fill.color = parameters.get('style.api.fill.color'));
250-
parameters.get('style.api.fill.opacity') && (style.fill.opacity = Number(parameters.get('style.api.fill.opacity')));
242+
logStartup(`Configuring the "Update Style" API from query parameters`);
243+
// Only create the StyleUpdate object if some parameters are set
244+
if (Array.from(parameters.keys()).filter(key => key.startsWith('style.api.')).length > 0) {
245+
style = { stroke: {}, font: {}, fill: {} };
246+
247+
parameters.get('style.api.stroke.color') && (style.stroke.color = parameters.get('style.api.stroke.color'));
248+
parameters.get('style.api.font.color') && (style.font.color = parameters.get('style.api.font.color'));
249+
parameters.get('style.api.font.opacity') && (style.font.opacity = Number(parameters.get('style.api.font.opacity')));
250+
parameters.get('style.api.fill.color') && (style.fill.color = parameters.get('style.api.fill.color'));
251+
parameters.get('style.api.fill.opacity') && (style.fill.opacity = Number(parameters.get('style.api.fill.opacity')));
252+
253+
logStartup(`Prepared "Update Style" API object`, style);
254+
} else {
255+
logStartup(`No query parameters, do not set the "Update Style" API object`);
256+
}
251257
}
252258

253259
function configureBpmnElementIdToCollapseFromParameters(parameters: URLSearchParams): void {

0 commit comments

Comments
 (0)