Fix persistence class names

This commit is contained in:
Paulo Gustavo Veiga 2021-12-23 11:58:50 -08:00
parent 77d88986b7
commit 04e4efddf9
9 changed files with 25 additions and 30 deletions

View File

@ -21,10 +21,9 @@
"no-param-reassign": "off", "no-param-reassign": "off",
"max-len": [1,300], "max-len": [1,300],
"class-methods-use-this": "off", "class-methods-use-this": "off",
"func-names": ["error", "as-needed"],
"no-console" : "off", "no-console" : "off",
"no-unused-vars": ["error", { "args": "none" }], "no-unused-vars": ["error", { "args": "none" }]
"camelcase": ["error", {"allow": ["XML"]}]
}, },
"settings": { "settings": {
"import/resolver": { "import/resolver": {

View File

@ -69,7 +69,7 @@ class DragManager {
_buildMouseMoveListener(workspace, dragNode, dragManager) { _buildMouseMoveListener(workspace, dragNode, dragManager) {
const screen = workspace.getScreenManager(); const screen = workspace.getScreenManager();
const me = this; const me = this;
const result = function (event) { const result = (event) => {
if (!me._isDragInProcess) { if (!me._isDragInProcess) {
// Execute Listeners .. // Execute Listeners ..
const startDragListener = dragManager._listeners.startdragging; const startDragListener = dragManager._listeners.startdragging;
@ -101,7 +101,7 @@ class DragManager {
_buildMouseUpListener(workspace, node, dragNode, dragManager) { _buildMouseUpListener(workspace, node, dragNode, dragManager) {
const screen = workspace.getScreenManager(); const screen = workspace.getScreenManager();
const me = this; const me = this;
const result = function (event) { const result = (event) => {
$assert(dragNode.isDragTopic, 'dragNode must be an DragTopic'); $assert(dragNode.isDragTopic, 'dragNode must be an DragTopic');
// Remove all the events. // Remove all the events.

View File

@ -17,7 +17,7 @@
*/ */
import { $assert, $defined } from '@wisemapping/core-js'; import { $assert, $defined } from '@wisemapping/core-js';
import ModelCodeName from './ModelCodeName'; import ModelCodeName from './ModelCodeName';
import XMLSerializer from './XMLSerializer_Pela'; import XMLSerializer from './XMLSerializerPela';
class Beta2PelaMigrator { class Beta2PelaMigrator {
constructor(betaSerializer) { constructor(betaSerializer) {

View File

@ -16,7 +16,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { $assert, $defined } from '@wisemapping/core-js'; import { $assert, $defined } from '@wisemapping/core-js';
import XMLSerializer from './XMLSerializer_Tango'; import XMLSerializer from './XMLSerializerTango';
import ModelCodeName from './ModelCodeName'; import ModelCodeName from './ModelCodeName';
class Pela2TangoMigrator { class Pela2TangoMigrator {

View File

@ -23,7 +23,7 @@ import INodeModel from '../model/INodeModel';
import TopicFeature from '../TopicFeature'; import TopicFeature from '../TopicFeature';
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
class XMLSerializer_Beta { class XMLSerializerBeta {
toXML(mindmap) { toXML(mindmap) {
$assert(mindmap, 'Can not save a null mindmap'); $assert(mindmap, 'Can not save a null mindmap');
@ -183,7 +183,7 @@ class XMLSerializer_Beta {
// Is a wisemap?. // Is a wisemap?.
$assert( $assert(
documentElement.tagName === XMLSerializer_Beta.MAP_ROOT_NODE, documentElement.tagName === XMLSerializerBeta.MAP_ROOT_NODE,
`This seem not to be a map document. Root Tag: '${documentElement.tagName}',HTML:${dom.innerHTML `This seem not to be a map document. Root Tag: '${documentElement.tagName}',HTML:${dom.innerHTML
}XML:${innerXML(dom)}`, }XML:${innerXML(dom)}`,
); );
@ -320,7 +320,7 @@ class XMLSerializer_Beta {
} }
} }
XMLSerializer_Beta.MAP_ROOT_NODE = 'map'; XMLSerializerBeta.MAP_ROOT_NODE = 'map';
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
export default XMLSerializer_Beta; export default XMLSerializerBeta;

View File

@ -18,9 +18,9 @@
import ModelCodeName from './ModelCodeName'; import ModelCodeName from './ModelCodeName';
import Beta2PelaMigrator from './Beta2PelaMigrator'; import Beta2PelaMigrator from './Beta2PelaMigrator';
import Pela2TangoMigrator from './Pela2TangoMigrator'; import Pela2TangoMigrator from './Pela2TangoMigrator';
import XMLSerializerBeta from './XMLSerializer_Beta'; import XMLSerializerBeta from './XMLSerializerBeta';
import XMLSerializerPela from './XMLSerializer_Pela'; import XMLSerializerPela from './XMLSerializerPela';
import XMLSerializerTango from './XMLSerializer_Tango'; import XMLSerializerTango from './XMLSerializerTango';
/** /**
* @class mindplot.persistence.XMLSerializerFactory * @class mindplot.persistence.XMLSerializerFactory

View File

@ -22,11 +22,7 @@ import INodeModel, { TopicShape } from '../model/INodeModel';
import TopicFeature from '../TopicFeature'; import TopicFeature from '../TopicFeature';
import ConnectionLine from '../ConnectionLine'; import ConnectionLine from '../ConnectionLine';
/** class XMLSerializerPela {
* @class
*/
// eslint-disable-next-line camelcase
class XMLSerializer_Pela {
toXML(mindmap) { toXML(mindmap) {
$assert(mindmap, 'Can not save a null mindmap'); $assert(mindmap, 'Can not save a null mindmap');
@ -60,7 +56,7 @@ class XMLSerializer_Pela {
&& mindmap.findNodeById(relationship.getToNode()) !== null && mindmap.findNodeById(relationship.getToNode()) !== null
) { ) {
// Isolated relationships are not persisted .... // Isolated relationships are not persisted ....
const relationDom = XMLSerializer_Pela._relationshipToXML(document, relationship); const relationDom = XMLSerializerPela._relationshipToXML(document, relationship);
mapElem.appendChild(relationDom); mapElem.appendChild(relationDom);
} }
}); });
@ -236,7 +232,7 @@ class XMLSerializer_Pela {
// Is a wisemap?. // Is a wisemap?.
$assert( $assert(
rootElem.tagName === XMLSerializer_Pela.MAP_ROOT_NODE, rootElem.tagName === XMLSerializerPela.MAP_ROOT_NODE,
'This seem not to be a map document.', 'This seem not to be a map document.',
); );
@ -257,7 +253,7 @@ class XMLSerializer_Pela {
const relationshipsNodes = childNodes.filter((child) => (child.nodeType === 1 && child.tagName === 'relationship')); const relationshipsNodes = childNodes.filter((child) => (child.nodeType === 1 && child.tagName === 'relationship'));
relationshipsNodes.forEach((child) => { relationshipsNodes.forEach((child) => {
try { try {
const relationship = XMLSerializer_Pela._deserializeRelationship(child, mindmap); const relationship = XMLSerializerPela._deserializeRelationship(child, mindmap);
mindmap.addRelationship(relationship); mindmap.addRelationship(relationship);
} catch (e) { } catch (e) {
console.error(e); console.error(e);
@ -385,7 +381,7 @@ class XMLSerializer_Pela {
} }
// Has text node ?. // Has text node ?.
const textAttr = XMLSerializer_Pela._deserializeTextAttr(child); const textAttr = XMLSerializerPela._deserializeTextAttr(child);
if (textAttr) { if (textAttr) {
attributes.text = textAttr; attributes.text = textAttr;
} }
@ -395,7 +391,7 @@ class XMLSerializer_Pela {
const feature = TopicFeature.createModel(featureType, attributes); const feature = TopicFeature.createModel(featureType, attributes);
topic.addFeature(feature); topic.addFeature(feature);
} else if (child.tagName === 'text') { } else if (child.tagName === 'text') {
const nodeText = XMLSerializer_Pela._deserializeNodeText(child); const nodeText = XMLSerializerPela._deserializeNodeText(child);
topic.setText(nodeText); topic.setText(nodeText);
} }
} }
@ -507,7 +503,7 @@ class XMLSerializer_Pela {
* @type {String} * @type {String}
* @default * @default
*/ */
XMLSerializer_Pela.MAP_ROOT_NODE = 'map'; XMLSerializerPela.MAP_ROOT_NODE = 'map';
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
export default XMLSerializer_Pela; export default XMLSerializerPela;

View File

@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import XMLSerializer from './XMLSerializer_Pela'; import XMLSerializer from './XMLSerializerPela';
/** /**
* This serializer works exactly the same way as for the former version Pela * This serializer works exactly the same way as for the former version Pela

View File

@ -1,9 +1,9 @@
import beta2PelaMigrator from './Beta2PelaMigrator'; import beta2PelaMigrator from './Beta2PelaMigrator';
import modelCodeName from './ModelCodeName'; import modelCodeName from './ModelCodeName';
import pela2TangoMigrator from './Pela2TangoMigrator'; import pela2TangoMigrator from './Pela2TangoMigrator';
import xmlSerializerBeta from './XMLSerializer_Beta'; import xmlSerializerBeta from './XMLSerializerBeta';
import xmlSerializerPela from './XMLSerializer_Pela'; import xmlSerializerPela from './XMLSerializerPela';
import xmlSerializerTango from './XMLSerializer_Tango'; import xmlSerializerTango from './XMLSerializerTango';
import xmlSerializerFactory from './XMLSerializerFactory'; import xmlSerializerFactory from './XMLSerializerFactory';
export default { export default {