Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.toModelArray()
.forEach((link) => {
// #TODO check if this is safe when REMOVE_NODE deletes nodeModel
if (link.portFromModel.outputParent.id == payload.parameterId) {
link.portToModel.inputParent.update(payload.newValues);
}
});
break;
}
return undefined;
}
}
Link.modelName = 'Link';
Link.fields = {
id: attr(),
portFrom: fk({
to: 'Port',
as: 'portFromModel',
relatedName: 'outputLinks',
}),
portTo: fk({
to: 'Port',
as: 'portToModel',
relatedName: 'inputLinks',
}),
};
export default Link;
const nodes = this.nodes.toModelArray().map(node => node.denormalize());
const buckets = this.buckets.toModelArray().map(bucket => bucket.denormalize());
let data = Object.assign({}, this.ref, {nodes: nodes})
if (buckets.length) data = Object.assign(data, {buckets: buckets})
console.log('this data', this.ref.id, data)
delete data.id;
delete data.node;
return data;
}
};
Survey.modelName = 'Survey';
Survey.fields = {
id: attr(),
default_language: attr(),
node: fk('Node', 'sub_surveys')
};
class Bucket extends CRUDModel {
denormalize() {
const data = Object.assign({}, this.ref)
delete data.id;
delete data.survey;
return data;
}
};
Bucket.modelName = 'Bucket';
Bucket.fields = {
static get fields() {
return {
id: attr(),
type: attr(),
new: attr(),
param: attr(),
date: attr(),
txt: attr(),
img: attr()
};
}
static get fields() {
return {
id: attr(),
messages: many('Message'),
gold: attr(),
img: attr(),
last: attr(),
lastid: attr(),
msg: attr(),
name: attr(),
new: attr(),
staff: attr(),
total: attr(),
initialized: attr({getDefault: false})
};
}
Model, attr, fk, many,
} from 'redux-orm';
import ActionTypes from '../constants/ActionTypes';
import Config from '../constants/Config';
export default class extends Model {
static modelName = 'Card';
static fields = {
id: attr(),
position: attr(),
name: attr(),
description: attr(),
dueDate: attr(),
timer: attr(),
isSubscribed: attr({
getDefault: () => false,
}),
isActionsFetching: attr({
getDefault: () => false,
}),
isAllActionsFetched: attr({
getDefault: () => false,
}),
listId: fk({
to: 'List',
as: 'list',
relatedName: 'cards',
}),
boardId: fk({
to: 'Board',
import { attr, fk, Model } from 'redux-orm';
class Image extends Model {}
Image.modelName = 'image';
Image.fields = {
category: fk('category', 'images'),
checksum: attr(),
data: attr(),
id: attr()
};
export default Image;
static get fields() {
return {
id: attr(),
body: attr(),
createdAt: attr(),
updatedAt: attr(),
user: fk('User', 'comments'),
post: fk('Post', 'comments'),
}
}
static get fields() {
return {
id: attr(),
messages: many('Message'),
gold: attr(),
img: attr(),
last: attr(),
lastid: attr(),
msg: attr(),
name: attr(),
new: attr(),
staff: attr(),
total: attr(),
initialized: attr({getDefault: false})
};
}
static get fields() {
return {
id: attr(),
messages: many('Message'),
gold: attr(),
img: attr(),
last: attr(),
lastid: attr(),
msg: attr(),
name: attr(),
new: attr(),
staff: attr(),
total: attr(),
initialized: attr({getDefault: false})
};
}
static get fields() {
return {
body: attr(),
date: attr(),
dir: attr(),
id: attr({getDefault: uuid.v4}),
msgid: attr(),
sent: attr({getDefault: () => true}),
unread: attr({getDefault: () => true})
};
}