Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

RSS configuration and a simple admin panel #96

Merged
merged 28 commits into from
Mar 14, 2018
Merged

RSS configuration and a simple admin panel #96

merged 28 commits into from
Mar 14, 2018

Commits on Dec 31, 2017

  1. Serve the podcast RSS feed from Shortcut server

    This enables us to get around any CORS issues with the podcast RSS feed.
    We just re-serve it from our server with CORS already enabled.
    
    By parsing the RSS serverside and serving it up as plain json, we
    no longer have to include a costly XML parsing step on the client. #80
    dariusk committed Dec 31, 2017
    Configuration menu
    Copy the full SHA
    2f81e7a View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2018

  1. Server and client can use RSS feed as data source

    There is now the option to point shortcut's client and server to an RSS
    feed URL instead of maintaining an `episodes.json` file with manual
    metadata. The admin sets the `useRSS` option in
    client/src/config/default.js to `true` and provides a feed URL in the
    server's .env file `RSS_FEED`.
    
    At every point in the code where `episodes.json` might be accessed for
    metadata about all episodes, the code now branches if RSS is enabled and
    instead parses the RSS feed.
    
    This closes #82.
    dariusk committed Jan 18, 2018
    Configuration menu
    Copy the full SHA
    7bf104e View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2018

  1. Admin panel

    There is now an admin panel that can be reached at the `/#/admin` route.
    The panel shows a list of episodes that Shortcut knows about, as well as
    their state as enabled or disabled (disabled by default). This state is
    stored in `server/adminData.json` on the server.
    
    This closes #81, because we no longer need a specific user-defined GUID
    to say "episode 3098281ABD23 is enabled" -- now we use the `guid` tag
    defined in the rss spec.
    dariusk committed Jan 30, 2018
    Configuration menu
    Copy the full SHA
    86d2f8f View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2018

  1. Configuration menu
    Copy the full SHA
    a7560d1 View commit details
    Browse the repository at this point in the history
  2. Add upstream repository to server/package.json

    Fixes the following warning reported:
    
      npm WARN [email protected] No repository field.
    Echelon9 authored and dariusk committed Feb 12, 2018
    Configuration menu
    Copy the full SHA
    5cf456f View commit details
    Browse the repository at this point in the history
  3. Remove stray Yeoman generator config file

    Whilst Yeoman may have been used during initial, one-off generation of
    the project it is unlikelt to be re-run. Remove the configuration file
    from upstream repository.
    
    Unlikely to be run again as: (1) yeoman itself isn't a dependency of this
    project, and (2) low likelihood of re-running a project generator after
    v1.0.0 has been released without a major refactor.
    Echelon9 authored and dariusk committed Feb 12, 2018
    Configuration menu
    Copy the full SHA
    ea4b8ce View commit details
    Browse the repository at this point in the history
  4. client: Update client project name to abstract away from tal

    Use new abstracted name in client/ documentation.
    Echelon9 authored and dariusk committed Feb 12, 2018
    Configuration menu
    Copy the full SHA
    5a8c678 View commit details
    Browse the repository at this point in the history
  5. server: Update server project name to abstract away from tal

    Update documentation and example commands in server/ to reflect
    new project name.
    Echelon9 authored and dariusk committed Feb 12, 2018
    Configuration menu
    Copy the full SHA
    d377be7 View commit details
    Browse the repository at this point in the history
  6. Add nodemon to shortcut-server devDependencies

    Documentation and package.json provide guidance to using nodemon to ease
    the development process. However, it was missing from devDependencies in
    server/package.json and a manual install instruction in server/README.md
    
    As npm has functionality to reflect dependencies that should not be run in
    --production (or when the NODE_ENV environment variable is set to production)
    then let's utilize that.
    
    This reduces the number of manual commands that must be run to setup the
    recommended shortcut development environment.
    Echelon9 authored and dariusk committed Feb 12, 2018
    Configuration menu
    Copy the full SHA
    248ced6 View commit details
    Browse the repository at this point in the history
  7. Improve test coverage by enabling ClippingContainerComponent test

    Rename the existing test to *Test.js, so that shortcut-client's test runner automatically
    finds the existing test for ClippingContainerComponent.
    
    This improves code coverage as measured by lines to 25.57% (from 23.56%). See below:
    
     BEFORE
     --------------------------------|----------|----------|----------|----------|----------------|
     File                            |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
     --------------------------------|----------|----------|----------|----------|----------------|
     ...
      src/components/                |    45.99 |    34.85 |    65.77 |    27.17 |                |
       ClippingContainerComponent.js |    45.96 |    25.62 |    74.19 |    22.43 |... 441,442,444 |
     ...
     --------------------------------|----------|----------|----------|----------|----------------|
     All files                       |    42.71 |    35.54 |    62.18 |    23.56 |                |
     --------------------------------|----------|----------|----------|----------|----------------|
    
     AFTER
     --------------------------------|----------|----------|----------|----------|----------------|
     File                            |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
     --------------------------------|----------|----------|----------|----------|----------------|
     ...
      src/components/                |       48 |    37.02 |    66.15 |    29.78 |                |
       ClippingContainerComponent.js |    63.35 |    41.32 |    77.42 |    45.79 |... 441,442,444 |
     ...
     --------------------------------|----------|----------|----------|----------|----------------|
     All files                       |    44.25 |    37.16 |    62.95 |    25.57 |                |
     --------------------------------|----------|----------|----------|----------|----------------|
    Echelon9 authored and dariusk committed Feb 12, 2018
    Configuration menu
    Copy the full SHA
    3bc0a34 View commit details
    Browse the repository at this point in the history
  8. client: Add missing peer dependency flexboxgrid

    Without this peer dependency of [email protected], the following error
    message is reported when running `npm install`:
    
      [email protected] /home/rhyskidd/Coding/shortcut/client
      └── UNMET PEER DEPENDENCY flexboxgrid@^6.3.0
    
      npm WARN [email protected] requires a peer of flexboxgrid@^6.3.0 but none was installed.
    
    Reported with:
      $ npm --version
      3.5.2
      $ nodejs --version
      v6.11.4
    
    For more on peer dependencies, see: https://stackoverflow.com/a/22004559/4206728
    Echelon9 authored and dariusk committed Feb 12, 2018
    Configuration menu
    Copy the full SHA
    b9b4920 View commit details
    Browse the repository at this point in the history
  9. Additional error state on RSS endpoint

    If no RSS_FEED is specified on the server, the `rss/` endpoint
    immediately returns a 404 instead of attempting a GET request. Relevant
    to #95.
    dariusk committed Feb 12, 2018
    Configuration menu
    Copy the full SHA
    7c5dbef View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2018

  1. Server uses single global cache object

    Fixes a bug where two cache objects were created; we now create a single
    cache object on server init, and then pass it into
    `routes/all-episode-data.js`.
    
    Forcing the entire cache to update every time, since this is only ever
    called during occasional admin-only tasks. (all `cache.save()` calls
    are now passed `true`);
    
    Also updates the Admin panel to grab the full list of episodes
    completely unfiltered from the server (via a call to
    `/recent?filter=0`). Before this commit, disabling an episode from
    appearing on the front page would also disable it from appearing in the
    admin panel! (The unfiltered endpoint doesn't need to be secure since
    it's pulling from the canonical rss anyway.)
    dariusk committed Feb 14, 2018
    Configuration menu
    Copy the full SHA
    1663421 View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2018

  1. Configuration menu
    Copy the full SHA
    60be559 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    adff6cf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7ed397e View commit details
    Browse the repository at this point in the history
  4. Make admin panel compatible with episodes.json

    This commit makes the admin panel control what appears on the front page
    even if Shortcut is set up to use `episodes.json` as its metadata source
    instead of RSS.
    dariusk committed Feb 15, 2018
    Configuration menu
    Copy the full SHA
    a1a8f2d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e8fe92b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0fddb27 View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2018

  1. Small changes based on @therewasaguy's feedback

    * Explicitly declare Node.js compatibility in the package.json
    * Replace a console.log with a thrown Error object
    * Safety-check the parent object of a subobject before testing if the
    subobject exists
    
    From @therewasaguy's PR feedback.
    dariusk committed Mar 13, 2018
    Configuration menu
    Copy the full SHA
    67ddd35 View commit details
    Browse the repository at this point in the history
  2. Remove infinite scroll on landing page

    Infinite scroll is overengineering for this particular UX element. Even
    the weakest smartphones can render ~1000 plaintext divs no problem, and
    while getting all the way down to the bottom might be a problem, as long
    as we don't provide a search feature (which is forthcoming) at least
    rendering all the episodes on one landing page lets a user ctrl+F or
    "find in page" on mobile to find the particular episode they are looking
    for. Even pagination (the usual alternative to infinite scroll) would
    make this impossible.
    dariusk committed Mar 13, 2018
    Configuration menu
    Copy the full SHA
    caf94c9 View commit details
    Browse the repository at this point in the history
  3. Do not render Admin panel unless authenticated

    This commit makes it so we render a blank page on the Admin page until
    the user successfully authenticates. Previously we rendered an empty
    Admin panel but probably best to obfuscate all Admin functions prior
    rendering instead of giving an empty placeholder admin panel.
    
    (Per @therewasaguy's suggestion)
    dariusk committed Mar 13, 2018
    Configuration menu
    Copy the full SHA
    7ee4cb4 View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2018

  1. Remove confusing note

    dariusk committed Mar 14, 2018
    Configuration menu
    Copy the full SHA
    fbdaa59 View commit details
    Browse the repository at this point in the history
  2. Removing the '/rss' endpoint

    Per @therewasaguy's
    [review](#96 (comment))
    the '/rss' and '/recent' endpoints return the same thing if you're set
    to RSS mode. So no reason to have a dedicated '/rss' endpoint, and also
    no more need for a `useRSS` configuration variable on the client.
    
    The client just asks the server for recent episodes, and the server
    knows if it needs to retrieve those from the RSS feed or from the JSON
    file.
    dariusk committed Mar 14, 2018
    Configuration menu
    Copy the full SHA
    d80755b View commit details
    Browse the repository at this point in the history
  3. Cleaning up warnings

    Cleaned up some jshint warnings and updated moment which was throwing a
    bad warning.
    dariusk committed Mar 14, 2018
    Configuration menu
    Copy the full SHA
    7c1bc26 View commit details
    Browse the repository at this point in the history
  4. Remove some old logic/comments

    The all-episode-data route used to have some gnarly logic built in but I
    removed that a while back. However, some confusing comments stayed in,
    and also some application logic that we didn't need was in there too.
    This commit removes those.
    dariusk committed Mar 14, 2018
    Configuration menu
    Copy the full SHA
    615dcd1 View commit details
    Browse the repository at this point in the history
  5. Admin will always update episode cache

    Accessing the admin panel will update the cache locally. It's just a
    GET request to the RSS feed (in the case of RSS), which we wouldn't want
    a normal user to intialize but is fine if an admin does it. The server
    endpoint is behind an auth gate so only an admin will ever kick it off.
    dariusk committed Mar 14, 2018
    Configuration menu
    Copy the full SHA
    e62cbc6 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8fecf48 View commit details
    Browse the repository at this point in the history