Skip to content

feat(dist): create-multi-aps#682

Merged
maxschmalenbach merged 36 commits intomainfrom
feat(dist)/create-multi-aps
Feb 27, 2026
Merged

feat(dist): create-multi-aps#682
maxschmalenbach merged 36 commits intomainfrom
feat(dist)/create-multi-aps

Conversation

@maxschmalenbach
Copy link
Copy Markdown
Collaborator

@maxschmalenbach maxschmalenbach commented Feb 17, 2026

🗒 Description

Expand the logic and UI of the create-ied-and-ap dialog to allow the creation and validation of multi access points

📷 Demo screen recording or Screenshots

Screenshot 2026-02-17 at 19 30 37 Screenshot 2026-02-17 at 19 30 21

📋 Checklist

You may remove tasks that do not make sense in this PR.

  • Ticket-ACs are checked and met
  • GitHub labels are assigned
  • Git Ticket / issue is linked with PR
  • Designated PR Reviewers are set
  • Tested by another developer
  • Changelog updated
  • Documentation updated (check Documentation guidelines for further reading )
  • All comments in the PR are resolved / answered

🔦 Useful commits

You can add specific commits which are worth taking a look into

❌ Link issue(s) to close - hint

closes #570

@maxschmalenbach
Copy link
Copy Markdown
Collaborator Author

Should we write tests for this? As of now we do not have tests in this part of the plugin.

@maxschmalenbach maxschmalenbach marked this pull request as ready for review February 17, 2026 18:32
Copy link
Copy Markdown
Collaborator

@tmenzel27 tmenzel27 left a comment

Choose a reason for hiding this comment

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

I think we should use the Barrel Pattern also for components.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just in general we have now some code inside the UI comonents right but i guess its okay?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

hmm, good question. I feel like its pretty much connected to the ui since its only validating. moving this towards headless feels a bit wrong. Wdyt?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It depends if it can be used headless like queries it should be moved to headless.
Reset.ts is tough but i guess it could stay there.
I am also not a fan of a lib folder like that isn't that usually what for us headless is?
Are the Types we have here not commonly used?
For the matching i have also moved it to that folder inside headless, but i get why it would be nice to have that close to each other.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The types are really only scoped for the form, they define the formData.
I moved the query function, since this one really makes sense in the headless part of the plugin.
I believe the other functions are so closely linked to the form and cant really be used by any other parts of the plugin, this is why I would keep them there.
I may rename the lib folder to something more descriptive, less blackboxy.

Comment on lines +172 to +178
<MultiApButton
{isMultiApMode}
hasValidInput={isMultiApMode ? hasCurrentAp : hasValidIed}
onEnterMultiApMode={enterMultiApMode}
onAddAccessPoint={addAccessPoint}
/>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it be easier if we are always in "multiple AP" mode and depending on how many the user adds, that is how many are created? E.g. if you want just one, then just add one

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

the way the ui is designed right now, we do first expect a single ap, only if the user "opts-in" the ui should offer multi ap creation.

Comment on lines +10 to +32
export function validateSubmission({
ied,
accessPoints,
xmlDocument
}: ValidateSubmissionParams): string | null {
const trimmedIedName = ied.name.trim()

if (ied.isNew) {
if (!trimmedIedName) {
return 'IED name is required when creating a new IED'
}
if (queryIedExists(xmlDocument, trimmedIedName)) {
return `IED "${trimmedIedName}" already exists`
}
} else {
if (!trimmedIedName) {
return 'Please select an existing IED or create a new one'
}
}

if (accessPoints.length === 0) {
return 'At least one Access Point is required'
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Writing form validtion can get messy and confusing quickly, so it might be worthwhile to look into using a form library or writing your own.

I haven't used any form library in svelte so I can't make a recommendation, but you could take a look at these https://svelte.dev/packages#forms.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

will do so using tanstack form management in a future pr.

@tmenzel27 tmenzel27 self-requested a review February 27, 2026 10:13
Copy link
Copy Markdown
Collaborator

@tmenzel27 tmenzel27 left a comment

Choose a reason for hiding this comment

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

LGTM. There is nothing that needs to be done before merging this is there?

@maxschmalenbach maxschmalenbach merged commit 7b5f2a1 into main Feb 27, 2026
@tmenzel27 tmenzel27 deleted the feat(dist)/create-multi-aps branch March 5, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create multiple APs in the modal

3 participants