diff --git a/Build/Sources/components/ReactFlow/CustomModelNode.jsx b/Build/Sources/components/ReactFlow/CustomModelNode.jsx index f24b7662..04599f35 100644 --- a/Build/Sources/components/ReactFlow/CustomModelNode.jsx +++ b/Build/Sources/components/ReactFlow/CustomModelNode.jsx @@ -9,6 +9,8 @@ import SelectComponent from "../forms/select/SelectComponent"; import { Handle, Position } from 'reactflow'; import propertyTypes from "./customModelNode/propertyTypes"; import relationTypes from "./customModelNode/relationTypes"; +import { faArrowUp, faArrowDown, faTrash } from '@fortawesome/free-solid-svg-icons' + export const CustomModelNode = (props) => { const [properties, setProperties] = useState(props.data.properties); @@ -85,6 +87,24 @@ export const CustomModelNode = (props) => { props.data.properties = properties; } + const removeProperty = (propertyIndex) => { + properties.splice(propertyIndex, 1); + setProperties([...properties]); + props.data.properties = properties; + } + + const moveProperty = (propertyIndex, direction) => { + const newIndex = propertyIndex + direction; + if (newIndex < 0 || newIndex >= properties.length) { + return; + } + const property = properties[propertyIndex]; + properties.splice(propertyIndex, 1); + properties.splice(newIndex, 0, property); + setProperties([...properties]); + props.data.properties = properties; + } + const updateRelation = (index, property, value) => { relations[index][property] = value; setRelations([...relations]); @@ -362,7 +382,7 @@ export const CustomModelNode = (props) => { label="is nullable?" checked={property.isNullable} onChange={(value) => { - updateProperty(index, "isNullable", value); + updateProperty(index, "isNullable", value); }} /> { updateProperty(index, "isl10nModeExlude", value); }} /> +
+ + + +
) @@ -395,7 +443,7 @@ export const CustomModelNode = (props) => { title="Add relation" onClick={addEmptyRelation} > - + { diff --git a/Resources/Public/JavaScript/main.js b/Resources/Public/JavaScript/main.js index 622eec2f..504bec5e 100644 --- a/Resources/Public/JavaScript/main.js +++ b/Resources/Public/JavaScript/main.js @@ -1,2 +1,2 @@ /*! For license information please see main.js.LICENSE.txt */ -!function(e,c){if("object"==typeof exports&&"object"==typeof module)module.exports=c();else if("function"==typeof define&&define.amd)define([],c);else{var n=c();for(var t in n)("object"==typeof exports?exports:e)[t]=n[t]}}(self,(function(){return function(){var e={184:function(e,c){var n;!function(){"use strict";var t={}.hasOwnProperty;function a(){for(var e=[],c=0;c0?" ".concat(c[5]):""," {")),n+=e(c),t&&(n+="}"),c[2]&&(n+="}"),c[4]&&(n+="}"),n})).join("")},c.i=function(e,n,t,a,r){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(t)for(var i=0;i0?" ".concat(f[5]):""," {").concat(f[1],"}")),f[5]=r),n&&(f[2]?(f[1]="@media ".concat(f[2]," {").concat(f[1],"}"),f[2]=n):f[2]=n),a&&(f[4]?(f[1]="@supports (".concat(f[4],") {").concat(f[1],"}"),f[4]=a):f[4]="".concat(a)),c.push(f))}},c}},81:function(e){"use strict";e.exports=function(e){return e[1]}},703:function(e,c,n){"use strict";var t=n(414);function a(){}function r(){}r.resetWarningCache=a,e.exports=function(){function e(e,c,n,a,r,o){if(o!==t){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function c(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:c,element:e,elementType:e,instanceOf:c,node:e,objectOf:c,oneOf:c,oneOfType:c,shape:c,exact:c,checkPropTypes:r,resetWarningCache:a};return n.PropTypes=n,n}},697:function(e,c,n){e.exports=n(703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},448:function(e,c,n){"use strict";var t=n(294),a=n(840);function r(e){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n