Skip to content

Fix #3531 Add collapse/pin/hide functionalities to the widgets#3535

Merged
offtherailz merged 26 commits intogeosolutions-it:masterfrom
offtherailz:fix_#3531
Feb 19, 2019
Merged

Fix #3531 Add collapse/pin/hide functionalities to the widgets#3535
offtherailz merged 26 commits intogeosolutions-it:masterfrom
offtherailz:fix_#3531

Conversation

@offtherailz
Copy link
Copy Markdown
Member

@offtherailz offtherailz commented Feb 14, 2019

Description

With this changes:

  • widgets can be collapsed in the new "WidgetTray" plugin.
  • widgets can be pinned (see the related issue for definition of pin)
  • widgets can be hidden to certain users (via localConfig.json)
  • hide and pin tools visibility and policies can be configured in localConfig.json.
  • text widgets can contain images

Pin

These tools are implemented as icons on the top left corner of a widget
image
Pinned widgets look like this:
image
The pin tool is not visible to users that are not able to pin/unpin widgets. By default, only admin can pin (configurable).

Collapse

Collapsed widget appear in a tray
image
When collapse a widget, the tray expands. You can collapse all widgets at once using the "collapse all" button in the tray

Hide

The hide functionality is disabled by default. If configured (in localConfig.json), a user that belongs to a certain role can be able to hide a widget to other users.

Add image to text widget

When you edit/create a widget, the WYSIWYG editor have the tool to add images.

image

Issues

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Feature

What is the current behavior? (You can also link to an open issue here)
Nor of features in #3531 is present

What is the new behavior?
Widgets are collapsible

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • No

Other information:

Hide and lock have some issues with collapse functionality.
Rules applied to display/hide widgets are at plugin level. Instead they should be at global level,
to be shared between Widgets and WidgetsTrey plugins.

This minimal solution is hide to everyone (so even the user that can hide the widget) the widget in the tray.
@offtherailz offtherailz added this to the 2019.02.00 milestone Feb 14, 2019
@ghost ghost assigned offtherailz Feb 14, 2019
@offtherailz offtherailz requested a review from mbarto February 14, 2019 15:20
/**
* Collapse/Expand all the widgets
*/
const toggleCollapseAll = (target = DEFAULT_TARGET) => ({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

test for this

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's tested with the reducer, anyway, I need to add a test for the action itself

* Collapse/Expand the widget
* @param {object} widget the widget to collapse
*/
const toggleCollapse = (widget, target = DEFAULT_TARGET) => ({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

test for this, i know it is an action but you choose

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

tested with the reducer, anyway, I need to add a test for the action itself

@@ -0,0 +1,92 @@
/*
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we move this in components/security/enhancers?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

security folder is now dedicated to user, group, and permission editor. This is a different thing, so I'm afraid placing it there may be misleading

@@ -0,0 +1,27 @@
/*
* Copyright 2018, GeoSolutions Sas.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2019 😊

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Some of these files has been created in 2018 😄

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 15, 2019

Coverage Status

Coverage increased (+0.2%) to 80.961% when pulling 6fec286 on offtherailz:fix_#3531 into 98278a8 on geosolutions-it:master.

@geosolutions-it geosolutions-it deleted a comment Feb 16, 2019
@tdipisa tdipisa removed the request for review from mbarto February 18, 2019 10:59
@offtherailz offtherailz merged commit fefa092 into geosolutions-it:master Feb 19, 2019
offtherailz added a commit to offtherailz/MapStore2 that referenced this pull request Apr 12, 2019
@tdipisa tdipisa modified the milestones: 2019.02.00, 2019.01.01 May 14, 2019
@offtherailz offtherailz deleted the fix_#3531 branch February 18, 2020 11:54
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.

Widgets collapse/pin/hide functionalities

6 participants