Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plugins/Subscription): Manage GOOSE service connections #569

Merged
merged 33 commits into from
Mar 17, 2022

Conversation

Flurb
Copy link
Contributor

@Flurb Flurb commented Feb 28, 2022

Also adding some tests for the subscription plugin, which were not included in the subscriber-plugin branch.

@Flurb Flurb marked this pull request as draft February 28, 2022 07:56
@Flurb Flurb marked this pull request as ready for review March 2, 2022 22:49
@Flurb Flurb changed the base branch from main to subscriber-plugin March 2, 2022 22:49
@Flurb
Copy link
Contributor Author

Flurb commented Mar 2, 2022

Updating an element is done as follows:

private async replaceElement(original: Element, clone: Element) {
    const parent = original.parentElement;

    this.dispatchEvent(
      newActionEvent({
        old: {
          parent: parent!,
          element: original,
          reference: original.nextSibling
        }
      })
    );

    await this.updateComplete;

    this.dispatchEvent(
      newActionEvent({
        new: {
          parent: parent!,
          element: clone,
          reference: clone.nextSibling
        }
      })
    );
  }

I want this to be done with 1 newActionEvent instead of 2, but I can't get it to work.
When I use a new element and an old element as well at the same time, it's just adding the new element into the old element.

It's working as it is now, but it's not a classy solution. You're free to fix it :)
It seems like a bug into the newActionEvent process, but I'm not sure.

@Flurb Flurb marked this pull request as draft March 4, 2022 13:56
Copy link
Collaborator

@JakobVogelsang JakobVogelsang left a comment

Choose a reason for hiding this comment

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

LGTM

@JakobVogelsang JakobVogelsang merged commit 204e6bb into subscriber-plugin Mar 17, 2022
@JakobVogelsang JakobVogelsang deleted the manage-goose-connections branch March 17, 2022 01:03
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.

2 participants