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

#5139 standard user session plugin #5154

Merged
merged 9 commits into from
Apr 29, 2020

Conversation

mbarto
Copy link
Contributor

@mbarto mbarto commented Apr 17, 2020

Description

This work extends user sessions base support, to allow enabling them in the standard product with reasonable defaults, like storing the session on the browser localStorage.

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

#5139

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

Other useful information

@coveralls
Copy link

coveralls commented Apr 18, 2020

Coverage Status

Coverage decreased (-0.08%) to 83.772% when pulling ad8e9f9 on mbarto:user_sessions_plugin into 22dfd39 on geosolutions-it:master.

Copy link
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

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

Looks great 👍
I only asked for some documentation (I know you provided a lot, only a few functions that are not too much clear in their role).

  • UserSession Plugin should stay in the list of plugins selectable for context.
  • moreover, should we enable user session in mapstore by default? What do you think? I think this is valid for georchestra (and it should be set enabled by default also in pluginsConfig.json for that project), but for MapStore, maybe, it should be disabled by default. @tdipisa, what do you think?

web/client/epics/config.js Show resolved Hide resolved
@@ -77,20 +84,50 @@ const errorToMessageId = (name, e, getState = () => {}) => {
}
return message;
};

const flowWithSession = (mapId, contextName, action$, getState) => {
Copy link
Member

Choose a reason for hiding this comment

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

I suggest to use createSessionFlow. It looks more clear then flowWithSession and similar to createContextFlow and createMapFlow.
Can you document arguments and returned stream, as for createMapFlow

@@ -32,12 +34,12 @@ function ContextError(error) {
this.originalError = error;
this.name = "context";
}
const createContextFlow = (id, action$, getState) =>
const createContextFlow = (id, session = {}, action$, getState) =>
Copy link
Member

Choose a reason for hiding this comment

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

Can you document this too, a little

web/client/localConfig.json Show resolved Hide resolved
@tdipisa
Copy link
Member

tdipisa commented Apr 21, 2020

@offtherailz

moreover, should we enable user session in mapstore by default? What do you think? I think this is valid for georchestra (and it should be set enabled by default also in pluginsConfig.json for that project), but for MapStore, maybe, it should be disabled by default. @tdipisa, what do you think?

Generally speaking if we have it, we can test it. If we have it, we can use it and better maintain it over time: if this functionlity stays disabled we are never able to identify regressions at this stage.
The important thing is that in MS we use a client side session storage (and not DB).

@mbarto
Copy link
Contributor Author

mbarto commented Apr 22, 2020

Generally speaking if we have it, we can test it. If we have it, we can use it and better maintain it over time: if this functionlity stays disabled we are never able to identify regressions at this stage.
The important thing is that in MS we use a client side session storage (and not DB).

I try to translate it in developer terms:
Generally speaking if we have it, we HAVE to test it. If we have it, we HAVE to use it and we have to MANTAIN it over time: if this functionlity stays disabled we are never able to identify regressions at this stage.

That said, no objections to have it enabled by default. Did you consider it also from the final user point of view? Does a user expect to see the last point of view when it reloads the map, instead of resetting to the standard view?

@mbarto
Copy link
Contributor Author

mbarto commented Apr 22, 2020

@offtherailz added the requested docs and pluginsConfig.json configuration for the UserSession plugin

@tdipisa
Copy link
Member

tdipisa commented Apr 22, 2020

@mbarto

That said, no objections to have it enabled by default. Did you consider it also from the final user point of view? Does a user expect to see the last point of view when it reloads the map, instead of resetting to the standard view?

I need this enabled by default in MS with a client side session storage to properly test it there too. It should be a matter of configuration, isn't it?

@mbarto
Copy link
Contributor Author

mbarto commented Apr 22, 2020

@tdipisa I checked, and configuration enables user sessions on localStorage by default

@offtherailz
Copy link
Member

I talked with @tdipisa :
Is it possible to test this only in a context (and related maps) without setting it up globally, so we can avoid to configure session on master ? What do you think about this proposal @mbarto ?

@mbarto
Copy link
Contributor Author

mbarto commented Apr 22, 2020

@offtherailz no, this configuration is not allowed at the moment: you mean to enable it only on one specific context or to enable it only for all the contexts?

@offtherailz
Copy link
Member

At the end we decided with @tdipisa and @mbarto to disable in MapStore, at least until the session cannot be disabled/enabled by the user.
It will be enabled in GeOrchestra

@offtherailz offtherailz merged commit 423044f into geosolutions-it:master Apr 29, 2020
@allyoucanmap allyoucanmap mentioned this pull request Aug 9, 2024
5 tasks
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.

4 participants