Skip to content

Commit

Permalink
21.0.7 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed Mar 17, 2023
1 parent bbe89f6 commit d4e6240
Show file tree
Hide file tree
Showing 220 changed files with 8,047 additions and 305,821 deletions.
30 changes: 29 additions & 1 deletion ChangeLog
@@ -1,3 +1,31 @@
17-MAR-2023: 21.0.7

- Fixes order of image class in styles [drawio-3432]
- Fixes update of global edge style [drawio-3429]
- Connector split clones marker and spacing [DS-946]
- VSDX import: Fixed some cases of incorrect text alignment [DID-7420]

09-MAR-2023: 21.0.6

- Fixes preview for smart template

09-MAR-2023: 21.0.5 Build Rejected on test

- Fixes e not a function error for arrow [DID-7677]
- Fixes 404 for sign out from GitLab [drawio-3416]

08-MAR-2023: 21.0.4

- Enables smart templates in production [DS-942]

08-MAR-2023: 21.0.3 Build Rejected on test

- Updates to Mermaid v10 [DS-945]
- Adds rack shape with vertical size determining number of units.
- Fixes HTML entities in format change [drawio-3403]
- [conf cloud] Shows message when conf diagram is edited from Jira Service Desk [DID-7647]
- Fixes default for container property [drawio-3406]

03-MAR-2023: 21.0.2

- Fixes BPMN event attachment [draw-3342]
Expand All @@ -7,7 +35,7 @@

- Changes behaviour of default styling [drawio-3312]

02-MAR-2023: 21.0.0
02-MAR-2023: 21.0.0 Build Rejected on test

- Build rejected, failed testing on stage

Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
21.0.2
21.0.7
3,069 changes: 1,534 additions & 1,535 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

35 changes: 24 additions & 11 deletions src/main/webapp/js/diagramly/App.js
Expand Up @@ -3344,6 +3344,7 @@ App.prototype.start = function()
this.getServiceName() == 'draw.io' && (id == null || id.length == 0) &&
!this.editor.isChromelessView())
{

this.checkDrafts();
}
else if (id != null && id.length > 0)
Expand Down Expand Up @@ -3696,6 +3697,11 @@ App.prototype.checkDrafts = function()
}));
dlg.init();
}
else if (urlParams['smart-template'] != null)
{
this.createFile(this.defaultFilename, this.getFileData(), null, null, null, null, null, true);
this.actions.get('insertTemplate').funct();
}
else if (urlParams['splash'] != '0')
{
this.loadFile();
Expand Down Expand Up @@ -6074,21 +6080,28 @@ App.prototype.fetchAndShowNotification = function(target, subtarget)
{
if (req.getStatus() >= 200 && req.getStatus() <= 299)
{
var notifs = JSON.parse(req.getText());

//Process and sort
notifs.sort(function(a, b)
try
{
return b.timestamp - a.timestamp;
});
var notifs = JSON.parse(req.getText());

//Process and sort
notifs.sort(function(a, b)
{
return b.timestamp - a.timestamp;
});

if (isLocalStorage)
if (isLocalStorage)
{
localStorage.setItem(cachedNotifKey, JSON.stringify({ts: Date.now(), notifs: notifs}));
}

this.fetchingNotif = false;
processNotif(notifs);
}
catch(e)
{
localStorage.setItem(cachedNotifKey, JSON.stringify({ts: Date.now(), notifs: notifs}));
// ignore
}

this.fetchingNotif = false;
processNotif(notifs);
}
}));
}
Expand Down
72 changes: 52 additions & 20 deletions src/main/webapp/js/diagramly/Dialogs.js
Expand Up @@ -603,7 +603,17 @@ var SplashDialog = function(editorUi)
addLogout(function()
{
editorUi.gitLab.logout();
editorUi.openLink(DRAWIO_GITLAB_URL + '/users/sign_out');

// Must use POST request to sign out of GitLab
// see https://gitlab.com/gitlab-org/gitlab/-/issues/202291
var form = document.createElement('form');
form.setAttribute('method', 'post');
form.setAttribute('action', DRAWIO_GITLAB_URL + '/users/sign_out');
form.setAttribute('target', '_blank');

document.body.appendChild(form);
form.submit();
form.parentNode.removeChild(form);
});
}
else if (editorUi.mode == App.MODE_TRELLO && editorUi.trello != null)
Expand Down Expand Up @@ -2144,9 +2154,7 @@ var ParseDialog = function(editorUi, title, defaultType)
mxMermaidToDrawio.addListener(mxUtils.bind(this, function(modelXml)
{
editorUi.spinner.stop();
var xml = '<mxfile><diagram id="d" name="n">' +
Graph.compress(modelXml) + '</diagram></mxfile>';
graph.setSelectionCells(editorUi.importXml(xml,
graph.setSelectionCells(editorUi.importXml(modelXml,
Math.max(insertPoint.x, 20),
Math.max(insertPoint.y, 20),
true, null, null, true));
Expand Down Expand Up @@ -2524,8 +2532,9 @@ var ParseDialog = function(editorUi, title, defaultType)
textarea.style.marginBottom = '16px';

var typeSelect = document.createElement('select');
typeSelect.className = 'geBtn';

if (defaultType == 'formatSql' || (defaultType == 'mermaid' && urlParams['dev'] != '1'))
if (defaultType == 'formatSql' || (defaultType == 'mermaid' && editorUi.getServiceName() != 'draw.io'))
{
typeSelect.style.display = 'none';
}
Expand Down Expand Up @@ -2554,19 +2563,19 @@ var ParseDialog = function(editorUi, title, defaultType)
tableOption.setAttribute('selected', 'selected');
}

var mermaidOption = document.createElement('option');
mermaidOption.setAttribute('value', 'mermaid');
mxUtils.write(mermaidOption, mxResources.get('mermaid'));

var mermaid2drawioOption = document.createElement('option');
mermaid2drawioOption.setAttribute('value', 'mermaid2drawio');
mxUtils.write(mermaid2drawioOption, mxResources.get('drawio'));
mxUtils.write(mermaid2drawioOption, mxResources.get('diagram'));

var mermaidOption = document.createElement('option');
mermaidOption.setAttribute('value', 'mermaid');
mxUtils.write(mermaidOption, mxResources.get('image'));

if (defaultType == 'mermaid')
{
typeSelect.appendChild(mermaidOption);
mermaidOption.setAttribute('selected', 'selected');
typeSelect.appendChild(mermaid2drawioOption);
mermaid2drawioOption.setAttribute('selected', 'selected');
typeSelect.appendChild(mermaidOption);
}

var diagramOption = document.createElement('option');
Expand Down Expand Up @@ -3234,6 +3243,11 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
description.style.boxSizing = 'border-box';
content.appendChild(description);

content.init = function()
{
description.focus();
};

mxUtils.br(content);

var preview = document.createElement('div');
Expand Down Expand Up @@ -3300,8 +3314,7 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
{
if (!useMermaidFormat)
{
templateXml = '<mxfile><diagram id="d" name="n">' +
Graph.compress(modelXml) + '</diagram></mxfile>';
templateXml = modelXml;
lastAiXml = templateXml;
}
}));
Expand All @@ -3325,8 +3338,7 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
imageData, w, h);

// Updates template XML for insert button
var previewXml = '<mxfile><diagram id="d" name="n">' +
Graph.compress(xml) + '</diagram></mxfile>';
var previewXml = '<mxfile><diagram>' + Graph.compress(xml) + '</diagram></mxfile>';

if (useMermaidFormat || typeof mxMermaidToDrawio === 'undefined')
{
Expand Down Expand Up @@ -3379,6 +3391,14 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
}, 0);
};

var temp = urlParams['smart-template'];

if (temp != null && temp != '1')
{
description.value = decodeURIComponent(temp);
updateState();
}

mxEvent.addListener(description, 'change', updateState);
mxEvent.addListener(description, 'keydown', updateState);
mxEvent.addListener(description, 'cut', updateState);
Expand Down Expand Up @@ -3624,9 +3644,10 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
{
//Create a diagram with the image to use the same code
//Note: Without compression it doesn't work for some reason. Find out why later
var xml = '<mxfile><diagram id="d" name="n">' + Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/>' +
'<mxCell id="2" value="" style="shape=image;image=' + extImg.src + ';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="' +
extImg.naturalWidth + '" height="' + extImg.naturalHeight + '" as="geometry" /></mxCell></root></mxGraphModel>') + '</diagram></mxfile>';
var xml = '<mxfile><diagram>' + Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/>' +
'<mxCell id="2" value="" style="shape=image;image=' + extImg.src + ';imageAspect=1;" parent="1" vertex="1">' +
'<mxGeometry width="' + extImg.naturalWidth + '" height="' + extImg.naturalHeight + '" as="geometry" />' +
'</mxCell></root></mxGraphModel>') + '</diagram></mxfile>';
showTooltip(xml, mxEvent.getClientX(evt), mxEvent.getClientY(evt), title, url);
return;
}
Expand Down Expand Up @@ -3853,7 +3874,7 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
categories['basic'] = [{title: 'blankDiagram', select: true}];
var templates = categories['basic'];

if (urlParams['test'] == '1' && editorUi.getServiceName() == 'draw.io')
if (editorUi.getServiceName() == 'draw.io')
{
categories['smartTemplate'] = {content: createSmartTemplateContent()};
}
Expand Down Expand Up @@ -4102,6 +4123,11 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
div.appendChild(categories[cat].content);
templateXml = lastAiXml;
templates = null;

if (categories[cat].content.init != null)
{
categories[cat].content.init();
}
}
else
{
Expand All @@ -4111,6 +4137,12 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
}
}
});

// Selects smart template section
if (urlParams['smart-template'] != null && cat == 'smartTemplate')
{
entry.click();
}
};

for (var cat in categories)
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/js/diagramly/DrawioFile.js
Expand Up @@ -1398,7 +1398,7 @@ DrawioFile.prototype.isSyncSupported = function()
*/
DrawioFile.prototype.isRealtime = function()
{
return this.ownPages != null;
return this.ownPages != null && this.ui.pages != null;
};

/**
Expand Down
8 changes: 7 additions & 1 deletion src/main/webapp/js/diagramly/Editor.js
Expand Up @@ -442,7 +442,13 @@
{val: 'centerPerimeter', dispName: 'Center'}]
},
{name: 'fixDash', dispName: 'Fixed Dash', type: 'bool', defVal: false},
{name: 'container', dispName: 'Container', type: 'bool', defVal: false, isVisible: function(state, format)
{name: 'container', dispName: 'Container', type: 'bool', getDefaultValue: function(state, format)
{
var cell = (state.vertices.length == 1 && state.edges.length == 0) ? state.vertices[0] : null;
var graph = format.editorUi.editor.graph;

return cell != null && graph.isSwimlane(cell);
}, isVisible: function(state, format)
{
return state.vertices.length == 1 && state.edges.length == 0;
}},
Expand Down

0 comments on commit d4e6240

Please sign in to comment.