Skip to content
Snippets Groups Projects
Commit 8edcd900 authored by Leonardo Christino's avatar Leonardo Christino
Browse files

fix: schema connection settings

parent 1ab129ca
No related branches found
No related tags found
No related merge requests found
Pipeline #132151 passed
...@@ -6,8 +6,10 @@ import { SchemaFromBackend, SchemaGraph, SchemaGraphology } from '../../schema'; ...@@ -6,8 +6,10 @@ import { SchemaFromBackend, SchemaGraph, SchemaGraphology } from '../../schema';
/**************************************************************** */ /**************************************************************** */
export const schemaConnectionTypeArray: Array<SchemaConnectionTypes> = ['connection', 'bezier', 'straight', 'step'];
export type SchemaConnectionTypes = 'connection' | 'bezier' | 'straight' | 'step';
export type SchemaSettings = { export type SchemaSettings = {
connectionType: 'connection' | 'bezier' | 'straight' | 'step'; connectionType: SchemaConnectionTypes;
layoutName: AllLayoutAlgorithms; layoutName: AllLayoutAlgorithms;
animatedEdges: boolean; animatedEdges: boolean;
}; };
......
...@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'; ...@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
import { Dialog, DialogProps } from '../../components/Dialog'; import { Dialog, DialogProps } from '../../components/Dialog';
import React from 'react'; import React from 'react';
import { useAppDispatch, useSchemaSettings } from '../../data-access'; import { useAppDispatch, useSchemaSettings } from '../../data-access';
import { SchemaSettings, setSchemaSettings } from '../../data-access/store/schemaSlice'; import { SchemaConnectionTypes, SchemaSettings, schemaConnectionTypeArray, setSchemaSettings } from '../../data-access/store/schemaSlice';
import { FormActions, FormBody, FormCard, FormControl, FormHBar, FormTitle, FormDiv } from '../../components/forms'; import { FormActions, FormBody, FormCard, FormControl, FormHBar, FormTitle, FormDiv } from '../../components/forms';
import { Layouts } from '../../graph-layout'; import { Layouts } from '../../graph-layout';
import { Input } from '../../components/inputs'; import { Input } from '../../components/inputs';
...@@ -34,9 +34,9 @@ export const SchemaDialog = (props: DialogProps) => { ...@@ -34,9 +34,9 @@ export const SchemaDialog = (props: DialogProps) => {
type="dropdown" type="dropdown"
label="Type of Connection" label="Type of Connection"
value={state.connectionType} value={state.connectionType}
options={['Default', 'Step', 'Straight', 'Bezier']} options={schemaConnectionTypeArray}
onChange={(value: string | number) => { onChange={(value: string | number) => {
setState({ ...state, connectionType: value as any }); setState({ ...state, connectionType: value as SchemaConnectionTypes });
}} }}
/> />
</FormControl> </FormControl>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment