Skip to content

Commit

Permalink
Backport changes made after creating this pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr committed Nov 20, 2016
1 parent e5e6d21 commit 804c1ad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions frontend/app/pages/dashboards/add-widget-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const AddWidgetDialog = {
widget.$save().then((response) => {
// update dashboard layout
this.dashboard.layout = response.layout;
this.dashboard.version = response.version;
const newWidget = new Widget(response.widget);
if (response.new_row) {
this.dashboard.widgets.push([newWidget]);
Expand Down
1 change: 1 addition & 0 deletions frontend/app/pages/dashboards/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function DashboardWidgetCtrl($location, $uibModal, $window, Events, currentUser)
this.dashboard.widgets = this.dashboard.widgets.filter(row => row.length > 0);

this.dashboard.layout = response.layout;
this.dashboard.version = response.version;
});
};

Expand Down
2 changes: 1 addition & 1 deletion frontend/app/pages/queries/query-results-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function queryResultLink() {
if (scope.queryResult.getId() == null) {
element.attr('href', '');
} else {
element.attr('href', `api/queries/${scope.query.id}/results/${scope.queryResult.getId()}.${fileType}`);
element.attr('href', `api/queries/${scope.query.id}/results/${scope.queryResult.getId()}.${fileType}${scope.embed ? `?api_key=${scope.apiKey}` : ''}`);
element.attr('download', `${scope.query.name.replace(' ', '_') + moment(scope.queryResult.getUpdatedAt()).format('_YYYY_MM_DD')}.${fileType}`);
}
});
Expand Down
7 changes: 4 additions & 3 deletions frontend/app/pages/users/show.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { each } from 'underscore';
import template from './show.html';

function UserCtrl($scope, $routeParams, $http, $location, toastr, currentUser, Events, User) {
function UserCtrl($scope, $routeParams, $http, $location, toastr, clientConfig, currentUser, Events, User) {
// $scope.$parent.pageTitle = 'Users';

$scope.userId = $routeParams.userId;
$scope.currentUser = currentUser;
$scope.clientConfig = clientConfig;

if ($scope.userId === 'me') {
$scope.userId = currentUser.id;
Expand Down Expand Up @@ -100,9 +101,9 @@ function UserCtrl($scope, $routeParams, $http, $location, toastr, currentUser, E

$scope.sendPasswordReset = () => {
$scope.disablePasswordResetButton = true;
$http.post(`api/users/${$scope.user.id}/reset_password`).success(() => {
$http.post(`api/users/${$scope.user.id}/reset_password`).success((data) => {
$scope.disablePasswordResetButton = false;
toastr.success('The user should receive a link to reset his password by email soon.');
$scope.passwordResetLink = data.reset_link;
});
};
}
Expand Down

0 comments on commit 804c1ad

Please sign in to comment.