Skip to content

Persist coordinates and dimensions in flow namespace#314

Open
Daan0709 wants to merge 8 commits intomasterfrom
feat/persist-flow-coords
Open

Persist coordinates and dimensions in flow namespace#314
Daan0709 wants to merge 8 commits intomasterfrom
feat/persist-flow-coords

Conversation

@Daan0709
Copy link
Contributor

@Daan0709 Daan0709 commented Mar 4, 2026

  • Coordinates are now stored on elements by using flow:x="xcoord" and flow:y="ycoord"
  • Same for width and height flow:width="width" and flow:height="height"
  • Namespace xmlns:flow="urn:frank-flow" is automatically added to all configurations that get saved that do not yet have the namespace
afbeelding

@Daan0709 Daan0709 self-assigned this Mar 4, 2026
@Daan0709 Daan0709 linked an issue Mar 4, 2026 that may be closed by this pull request
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2026

@Daan0709 Daan0709 marked this pull request as ready for review March 4, 2026 16:09
@Daan0709 Daan0709 requested review from Matthbo and stijnpotters1 and removed request for stijnpotters1 March 4, 2026 16:10
@PathVariable String projectName, @RequestBody ConfigurationDTO configurationDTO)
throws ConfigurationNotFoundException, InvalidXmlContentException, IOException, ProjectNotFoundException {
throws ConfigurationNotFoundException, InvalidXmlContentException, IOException, ProjectNotFoundException,
Exception, TransformerException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you catch Exception by itself there's no need for any child exceptions to be put here.

because Exception is the parent of all of these it will always give it back no matter what the child exception is

Comment on lines +58 to +59
throws IOException, ProjectNotFoundException, ConfigurationNotFoundException, Exception,
TransformerException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you catch Exception by itself there's no need for any child exceptions to be put here.

Because Exception is the parent of all of these it will always give it back no matter what the child exception is

Comment on lines +36 to +39
}> & {
width?: number
height?: number
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A tip, use typescript's Utility Types if the types are reusable
In this case

type ElementPositions {
  width: number
  height:number
}

type FrankNodeType = {...} & Partial<ElementPositions>

No need to change it now, but something to consider when looking back at these sorts of types

const dagreGraph = new Dagre.graphlib.Graph()
dagreGraph.setDefaultEdgeLabel(() => ({}))
dagreGraph.setGraph({ rankdir: direction })
dagreGraph.setGraph({ rankdir: direction, ranksep: 300, nodesep: 200 })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to have these as constant values so they can easily be found and changed

type: 'Exit',
subtype: 'Exit',
attributes,
attributes: Object.keys(attributes).length > 0 ? attributes : {},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check is silly, if length is 0 than it'll be an empty object

Suggested change
attributes: Object.keys(attributes).length > 0 ? attributes : {},
attributes,

type: 'Exit',
subtype: 'Exit',
attributes,
attributes: Object.keys(attributes).length > 0 ? attributes : {},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
attributes: Object.keys(attributes).length > 0 ? attributes : {},
attributes,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flow namespace toevoegen voor opslaan positie flow elementen

2 participants