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

Warn te user when deleting multiple analysis #14222

Merged
merged 17 commits into from
Aug 7, 2018

Conversation

rubenmoya
Copy link
Contributor

@rubenmoya rubenmoya commented Aug 6, 2018

Related to: https://github.com/CartoDB/design/issues/1163

Description

This PR adds a warning when the user tries to delete an analysis node which is not the last one.

Image

screen shot 2018-08-07 at 10 20 47

Acceptance

With one analysis:

  • The delete button deletes the analysis

With multiple analysis:

  • When the analysis is the last one, the analysis is deleted
  • When the analysis is not the last one, a warning is shown:
    • Clicking on cancel removes the warning and doesn't delete the analysis
    • Clicking on delete deletes the analysis

Extra

This PR also implements the new infobox styles:

When a layer is hidden:
screen shot 2018-08-07 at 09 44 56

When a legend has custom HTML:
screen shot 2018-08-07 at 10 01 28

When a popup has custom HTML:
screen shot 2018-08-07 at 10 02 49

When custom CartoCSS is applied:
screen shot 2018-08-07 at 10 03 30

When the user is over limits:
screen shot 2018-08-07 at 10 23 22

@rubenmoya rubenmoya force-pushed the d1163-delete-multiple-analysis branch from 9221002 to 299cea4 Compare August 7, 2018 08:52
@@ -354,7 +353,9 @@ module.exports = CoreView.extend({

_onDeleteClicked: function () {
if (this._canDelete()) {
this._deleteAnalysis();
this._analysisFormsCollection.first() !== this._formModel
Copy link
Contributor

Choose a reason for hiding this comment

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

Without context, I'm not getting the exact meaning of this._analysisFormsCollection.first() !== this._formModel. Could we extract an explaining variable with that expression, so the delete / warning logic is clearer?

Copy link
Contributor

Choose a reason for hiding this comment

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

Everything LGTM, just asked for a little clarification above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, I moved it to its own function, basically, it checks if the selected analysis node is the last one (which is the first in the collection because it's reversed)

@ramiroaznar
Copy link

LGTM!

@rubenmoya rubenmoya merged commit 39327d3 into master Aug 7, 2018
@rubenmoya rubenmoya deleted the d1163-delete-multiple-analysis branch August 7, 2018 12: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.

3 participants