Skip to content

Commit

Permalink
17.5.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed May 4, 2022
1 parent 82025f7 commit 7fb520a
Show file tree
Hide file tree
Showing 88 changed files with 15,667 additions and 8,669 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -57,7 +57,6 @@ jobs:
cd etc/build
npm install workbox-cli@6.3.0 --global
ant
ant javac
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -71,4 +70,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v1
31 changes: 31 additions & 0 deletions ChangeLog
@@ -1,3 +1,34 @@
04-APR-2022: 17.5.1

- [conf cloud] Adds saving delay for specific timing case [DID-4851]
- Adds "shareCursorPosition": true/false configuration
- [conf cloud] Prevent publishing without changes creating new version
- Fixes alt+shift for floating connection [DID-4550]
- Changes default for shareCursorPosition to true
- Hides non-applicable sketch options for edges
- Fixes handling of invalid background page images
- Adds showRemoteCursors option
- Fixes LocalFile ctor arguments
- Fixes lazy shadow pages, stale local draft files
- Fixes conflict handling for writing electron files

28-APR-2022: 17.5.0

- Refactors GCP2 shapes
- [conf cloud] Improves page IDs import

20-APR-2022: 17.4.6

- Internal release testing whiteboard app changes

11-APR-2022: 17.4.5

- Internal release testing whiteboard app changes

11-APR-2022: 17.4.4

- Internal release testing whiteboard app changes

11-APR-2022: 17.4.3

- Avoids null string in unused token key
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
17.4.3
17.5.1
2 changes: 1 addition & 1 deletion src/main/webapp/electron.js
Expand Up @@ -1637,7 +1637,7 @@ async function saveFile(fileObject, data, origStat, overwrite, defEnc)

if (stat && isConflict(origStat, stat))
{
new Error('conflict');
throw new Error('conflict');
}
else
{
Expand Down
Binary file modified src/main/webapp/images/sidebar-gcp2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6,914 changes: 3,725 additions & 3,189 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/main/webapp/js/diagramly/App.js
Expand Up @@ -1117,6 +1117,13 @@ App.main = function(callback, createUi)
mxEvent.removeListener(window, 'message', configHandler);
Editor.configure(data.config, true);
mxSettings.load();

//To enable transparent iframe in dark mode (e.g, in gitlab)
if (data.colorSchemeMeta)
{
mxmeta('color-scheme', 'dark light');
}

doMain();
}
}
Expand Down Expand Up @@ -3488,6 +3495,9 @@ App.prototype.filterDrafts = function(filePath, guid, callback)
{
this.getDatabaseItems(mxUtils.bind(this, function(items)
{
EditorUi.debug('App.filterDrafts',
[this], 'items', items);

// Collects orphaned drafts
for (var i = 0; i < items.length; i++)
{
Expand Down
5 changes: 4 additions & 1 deletion src/main/webapp/js/diagramly/Devel.js
Expand Up @@ -308,4 +308,7 @@ if (urlParams['orgChartDev'] == '1')
mxscript(drawDevUrl + 'js/orgchart/bridge.collections.min.js');
mxscript(drawDevUrl + 'js/orgchart/OrgChart.Layout.min.js');
mxscript(drawDevUrl + 'js/orgchart/mxOrgChartLayout.js');
}
}

// Miro Import
mxscript(drawDevUrl + 'js/diagramly/miro/MiroImporter.js');
33 changes: 24 additions & 9 deletions src/main/webapp/js/diagramly/DrawioFile.js
Expand Up @@ -7,7 +7,8 @@ DrawioFile = function(ui, data)
mxEventSource.call(this);

this.ui = ui;
this.data = data || '';
this.setData(data || '');
this.initialData = this.getData();
this.created = new Date().getTime();

// Creates the stats object
Expand Down Expand Up @@ -180,7 +181,7 @@ DrawioFile.prototype.getShadowPages = function()
{
if (this.shadowPages == null)
{
this.shadowPages = this.ui.getPagesForXml(this.data);
this.shadowPages = this.ui.getPagesForXml(this.initialData);
}

return this.shadowPages;
Expand Down Expand Up @@ -324,10 +325,11 @@ DrawioFile.prototype.mergeFile = function(file, success, error, diffShadow)
var checksum = this.ui.getHashValueForPages(patched, patchedDetails);
var current = this.ui.getHashValueForPages(pages, currentDetails);

EditorUi.debug('File.mergeFile', [this], 'file', [file], 'patches', patches,
'backup', this.backupPatch, 'checksum', checksum, 'current', current,
'valid', checksum == current, 'from', this.getCurrentRevisionId(),
'to', file.getCurrentRevisionId());
EditorUi.debug('File.mergeFile', [this], 'file', [file], 'shadow', shadow,
'pages', this.ui.pages, 'patches', patches, 'backup', this.backupPatch,
'checksum', checksum, 'current', current, 'valid', checksum == current,
'from', this.getCurrentRevisionId(), 'to', file.getCurrentRevisionId(),
'modified', this.isModified());

if (checksum != null && checksum != current)
{
Expand Down Expand Up @@ -1186,6 +1188,9 @@ DrawioFile.prototype.getTitle = function()
DrawioFile.prototype.setData = function(data)
{
this.data = data;

EditorUi.debug('DrawioFile.setData',
[this], 'data', [data]);
};

/**
Expand Down Expand Up @@ -1600,7 +1605,14 @@ DrawioFile.prototype.saveDraft = function()
{
if (this.draftId == null)
{
this.draftId = Editor.guid();
if (this.usedDraftId != null)
{
this.draftId = this.usedDraftId;
}
else
{
this.draftId = Editor.guid();
}
}

var draft = {type: 'draft',
Expand Down Expand Up @@ -1632,9 +1644,12 @@ DrawioFile.prototype.removeDraft = function()
{
if (this.draftId != null)
{
EditorUi.debug('DrawioFile.removeDraft',
[this], 'draftId', this.draftId);

this.ui.removeDatabaseItem('.draft_' + this.draftId);
EditorUi.debug('DrawioFile.saveDraft', [this],
'.draft_' + this.draftId);
this.usedDraftId = this.draftId;
this.draftId = null;
}
}
catch (e)
Expand Down
36 changes: 24 additions & 12 deletions src/main/webapp/js/diagramly/Editor.js
Expand Up @@ -332,15 +332,18 @@
}},
{name: 'fillWeight', dispName: 'Fill Weight', type: 'int', defVal: -1, isVisible: function(state, format)
{
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1';
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1' &&
state.vertices.length > 0;
}},
{name: 'hachureGap', dispName: 'Hachure Gap', type: 'int', defVal: -1, isVisible: function(state, format)
{
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1';
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1' &&
state.vertices.length > 0;
}},
{name: 'hachureAngle', dispName: 'Hachure Angle', type: 'int', defVal: -41, isVisible: function(state, format)
{
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1';
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1' &&
state.vertices.length > 0;
}},
{name: 'curveFitting', dispName: 'Curve Fitting', type: 'float', defVal: 0.95, isVisible: function(state, format)
{
Expand All @@ -356,24 +359,23 @@
}},
{name: 'disableMultiStrokeFill', dispName: 'Disable Multi Stroke Fill', type: 'bool', defVal: false, isVisible: function(state, format)
{
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1';
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1' &&
state.vertices.length > 0;
}},
{name: 'dashOffset', dispName: 'Dash Offset', type: 'int', defVal: -1, isVisible: function(state, format)
{
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1';
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1' &&
state.vertices.length > 0;
}},
{name: 'dashGap', dispName: 'Dash Gap', type: 'int', defVal: -1, isVisible: function(state, format)
{
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1';
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1' &&
state.vertices.length > 0;
}},
{name: 'zigzagOffset', dispName: 'ZigZag Offset', type: 'int', defVal: -1, isVisible: function(state, format)
{
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1';
}},
{name: 'jiggle', dispName: 'Jiggle', type: 'float', min: 0, defVal: 1, isVisible: function(state, format)
{
return mxUtils.getValue(state.style, 'comic', '0') == '1' ||
mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1';
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1' &&
state.vertices.length > 0;
}},
{name: 'sketchStyle', dispName: 'Sketch Style', type: 'enum', defVal: 'rough',
enumList: [{val: 'rough', dispName: 'Rough'}, {val: 'comic', dispName: 'Comic'}],
Expand Down Expand Up @@ -2094,6 +2096,16 @@
{
EditorUi.prototype.maxImageSize = config.maxImageSize;
}

if (config.shareCursorPosition != null)
{
EditorUi.prototype.shareCursorPosition = config.shareCursorPosition;
}

if (config.showRemoteCursors != null)
{
EditorUi.prototype.showRemoteCursors = config.showRemoteCursors;
}
}
};

Expand Down
58 changes: 53 additions & 5 deletions src/main/webapp/js/diagramly/EditorUi.js
Expand Up @@ -406,7 +406,12 @@
/**
* Restores app defaults for UI
*/
EditorUi.prototype.shareCursorPosition = false;
EditorUi.prototype.shareCursorPosition = true;

/**
* Restores app defaults for UI
*/
EditorUi.prototype.showRemoteCursors = true;

/**
* Capability check for canvas export
Expand Down Expand Up @@ -536,6 +541,24 @@
return this.shareCursorPosition;
};

/**
* Returns true if offline app, which isn't a defined thing
*/
EditorUi.prototype.setShowRemoteCursors = function(value)
{
this.showRemoteCursors = value;

this.fireEvent(new mxEventObject('showRemoteCursorsChanged'));
};

/**
* Returns true if offline app, which isn't a defined thing
*/
EditorUi.prototype.isShowRemoteCursors = function()
{
return this.showRemoteCursors;
};

/**
* Returns true if offline app, which isn't a defined thing
*/
Expand Down Expand Up @@ -6244,11 +6267,11 @@
var lblToSvgOption = document.createElement('option');
lblToSvgOption.setAttribute('value', 'lblToSvg');
mxUtils.write(lblToSvgOption, mxResources.get('lblToSvg'));
txtSettingsSelect.appendChild(lblToSvgOption);


if (this.isOffline())
if (!this.isOffline() && !EditorUi.isElectronApp)
{
lblToSvgOption.setAttribute('disabled', 'disabled');
txtSettingsSelect.appendChild(lblToSvgOption);
}

mxEvent.addListener(txtSettingsSelect, 'change', mxUtils.bind(this, function()
Expand Down Expand Up @@ -11133,6 +11156,14 @@
mxEvent.consume(evt);
}
}
//Miro is using unkown encoding instead of BASE64 as before
/*else if (spans != null && spans.length > 0 && spans[0].hasAttribute('data-meta')
&& spans[0].getAttribute('data-meta').substring(0, 14) == '<--(miro-data)')
{
var miroData = spans[0].getAttribute('data-meta');
miroData = miroData.substring(14, miroData.length - 15);
console.log(miroData);
}*/
else
{
// KNOWN: Paste from IE11 to other browsers on Windows
Expand Down Expand Up @@ -11165,7 +11196,8 @@
mxUtils.trim(decodeURIComponent(spans[0].textContent)) :
decodeURIComponent(xml);

if (this.isCompatibleString(tmp))
if (tmp && (this.isCompatibleString(tmp) ||
tmp.substring(0, 20).replace(/\s/g, '').indexOf('{"isProtected":') == 0))
{
compat = true;
xml = tmp;
Expand All @@ -11180,6 +11212,22 @@
{
if (xml != null && xml.length > 0)
{
if (xml.substring(0, 20).replace(/\s/g, '').indexOf('{"isProtected":') == 0)
{
try
{
if (typeof MiroImporter !== 'undefined')
{
var miro = new MiroImporter();
xml = miro.importMiroJson(JSON.parse(xml));
}
}
catch(e)
{
console.log('Miro import error:', e);
}
}

this.pasteXml(xml, pasteAsLabel, compat, evt);

try
Expand Down

0 comments on commit 7fb520a

Please sign in to comment.