diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..0d8a100 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,29 @@ +module.exports = { + env: { + browser: true, + es2020: true, + node: true, + }, + extends: [ + "eslint:recommended", + "plugin:react/recommended", + "plugin:@typescript-eslint/recommended", + ], + parser: "@typescript-eslint/parser", + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + ecmaVersion: 11, + sourceType: "module", + }, + plugins: ["react", "@typescript-eslint"], + rules: { + "no-async-promise-executor": 1, + }, + settings: { + react: { + version: "detect", + }, + }, +}; diff --git a/CHANGELOG.md b/CHANGELOG.md index f31ec5d..498d1e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,32 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.0] - 2020-07-19 + +### πŸš€ Initial Release + +### Added + +- `prettier` +- `eslint` +- Stubs for `optionsPanel.spec.js` +- Stubs for `search.spec.js` +- Test for `
` + +### Changed + +- `` color better reflects theme +- The `
` is now clickable, and will send you to the Search page +- `` won't display alert if image is missing + +### Removed + +### Fixed + +- ESLint Errors +- Text in "How To Apply" section spilling over the container if a long url was present +- Clicking "Full Time" actually does filter by "Full Time" positions now. GitHub Jobs API for `full_time` does not work. + ## [0.26.0] - 2020-07-17 ### πŸ”§ Tweaks that Make Em Squeaks diff --git a/README.md b/README.md index 7a04e02..3eb461a 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,27 @@ ## πŸ“ Table of Contents +- [About](#about) - [Built Using](#built_using) - [Authors](#authors) +## πŸ“ About + +This application was originally created as a submission to a [DevChallenges](https://devchallenges.io/challenges) challenge. The [challenge](https://devchallenges.io/challenges/TtUjDt19eIHxNQ4n5jps) was to build an application to complete the following prompt + +> Challenge: Create a job search using an API. Use Front-end libraries like React or Vue. Don’t look at the existing solution. Fulfill user stories below: + +- [x] User story: I can see a list of jobs in a city by default +- [x] User story: I can search for jobs with a given keyword +- [x] User story: I can search for jobs with a city name, zip code or other location +- [x] User story: I can select one option from at least 4 pre-defined options +- [x] User story: I can search for a full-time job only +- [x] User story: I can see a list of jobs with their logo, company name, location, and posted time. +- [x] User story: When I select a job, I can see job descriptions and how to apply like the given design. +- [x] User story: When I am on the job details page, I can go back to the search page +- [x] User story (optional): I can see a list of jobs in the closest city from my location by default +- [x] User story (optional): I can see jobs in different pages, 5 items each page + ## ⛏️ Built Using ### Dependencies @@ -42,7 +60,10 @@ - [css-loader](https://github.com/webpack-contrib/css-loader) - CSS Loader. - [cypress](https://www.cypress.io/) - Fast, easy and reliable testing for anything that runs in a browser. - [env-cmd](https://github.com/toddbluhm/env-cmd) - Setting the environment from a file. +- [eslint](https://eslint.org/) - Find and fix problems in your JavaScript code. +- [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) - React specific linting rules for ESLint. - [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) - Simplifies creation of HTML files to serve your webpack bundles. +- [prettier](https://prettier.io/) - Prettier is an opinionated code formatter. - [rimraf](https://github.com/isaacs/rimraf) - A `rm -rf` util for nodejs. - [source-map-loader](https://webpack.js.org/loaders/source-map-loader/) - Source map loader. - [start-server-and-test](https://github.com/bahmutov/start-server-and-test) - Starts server, waits for URL, then runs test command; when the tests end, shuts down server. diff --git a/cypress/fixtures/jobsSearch1.json b/cypress/fixtures/jobsSearch1.json new file mode 100644 index 0000000..762bf24 --- /dev/null +++ b/cypress/fixtures/jobsSearch1.json @@ -0,0 +1,93 @@ +[ + { + "id": 1, + "type": "Contract", + "url": "http://nbcnews.com/id/justo.html?ante=tellus&vestibulum=in&ante=sagittis&ipsum=dui&primis=vel&in=nisl&faucibus=duis&orci=ac&luctus=nibh&et=fusce&ultrices=lacus&posuere=purus&cubilia=aliquet&curae=at&duis=feugiat&faucibus=non&accumsan=pretium&odio=quis&curabitur=lectus&convallis=suspendisse&duis=potenti&consequat=in&dui=eleifend&nec=quam&nisi=a&volutpat=odio&eleifend=in&donec=hac&ut=habitasse&dolor=platea&morbi=dictumst&vel=maecenas&lectus=ut&in=massa&quam=quis&fringilla=augue&rhoncus=luctus&mauris=tincidunt&enim=nulla&leo=mollis", + "created_at": "2009-12-26T17:13:11Z", + "company": "Anderson LLC", + "company_url": "https://deliciousdays.com/consequat/lectus/in.png?nisl=nibh&aenean=fusce&lectus=lacus&pellentesque=purus&eget=aliquet&nunc=at&donec=feugiat&quis=non&orci=pretium&eget=quis&orci=lectus&vehicula=suspendisse&condimentum=potenti&curabitur=in&in=eleifend&libero=quam&ut=a&massa=odio&volutpat=in&convallis=hac&morbi=habitasse&odio=platea&odio=dictumst&elementum=maecenas&eu=ut&interdum=massa&eu=quis&tincidunt=augue&in=luctus&leo=tincidunt&maecenas=nulla&pulvinar=mollis&lobortis=molestie&est=lorem&phasellus=quisque&sit=ut", + "location": "Pennsylvania", + "title": "Analog Circuit Design manager", + "description": "", + "how_to_apply": "", + "company_logo": "http://dummyimage.com/155x185.png/cc0000/ffffff" + }, + { + "id": 2, + "type": "Contract", + "url": "https://posterous.com/et/ultrices/posuere/cubilia/curae/duis.json?nunc=non&purus=velit&phasellus=donec&in=diam&felis=neque&donec=vestibulum&semper=eget&sapien=vulputate&a=ut&libero=ultrices&nam=vel&dui=augue&proin=vestibulum&leo=ante&odio=ipsum&porttitor=primis&id=in&consequat=faucibus&in=orci&consequat=luctus&ut=et&nulla=ultrices&sed=posuere&accumsan=cubilia&felis=curae&ut=donec&at=pharetra&dolor=magna&quis=vestibulum&odio=aliquet&consequat=ultrices&varius=erat", + "created_at": "2019-10-01T13:09:54Z", + "company": "Herman-Kuhic", + "company_url": "http://weather.com/eleifend/donec/ut/dolor/morbi.json?tellus=augue&nisi=aliquam&eu=erat&orci=volutpat&mauris=in&lacinia=congue&sapien=etiam&quis=justo&libero=etiam&nullam=pretium&sit=iaculis&amet=justo&turpis=in&elementum=hac&ligula=habitasse&vehicula=platea&consequat=dictumst&morbi=etiam&a=faucibus&ipsum=cursus&integer=urna&a=ut&nibh=tellus&in=nulla&quis=ut&justo=erat&maecenas=id&rhoncus=mauris&aliquam=vulputate&lacus=elementum&morbi=nullam&quis=varius&tortor=nulla&id=facilisi&nulla=cras&ultrices=non&aliquet=velit&maecenas=nec&leo=nisi&odio=vulputate&condimentum=nonummy&id=maecenas&luctus=tincidunt&nec=lacus&molestie=at&sed=velit&justo=vivamus&pellentesque=vel&viverra=nulla&pede=eget&ac=eros&diam=elementum&cras=pellentesque&pellentesque=quisque&volutpat=porta&dui=volutpat&maecenas=erat&tristique=quisque&est=erat&et=eros&tempus=viverra&semper=eget&est=congue&quam=eget&pharetra=semper&magna=rutrum&ac=nulla&consequat=nunc&metus=purus&sapien=phasellus&ut=in&nunc=felis&vestibulum=donec&ante=semper&ipsum=sapien&primis=a&in=libero&faucibus=nam&orci=dui&luctus=proin&et=leo&ultrices=odio&posuere=porttitor&cubilia=id&curae=consequat&mauris=in&viverra=consequat&diam=ut", + "location": "California", + "title": "Operator", + "description": "", + "how_to_apply": "", + "company_logo": "http://dummyimage.com/185x224.jpg/cc0000/ffffff" + }, + { + "id": 3, + "type": "Contract", + "url": "https://craigslist.org/luctus/rutrum.png?vestibulum=elit&rutrum=proin&rutrum=risus&neque=praesent&aenean=lectus&auctor=vestibulum&gravida=quam&sem=sapien&praesent=varius&id=ut&massa=blandit&id=non&nisl=interdum&venenatis=in&lacinia=ante&aenean=vestibulum&sit=ante&amet=ipsum&justo=primis&morbi=in&ut=faucibus&odio=orci&cras=luctus&mi=et&pede=ultrices&malesuada=posuere&in=cubilia&imperdiet=curae&et=duis&commodo=faucibus&vulputate=accumsan&justo=odio&in=curabitur&blandit=convallis&ultrices=duis&enim=consequat&lorem=dui&ipsum=nec&dolor=nisi&sit=volutpat&amet=eleifend&consectetuer=donec&adipiscing=ut&elit=dolor&proin=morbi&interdum=vel&mauris=lectus&non=in&ligula=quam&pellentesque=fringilla&ultrices=rhoncus&phasellus=mauris&id=enim&sapien=leo&in=rhoncus&sapien=sed&iaculis=vestibulum&congue=sit&vivamus=amet&metus=cursus&arcu=id&adipiscing=turpis&molestie=integer&hendrerit=aliquet&at=massa&vulputate=id&vitae=lobortis&nisl=convallis&aenean=tortor&lectus=risus&pellentesque=dapibus&eget=augue&nunc=vel&donec=accumsan&quis=tellus&orci=nisi&eget=eu&orci=orci&vehicula=mauris&condimentum=lacinia&curabitur=sapien&in=quis&libero=libero&ut=nullam&massa=sit&volutpat=amet&convallis=turpis&morbi=elementum&odio=ligula&odio=vehicula&elementum=consequat&eu=morbi&interdum=a", + "created_at": "2013-03-11T15:13:15Z", + "company": "Howe-Becker", + "company_url": "https://boston.com/orci/luctus/et/ultrices.jpg?condimentum=semper&neque=est&sapien=quam&placerat=pharetra&ante=magna&nulla=ac&justo=consequat&aliquam=metus&quis=sapien&turpis=ut&eget=nunc&elit=vestibulum&sodales=ante&scelerisque=ipsum&mauris=primis&sit=in&amet=faucibus&eros=orci&suspendisse=luctus&accumsan=et&tortor=ultrices&quis=posuere&turpis=cubilia&sed=curae&ante=mauris&vivamus=viverra&tortor=diam&duis=vitae&mattis=quam&egestas=suspendisse&metus=potenti&aenean=nullam&fermentum=porttitor&donec=lacus&ut=at&mauris=turpis&eget=donec&massa=posuere&tempor=metus&convallis=vitae&nulla=ipsum&neque=aliquam&libero=non&convallis=mauris&eget=morbi&eleifend=non&luctus=lectus&ultricies=aliquam&eu=sit&nibh=amet&quisque=diam&id=in&justo=magna&sit=bibendum&amet=imperdiet&sapien=nullam&dignissim=orci&vestibulum=pede&vestibulum=venenatis&ante=non&ipsum=sodales&primis=sed&in=tincidunt&faucibus=eu&orci=felis&luctus=fusce&et=posuere&ultrices=felis&posuere=sed&cubilia=lacus&curae=morbi&nulla=sem&dapibus=mauris&dolor=laoreet&vel=ut&est=rhoncus&donec=aliquet&odio=pulvinar&justo=sed&sollicitudin=nisl&ut=nunc&suscipit=rhoncus&a=dui&feugiat=vel&et=sem&eros=sed&vestibulum=sagittis&ac=nam&est=congue&lacinia=risus&nisi=semper&venenatis=porta&tristique=volutpat&fusce=quam", + "location": "Oregon", + "title": "Software Test Engineer I", + "description": "", + "how_to_apply": "", + "company_logo": "http://dummyimage.com/111x130.bmp/5fa2dd/ffffff" + }, + { + "id": 4, + "type": "Full Time", + "url": "http://usa.gov/at/diam/nam/tristique/tortor/eu/pede.jsp?in=turpis&blandit=adipiscing&ultrices=lorem&enim=vitae&lorem=mattis&ipsum=nibh&dolor=ligula&sit=nec&amet=sem&consectetuer=duis&adipiscing=aliquam&elit=convallis&proin=nunc", + "created_at": "2000-12-20T22:53:44Z", + "company": "Wolff LLC", + "company_url": "http://time.com/congue.jsp?pretium=turpis&iaculis=enim&justo=blandit&in=mi&hac=in&habitasse=porttitor&platea=pede&dictumst=justo&etiam=eu&faucibus=massa&cursus=donec&urna=dapibus&ut=duis&tellus=at&nulla=velit&ut=eu&erat=est&id=congue", + "location": "Texas", + "title": "Staff Scientist", + "description": "", + "how_to_apply": "", + "company_logo": "http://dummyimage.com/122x234.bmp/5fa2dd/ffffff" + }, + { + "id": 5, + "type": "Contract", + "url": "http://yelp.com/lectus/aliquam/sit/amet/diam.png?orci=ante&mauris=vel&lacinia=ipsum&sapien=praesent&quis=blandit&libero=lacinia&nullam=erat&sit=vestibulum&amet=sed&turpis=magna&elementum=at&ligula=nunc&vehicula=commodo&consequat=placerat&morbi=praesent&a=blandit&ipsum=nam&integer=nulla&a=integer&nibh=pede&in=justo&quis=lacinia&justo=eget&maecenas=tincidunt&rhoncus=eget&aliquam=tempus&lacus=vel&morbi=pede&quis=morbi&tortor=porttitor&id=lorem&nulla=id&ultrices=ligula&aliquet=suspendisse&maecenas=ornare&leo=consequat&odio=lectus&condimentum=in&id=est&luctus=risus&nec=auctor&molestie=sed&sed=tristique&justo=in&pellentesque=tempus&viverra=sit&pede=amet&ac=sem&diam=fusce&cras=consequat&pellentesque=nulla&volutpat=nisl&dui=nunc&maecenas=nisl&tristique=duis&est=bibendum&et=felis&tempus=sed&semper=interdum&est=venenatis&quam=turpis&pharetra=enim&magna=blandit&ac=mi&consequat=in&metus=porttitor&sapien=pede&ut=justo&nunc=eu&vestibulum=massa&ante=donec&ipsum=dapibus&primis=duis&in=at&faucibus=velit&orci=eu&luctus=est&et=congue&ultrices=elementum&posuere=in&cubilia=hac&curae=habitasse", + "created_at": "2000-08-30T22:51:20Z", + "company": "Senger-Gerhold", + "company_url": "http://yellowbook.com/nisl/nunc/rhoncus/dui.html?ipsum=cras&integer=non&a=velit&nibh=nec&in=nisi&quis=vulputate&justo=nonummy&maecenas=maecenas&rhoncus=tincidunt&aliquam=lacus&lacus=at&morbi=velit&quis=vivamus&tortor=vel&id=nulla&nulla=eget&ultrices=eros&aliquet=elementum&maecenas=pellentesque&leo=quisque&odio=porta&condimentum=volutpat&id=erat&luctus=quisque&nec=erat&molestie=eros&sed=viverra&justo=eget&pellentesque=congue&viverra=eget&pede=semper&ac=rutrum&diam=nulla&cras=nunc&pellentesque=purus&volutpat=phasellus&dui=in&maecenas=felis&tristique=donec&est=semper&et=sapien&tempus=a&semper=libero&est=nam&quam=dui&pharetra=proin&magna=leo&ac=odio&consequat=porttitor&metus=id&sapien=consequat&ut=in&nunc=consequat&vestibulum=ut&ante=nulla&ipsum=sed&primis=accumsan&in=felis&faucibus=ut&orci=at&luctus=dolor&et=quis&ultrices=odio&posuere=consequat&cubilia=varius&curae=integer&mauris=ac&viverra=leo&diam=pellentesque&vitae=ultrices", + "location": "Texas", + "title": "Environmental Tech", + "description": "", + "how_to_apply": "", + "company_logo": "http://dummyimage.com/162x190.png/cc0000/ffffff" + }, + { + "id": 6, + "type": "Contract", + "url": "http://shinystat.com/ultricies/eu/nibh/quisque/id/justo.xml?at=nisl&turpis=duis&a=bibendum&pede=felis&posuere=sed&nonummy=interdum&integer=venenatis&non=turpis&velit=enim&donec=blandit&diam=mi&neque=in&vestibulum=porttitor&eget=pede&vulputate=justo&ut=eu&ultrices=massa&vel=donec&augue=dapibus&vestibulum=duis&ante=at&ipsum=velit&primis=eu&in=est&faucibus=congue&orci=elementum&luctus=in&et=hac&ultrices=habitasse&posuere=platea&cubilia=dictumst&curae=morbi&donec=vestibulum&pharetra=velit&magna=id&vestibulum=pretium&aliquet=iaculis&ultrices=diam&erat=erat&tortor=fermentum", + "created_at": "2017-12-17T08:44:18Z", + "company": "Zulauf, Reynolds and Green", + "company_url": "http://cyberchimps.com/fusce/congue/diam/id.json?aliquam=nulla&non=tempus&mauris=vivamus&morbi=in&non=felis&lectus=eu&aliquam=sapien&sit=cursus&amet=vestibulum&diam=proin&in=eu&magna=mi&bibendum=nulla&imperdiet=ac&nullam=enim&orci=in&pede=tempor&venenatis=turpis&non=nec&sodales=euismod&sed=scelerisque&tincidunt=quam&eu=turpis&felis=adipiscing&fusce=lorem&posuere=vitae&felis=mattis&sed=nibh&lacus=ligula&morbi=nec&sem=sem&mauris=duis&laoreet=aliquam&ut=convallis&rhoncus=nunc&aliquet=proin&pulvinar=at&sed=turpis&nisl=a&nunc=pede&rhoncus=posuere&dui=nonummy&vel=integer&sem=non&sed=velit&sagittis=donec&nam=diam&congue=neque&risus=vestibulum&semper=eget&porta=vulputate&volutpat=ut&quam=ultrices&pede=vel&lobortis=augue&ligula=vestibulum&sit=ante&amet=ipsum&eleifend=primis&pede=in&libero=faucibus&quis=orci&orci=luctus&nullam=et&molestie=ultrices&nibh=posuere", + "location": "New York", + "title": "Director of Sales", + "description": "", + "how_to_apply": "", + "company_logo": "http://dummyimage.com/225x233.jpg/5fa2dd/ffffff" + }, + { + "id": 7, + "type": "Full Time", + "url": "http://reverbnation.com/luctus.js?viverra=eu&diam=magna&vitae=vulputate&quam=luctus&suspendisse=cum&potenti=sociis&nullam=natoque&porttitor=penatibus&lacus=et&at=magnis&turpis=dis&donec=parturient&posuere=montes&metus=nascetur&vitae=ridiculus&ipsum=mus&aliquam=vivamus&non=vestibulum&mauris=sagittis&morbi=sapien&non=cum&lectus=sociis&aliquam=natoque&sit=penatibus&amet=et&diam=magnis&in=dis&magna=parturient&bibendum=montes&imperdiet=nascetur&nullam=ridiculus&orci=mus&pede=etiam&venenatis=vel&non=augue&sodales=vestibulum&sed=rutrum&tincidunt=rutrum&eu=neque&felis=aenean&fusce=auctor&posuere=gravida&felis=sem&sed=praesent&lacus=id&morbi=massa&sem=id&mauris=nisl&laoreet=venenatis&ut=lacinia&rhoncus=aenean&aliquet=sit&pulvinar=amet&sed=justo&nisl=morbi&nunc=ut&rhoncus=odio&dui=cras&vel=mi", + "created_at": "2007-09-30T09:39:32Z", + "company": "VonRueden and Sons", + "company_url": "http://wix.com/ante/vestibulum/ante/ipsum/primis/in.aspx?vivamus=habitasse&tortor=platea&duis=dictumst&mattis=etiam&egestas=faucibus&metus=cursus&aenean=urna&fermentum=ut&donec=tellus&ut=nulla&mauris=ut&eget=erat&massa=id&tempor=mauris&convallis=vulputate&nulla=elementum&neque=nullam&libero=varius&convallis=nulla&eget=facilisi&eleifend=cras&luctus=non&ultricies=velit&eu=nec&nibh=nisi&quisque=vulputate&id=nonummy&justo=maecenas&sit=tincidunt&amet=lacus&sapien=at&dignissim=velit&vestibulum=vivamus&vestibulum=vel&ante=nulla&ipsum=eget&primis=eros&in=elementum&faucibus=pellentesque&orci=quisque&luctus=porta&et=volutpat&ultrices=erat&posuere=quisque&cubilia=erat&curae=eros&nulla=viverra&dapibus=eget&dolor=congue&vel=eget&est=semper&donec=rutrum&odio=nulla&justo=nunc&sollicitudin=purus&ut=phasellus&suscipit=in&a=felis&feugiat=donec&et=semper&eros=sapien&vestibulum=a&ac=libero&est=nam&lacinia=dui&nisi=proin&venenatis=leo&tristique=odio&fusce=porttitor", + "location": "California", + "title": "Legal Assistant", + "description": "", + "how_to_apply": "", + "company_logo": "http://dummyimage.com/186x179.png/5fa2dd/ffffff" + } +] diff --git a/cypress/integration/details.spec.js b/cypress/integration/details.spec.js new file mode 100644 index 0000000..4508e78 --- /dev/null +++ b/cypress/integration/details.spec.js @@ -0,0 +1,53 @@ +/// + +context("Search", () => { + beforeEach(() => { + cy.fixture("jobs50").then((jobsJson) => { + cy.server(); + cy.route({ + method: "GET", + url: "/jobs", + status: 200, + response: jobsJson, + delay: 1000, + }); + }); + cy.visit("http://localhost:3000"); + cy.wait(1000); + cy.get( + "#app > div.search__container > div.jobs__container > div:nth-child(1) > div.jobcard__container__left > div.jobcard__container__middle > a > p" + ).click(); + }); + + it("Should display '
' correctly", () => { + cy.get( + "#app > div.details__container > div.details__side__container > div > span" + ).should("have.text", "How to Apply"); + cy.get( + "#app > div.details__container > div.details__main__container > div.details__container__title > div.details__container__title__inner > h2" + ).should("have.text", "Cloud DevOps Engineer"); + cy.get( + "#app > div.details__container > div.details__main__container > div.details__container__title > div.details__container__title__inner > p" + ).should("have.text", "Full Time"); + cy.get( + "#app > div.details__container > div.details__main__container > div.details__container__company > div.details__company__right > a" + ).should("have.text", "Cool Company"); + }); + + it("Should be able to return to ''", () => { + cy.get("#search").should("not.be.visible"); + + cy.get( + "#app > div.details__container > div.details__side__container > a > span" + ).click(); + cy.get("#search").should("be.visible"); + + cy.get( + "#app > div.search__container > div.jobs__container > div:nth-child(1) > div.jobcard__container__left > div.jobcard__container__middle > a > p" + ).click(); + cy.get("#search").should("not.be.visible"); + + cy.get("header").click(); + cy.get("#search").should("be.visible"); + }); +}); diff --git a/cypress/integration/optionsPanel.spec.js b/cypress/integration/optionsPanel.spec.js index 636bbc7..abcb51b 100644 --- a/cypress/integration/optionsPanel.spec.js +++ b/cypress/integration/optionsPanel.spec.js @@ -1,17 +1,44 @@ /// -// TODO - Stub these responses context("Options Panel", () => { beforeEach(() => { cy.fixture("jobs50").then((jobsJson) => { - cy.server(); - cy.route({ - method: "GET", - url: "/jobs", - status: 200, - response: jobsJson, - onRequest: (xhr) => {}, - onResponse: (xhr) => {}, + cy.fixture("jobsSearch1").then((jobsSearch1Json) => { + cy.server(); + cy.route({ + method: "GET", + url: "/jobs", + status: 200, + response: jobsJson, + }); + cy.route({ + method: "GET", + url: "/jobs/search?full_time=true&description=developer", + status: 200, + delay: 1000, + response: jobsSearch1Json, + }); + cy.route({ + method: "GET", + url: "/jobs/search?full_time=false&description=&location=Los Angeles", + status: 200, + delay: 1000, + response: jobsSearch1Json, + }); + cy.route({ + method: "GET", + url: "/jobs/search?full_time=false&description=&location=Chicago", + status: 200, + delay: 1000, + response: jobsSearch1Json, + }); + cy.route({ + method: "GET", + url: "/jobs/search?full_time=false&description=developer", + status: 200, + delay: 1000, + response: jobsSearch1Json, + }); }); }); cy.visit("http://localhost:3000"); @@ -51,4 +78,24 @@ context("Options Panel", () => { cy.wait(1000); cy.get("#location-1").should("be.checked"); }); + + it("Should filter with fullTime correctly", () => { + cy.get("#search").type("developer"); + cy.get(".search__button").click(); + + cy.wait(1500); + cy.get(".jobcard__container").then(($jobs) => { + assert.equal($jobs.length, 5); + }); + + cy.get( + "#app > div.search__container > div.options-panel__container > label:nth-child(1) > span" + ).click(); + cy.get(".search__button").click(); + + cy.wait(1500); + cy.get(".jobcard__container").then(($jobs) => { + assert.equal($jobs.length, 2); + }); + }); }); diff --git a/cypress/integration/search.spec.js b/cypress/integration/search.spec.js index b13e4be..bd89eb4 100644 --- a/cypress/integration/search.spec.js +++ b/cypress/integration/search.spec.js @@ -3,14 +3,22 @@ context("Search", () => { beforeEach(() => { cy.fixture("jobs50").then((jobsJson) => { - cy.server(); - cy.route({ - method: "GET", - url: "/jobs", - status: 200, - response: jobsJson, - onRequest: (xhr) => {}, - onResponse: (xhr) => {}, + cy.fixture("jobsSearch1").then((searchJson) => { + cy.server(); + cy.route({ + method: "GET", + url: "/jobs", + status: 200, + response: jobsJson, + delay: 1000, + }); + cy.route({ + method: "GET", + url: "/jobs/search?full_time=false&description=developer", + status: 200, + response: searchJson, + delay: 1000, + }); }); }); cy.visit("http://localhost:3000"); @@ -52,8 +60,14 @@ context("Search - No Results", () => { url: "/jobs", status: 200, response: [], - onRequest: (xhr) => {}, - onResponse: (xhr) => {}, + delay: 1000, + }); + cy.route({ + method: "GET", + url: "/jobs/search?full_time=false&description=developer", + status: 200, + response: [], + delay: 1000, }); cy.visit("http://localhost:3000"); }); diff --git a/package-lock.json b/package-lock.json index f6b9852..181008e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,87 @@ { "name": "gh-jobs", - "version": "0.26.0", + "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "@babel/runtime": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.4.tgz", @@ -261,6 +339,12 @@ "@types/express": "*" } }, + "@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", + "dev": true + }, "@types/express": { "version": "4.17.7", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.7.tgz", @@ -547,6 +631,135 @@ } } }, + "@typescript-eslint/eslint-plugin": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.6.1.tgz", + "integrity": "sha512-06lfjo76naNeOMDl+mWG9Fh/a0UHKLGhin+mGaIw72FUMbMGBkdi/FEJmgEDzh4eE73KIYzHWvOCYJ0ak7nrJQ==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "3.6.1", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + } + } + }, + "@typescript-eslint/experimental-utils": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.6.1.tgz", + "integrity": "sha512-oS+hihzQE5M84ewXrTlVx7eTgc52eu+sVmG7ayLfOhyZmJ8Unvf3osyFQNADHP26yoThFfbxcibbO0d2FjnYhg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/types": "3.6.1", + "@typescript-eslint/typescript-estree": "3.6.1", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + }, + "dependencies": { + "eslint-scope": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", + "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + } + } + }, + "@typescript-eslint/parser": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.6.1.tgz", + "integrity": "sha512-SLihQU8RMe77YJ/jGTqOt0lMq7k3hlPVfp7v/cxMnXA9T0bQYoMDfTsNgHXpwSJM1Iq2aAJ8WqekxUwGv5F67Q==", + "dev": true, + "requires": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "3.6.1", + "@typescript-eslint/types": "3.6.1", + "@typescript-eslint/typescript-estree": "3.6.1", + "eslint-visitor-keys": "^1.1.0" + } + }, + "@typescript-eslint/types": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.6.1.tgz", + "integrity": "sha512-NPxd5yXG63gx57WDTW1rp0cF3XlNuuFFB5G+Kc48zZ+51ZnQn9yjDEsjTPQ+aWM+V+Z0I4kuTFKjKvgcT1F7xQ==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.6.1.tgz", + "integrity": "sha512-G4XRe/ZbCZkL1fy09DPN3U0mR6SayIv1zSeBNquRFRk7CnVLgkC2ZPj8llEMJg5Y8dJ3T76SvTGtceytniaztQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "3.6.1", + "@typescript-eslint/visitor-keys": "3.6.1", + "debug": "^4.1.1", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.6.1.tgz", + "integrity": "sha512-qC8Olwz5ZyMTZrh4Wl3K4U6tfms0R/mzU4/5W3XeUZptVraGVmbptJbn6h2Ey6Rb3hOs3zWoAUebZk8t47KGiQ==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, "@webassemblyjs/ast": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", @@ -755,6 +968,12 @@ "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", "dev": true }, + "acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true + }, "ajv": { "version": "6.12.3", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", @@ -851,6 +1070,15 @@ "integrity": "sha512-NTBIIbAfkJeIletyABbVtdPgeKfDafR+1mZV/AyyfC1UkVkp9iUjV+wwmqtUgphHYajbI86jejBJp5e+jkGTiQ==", "dev": true }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, "arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", @@ -874,6 +1102,17 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, + "array-includes": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", + "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "is-string": "^1.0.5" + } + }, "array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", @@ -895,6 +1134,17 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, + "array.prototype.flatmap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.2.3.tgz", + "integrity": "sha512-OOEk+lkePcg+ODXIpvuU9PAryCikCJyo7GlDG1upleEpQRx6mzL9puEBkozQ5iAx20KV0l3DbyQwqciJtqe5Pg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1" + } + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -962,6 +1212,12 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "async": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", @@ -1458,6 +1714,12 @@ "integrity": "sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==", "dev": true }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, "camel-case": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.1.tgz", @@ -2349,6 +2611,12 @@ "regexp.prototype.flags": "^1.2.0" } }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, "default-gateway": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz", @@ -2612,6 +2880,15 @@ "buffer-indexof": "^1.0.0" } }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -2779,6 +3056,23 @@ "tapable": "^1.0.0" } }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + } + } + }, "entities": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", @@ -2845,6 +3139,122 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "eslint": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.4.0.tgz", + "integrity": "sha512-gU+lxhlPHu45H3JkEGgYhWhkR9wLHHEXC9FbWFnTlEkbKyZKWgWRLgf61E8zWmBuI6g5xKBph9ltg3NtZMVF8g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.0.0", + "eslint-visitor-keys": "^1.2.0", + "espree": "^7.1.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "eslint-scope": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", + "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + } + } + }, + "eslint-plugin-react": { + "version": "7.20.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.20.3.tgz", + "integrity": "sha512-txbo090buDeyV0ugF3YMWrzLIUqpYTsWSDZV9xLSmExE1P/Kmgg9++PD931r+KEWS66O1c9R4srLVVHmeHpoAg==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flatmap": "^1.2.3", + "doctrine": "^2.1.0", + "has": "^1.0.3", + "jsx-ast-utils": "^2.4.1", + "object.entries": "^1.1.2", + "object.fromentries": "^2.0.2", + "object.values": "^1.1.1", + "prop-types": "^15.7.2", + "resolve": "^1.17.0", + "string.prototype.matchall": "^4.0.2" + }, + "dependencies": { + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + } + } + }, "eslint-scope": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", @@ -2855,6 +3265,63 @@ "estraverse": "^4.1.1" } }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "espree": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", + "integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", + "dev": true, + "requires": { + "acorn": "^7.3.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "acorn": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz", + "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "dev": true + } + } + }, "esrecurse": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", @@ -2870,6 +3337,12 @@ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -3171,6 +3644,12 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, "faye-websocket": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", @@ -3205,6 +3684,15 @@ "object-assign": "^4.1.0" } }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -3281,6 +3769,34 @@ "resolve-dir": "^1.0.1" } }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, "flush-write-stream": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", @@ -3415,6 +3931,12 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -3561,6 +4083,15 @@ } } }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, "globby": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", @@ -3980,6 +4511,30 @@ "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", "dev": true }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } + } + }, "import-local": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", @@ -4045,6 +4600,17 @@ "ipaddr.js": "^1.9.0" } }, + "internal-slot": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.2.tgz", + "integrity": "sha512-2cQNfwhAfJIkU4KZPkDI+Gj5yNNnbqi40W9Gge6dfnk4TocEVm00B3bdiL+JINrbGJil2TeHvM4rETGzk/f/0g==", + "dev": true, + "requires": { + "es-abstract": "^1.17.0-next.1", + "has": "^1.0.3", + "side-channel": "^1.0.2" + } + }, "interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", @@ -4303,6 +4869,12 @@ "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", "dev": true }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, "is-symbol": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", @@ -4358,6 +4930,16 @@ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -4382,6 +4964,12 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -4424,6 +5012,16 @@ "verror": "1.10.0" } }, + "jsx-ast-utils": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.4.1.tgz", + "integrity": "sha512-z1xSldJ6imESSzOjd3NNkieVJKRlKYSOtMG8SFyCj2FIrvSaSuli/WjpBkEzCBoR9bYYYFgqJw61Xhu7Lcgk+w==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "object.assign": "^4.1.0" + } + }, "kareem": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.1.tgz", @@ -4447,6 +5045,16 @@ "integrity": "sha1-eZllXoZGwX8In90YfRUNMyTVRRM=", "dev": true }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, "listr": { "version": "0.14.3", "resolved": "https://registry.npmjs.org/listr/-/listr-0.14.3.tgz", @@ -5287,6 +5895,12 @@ "to-regex": "^3.0.1" } }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", @@ -5515,6 +6129,29 @@ "object-keys": "^1.0.11" } }, + "object.entries": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.2.tgz", + "integrity": "sha512-BQdB9qKmb/HyNdMNWVr7O3+z5MUIx3aiegEIJqjMBbBf0YT9RRxTJSim4mzFqtyr7PDAHigq0N9dO0m0tRakQA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "has": "^1.0.3" + } + }, + "object.fromentries": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.2.tgz", + "integrity": "sha512-r3ZiBH7MQppDJVLx6fhD618GKNG40CZYH9wgwdhKxBDDbQgjeWGGd4AtkZad84d291YxvWe7bJGuE65Anh0dxQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, "object.getownpropertydescriptors": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", @@ -5534,6 +6171,18 @@ "isobject": "^3.0.1" } }, + "object.values": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, "obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", @@ -5580,6 +6229,20 @@ "is-wsl": "^1.1.0" } }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, "original": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", @@ -5673,6 +6336,15 @@ "tslib": "^1.10.0" } }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "parse-asn1": { "version": "5.1.5", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", @@ -5750,6 +6422,12 @@ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -5997,6 +6675,18 @@ "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", "dev": true }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "prettier": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", + "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "dev": true + }, "pretty-bytes": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.3.0.tgz", @@ -6024,6 +6714,12 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, "promise-inflight": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", @@ -6348,6 +7044,12 @@ "es-abstract": "^1.17.0-next.1" } }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, "relateurl": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", @@ -6466,6 +7168,15 @@ "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", "dev": true }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, "resolve-cwd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", @@ -6804,6 +7515,16 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, + "side-channel": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.2.tgz", + "integrity": "sha512-7rL9YlPHg7Ancea1S96Pa8/QWb4BtXL/TZvS6B8XFetGBeuhAsfmUspK6DokBeZ64+Kj9TCNRD/30pVz1BvQNA==", + "dev": true, + "requires": { + "es-abstract": "^1.17.0-next.1", + "object-inspect": "^1.7.0" + } + }, "sift": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/sift/-/sift-7.0.1.tgz", @@ -7162,6 +7883,12 @@ "extend-shallow": "^3.0.0" } }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, "sshpk": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", @@ -7311,6 +8038,20 @@ "strip-ansi": "^6.0.0" } }, + "string.prototype.matchall": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.2.tgz", + "integrity": "sha512-N/jp6O5fMf9os0JU3E72Qhf590RSRZU/ungsL/qJUYVTNv7hTG0P/dbPjxINVN9jpscu3nzYwKESU3P3RY5tOg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "has-symbols": "^1.0.1", + "internal-slot": "^1.0.2", + "regexp.prototype.flags": "^1.3.0", + "side-channel": "^1.0.2" + } + }, "string.prototype.trimend": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", @@ -7360,6 +8101,12 @@ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, "style-loader": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-1.2.1.tgz", @@ -7383,6 +8130,93 @@ "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "tapable": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", @@ -7450,6 +8284,12 @@ } } }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, "throttleit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", @@ -7729,6 +8569,15 @@ "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", "dev": true }, + "tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, "tty-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", @@ -7750,6 +8599,21 @@ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", "dev": true }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -8833,6 +9697,12 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, "worker-farm": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", @@ -8859,6 +9729,15 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, "ws": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", diff --git a/package.json b/package.json index c127ebf..c41e162 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gh-jobs", - "version": "0.26.0", + "version": "1.0.0", "description": "A MERN application bootstrapped with create-mern-application.", "main": "build/index.js", "scripts": { @@ -10,6 +10,8 @@ "cy:open": "cypress open", "cy:run": "cypress run", "dev": "env-cmd -e development npm run start", + "format": "prettier --write src/**/*", + "lint": "eslint src", "start": "node build/index.js", "start:dev": "start-server-and-test dev http://localhost:3000 'webpack-dev-server --info=false'", "test": "start-server-and-test test-server http://localhost:3000 cy:run", @@ -47,12 +49,17 @@ "@types/react-dom": "^16.9.8", "@types/react-redux": "^7.1.9", "@types/react-router-dom": "^5.1.5", + "@typescript-eslint/eslint-plugin": "^3.6.1", + "@typescript-eslint/parser": "^3.6.1", "clean-webpack-plugin": "^3.0.0", "copyfiles": "^2.3.0", "css-loader": "^3.6.0", "cypress": "^4.10.0", "env-cmd": "^10.1.0", + "eslint": "^7.4.0", + "eslint-plugin-react": "^7.20.3", "html-webpack-plugin": "^4.3.0", + "prettier": "^2.0.5", "rimraf": "^3.0.2", "source-map-loader": "^1.0.1", "start-server-and-test": "^1.11.2", diff --git a/src/client/components/Copyright.tsx b/src/client/components/Copyright.tsx index 3291b22..ec1f960 100644 --- a/src/client/components/Copyright.tsx +++ b/src/client/components/Copyright.tsx @@ -1,8 +1,7 @@ import * as React from "react"; -export interface CopyrightProps {} - -const Copyright: React.SFC = () => { +// eslint-disable-next-line +const Copyright: React.SFC<{}> = () => { return (

Copyright Β©  diff --git a/src/client/components/Header.tsx b/src/client/components/Header.tsx index e6dca29..0cddb96 100644 --- a/src/client/components/Header.tsx +++ b/src/client/components/Header.tsx @@ -1,12 +1,14 @@ import * as React from "react"; +import { Link } from "react-router-dom"; -export interface HeaderProps {} - -const Header: React.SFC = () => { +// eslint-disable-next-line +const Header: React.SFC<{}> = () => { return ( -

- GitHub Jobs -
+ +
+ GitHub Jobs +
+ ); }; diff --git a/src/client/components/JobCard.tsx b/src/client/components/JobCard.tsx index bd5acb2..22e20af 100644 --- a/src/client/components/JobCard.tsx +++ b/src/client/components/JobCard.tsx @@ -12,7 +12,7 @@ const JobCard: React.SFC = (props: JobCardProps) => { const { job } = props; const handleImageError = () => { // TODO - Should set the image to a fallback/just display the div with the not found text - alert("IMAGE ERROR - CREATE FUNCTIONALITY"); + // alert("IMAGE ERROR - CREATE FUNCTIONALITY"); }; return (
diff --git a/src/client/components/PaginationMore.tsx b/src/client/components/PaginationMore.tsx index 71285ef..1d23f86 100644 --- a/src/client/components/PaginationMore.tsx +++ b/src/client/components/PaginationMore.tsx @@ -1,5 +1,6 @@ import * as React from "react"; +// eslint-disable-next-line const PaginationMore: React.SFC<{}> = () => (
  • more_horiz diff --git a/src/client/index.css b/src/client/index.css index 468560e..633c36c 100644 --- a/src/client/index.css +++ b/src/client/index.css @@ -19,6 +19,10 @@ body { padding: 0; } +#header-link { + text-decoration: none; +} + header { font-size: 1.5rem; font-weight: lighter; @@ -470,6 +474,7 @@ input::placeholder { display: flex; flex-direction: column; margin-top: 36px; + overflow-wrap: break-word; } .details__container__label { @@ -674,21 +679,21 @@ input::placeholder { left: 0%; top: 0%; animation: orbit-spinner-orbit-one-animation 1200ms linear infinite; - border-bottom: 3px solid #00d3ff; + border-bottom: 3px solid #b9bdcf; } .orbit-spinner .orbit:nth-child(2) { right: 0%; top: 0%; animation: orbit-spinner-orbit-two-animation 1200ms linear infinite; - border-right: 3px solid #00d3ff; + border-right: 3px solid #b9bdcf; } .orbit-spinner .orbit:nth-child(3) { right: 0%; bottom: 0%; animation: orbit-spinner-orbit-three-animation 1200ms linear infinite; - border-top: 3px solid #00d3ff; + border-top: 3px solid #b9bdcf; } @keyframes orbit-spinner-orbit-one-animation { diff --git a/src/client/pages/Details.tsx b/src/client/pages/Details.tsx index 307b920..35add74 100644 --- a/src/client/pages/Details.tsx +++ b/src/client/pages/Details.tsx @@ -12,7 +12,7 @@ interface DetailsProps { const Details: React.SFC = (props: DetailsProps) => { const { jobs } = props; - let { id } = useParams(); + const { id } = useParams(); const [data, setData] = React.useState(null); const [applyLink, setApplyLink] = React.useState(""); diff --git a/src/client/redux/actions/application.ts b/src/client/redux/actions/application.ts index ab2249b..2e0e009 100644 --- a/src/client/redux/actions/application.ts +++ b/src/client/redux/actions/application.ts @@ -10,46 +10,51 @@ import { SET_TOTAL_PAGES, } from "../actionTypes"; -import { Job } from "../../types"; +import { ApplicationAction, Job } from "../../types"; -export const setCurrentJobs = (currentJobs: Job[]) => ({ +export const setCurrentJobs = (currentJobs: Job[]): ApplicationAction => ({ type: SET_CURRENT_JOBS, payload: { currentJobs }, }); -export const setCurrentPage = (currentPage: number) => ({ +export const setCurrentPage = (currentPage: number): ApplicationAction => ({ type: SET_CURRENT_PAGE, payload: { currentPage }, }); -export const setFullTime = (fullTime: boolean) => ({ +export const setFullTime = (fullTime: boolean): ApplicationAction => ({ type: SET_FULL_TIME, payload: { fullTime }, }); -export const setIsLoading = (isLoading: boolean) => ({ +export const setIsLoading = (isLoading: boolean): ApplicationAction => ({ type: SET_IS_LOADING, payload: { isLoading }, }); -export const setJobs = (jobs: Job[]) => ({ type: SET_JOBS, payload: { jobs } }); +export const setJobs = (jobs: Job[]): ApplicationAction => ({ + type: SET_JOBS, + payload: { jobs }, +}); -export const setJobsFetchedAt = (jobsFetchedAt: string) => ({ +export const setJobsFetchedAt = (jobsFetchedAt: string): ApplicationAction => ({ type: SET_JOBS_FETCHED_AT, payload: { jobsFetchedAt }, }); -export const setLocationSearch = (locationSearch: string) => ({ +export const setLocationSearch = ( + locationSearch: string +): ApplicationAction => ({ type: SET_LOCATION_SEARCH, payload: { locationSearch }, }); -export const setSearchValue = (searchValue: string) => ({ +export const setSearchValue = (searchValue: string): ApplicationAction => ({ type: SET_SEARCH_VALUE, payload: { searchValue }, }); -export const setTotalPages = (totalPages: number) => ({ +export const setTotalPages = (totalPages: number): ApplicationAction => ({ type: SET_TOTAL_PAGES, payload: { totalPages }, }); diff --git a/src/client/redux/thunks.ts b/src/client/redux/thunks.ts index 63262e9..b0269d6 100644 --- a/src/client/redux/thunks.ts +++ b/src/client/redux/thunks.ts @@ -11,7 +11,7 @@ import { getData, unique } from "../util"; import { AppThunk, Job, LocationOption, RootState } from "../types"; -export const getJobs = (): AppThunk => async (dispatch, getState) => { +export const getJobs = (): AppThunk => async (dispatch) => { try { const jobs: Job[] = await getData("/jobs"); @@ -26,7 +26,6 @@ export const getJobs = (): AppThunk => async (dispatch, getState) => { } }; -// TODO - `full_time` doesn't really work on GitHub API export const searchJobs = ( search: string, locationOptions: LocationOption[] @@ -61,7 +60,7 @@ export const searchJobs = ( location.value )}`; const data = await getData(url); - jobs.push.apply(jobs, data); + jobs.push(...data); }) ); @@ -70,20 +69,21 @@ export const searchJobs = ( fullTime.toString() )}&description=${encodeURI(search)}`; const data = await getData(url); - jobs.push.apply(jobs, data); + jobs.push(...data); } const uniqueJobs = unique(jobs); - dispatch(setCurrentJobs(uniqueJobs)); + const finalJobs = uniqueJobs.filter((job: Job) => + fullTime ? job.type === "Full Time" : job + ); + + dispatch(setCurrentJobs(finalJobs)); dispatch(setCurrentPage(1)); - dispatch(setTotalPages(Math.ceil(uniqueJobs.length / 5))); + dispatch(setTotalPages(Math.ceil(finalJobs.length / 5))); dispatch(setIsLoading(false)); }; -export const pagination = (pageNumber: number): AppThunk => ( - dispach, - getState -) => { +export const pagination = (pageNumber: number): AppThunk => (dispach) => { dispach(setCurrentPage(pageNumber)); }; diff --git a/src/client/util.ts b/src/client/util.ts index 295ca7d..16d1265 100644 --- a/src/client/util.ts +++ b/src/client/util.ts @@ -9,12 +9,14 @@ export const getData = async (url: string): Promise => { return data; }; +// eslint-disable-next-line export const groupBy = (arr: any[], key: any): any => arr.reduce( (acc, item) => ((acc[item[key]] = [...(acc[item[key]] || []), item]), acc), {} ); +// eslint-disable-next-line export const unique = (arr: any[]): any[] => [...new Set(arr)]; export const validURL = (str: string): boolean => { @@ -34,7 +36,7 @@ export const validURL = (str: string): boolean => { * Loads the state of the application from localStorage if present. * @returns {object} */ -export const loadState = () => { +export const loadState = (): any => { try { const serializedState = localStorage.getItem("state"); if (serializedState === null) { @@ -50,7 +52,8 @@ export const loadState = () => { * Saves the application state in localStorage. * @param {object} state State of the application. */ -export const saveState = (state) => { +// eslint-disable-next-line +export const saveState = (state: any): void => { try { const serializedState = JSON.stringify(state); localStorage.setItem("state", serializedState); diff --git a/src/server/app.ts b/src/server/app.ts index a8a237c..45c0b9e 100644 --- a/src/server/app.ts +++ b/src/server/app.ts @@ -32,7 +32,10 @@ class App { ]; const corsOptions: CorsOptions = { - origin: (requestOrigin: string | undefined, callback: Function): void => { + origin: ( + requestOrigin: string | undefined, + callback: (error?: Error, success?: boolean) => void + ): void => { if (whitelistDomains.indexOf(requestOrigin) !== -1) { callback(null, true); } else { diff --git a/src/server/index.ts b/src/server/index.ts index 3608fba..665ded5 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -1,5 +1,3 @@ -import chalk from "chalk"; - import App from "./app"; import AssetsController from "./controllers/assets"; import JobController from "./controllers/job"; diff --git a/src/server/models/Beer.ts b/src/server/models/Beer.ts deleted file mode 100644 index 6f9d8ca..0000000 --- a/src/server/models/Beer.ts +++ /dev/null @@ -1,44 +0,0 @@ -import mongoose from "mongoose"; - -/** - * Beer Model. - */ -const beerSchema = new mongoose.Schema( - { - abv: { - required: true, - type: Number, - }, - brewer: { - required: true, - type: String, - }, - description: { - required: true, - type: String, - }, - name: { - required: true, - type: String, - }, - type: { - required: true, - type: String, - }, - }, - { timestamps: true } -); - -/* NEW LINE */ -function applicationToJSON(this: any): void { - return this.toObject(); -} - -/* NEW LINE */ -beerSchema.methods.toJSON = applicationToJSON; - -/* NEW LINE */ -const Beer = mongoose.model("Beer", beerSchema); - -/* NEW LINE */ -export default Beer; diff --git a/src/server/util.ts b/src/server/util.ts index 8292bc8..c3181ff 100644 --- a/src/server/util.ts +++ b/src/server/util.ts @@ -3,12 +3,11 @@ import fetch from "node-fetch"; /** * Check if MongoDB is running locally. Stops application from continuing if false. */ -export const checkIfMongoDBIsRunning = async (): Promise => - new Promise(async (resolve, reject) => { +export const checkIfMongoDBIsRunning = async (): Promise => + new Promise(async (resolve) => { try { if (!process.env.MONGODB_URL) throw new Error("No MONGODB_URL"); - /* NEW LINE */ const response = await fetch( process.env.MONGODB_URL.replace(/mongodb:\/\//gm, "http://") );