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",
"max-len": [1,300],
"class-methods-use-this": "off",
"func-names": ["error", "as-needed"],
"no-console" : "off",
"no-unused-vars": ["error", { "args": "none" }],
"camelcase": ["error", {"allow": ["XML"]}]
"no-unused-vars": ["error", { "args": "none" }]
},
"settings": {
"import/resolver": {

View File

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

View File

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

View File

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

View File

@ -23,7 +23,7 @@ import INodeModel from '../model/INodeModel';
import TopicFeature from '../TopicFeature';
// eslint-disable-next-line camelcase
class XMLSerializer_Beta {
class XMLSerializerBeta {
toXML(mindmap) {
$assert(mindmap, 'Can not save a null mindmap');
@ -183,7 +183,7 @@ class XMLSerializer_Beta {
// Is a wisemap?.
$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
}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
export default XMLSerializer_Beta;
export default XMLSerializerBeta;

View File

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

View File

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

View File

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