Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* #66 initial article commit * #66: Refactor article page, fetch article metadata Moved Article.vue, separated out into article.js to match file structure of other pages. Progressed on Semantic Scholar API logic. * #66: Refactor article.js * #66: Refactor Article.vue * #66: Add route for Article View Added route to explorer for the article view. Moved DOI from component prop to a watcher and computed property pair. * #66: Refactor article.js to move logic to services Moved article metadata retrieval logic to services. Unified all metadata under one object for simpler reference. * #66: First pass at article HTML view First attempt at displaying all article metadata. Also added pre-push linting fixes. * #66: Add loading state awareness * #66: Add article venue to retrieved fields * #66: Second pass at article view HTML Added basic loading indicator, refactored table to have better structure (I think) * #66: Basic CSS for article view * #66: Removed erroneous comment * #66: Fix scrolling bug Scrolling tables also scrolled their titles, but not their header rows. Isolated tables in their own div, maybe tables should be their own component... * #66: Unify dir structure, nest article page Move explorer/article/services to modules/explorer/article/services, clean up article now that it's nested properly (barring further change to nest completely under sample). Refactor extra function from fetchJSON into getArticleMetadata. * #66: initial Article.vue testing commit Includes mock for Semantic Scholar API calls and article.js whitespace linting fix. * #66: Refactored getArticleMetadata for easier mock Mocking getArticleMetadata easily required moving it into an enclosing object so that the manual mock could do the same, allowing it to access properties. The manual mock was written following along with [jest's manual mock](https://jestjs.io/docs/manual-mocks). The mock of the resulting getArticle also provides a stub of the SemanticScholar API response as of 2/2/22, for reference and testing. * #66: Write tests for Article.vue Wrote tests of DOI loading, reloading; article data loading; API failure. Added classes to article.html items to distinguish them and allow the tests to refer to them. Updated article.js to use the new articleMetadata.js and fixed bugs that appeared in testing. * #66: Fix linting errors * #66: Write tests for module articleMetadata.js Updated articleMetadata mock to include raw and cleaned mock data, and wrote tests of the fetch handler and response cleaning routines. Fixed issues in articleMetadata.js that came up in testing. * #66: Refactored articleMetadata.js to better track API errors Refactored .get function to remove repeated code and allow API calls to occur in parallel. Rewrote how internal fetch returns in order to pass errors (and success codes) in API call along to caller. Updated mock data to include mock version of success codes * #66: Updated tests to match Also added missing response codes to mock data, and fixed citation and reference call status not being passed through * #66: Updated Article.vue to display errors Article view now takes advantage of newly passed API errors to inform the user that an error has occurred. This could be expanded on * #66: Linting fixes * #66: Update test to use createWrapper Replaced localVue, shallowMount with createWrapper for consistency. Added test to ensure error message is displayed to user. * #66: Write comments, refactor error storage * #66: Write jsdoc-style function comments Documented functions, removed unused mock response function, and refactored testing slightly to remove repetition. * #66: Move article to its own route * #25: Remove console.logs, add reusable spinner
- Loading branch information