Skip to content
Snippets Groups Projects
Commit 7eff4dff authored by Allen Gilliland's avatar Allen Gilliland
Browse files

when the user dismisses the QB newb modal, persist that so they don't see it again.

parent 6ce7aa65
No related branches found
No related tags found
No related merge requests found
......@@ -44,8 +44,8 @@ CardControllers.controller('CardList', ['$scope', '$location', function($scope,
}]);
CardControllers.controller('CardDetail', [
'$rootScope', '$scope', '$route', '$routeParams', '$location', '$q', '$window', '$timeout', 'Card', 'Dashboard', 'Metabase', 'Revision',
function($rootScope, $scope, $route, $routeParams, $location, $q, $window, $timeout, Card, Dashboard, Metabase, Revision) {
'$rootScope', '$scope', '$route', '$routeParams', '$location', '$q', '$window', '$timeout', 'Card', 'Dashboard', 'Metabase', 'Revision', 'User',
function($rootScope, $scope, $route, $routeParams, $location, $q, $window, $timeout, Card, Dashboard, Metabase, Revision, User) {
// promise helper
$q.resolve = function(object) {
var deferred = $q.defer();
......@@ -380,6 +380,10 @@ CardControllers.controller('CardDetail', [
onClose: () => {
isShowingNewbModal = false;
renderAll();
// persist the fact that this user has seen the NewbModal
$scope.user.is_qbnewb = false;
User.update_qbnewb({id: $scope.user.id});
}
}
......@@ -844,7 +848,6 @@ CardControllers.controller('CardDetail', [
}
function reloadCard() {
delete $routeParams.serializedCard;
$location.hash(null);
loadAndSetCard();
}
......
......@@ -2,12 +2,8 @@ import React, { Component, PropTypes } from "react";
import Modal from "metabase/components/Modal.jsx";
export default class SavedQuestionIntroModal extends Component {
static defaultProps = {
buttons: [],
className: ""
};
export default class SavedQuestionIntroModal extends Component {
render() {
return (
......@@ -20,7 +16,7 @@ export default class SavedQuestionIntroModal extends Component {
</div>
<div className="Form-actions flex justify-center py1">
<button className="Button Button--primary" onClick={() => this.props.onClose()}>Okay</button>
<button data-metabase-event={"QueryBuilder;IntroModal"} className="Button Button--primary" onClick={() => this.props.onClose()}>Okay</button>
</div>
</div>
</Modal>
......
......@@ -831,6 +831,13 @@ CoreServices.factory('User', ['$resource', '$cookies', function($resource, $cook
'userId': '@id'
}
},
update_qbnewb: {
url: '/api/user/:userId/qbnewb',
method: 'PUT',
params: {
'userId': '@id'
}
},
delete: {
method: 'DELETE',
params: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment