Skip to content

Commit 9c0f1ac

Browse files
Fixes the "publish images" feature.
1 parent 1ad62c6 commit 9c0f1ac

File tree

1 file changed

+5
-6
lines changed
  • structurizr-onpremises/src/main/webapp/WEB-INF/fragments/diagrams

1 file changed

+5
-6
lines changed

structurizr-onpremises/src/main/webapp/WEB-INF/fragments/diagrams/publish.jspf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
function publishAllViews() {
88
numberOfPublishedImages = 0;
9-
publishImages(structurizr.workspace.getViews().map(function(v) { return v.key; }));
9+
publishImages(structurizr.workspace.getViews());
1010
}
1111

1212
function publishViewsFinished() {
@@ -15,17 +15,16 @@
1515

1616
function publishImages(viewsToExport) {
1717
if (viewsToExport && viewsToExport.length > 0) {
18-
const viewToExport = viewsToExport[0];
18+
const view = viewsToExport[0];
1919

20-
structurizr.diagram.changeView(viewToExport, function () {
20+
changeView(view, function () {
2121
structurizr.diagram.exportCurrentDiagramToPNG(true, false, function(diagramAsPNG) {
22-
publishImage(viewToExport, viewToExport + '.png', diagramAsPNG, function() {
22+
publishImage(view.key, view.key + '.png', diagramAsPNG, function() {
2323
numberOfPublishedImages++;
2424

25-
const view = structurizr.workspace.findViewByKey(viewToExport);
2625
if (view.type !== structurizr.constants.IMAGE_VIEW_TYPE) {
2726
structurizr.diagram.exportCurrentDiagramKeyToPNG(function (diagramKeyAsPNG) {
28-
publishImage(viewToExport, viewToExport + '-key.png', diagramKeyAsPNG, function () {
27+
publishImage(view.key, view.key + '-key.png', diagramKeyAsPNG, function () {
2928
viewsToExport.splice(0, 1);
3029
publishImages(viewsToExport);
3130
})

0 commit comments

Comments
 (0)