From 2d8ac4859e4433bf0d80995e1e41ba5726497c30 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2020 21:20:53 +0000 Subject: [PATCH 01/27] chore(package): update svg-url-loader to version 5.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2d9c561496..2087f6a1a5 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "sass-loader": "^8.0.0", "style-loader": "^1.1.2", "supports-color": "^3.1.2", - "svg-url-loader": "^4.0.0", + "svg-url-loader": "^5.0.0", "transifex": "^1.6.6", "uglifyjs-webpack-plugin": "^2.2.0", "url-loader": "^3.0.0", From 2d7119a9861265a298d19aa854ff1504fbbb2331 Mon Sep 17 00:00:00 2001 From: noone0212 Date: Thu, 19 Mar 2020 07:31:28 +0530 Subject: [PATCH 02/27] Search field cleared --- app/common/directives/filter-system/filter-searchbar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/directives/filter-system/filter-searchbar.html b/app/common/directives/filter-system/filter-searchbar.html index d97c0b55de..477564c75b 100644 --- a/app/common/directives/filter-system/filter-searchbar.html +++ b/app/common/directives/filter-system/filter-searchbar.html @@ -11,7 +11,7 @@ ng-model="model.q" ng-focus="showSearchResults()" ng-keyup="detectSubmit($event)" - ng-value="model.q" + ng-value="model.q=''" > From ea80e84b40496def8bdbf5718697127da04b5063 Mon Sep 17 00:00:00 2001 From: noone0212 Date: Sun, 22 Mar 2020 04:33:52 +0530 Subject: [PATCH 03/27] updated selected user count --- app/settings/users/users.controller.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/settings/users/users.controller.js b/app/settings/users/users.controller.js index daeb906a95..a74cf9d7f7 100644 --- a/app/settings/users/users.controller.js +++ b/app/settings/users/users.controller.js @@ -93,6 +93,7 @@ function ( $q.all(calls).then(function () { Notify.notify('notify.user.bulk_destroy_success'); $scope.getUsersForPagination(); + $scope.selectedUsers.length = 0; }, handleResponseErrors) .finally($scope.filterRole); }, function () {}); From c2bb127a68e87766212ec62edb10321d788a095f Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2020 11:46:55 +0000 Subject: [PATCH 04/27] chore(package): update html-webpack-plugin to version 4.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b50e11b85b..2d9afc0b42 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "gulp-rename": "^1.4.0", "gulp-tar": "^3.1.0", "html-loader": "^0.5.5", - "html-webpack-plugin": "^3.2.0", + "html-webpack-plugin": "^4.0.0", "imports-loader": "^0.8.0", "is-url": "^1.2.4", "jasmine-core": "^3.5.0", From 80b2459be66368a407a14cdb785ab9fd3d883981 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Tue, 24 Mar 2020 10:47:54 +0545 Subject: [PATCH 05/27] test: user profile & session update --- .../directives/user-profile-directive-spec.js | 45 +++++++++++++++++-- test/unit/mock/services/user.js | 3 +- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/test/unit/common/user-profile/directives/user-profile-directive-spec.js b/test/unit/common/user-profile/directives/user-profile-directive-spec.js index 31797073b5..e80d4640d3 100644 --- a/test/unit/common/user-profile/directives/user-profile-directive-spec.js +++ b/test/unit/common/user-profile/directives/user-profile-directive-spec.js @@ -44,14 +44,18 @@ describe('user profile directive', function () { }); describe('saveUser', function () { - describe('with a successfull backend call', function () { + describe('with a successful backend call', function () { beforeEach(function () { spyOn(UserEndpoint, 'update').and.callThrough(); + spyOn(Session, 'setSessionDataEntries').and.callThrough(); + spyOn(Notify, 'apiErrors') + spyOn(Notify, 'notify').and.callThrough(); }); describe('after changed values of user', function () { beforeEach(function () { isolateScope.user.realname = 'Changed name'; + isolateScope.user.email = 'changed@ushahidi.com'; }); describe('after calling saveUser', function () { @@ -60,8 +64,21 @@ describe('user profile directive', function () { }); it('should call "update" on the UserEndpoint with id=me and the changed user profile values', function () { - expect(UserEndpoint.update).toHaveBeenCalled(); + expect(UserEndpoint.update).toHaveBeenCalledWith( + {id: 'me'}, + jasmine.objectContaining({ + 'email': 'changed@ushahidi.com', + 'realname': 'Changed name' + } + ) + ); expect(isolateScope.user.realname).toBe('Changed name'); + expect(isolateScope.user.email).toBe('changed@ushahidi.com'); + expect(Notify.notify).toHaveBeenCalledWith('user_profile.update_success'); + expect(Notify.apiErrors).toHaveBeenCalledTimes(0) + expect(Session.setSessionDataEntries).toHaveBeenCalledWith( + {'email': 'changed@ushahidi.com', 'realname': 'Changed name'} + ); }); it('should set user to the new data', function () { @@ -69,10 +86,32 @@ describe('user profile directive', function () { }); }); }); + + describe('after changed the password of the user', function () { + beforeEach(function () { + isolateScope.user.password = 'changed'; + }); + + describe('after calling saveUser', function () { + beforeEach(function () { + isolateScope.saveUser(isolateScope.user); + }); + + it('should call "update" on the UserEndpoint with the changed password', function () { + expect(UserEndpoint.update).toHaveBeenCalledWith( + {id: 'me'}, + jasmine.objectContaining({ + 'password': 'changed' + } + ) + ); + expect(Notify.apiErrors).toHaveBeenCalledTimes(0) + }); + }); + }); }); describe('with an error on the backend call', function () { - var errorResponse = { status: 400, data: { diff --git a/test/unit/mock/services/user.js b/test/unit/mock/services/user.js index 043594270d..e865439c76 100644 --- a/test/unit/mock/services/user.js +++ b/test/unit/mock/services/user.js @@ -47,7 +47,8 @@ module.exports = [function () { successCallback({ realname: 'Changed name', id: 1, - someField: 'addedByServer' + someField: 'addedByServer', + email: 'changed@ushahidi.com' }); } else { failCallback({ From 9bd2fe48a3bac211f226c43f3322d52cfd8440de Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Tue, 24 Mar 2020 11:05:12 +0545 Subject: [PATCH 06/27] fix: loading correct amount of posts after deleting --- app/main/posts/views/post-view-data.directive.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main/posts/views/post-view-data.directive.js b/app/main/posts/views/post-view-data.directive.js index 91f1ec0558..4adce776cc 100644 --- a/app/main/posts/views/post-view-data.directive.js +++ b/app/main/posts/views/post-view-data.directive.js @@ -326,7 +326,7 @@ function PostViewDataController( limit: $scope.itemsPerPage }); if (useOffset === true) { - postQuery.offset = ($scope.currentPage - 1) * $scope.itemsPerPage; + postQuery.offset = $scope.posts.length; } PostEndpoint.query(postQuery).$promise.then(function (postsResponse) { //Clear posts From 619875fd4f117f9d963784ba5ce8238af216609d Mon Sep 17 00:00:00 2001 From: rohit645 Date: Tue, 24 Mar 2020 23:18:57 +0530 Subject: [PATCH 07/27] Removed share button from post creation page --- app/main/posts/modify/post-editor.html | 1 - 1 file changed, 1 deletion(-) diff --git a/app/main/posts/modify/post-editor.html b/app/main/posts/modify/post-editor.html index e34ac8e77a..49fbe656a9 100644 --- a/app/main/posts/modify/post-editor.html +++ b/app/main/posts/modify/post-editor.html @@ -35,7 +35,6 @@

{{post.form.name}}

- + +
`, texts.title, false, scope, false, false); + } + return deferred.promise; + } function confirmDelete(confirmText, confirmWarningText, translateValues) { var deferred = $q.defer(); @@ -227,7 +273,6 @@ function Notify(_, $q, $rootScope, $translate, SliderService, ModalService, Demo translateValues = confirmWarningText; confirmWarningText = false; } - $translate(confirmText, translateValues).then(show, show); function show(confirmText) { diff --git a/app/settings/surveys/surveys.controller.js b/app/settings/surveys/surveys.controller.js index 63ab14e9ba..fdbbcccb78 100644 --- a/app/settings/surveys/surveys.controller.js +++ b/app/settings/surveys/surveys.controller.js @@ -49,7 +49,7 @@ function ( }; $scope.deleteSurvey = function (survey) { - Notify.confirmDelete('notify.form.delete_form_confirm', 'notify.form.delete_form_confirm_desc').then(function () { + Notify.deleteWithInput('survey', survey.name).then(function () { // If we haven't saved the survey // just go back to the surveys views if (!survey.id) { From 6f718669725cd6f3a301fec98e0a6d71466c0572 Mon Sep 17 00:00:00 2001 From: Anna Date: Thu, 26 Mar 2020 10:00:30 +0100 Subject: [PATCH 09/27] adding test --- .../common/notifications/notify.service.spec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/unit/common/notifications/notify.service.spec.js b/test/unit/common/notifications/notify.service.spec.js index 79d657364d..ce1777a257 100644 --- a/test/unit/common/notifications/notify.service.spec.js +++ b/test/unit/common/notifications/notify.service.spec.js @@ -203,6 +203,21 @@ describe('Notify', function () { }); }); + describe('deleteWithInput', function () { + beforeEach(function () { + spyOn(mockModalService, 'openTemplate').and.callThrough(); + spyOn(mockSliderService, 'openTemplate').and.callThrough(); + }); + + it('Calls ModalService.openTemplate with error message', function () { + mockModalService.state = false; + Notify.deleteWithInput('survey', 'this is the name of the survey'); + $rootScope.$digest(); + expect(mockModalService.openTemplate).toHaveBeenCalled(); + }); + }); + + describe('limit', function () { beforeEach(function () { spyOn(mockSliderService, 'openTemplate').and.callThrough(); From 0075bf123a73042434ef28530fa6ad4fa9af343a Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Fri, 27 Mar 2020 12:11:46 +0545 Subject: [PATCH 10/27] fix: typo --- .../user-profile/directives/user-profile-directive-spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/common/user-profile/directives/user-profile-directive-spec.js b/test/unit/common/user-profile/directives/user-profile-directive-spec.js index 31797073b5..9fe48e7d7c 100644 --- a/test/unit/common/user-profile/directives/user-profile-directive-spec.js +++ b/test/unit/common/user-profile/directives/user-profile-directive-spec.js @@ -44,7 +44,7 @@ describe('user profile directive', function () { }); describe('saveUser', function () { - describe('with a successfull backend call', function () { + describe('with a successful backend call', function () { beforeEach(function () { spyOn(UserEndpoint, 'update').and.callThrough(); }); From b6820484c295339d3cf6a941fc00f8456b825e5a Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Fri, 27 Mar 2020 13:40:29 +0545 Subject: [PATCH 11/27] fix: csv column titles not shown in FF --- app/settings/data-import/data-import.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/settings/data-import/data-import.html b/app/settings/data-import/data-import.html index 9e99cc2f40..27fd6c61c5 100644 --- a/app/settings/data-import/data-import.html +++ b/app/settings/data-import/data-import.html @@ -150,7 +150,9 @@

Ushahidi recognizes one of three post statuses: Published, Under review, and Archived. So be sure that each entry in the column you select has one of those three values.

@@ -183,7 +185,9 @@

-

From 6ad82b4d5b97c7ced57bb0e5ed3000b7112ef6a2 Mon Sep 17 00:00:00 2001 From: Anna Date: Fri, 27 Mar 2020 11:31:42 +0100 Subject: [PATCH 12/27] tweaks to confirmation-notification --- app/common/locales/en.json | 4 ++-- app/common/notifications/notify.service.js | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/common/locales/en.json b/app/common/locales/en.json index b7ccf03520..92c7bc8e61 100644 --- a/app/common/locales/en.json +++ b/app/common/locales/en.json @@ -319,7 +319,7 @@ "delete" : { "desc" : "If you delete this survey, all of its posts will also be deleted. Proceed with caution.", "delete" : "Delete survey", - "delete_this" : "Delete this surve", + "delete_this" : "Delete this survey", "delete_this_field" : "Delete this field", "delete_field" : "Delete field", "desc_field" : "If you delete this field, all of the data that was collected within it will also be deleted. Proceed with caution." @@ -1523,7 +1523,7 @@ "save_attribute_success" : "Field {{name}} added", "edit_form_success" : "Survey {{name}} updated", "edit_stage_success" : "Survey task {{name}} updated", - "delete_form_confirm" : "Are you sure you want to delete this survey and all its posts?", + "delete_form_confirm" : "Are you sure you want to delete this survey and all of its data?", "delete_form_confirm_desc" : "This action cannot be undone. Deleting this survey will remove all of its data, including posts. Write the name of the survey:

{{check_name}}

in the box below to confirm deletion.", "delete_form_error": "The text you entered does not match the survey-name, please try again", "delete_form_button": "Delete this survey", diff --git a/app/common/notifications/notify.service.js b/app/common/notifications/notify.service.js index a86655cf66..56b0f6aff3 100644 --- a/app/common/notifications/notify.service.js +++ b/app/common/notifications/notify.service.js @@ -221,7 +221,7 @@ function Notify(_, $q, $rootScope, $translate, SliderService, ModalService, Demo function deleteWithInput (type, checkName) { var scope = getScope(); var deferred = $q.defer(); - scope.noequal = false; + scope.isEqual = true; const modalText = { survey: { @@ -237,14 +237,11 @@ function Notify(_, $q, $rootScope, $translate, SliderService, ModalService, Demo $translate(texts.modalBody, {check_name: checkName}).then(show, show); function show(body) { - scope.confirm = function (name) { - if (name === checkName) { - scope.noequal = false; + scope.isEqual = name === checkName; + if (scope.isEqual) { deferred.resolve(); ModalService.close(); - } else { - scope.noequal = true; } }; @@ -256,7 +253,7 @@ function Notify(_, $q, $rootScope, $translate, SliderService, ModalService, Demo ModalService.openTemplate( `

${body}

-

${texts.errorLabel}

+

${texts.errorLabel}

From ae973426ffe6a087ea73f7887fe5b0210054ede8 Mon Sep 17 00:00:00 2001 From: noone0212 Date: Tue, 31 Mar 2020 13:39:00 +0530 Subject: [PATCH 13/27] cleaning secondary toolbar --- app/main/posts/views/add-post-button.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main/posts/views/add-post-button.html b/app/main/posts/views/add-post-button.html index 9dd628a496..f5c429e6b3 100644 --- a/app/main/posts/views/add-post-button.html +++ b/app/main/posts/views/add-post-button.html @@ -1,5 +1,5 @@
-