Skip to content

Commit

Permalink
GEP-97 delete use of backbone
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiga115 committed Oct 10, 2024
1 parent 8ae40d6 commit de13b46
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 40 deletions.
1 change: 0 additions & 1 deletion geppetto-showcase/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ module.exports = {
"stackViewerRequest": true,
"_": true,
"labelsInTV": true,
"Backbone": true,
"registeredEvents": true,
"Handlebars": true,
"ActiveXObject": true,
Expand Down
1 change: 0 additions & 1 deletion geppetto.js/geppetto-client/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ const jsConfig = {
stackViewerRequest: true,
_: true,
labelsInTV: true,
Backbone: true,
registeredEvents: true,
Handlebars: true,
ActiveXObject: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import Utils from './GeppettoJupyterUtils';

export function createPythonControlledComponent(WrappedComponent) {
export default function createPythonControlledComponent(WrappedComponent) {
if (typeof WrappedComponent !== 'function') {
class Wrapper extends React.Component {
render() {
Expand Down Expand Up @@ -73,7 +73,7 @@ export function createPythonControlledComponent(WrappedComponent) {
return PythonControlledComponent;
}

export function createPythonControlledControl(WrappedComponent) {
export default function createPythonControlledControl(WrappedComponent) {
var PythonControlledComponent = this.createPythonControlledComponent(WrappedComponent);
class PythonControlledControl extends PythonControlledComponent {

Expand Down Expand Up @@ -316,7 +316,7 @@ export function createPythonControlledControl(WrappedComponent) {
return PythonControlledControl;
}

export function createPythonControlledControlWithPythonDataFetch(WrappedComponent) {
export default function createPythonControlledControlWithPythonDataFetch(WrappedComponent) {
var PythonControlledComponent = this.createPythonControlledComponent(WrappedComponent);
class PythonControlledControlWithPythonDataFetch extends PythonControlledComponent {

Expand Down Expand Up @@ -458,12 +458,6 @@ export function createPythonControlledControlWithPythonDataFetch(WrappedComponen
return PythonControlledControlWithPythonDataFetch;
}

export default {
createPythonControlledComponent,
createPythonControlledControl,
createPythonControlledControlWithPythonDataFetch
};

function getNameFromWrappedComponent(WrappedComponent) {
return WrappedComponent.name || WrappedComponent.displayName || WrappedComponent.Naked.render.name;
}
1 change: 0 additions & 1 deletion geppetto.js/geppetto-core/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ const jsConfig = {
stackViewerRequest: true,
_: true,
labelsInTV: true,
Backbone: true,
registeredEvents: true,
Handlebars: true,
ActiveXObject: true,
Expand Down
54 changes: 27 additions & 27 deletions geppetto.js/geppetto-core/src/model/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@
* @author Jesus R. Martinez ([email protected])
*/

import Backbone from 'backbone';

const Model = Backbone.Model.extend({
name: "",
instancePath: "",
id: "",
domainType: "",
_metaType: "",
aspectNode: null,
parent: null,
tags: null,

class Model {

constructor() {
this.name = "";
this.instancePath = "";
this.id = "";
this.domainType = "";
this._metaType = "";
this.aspectNode = null;
this.parent = null;
this.tags = null;
}

/**
* Gets the instance path of the node
Expand All @@ -25,7 +27,7 @@ const Model = Backbone.Model.extend({
*/
getInstancePath() {
return this.instancePath;
},
}

/**
* Gets the name of the node
Expand All @@ -35,11 +37,11 @@ const Model = Backbone.Model.extend({
*/
getName() {
return this.name;
},
}

getAspectNode() {
return this.aspectNode;
},
}

/**
* Sets the name of the node
Expand All @@ -48,7 +50,7 @@ const Model = Backbone.Model.extend({
*/
setName(newname) {
this.name = newname;
},
}

/**
* Get the id associated with node
Expand All @@ -58,23 +60,23 @@ const Model = Backbone.Model.extend({
*/
getId() {
return this.id;
},
}

getDomainType() {
return this.domainType;
},
}

setDomainType(newDomainType) {
this.domainType = newDomainType;
},
}

setParent(parent) {
this.parent = parent;
},
}

getParent() {
return this.parent;
},
}

/**
* Recursively collects all nodes matching the given predicate.
Expand All @@ -94,7 +96,7 @@ const Model = Backbone.Model.extend({
}

return matches;
},
}

/**
* Search inside a node for all the nodes of a specific domain type.
Expand All @@ -104,7 +106,7 @@ const Model = Backbone.Model.extend({
*/
getSubNodesOfDomainType(domainType) {
return this._all((n) => n.domainType === domainType);
},
}

/**
* Search inside a node for all the nodes of a specific meta type.
Expand All @@ -114,9 +116,7 @@ const Model = Backbone.Model.extend({
*/
getSubNodesOfMetaType(metaType) {
return this._all((n) => n._metaType === metaType);
},
});
}
};

export default {
Model,
};
export default Model;
1 change: 0 additions & 1 deletion geppetto.js/geppetto-ui/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ const jsConfig = {
stackViewerRequest: true,
_: true,
labelsInTV: true,
Backbone: true,
registeredEvents: true,
Handlebars: true,
ActiveXObject: true,
Expand Down

0 comments on commit de13b46

Please sign in to comment.