1. 13 Oct, 2015 4 commits
    • Robert Knight's avatar
    • Robert Knight's avatar
      Avoid redundant view reloads on startup and simplify group focus change handling · 0d0e47ea
      Robert Knight authored
       * Remove the logic from app-controller.coffee to focus the Public group
         on logout. This is no longer needed as the 'groups' service automatically
         updates the focused group if the previously focused group is removed.
      
       * Only emit the SESSION_CHANGED event on updates to the session state,
         not the initial app load, since initialization of the view is deferred
         until the session has already been loaded.
      
         Since the SESSION_CHANGED handler currently reloads the whole view,
         this avoids reloading the view twice on startup.
      
         Refactoring handling of SESSION_CHANGED to only update the relevant
         app state is left for a future refactoring.
      
      T-105
      0d0e47ea
    • Robert Knight's avatar
      Address CR feedback · 2660ef5d
      Robert Knight authored
       * Sort injected parameter names alphabetically for Angular
         services
      
       * Use imperative names for group events published on the 'user'
         NSQ topic
      
       * Avoid unnecessary dance with functools.partial() in streamer.py
         to pass the reader's topic to the message handler
      2660ef5d
    • Robert Knight's avatar
      Implement push notifications for when a user joins or leaves a group · 0690b1ac
      Robert Knight authored
      This adds a new class of push notification, 'session-change'
      which is broadcast to logged-in clients when changes to the user's
      state, including the list of groups that they are a member of,
      changes.
      
      When the user creates or joins a group, a notification is
      added to the event queue with an associated user ID
      which is then broadcast via the web socket.
      
      On the client side, the streamer service listens for the new
      class of notification and triggers an update of the session
      state in response.
      
      When the user leaves a group, this may trigger an implicit change
      of focus if the user was a member of the group.
      
      T-105
      0690b1ac
  2. 12 Oct, 2015 3 commits
  3. 09 Oct, 2015 9 commits
  4. 08 Oct, 2015 5 commits
  5. 07 Oct, 2015 5 commits
    • Robert Knight's avatar
      Implement the UI for leaving a group · 15b2422a
      Robert Knight authored
      Add a new cancel/leave icon next to private groups
      in the groups list and invoke groups.leave() when clicked.
      
      Leaving a group invokes the as-yet-unimplemented
      'POST /groups/<id>/leave' endpoint on the server.
      
      T-88
      15b2422a
    • Nick Stenning's avatar
      Merge pull request #2596 from robertknight/icon_font_fix_2 · 053ec08a
      Nick Stenning authored
      Inline the H icon font
      053ec08a
    • Robert Knight's avatar
      Merge pull request #2594 from hypothesis/fix-groups-race · f0312ef8
      Robert Knight authored
      Fix race for session data on startup
      f0312ef8
    • Robert Knight's avatar
      Inline the H icon font · c3960b8e
      Robert Knight authored
      The previous fix to use an absolute URL to the icon
      font did not work in the Chrome extension because
      the base path for assets was different.
      
      The proper solution here will involve refactoring
      the CSS build pipeline and possibly automatically
      inlining font URLs in the process. I did not just
      add a preprocessor to inline all URLs because
      that would also have affected fonts in katex.min.css
      and added significantly to the size of the CSS bundle.
      
      This commit reverts back to the previous solution of
      inlining just the icon font.
      
      See #2571
      c3960b8e
    • Nick Stenning's avatar
      Fix race for session data on startup · 804def7d
      Nick Stenning authored
      Several parts of the application require access to the session data
      fetched from the server when rendering. On first page load we don't have
      this data (something we can fix in the future by inlining the data with
      the viewer HTML) and this resulted in a race between the session data
      load triggered by `checkAuthentication` (in config/identity.js) and the
      query sent to the server by `WidgetController`, which needs to know the
      current focused group id.
      
      Fix this by ensuring that the first load of session data is complete
      before switching views -- achieved by adding an item to the list of
      dependencies passed to `$routeProvider`.
      
      This works, but results in multiple requests for session data in quick
      succession, because `checkAuthentication` runs while the view is
      loading. To resolve this problem, we add a straightforward TTL check to
      the `session.load()` method, and only make a new request if the data is
      more than 5m old.
      
      Session data will be overwritten as normal whenever session mutating
      methods (`session.login()`, `session.logout()`) etc. are called.
      
      Fixes #2590.
      804def7d
  6. 06 Oct, 2015 5 commits
  7. 05 Oct, 2015 1 commit
    • Robert Knight's avatar
      Implement new designs for pages for creating, joining and sharing groups · 7d14d217
      Robert Knight authored
       * Implement new look for the Create, Join and Share groups pages.
         The forms are functional without JS but contain a small amount
         of JS logic for enhancements such as selecting the content of
         the share pane.
      
       * Merge the 'Login to join' and 'Join' pages into a single
         form. The only difference between the two is that
         when the user is not signed in, the button label
         changes from 'Join <Group Name>' to 'Sign in to join <Group Name>'
         which redirects to the login page.
      
       * Create a new site.scss file which is intended to
         contain only styling for the website and a site-bundle.js
         bundle which contains JS code used only for the site.
      
       * Extract out the button styles used by <dropdown-menu-btn> into
         a separate .scss file for re-use
      
       * Add additional colors used by the new group forms
         to variables.scss. To avoid the problems
         with naming that arise when trying to insert additional
         colors into a list with names like 'light', 'lighter' etc.
         I'm starting to use http://chir.ag/projects/name-that-color for
         memorable names.
      
       * Start to use a '$color-' prefix for colors, in preparation
         for extracting colors into their own file.
      
      Card 93
      7d14d217
  8. 02 Oct, 2015 8 commits