Skip to content

Responsive Design - Info Box#5295

Closed
vlt1 wants to merge 6 commits intogeosolutions-it:masterfrom
vlt1:c125-info-box
Closed

Responsive Design - Info Box#5295
vlt1 wants to merge 6 commits intogeosolutions-it:masterfrom
vlt1:c125-info-box

Conversation

@vlt1
Copy link
Copy Markdown
Contributor

@vlt1 vlt1 commented May 19, 2020

Description

Initial Info Box implementation.

Please check if the PR fulfills these requirements

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

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

austrocontrol-C125/#160

What is the current behavior?
Access to map details in viewer is read-only in panel.

What is the new behavior?
Enhances Details plugin for it to present information either in panel or in dialog form, adds an ability to edit details in viewer, show details information automatically when the map is opened.

Breaking change

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

  • Yes, and I documented them in migration notes
  • No

@vlt1 vlt1 self-assigned this May 19, 2020
@vlt1 vlt1 changed the title Responsive Design - Info Box #160 Responsive Design - Info Box May 19, 2020
@coveralls
Copy link
Copy Markdown

coveralls commented May 19, 2020

Coverage Status

Coverage decreased (-0.1%) to 83.372% when pulling 436304d on vlt1:c125-info-box into 0670c4b on geosolutions-it:master.

@tdipisa tdipisa requested a review from offtherailz May 19, 2020 08:30
@offtherailz offtherailz requested review from MV88 and removed request for offtherailz May 20, 2020 14:43
@tdipisa tdipisa added this to the 2020.03.00 milestone May 21, 2020
Copy link
Copy Markdown
Contributor

@MV88 MV88 left a comment

Choose a reason for hiding this comment

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

Hi @vlt1 i think you did a good work, but is something i would like to change / improve :

  • there is a bug when i try to edit the content the details from in map as modal,
    it works if i edit settings
StandardRouter.jsx:130 Error: You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas
    at Object.Quill_componentWillReceiveProps [as componentWillReceiveProps] (component.js:168)
    at callComponentWillReceiveProps (react-dom.development.js:14329)
    at updateClassInstance (react-dom.development.js:14546)
    at updateClassComponent (react-dom.development.js:18357)
    at beginWork$1 (react-dom.development.js:20108)
    at HTMLUnknownElement.callCallback (react-dom.development.js:362)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:411)
    at invokeGuardedCallback (react-dom.development.js:466)
    at beginWork$$1 (react-dom.development.js:25730)
    at performUnitOfWork (react-dom.development.js:24638)
    at workLoopSync (react-dom.development.js:24614)
    at performSyncWorkOnRoot (react-dom.development.js:24182)
    at eval (react-dom.development.js:12238)
    at unstable_runWithPriority (scheduler.development.js:815)
    at runWithPriority$2 (react-dom.development.js:12188)
    at flushSyncCallbackQueueImpl (react-dom.development.js:12233)
  • ui change

Also i would propose a little change on the ui of the modal to make it equal to the one in the side panel

this is the current situation for the modal
image
and for the panel
image

My proposal is:

  • to remove the buttons in the footer of the modal and add a toolbar in the header, as done for the panel
  • since settings are two checkboxes we can add two toggle button in the new toolbar
  • the edit text can be replaced by a pencil icon
  • the toolbar will have toolitps and will be centered and always visible (both in view and edit mode)
  • when in edit mode there will be a arrow-left and a floppy disk icon.
  • this would require some sort of save on exit behaviour if one toggles the settings
    @allyoucanmap what do you think ?

icon: <Glyphicon glyph="sheet"/>,
action: openDetailsPanel,
action: setControlProperty.bind(null, 'details', 'enabled', true),
selector: (state) => {
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.

here i have some doubts.
if someone removes the Toolbar from localConfig you are not able to reopen the details if
showAsModal is turned on && showOnStartUp is turned off

In my opinion this plugin should be shown without looking at showAsModal flag.
Another things is that if you add a priority of 1 here and on let's say 5 on the Toolbar container this will make the details plugin visible in the toolbar if both are present, or visible in burger menu if toolbar is not present. (but we still just check the presence of detailsUri

@tdipisa what do you think?

const mapId = mapIdSelector(state);
const detailsUri = mapId && mapInfoDetailsUriFromIdSelector(state, mapId);
const settings = settingsSelector(state) || {};
if (detailsUri && !settings.showAsModal) {
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.

Following my previous post

Suggested change
if (detailsUri && !settings.showAsModal) {
if (detailsUri) {

Toolbar: {
name: 'details',
position: 1,
priority: 1,
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.

Suggested change
priority: 1,
priority: 4,

text: <Message msgId="details.title"/>,
icon: <Glyphicon glyph="sheet"/>,
action: openDetailsPanel,
action: setControlProperty.bind(null, 'details', 'enabled', true),
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.

Suggested change
action: setControlProperty.bind(null, 'details', 'enabled', true),
priority: 1,
action: setControlProperty.bind(null, 'details', 'enabled', true),

const detailsUri = mapId && mapInfoDetailsUriFromIdSelector(state, mapId);
if (detailsUri) {
const settings = settingsSelector(state) || {};
if (detailsUri && settings.showAsModal) {
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.

I think showAsModal should not be necessary

Suggested change
if (detailsUri && settings.showAsModal) {
if (detailsUri) {

@vlt1
Copy link
Copy Markdown
Contributor Author

vlt1 commented May 27, 2020

@MV88 I couldn't reproduce the bug, could you please provide more information?
Also regarding containers and priorities, the only way to resolve this right now is to always show the button in BurgerMenu and remove priorities(the solution you proposed wouldn't work for showAsModal = false, because Toolbar would still have higher priority, so BurgerMenu button won't be shown).

@vlt1
Copy link
Copy Markdown
Contributor Author

vlt1 commented May 28, 2020

@allyoucanmap these changes are not for Details plugin, this is a bugfix connected to changes introduced for MapExport plugin

@MV88
Copy link
Copy Markdown
Contributor

MV88 commented May 28, 2020

showAsModal = false,

i was proposing to remove showAsModal in the condition of selectors
then if you configure the priority as said for both pieces it wins only one of the two (i,.e toolbar)
see my previous comment

The bug was to open a map with details, from within the map, try to save new details,
but now has gone, i cannot reproduce it anymore.

  • i would ask you to apply the scrollbar only to the content, and make the toolbar always visible

image

@allyoucanmap
Copy link
Copy Markdown
Contributor

@allyoucanmap these changes are not for Details plugin, this is a bugfix connected to changes introduced for MapExport plugin

@vlt1 If not strictly related or required for this issue we should remove them and open another issue explaining the problem with MapExport.
It's a bit difficult to understand changes of PluginsUtils and PluginsConatiner in the context of this PR.

We usually have to adress one issue for PR, see PR guideline:

Address a single issue or add a single item of functionality.

@allyoucanmap allyoucanmap self-requested a review May 28, 2020 15:03
@vlt1 vlt1 mentioned this pull request Jun 3, 2020
12 tasks
@vlt1
Copy link
Copy Markdown
Contributor Author

vlt1 commented Jun 3, 2020

Closing this in favor of #5396.

@vlt1 vlt1 closed this Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants