Skip to content

Add non-canvas element management with controller and service integration#574

Open
stijnpotters1 wants to merge 5 commits into
masterfrom
feat/add-non-canvas-elements
Open

Add non-canvas element management with controller and service integration#574
stijnpotters1 wants to merge 5 commits into
masterfrom
feat/add-non-canvas-elements

Conversation

@stijnpotters1

@stijnpotters1 stijnpotters1 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor
image image image image image

@stijnpotters1 stijnpotters1 self-assigned this Jun 24, 2026
@stijnpotters1 stijnpotters1 requested a review from Matthbo June 24, 2026 14:51
@stijnpotters1 stijnpotters1 linked an issue Jun 24, 2026 that may be closed by this pull request
@stijnpotters1 stijnpotters1 requested a review from philipsens June 24, 2026 14:53
@philipsens

philipsens commented Jun 25, 2026

Copy link
Copy Markdown
Member

Looks good!

There is a difference between the pen-pot tho. In the design, there can be two rows in each component. A type and a name (or ref in the case of an include). The type should be small and bold while the name would be larger. Is there is no name, the type should be the same styling as the name would've been.

Also, I think elements should just be called components.

image

Also, I think each component should be clickable to configure it, even if it has a button to go to the studio. That makes it easy to rename an adapter for example or to delete it.

…ler integration and improved frontend according to feedback
@stijnpotters1

Copy link
Copy Markdown
Contributor Author
image

Improved!

@sonarqubecloud

Copy link
Copy Markdown


const handleDragLeave = () => {
if (!isComponentDrag) return
dragDepth.current -= 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No preventDefault() needed here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe sub components defined here should be in their own files

Comment on lines +230 to +231
const aIsRoot = a.relativePath.split(/[/\\]/).pop()?.toLowerCase() === 'configuration.xml'
const bIsRoot = b.relativePath.split(/[/\\]/).pop()?.toLowerCase() === 'configuration.xml'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these paths not normalised at this point?
If so then you wont have to check for both / and \ all the time

String updatedContent = XmlConfigurationUtils.convertNodeToString(configurationDocument);
fileSystemStorage.writeFile(absolutePath.toString(), updatedContent);
} catch (TransformerException | IOException exception) {
throw new ApiException("Failed to write configuration: " + exception.getMessage(), HttpStatus.BAD_REQUEST);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How is this a bed request? Something went wrong on the server, not because of the client

String repairedContent = XmlConfigurationUtils.repairFlowNamespace(content);
return XmlSecurityUtils.createSecureDocumentBuilder().parse(new InputSource(new StringReader(repairedContent)));
} catch (IOException | ParserConfigurationException | SAXException exception) {
throw new ApiException("Failed to read configuration: " + exception.getMessage(), HttpStatus.BAD_REQUEST);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here, if the file is not found then yes its on the client, but any other error is the fault on the server side

for (const name of getFirstLevelElementsForType(xsdDocument, rootType)) collect(name)
}

return [...addableNames].toSorted((first, second) => first.localeCompare(second))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

toSorted already makes a new array copy, no need to spread onto a new array first

Comment on lines +216 to +241
{restKeys.length > 0 && (
<div className="pt-4">
<Button onClick={() => setShowAll((previous) => !previous)} className="w-full">
{showAll ? 'Hide empty attributes' : 'Show all attributes'}
</Button>
</div>
)}
</div>
</div>

<div className="border-t-border bg-background border-t p-4">
<div className="flex w-full items-center justify-between">
<Button
onClick={handleSave}
disabled={!canSave || isSaving}
className="disabled:text-foreground-muted w-auto disabled:cursor-not-allowed disabled:opacity-50"
>
{isSaving ? 'Saving...' : 'Save & Close'}
</Button>

<Button className="w-auto" onClick={mode === 'edit' ? handleDelete : onClose} disabled={isSaving}>
Delete
</Button>
</div>

{errorMessage && <p className="text-error mt-2 text-sm">{errorMessage}</p>}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is similar to how its done in the studio right?
Cant parts of that logic be its own component and reused here?

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.

Implement a configure non-canvas elements screen

3 participants