Chromium Code Reviews (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out

Side by Side Diff: appengine/monorail/features/

Issue 1868553004: Open Source Monorail (Closed) Base URL:
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is govered by a BSD-style
3 # license that can be found in the LICENSE file or at
4 #
6 """Simple servlet to store the fact that a user has dismissed a cue card.
8 Cue cards are small on-page help items that appear when the user has
9 done a certain action or is viewing a project that is in a certain
10 state. The cue card give the user a suggestion of what he/she should
11 do next. Cue cards can be dismissed to reduce visual clutter on the
12 page once the user has learned the content of the suggestion. That
13 preference is recorded in the User PB, and the same cue card will not
14 be presented again to the same user.
16 Exmple: The logged in user has dismissed the cue card that tells him/her how
17 to search for numbers in the issue tracker:
19 POST /hosting/
20 cue_id=search_for_numbers&token=12344354534
21 """
24 import logging
26 from framework import jsonfeed
27 from framework import monorailrequest
30 class SetCuesFeed(jsonfeed.JsonFeed):
31 """A class to process an AJAX request to dismiss a cue card."""
33 def HandleRequest(self, mr):
34 """Processes a user's POST request to dismiss a cue card.
36 Args:
37 mr: commonly used info parsed from the request.
38 """
40 cue_id = mr.GetParam('cue_id')
41 if not cue_id:
42 raise monorailrequest.InputException('no cue_id specified')
44'Handling user set cue request: %r', cue_id)
45 new_dismissed_cues = mr.auth.user_pb.dismissed_cues
46 new_dismissed_cues.append(cue_id)
48 mr.cnxn, mr.auth.user_id, mr.auth.user_pb,
49 dismissed_cues=new_dismissed_cues)
« no previous file with comments | « appengine/monorail/features/ ('k') | appengine/monorail/features/ » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698