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

[BUG] View Background Color not working #1363

Closed
LordNetro opened this issue Sep 9, 2024 · 6 comments
Closed

[BUG] View Background Color not working #1363

LordNetro opened this issue Sep 9, 2024 · 6 comments
Labels
bug Something isn't working fixed

Comments

@LordNetro
Copy link

Describe the bug
The background color and behaviour of the view is lost whenever you acces the view by an event.
If you acces the view via the side menu the behaviour is the expected (it works). The bug only happens when you acces the view via a button in a different view

To Reproduce
Steps to reproduce the behavior:

  1. Add a button to a view
  2. Add an mouse down / open page event to the button
  3. Assign a view that has a different background color than the default to the event
  4. Try it and see that the background color is white and not the one that you assigned before

Expected behavior
See the view with the expected background color and behaviour.

Screenshots
View accessed via button in different view
image

View accesed via side menu
image

Environment

  • FUXA version: 1.2.0-1751
  • Node.js version: v18.20.3
  • npm version: 10.7.0
  • Platform/OS: Windows 10 Pro
  • Browser: Microsoft Edge
@henjoe
Copy link

henjoe commented Sep 12, 2024

I checked the logic for this, the sideNav has different logic from the button (navigating to other page).

If you can edit a code, you can simply change the fuxa-view.component.ts under client\src\app\fuxa-view

Search the code below: (loadPage)

 loadPage(param: any, viewref: string, options: any) {

        let view: View = this.getView(viewref);
        if (view) {
            if (options?.variablesMapping) {
                this.loadVariableMapping(options.variablesMapping);
            }
            this.loadHmi(view);
            if (param.scaleMode) {
                Utils.resizeViewRev(this.dataContainer.nativeElement, this.dataContainer.nativeElement.parentElement?.parentElement, param.scaleMode);
            }
        }
    }

and change the this.loadHmi(view) to this.loadHmi(view, true)

loadPage(param: any, viewref: string, options: any) {

        let view: View = this.getView(viewref);
        if (view) {
            if (options?.variablesMapping) {
                this.loadVariableMapping(options.variablesMapping);
            }
            this.loadHmi(view, true);
            if (param.scaleMode) {
                Utils.resizeViewRev(this.dataContainer.nativeElement, this.dataContainer.nativeElement.parentElement?.parentElement, param.scaleMode);
            }
        }
    }

@henjoe
Copy link

henjoe commented Sep 12, 2024

By the way, how you manage all the controls (sliders, gauges and etc.) to have a little bit of transparent background?

This is awesome.

@henjoe
Copy link

henjoe commented Sep 12, 2024

By the way, how you manage all the controls (sliders, gauges and etc.) to have a little bit of transparent background?

This is awesome.

By the way, how you manage all the controls (sliders, gauges and etc.) to have a little bit of transparent background?

This is awesome.

Nevermind, I knew it. What a dumb question 😄

@LordNetro
Copy link
Author

LordNetro commented Sep 16, 2024

I checked the logic for this, the sideNav has different logic from the button (navigating to other page).

If you can edit a code, you can simply change the fuxa-view.component.ts under client\src\app\fuxa-view

Search the code below: (loadPage)

 loadPage(param: any, viewref: string, options: any) {

        let view: View = this.getView(viewref);
        if (view) {
            if (options?.variablesMapping) {
                this.loadVariableMapping(options.variablesMapping);
            }
            this.loadHmi(view);
            if (param.scaleMode) {
                Utils.resizeViewRev(this.dataContainer.nativeElement, this.dataContainer.nativeElement.parentElement?.parentElement, param.scaleMode);
            }
        }
    }

and change the this.loadHmi(view) to this.loadHmi(view, true)

loadPage(param: any, viewref: string, options: any) {

        let view: View = this.getView(viewref);
        if (view) {
            if (options?.variablesMapping) {
                this.loadVariableMapping(options.variablesMapping);
            }
            this.loadHmi(view, true);
            if (param.scaleMode) {
                Utils.resizeViewRev(this.dataContainer.nativeElement, this.dataContainer.nativeElement.parentElement?.parentElement, param.scaleMode);
            }
        }
    }

Thank you so much!
@unocelli could you add this fix to the PRO version please? Thank you in advance.

@unocelli unocelli added the bug Something isn't working label Sep 19, 2024
@unocelli
Copy link
Member

@henjoe Thanks a lot!

@unocelli
Copy link
Member

I’m going to close this as resolved. let me know if you have any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

3 participants