diff --git a/Changelog.md b/Changelog.md index 52273dd05..aa7fbe850 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,7 @@ ## Features * Change email without confirmation when mail is disabled [#7455](https://github.com/diaspora/diaspora/pull/7455) +* Warn users if they leave the profile editing page with unsaved changes [#7473](https://github.com/diaspora/diaspora/pull/7473) # 0.6.6.0 diff --git a/Gemfile b/Gemfile index 2dbce35e2..a8e4f3e5b 100644 --- a/Gemfile +++ b/Gemfile @@ -112,6 +112,7 @@ source "https://rails-assets.org" do gem "rails-assets-autosize", "3.0.20" gem "rails-assets-blueimp-gallery", "2.25.0" + gem "rails-assets-jquery.are-you-sure", "1.9.0" gem "rails-assets-jquery-placeholder", "2.3.1" gem "rails-assets-jquery-textchange", "0.2.3" gem "rails-assets-perfect-scrollbar", "0.6.16" diff --git a/Gemfile.lock b/Gemfile.lock index 499e6582c..2012458cb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -529,6 +529,8 @@ GEM rails-assets-jquery (>= 1.6) rails-assets-jquery-textchange (0.2.3) rails-assets-jquery + rails-assets-jquery.are-you-sure (1.9.0) + rails-assets-jquery (>= 1.4.2) rails-assets-jquery.slimscroll (1.3.8) rails-assets-jquery.ui (1.11.4) rails-assets-jquery (>= 1.6) @@ -847,6 +849,7 @@ DEPENDENCIES rails-assets-jquery (= 2.2.4)! rails-assets-jquery-placeholder (= 2.3.1)! rails-assets-jquery-textchange (= 0.2.3)! + rails-assets-jquery.are-you-sure (= 1.9.0)! rails-assets-markdown-it (= 8.3.0)! rails-assets-markdown-it--markdown-it-for-inline (= 0.1.1)! rails-assets-markdown-it-diaspora-mention (= 1.1.1)! diff --git a/app/assets/javascripts/app/pages/settings.js b/app/assets/javascripts/app/pages/settings.js index 3bbfaeb6a..d34226016 100644 --- a/app/assets/javascripts/app/pages/settings.js +++ b/app/assets/javascripts/app/pages/settings.js @@ -14,6 +14,7 @@ app.pages.Settings = Backbone.View.extend({ el: $(".aspect_dropdown"), form: $("#post-default-aspects") }); + $("#update_profile_form").areYouSure(); } }); // @license-end diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index c754c5686..dccddf014 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -41,5 +41,6 @@ //= require blueimp-gallery/blueimp-gallery-indicator //= require leaflet //= require api/authorization_page -// = require bootstrap-markdown/bootstrap-markdown -// = require helpers/markdown_editor +//= require bootstrap-markdown/bootstrap-markdown +//= require helpers/markdown_editor +//= require jquery.are-you-sure diff --git a/features/desktop/edits_profile.feature b/features/desktop/edits_profile.feature index 8eeb5bb9d..bf68ed972 100644 --- a/features/desktop/edits_profile.feature +++ b/features/desktop/edits_profile.feature @@ -33,6 +33,10 @@ Feature: editing your profile And I should see "#starwars" within "ul#as-selections-tags" And the "#profile_public_details" bootstrap-switch should be off + When I fill in "profile_bio" with "This is a new awesome bio" + And I reject the alert after I follow "My activity" + Then I should be on my edit profile page + When I fill in "profile[tag_string]" with "#kamino" And I press the first ".as-result-item" within ".as-results" And I toggle the "#profile_public_details" bootstrap-switch