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

Added hide custom view functionality #8980

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Added hide custom view functionality #8980

wants to merge 2 commits into from

Conversation

alfredosilvestre-natixis
Copy link
Contributor

@alfredosilvestre-natixis alfredosilvestre-natixis commented Sep 10, 2020

Description

This new functionality allows to hide a custom view without deleting it.

It is useful if you want to cleanup your custom views list that you shared without having to delete them.

It also adds clarity by having a clear distinction between the action for hiding a view and for deleting a view because currently there is only a "Delete view" button.

Fixes
#4721

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software
  • Updating documentation (missing information, typo...)

Target serie

  • 19.04.x
  • 19.10.x
  • 20.04.x
  • 20.10.x (master)

How this pull request can be tested ?

  1. Open the custom views page
  2. Create a new view or add an existing one
  3. If a new view was created, both the "Delete view" and "Hide view" buttons are active
  4. If an existing view was added, only the "Hide view" button is active

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 made corresponding changes to the documentation.
  • I have rebased my development branch on the base branch (master, maintenance).

@cgagnaire cgagnaire added area/backend area/custom-views area/ui kind/feature pr/external PR made by the contributors status/needs-attention The PR is on-hold. The reasons are specified in the PR labels Sep 11, 2020
@cgagnaire
Copy link

Hi @alfredosilvestre-natixis,
Thanks for this PR too.
I'll let @kduret and @adr-mo take a look at this one before it enters our backlog.
As it's a new feature, it could (unfortunately) only reach the master branch.

@alfredosilvestre-natixis
Copy link
Contributor Author

Hello,

I can't see why the build has failed since it looks like I can't connect to the jenkins url.

On my test platform it working correctly.

@cgagnaire
Copy link

Don't worry, we will manage the build.

@kduret kduret removed the area/ui label Sep 24, 2020
@kduret
Copy link
Contributor

kduret commented Sep 24, 2020

LGTM
But we need to test lot of use cases to check if everything works fine.
particularly, this use case : hide, then show a hidden view (add share view ?)

$stmt = $this->db->prepare($query);
$stmt->bindParam(':customViewId', $customViewId, PDO::PARAM_INT);
$stmt->bindParam(':userId', $this->userId, PDO::PARAM_INT);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

$query .= ' DELETE FROM widget_preferences WHERE ' .
            ' widget_view_id in (SELECT widget_view_id FROM centreon.widget_views WHERE ' .
            ' custom_view_id = :customViewId) ' .
            ' AND user_id = :userId';
            $stmt = $this->db->prepare($query);
            $stmt->bindParam(':customViewId', $customViewId, PDO::PARAM_INT);
            $stmt->bindParam(':userId', $this->userId, PDO::PARAM_INT);

$stmt->bindParam(':userId', $this->userId, PDO::PARAM_INT);
} else {
$query = 'DELETE FROM custom_view_user_relation WHERE ' .
' custom_view_id = :customViewId AND user_id = :userId';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

' custom_view_id = :customViewId AND user_id = :userId;';

@alfredosilvestre-natixis
Copy link
Contributor Author

I accidentally removed my fork repository while trying to fix it, so I don't know if it is possible to add more commits to this PR.

I left a comment because there was a bug when removing the view the widget_preferences are not removed

@TamazC TamazC changed the base branch from master to develop September 26, 2022 09:29
@TamazC TamazC requested review from a team, adr-mo and dmyios September 26, 2022 09:29
@Barbeloa
Copy link

Hi @alfredosilvestre-natixis we have a new process regarding the implementation of new features, we submit the idea on "The Watch" and if this improvement idea wins enough votes, we can retain it, prioritize it, etc.

Your idea has been submitted on "Tha watch" and is currently awaiting some vote https://thewatch.centreon.com/ideas/add-hide-functionality-to-custom-views-1032
best regards Baptiste

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/custom-views kind/feature pr/external PR made by the contributors status/needs-attention The PR is on-hold. The reasons are specified in the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants