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

Set view group data for wc api #3494

Merged
merged 13 commits into from
Jan 25, 2024
Merged

Conversation

JohannesDoberer
Copy link
Contributor

No description provided.

@JohannesDoberer JohannesDoberer marked this pull request as ready for review January 18, 2024 05:52
@JohannesDoberer
Copy link
Contributor Author

JohannesDoberer commented Jan 18, 2024

vg_live_settingsWC

export default class extends HTMLElement {
    constructor() {
        super();
        const btn = document.createElement('template');
        btn.innerHTML = `<button id="setViewGroupData">setRandomViewGroup</button>`;

        this._shadowRoot = this.attachShadow({
            mode: 'open',
            delegatesFocus: false
        });
        this._shadowRoot.appendChild(btn.content.cloneNode(true));

        this.$btn = this._shadowRoot.querySelector('#setViewGroupData');
        this.$btn.addEventListener('click', async () => {
            if (this.LuigiClient) {
                this.LuigiClient.setViewGroupData({
                    foo: '(' + Math.round(Math.random() * 100) + ')',
                    bar: '(' + Math.round(Math.random() * 100) + ')'
                });
            }
        });
    }

}

Node config

{
            pathSegment: 'mfe1Wc',
            label: 'MFE 1 {viewGroupData.foo} Wc',
            viewUrl: '/vg_live_settingsWC.js',
            viewGroup: 'vg1',
            webcomponent: true
          },

Viewgroup settings

viewGroupSettings: {
          vg1: {
            customData: {
              foo: 'bar'
            }
          },

@ndricimrr ndricimrr self-assigned this Jan 18, 2024
Copy link
Contributor

@ndricimrr ndricimrr left a comment

Choose a reason for hiding this comment

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

small comments

@JohannesDoberer JohannesDoberer added the enhancement New feature or request label Jan 25, 2024
@JohannesDoberer JohannesDoberer merged commit c5cb477 into main Jan 25, 2024
@JohannesDoberer JohannesDoberer deleted the setViewGroupData-for-wc-api branch January 25, 2024 11:18
@JohannesDoberer JohannesDoberer mentioned this pull request Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants