Skip to content

Refactor editor attribute sorting logic#453

Open
stijnpotters1 wants to merge 10 commits intomasterfrom
fix/editor-attriburte-order
Open

Refactor editor attribute sorting logic#453
stijnpotters1 wants to merge 10 commits intomasterfrom
fix/editor-attriburte-order

Conversation

@stijnpotters1
Copy link
Copy Markdown
Contributor

image

@stijnpotters1 stijnpotters1 requested a review from Matthbo April 23, 2026 08:53
@stijnpotters1 stijnpotters1 self-assigned this Apr 23, 2026
@stijnpotters1 stijnpotters1 linked an issue Apr 23, 2026 that may be closed by this pull request
Comment thread src/main/java/org/frankframework/flow/utility/XmlFormatter.java Fixed
Comment thread src/main/frontend/app/routes/studio/flow-to-xml-parser.ts Outdated
Comment thread src/main/frontend/app/routes/studio/flow-to-xml-parser.ts Outdated
Comment thread src/main/java/org/frankframework/flow/utility/XmlFormatter.java Outdated
@philipsens
Copy link
Copy Markdown
Member

Sorry that I'm only jumping in now, but can you explain what order is being used for the attributes now. I commented on the issue (#374 (comment)), but didn't realize that there was a PR already.

@stijnpotters1
Copy link
Copy Markdown
Contributor Author

Sorry that I'm only jumping in now, but can you explain what order is being used for the attributes now. I commented on the issue (#374 (comment)), but didn't realize that there was a PR already.

Its sorted in 4 layers.

First on namespaced attributes
Second on mandatory attributes according tot the xsd
Thirth the name attribute since this is used almost in every element.
Fourth the rest of the attributes on alphabetical order

@philipsens
Copy link
Copy Markdown
Member

I'd rather see the order that is used in the XSD itself (and required at the top maybe). Then there is "less magic" and is inline with the FF! Doc.

@stijnpotters1 stijnpotters1 requested a review from Matthbo April 29, 2026 13:54
@stijnpotters1 stijnpotters1 force-pushed the fix/editor-attriburte-order branch from 150fead to 2957e02 Compare April 29, 2026 14:01
@philipsens
Copy link
Copy Markdown
Member

We also discussed with in the Core Refining:

Why not just sort in the order of the XSD?

On another note: I don't think the editor should reformat automatically at all. Maybe when > switching context, but never when the user is focused on the editor.

So:

User is typing, saving, editing again -> Nothing should change
User calls reformat function -> Reformat and reorder
User edits flow -> XML gets changes programmatically and gets reformatted and reordered
Maybe: User loses editor focus, changes tab/file or page -> auto-reformat

The order in the FF! Doc is as follows:

  • Required attributes
  • Order of the XSD

The order of the XSD is actually important because it is sorted by input/output rather than alphabetically.

The Flow also had namespaces in the XML. I don't care where they are shown (At top or bottom) as long as they are together and also in the order of the XSD.

Copy link
Copy Markdown
Member

@philipsens philipsens left a comment

Choose a reason for hiding this comment

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

Just to block merging until order and usability have been confirmed/implemented.

…prove attribute reordering logic with required/optional handling
@stijnpotters1
Copy link
Copy Markdown
Contributor Author

We also discussed with in the Core Refining:

Why not just sort in the order of the XSD?
On another note: I don't think the editor should reformat automatically at all. Maybe when > switching context, but never when the user is focused on the editor.

So:

User is typing, saving, editing again -> Nothing should change User calls reformat function -> Reformat and reorder User edits flow -> XML gets changes programmatically and gets reformatted and reordered Maybe: User loses editor focus, changes tab/file or page -> auto-reformat

The order in the FF! Doc is as follows:

  • Required attributes
  • Order of the XSD

The order of the XSD is actually important because it is sorted by input/output rather than alphabetically.

The Flow also had namespaces in the XML. I don't care where they are shown (At top or bottom) as long as they are together and also in the order of the XSD.

I have implemented this. Now its ordered according to the xsd order.
image

@sonarqubecloud
Copy link
Copy Markdown

1 similar comment
@sonarqubecloud
Copy link
Copy Markdown

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.

Backend automatically alphabetises attributes

4 participants