Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

fix(widget) : widget params on public view #7408

Merged
merged 6 commits into from
Apr 18, 2019
Merged

Conversation

sc979
Copy link
Contributor

@sc979 sc979 commented Apr 10, 2019

Pull Request Template

Description

If the view is being added for the first time, we make sure that the widget parameters are going to be set
Get all widget's parameters from the view that is being added and add every widget parameters to the current user

Fixes # (issue)

Type of change

  • Patch fixing an issue (non-breaking change)

Target serie

  • 18.10.x
  • 19.04.x (master)

How this pull request can be tested ?

you can test this pull request by creating a new view with various widgets on it and configure them so that they do not show the default data and/or the warning message telling you ton configure them.

When done, just make your view public so that people can add this view to their home page.

Switch to another user, try to load the public view, you'll notice that every single widget in the view is not configured.

this fixes #7320 and #7383
I've forgot to test what happens if the view creator made an unlocked sharing to a specific user and then someone adds this view from the public views list (i'm thinking about that because of the locked=0 condition in the query (might want to change that for is_owner=1 . I'll test that later today and update the thread. (thx @tanguyvda )

Checklist

  • I followed the coding style guidelines provided by Centreon
  • I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • I have commented my code, especially hard-to-understand areas of the PR.
  •   I have rebased my development branch on the base branch (master, maintenance).

@tanguyvda
Copy link
Contributor

tanguyvda commented Apr 11, 2019

you can test this pull request by creating a new view with various widgets on it and configure them so that they do not show the default data and/or the warning message telling you ton configure them.

When done, just make your view public so that people can add this view to their home page.

Switch to another user, try to load the public view, you'll notice that every single widget in the view is not configured.

this fixes #7320 and #7383
I've forgot to test what happens if the view creator made an unlocked sharing to a specific user and then someone adds this view from the public views list (i'm thinking about that because of the locked=0 condition in the query (might want to change that for is_owner=1 . I'll test that later today and update the thread.

www/class/centreonCustomView.class.php Outdated Show resolved Hide resolved
@sc979 sc979 force-pushed the tanguyvda-fix-public-widget branch from 40d943a to 43b85e4 Compare April 11, 2019 11:47
@sc979 sc979 force-pushed the tanguyvda-fix-public-widget branch from 43b85e4 to cc6190e Compare April 11, 2019 15:39
@sc979 sc979 force-pushed the tanguyvda-fix-public-widget branch from cc6190e to 48c9019 Compare April 15, 2019 10:55
www/class/centreonCustomView.class.php Outdated Show resolved Hide resolved
Co-Authored-By: sc979 <34628915+sc979@users.noreply.github.com>
@sc979 sc979 merged commit 12655ef into master Apr 18, 2019
@sc979 sc979 deleted the tanguyvda-fix-public-widget branch April 18, 2019 08:29
sc979 added a commit that referenced this pull request Apr 18, 2019
from : fix(widget) : widget params on public view #7383

* correctly set widget params when you load a public view
* enh : check if $userId is non empty
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Widget doesn't load properly, need to use the Locked Users field
4 participants