From a4ec3ce659f7c382d021fe6b3b5105bc4e258bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Palma?= Date: Tue, 29 Nov 2022 11:38:06 +0000 Subject: [PATCH 01/15] search button display changes depending on user search input --- src/components/HomePage/SearchArea/SearchArea.js | 4 ++++ .../HomePage/SearchArea/SubmitSearchButton.js | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/HomePage/SearchArea/SearchArea.js b/src/components/HomePage/SearchArea/SearchArea.js index bed37551..db00fee4 100644 --- a/src/components/HomePage/SearchArea/SearchArea.js +++ b/src/components/HomePage/SearchArea/SearchArea.js @@ -177,6 +177,10 @@ export const SearchArea = ({ onSubmit, searchValue, diff --git a/src/components/HomePage/SearchArea/SubmitSearchButton.js b/src/components/HomePage/SearchArea/SubmitSearchButton.js index ba5adb44..63ca547b 100644 --- a/src/components/HomePage/SearchArea/SubmitSearchButton.js +++ b/src/components/HomePage/SearchArea/SubmitSearchButton.js @@ -2,27 +2,29 @@ import React from "react"; import PropTypes from "prop-types"; import { Fab } from "@material-ui/core"; -import { Search } from "@material-ui/icons"; import useSearchAreaStyle from "./searchAreaStyle"; -const ShowAdvancedOptionsButton = ({ onClick }) => { +const SubmitSearchButton = ({ onClick, searchHasUserInput }) => { const classes = useSearchAreaStyle(); return (
- + { searchHasUserInput ? Search + : Search All }
); }; -ShowAdvancedOptionsButton.propTypes = { +SubmitSearchButton.propTypes = { onClick: PropTypes.func.isRequired, + searchHasUserInput: PropTypes.bool.isRequired, }; -export default ShowAdvancedOptionsButton; +export default SubmitSearchButton; From 68db93153faf6e9c10c0ae52baf9559d3ced10c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Palma?= Date: Fri, 9 Dec 2022 02:03:54 +0000 Subject: [PATCH 02/15] added tests to search button display change behaviour --- .../HomePage/SearchArea/SearchArea.spec.js | 141 ++++++++++++++++-- .../HomePage/SearchArea/SubmitSearchButton.js | 7 +- .../SearchArea/SubmitSearchButton.spec.js | 4 - 3 files changed, 133 insertions(+), 19 deletions(-) diff --git a/src/components/HomePage/SearchArea/SearchArea.spec.js b/src/components/HomePage/SearchArea/SearchArea.spec.js index 109cb723..3de94421 100644 --- a/src/components/HomePage/SearchArea/SearchArea.spec.js +++ b/src/components/HomePage/SearchArea/SearchArea.spec.js @@ -10,10 +10,12 @@ import { } from "../../../actions/searchOffersActions"; import { createTheme } from "@material-ui/core"; import { renderWithStoreAndTheme, screen, fireEvent, act } from "../../../test-utils"; - import { MemoryRouter } from "react-router-dom"; +import PropTypes from "prop-types"; + import qs from "qs"; +import { INITIAL_JOB_TYPE } from "../../../reducers/searchOffersReducer"; // eslint-disable-next-line react/prop-types const RouteWrappedContent = ({ children, url = "/" }) => ( @@ -22,6 +24,47 @@ const RouteWrappedContent = ({ children, url = "/" }) => ( ); +const SearchAreaWrapper = ({ + searchValue = "", jobType = INITIAL_JOB_TYPE, jobDuration = [null, null], filterJobDuration = false, + showJobDurationSlider = false, fields = [], technologies = [], setShowJobDurationSlider = () => { }, + setTechs = () => { }, setJobDuration = () => { }, setFields = () => { }, setJobType = () => { }, + setSearchValue = () => { }, onSubmit = () => {}, +}) => ( + +); + +SearchAreaWrapper.propTypes = { + onSubmit: PropTypes.func, + searchValue: PropTypes.string.isRequired, + jobType: PropTypes.string, + setSearchValue: PropTypes.func.isRequired, + setJobDuration: PropTypes.func.isRequired, + setJobType: PropTypes.func.isRequired, + fields: PropTypes.array.isRequired, + technologies: PropTypes.array.isRequired, + showJobDurationSlider: PropTypes.bool.isRequired, + setFields: PropTypes.func.isRequired, + setTechs: PropTypes.func.isRequired, + setShowJobDurationSlider: PropTypes.func.isRequired, + jobDuration: PropTypes.number, + filterJobDuration: PropTypes.bool, +}; + describe("SearchArea", () => { let onSubmit; const theme = createTheme(); @@ -34,16 +77,8 @@ describe("SearchArea", () => { it("should render a Paper, a Form, a Search Bar, a Search Button and Advanced Options Button", () => { renderWithStoreAndTheme( - { }} - setTechs={() => { }} - setJobDuration={() => { }} - setFields={() => { }} - setJobType={() => { }} - setSearchValue={() => { }} /> , { initialState, theme } @@ -55,6 +90,88 @@ describe("SearchArea", () => { expect(screen.getByRole("button", { name: "Search" })).toBeInTheDocument(); expect(screen.getByRole("button", { name: "Toggle Advanced Search" })).toBeInTheDocument(); }); + it("should render a text='Show All' in the default state of searchArea", () => { + const searchArea = renderWithStoreAndTheme( + + + , + { initialState, theme } + ); + + expect(searchArea.getByRole("button", { name: "Search" })).toHaveTextContent("Show All"); + }); + it("should render a text='Search' when search bar value != ''", () => { + const searchArea = renderWithStoreAndTheme( + + + , + { initialState, theme } + ); + + expect(searchArea.getByRole("button", { name: "Search" })).toHaveTextContent("Search"); + }); + it("should render a text='Show All' when search bar has undefined value", () => { + const searchArea = renderWithStoreAndTheme( + + + , + { initialState, theme } + ); + + expect(searchArea.getByRole("button", { name: "Search" })).toHaveTextContent("Show All"); + }); + it("should render a text='Search' when fields != []", () => { + const searchArea = renderWithStoreAndTheme( + + + , + { initialState, theme } + ); + + expect(searchArea.getByRole("button", { name: "Search" })).toHaveTextContent("Search"); + }); + it("should render a text='Search' when technologies != []", () => { + const searchArea = renderWithStoreAndTheme( + + + , + { initialState, theme } + ); + + expect(searchArea.getByRole("button", { name: "Search" })).toHaveTextContent("Search"); + }); + it("should render a text='Search' when jobType != INITIAL_JOB_TYPE", () => { + const searchArea = renderWithStoreAndTheme( + + + , + { initialState, theme } + ); + + expect(searchArea.getByRole("button", { name: "Search" })).toHaveTextContent("Search"); + }); + it("should render a text='Search' when showJobDurationSlider = true ", () => { + const searchArea = renderWithStoreAndTheme( + + + , + { initialState, theme } + ); + + expect(searchArea.getByRole("button", { name: "Search" })).toHaveTextContent("Search"); + }); }); describe("interaction", () => { @@ -124,15 +241,13 @@ describe("SearchArea", () => { renderWithStoreAndTheme( - , diff --git a/src/components/HomePage/SearchArea/SubmitSearchButton.js b/src/components/HomePage/SearchArea/SubmitSearchButton.js index 63ca547b..7f63ffd7 100644 --- a/src/components/HomePage/SearchArea/SubmitSearchButton.js +++ b/src/components/HomePage/SearchArea/SubmitSearchButton.js @@ -15,8 +15,11 @@ const SubmitSearchButton = ({ onClick, searchHasUserInput }) => { variant="extended" onClick={onClick} > - { searchHasUserInput ? Search - : Search All } + + {searchHasUserInput + ? "Search" + : "Show All"} + ); diff --git a/src/components/HomePage/SearchArea/SubmitSearchButton.spec.js b/src/components/HomePage/SearchArea/SubmitSearchButton.spec.js index 75f4fb58..e08848d0 100644 --- a/src/components/HomePage/SearchArea/SubmitSearchButton.spec.js +++ b/src/components/HomePage/SearchArea/SubmitSearchButton.spec.js @@ -1,5 +1,4 @@ import React from "react"; -import { Search } from "@material-ui/icons"; import { Fab } from "@material-ui/core"; import SubmitSearchButton from "./SubmitSearchButton"; @@ -11,9 +10,6 @@ describe("SubmitSearchButton", () => { .find(Fab).exists() ).toBe(true); }); - it("should render 'search' icon", () => { - expect(shallow().find(Search).exists()).toBe(true); - }); }); describe("interaction", () => { From 6f0c2cc2732cca1a080c16be9d2bb5de944936b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Palma?= Date: Wed, 1 Feb 2023 00:05:57 +0000 Subject: [PATCH 03/15] fix wrong documentation link for reactive controller pattern --- src/hooks/useComponentController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useComponentController.js b/src/hooks/useComponentController.js index 04c74b92..696ae753 100644 --- a/src/hooks/useComponentController.js +++ b/src/hooks/useComponentController.js @@ -3,7 +3,7 @@ import React from "react"; export const DefaultContext = React.createContext(); /** - * This is based on the pattern described here: https://angeloteixeira.me/blog/reactive-controller-pattern + * This is based on the pattern described here: https://angeloteixeira.eu/blog/reactive-controller-pattern * With it, components can abstract logic common to different view layouts (such as desktop/mobile) and both can read from the given Context * * @param controller - A function (can be a React Hook) that handles some logic. From 99395d4a7464fe532388272b7792e623619a9dbe Mon Sep 17 00:00:00 2001 From: diogofonte Date: Mon, 30 Jan 2023 23:14:22 +0000 Subject: [PATCH 04/15] fixed divider bug --- .../SearchResultsWidget/SearchResultsDesktop.js | 4 +++- .../SearchResultsWidget/searchResultsWidgetStyles.js | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/HomePage/SearchResultsArea/SearchResultsWidget/SearchResultsDesktop.js b/src/components/HomePage/SearchResultsArea/SearchResultsWidget/SearchResultsDesktop.js index 9058ecd1..6cdcf0e0 100644 --- a/src/components/HomePage/SearchResultsArea/SearchResultsWidget/SearchResultsDesktop.js +++ b/src/components/HomePage/SearchResultsArea/SearchResultsWidget/SearchResultsDesktop.js @@ -15,7 +15,7 @@ const OffersList = ({ showSearchFilters, toggleShowSearchFilters, offers, moreOffersLoading, loadMoreOffers, searchQueryToken, }) => ( - +
{noOffers ?
@@ -51,6 +51,7 @@ OffersList.propTypes = { classes: PropTypes.shape({ divider: PropTypes.string.isRequired, fullHeight: PropTypes.string.isRequired, + heightOffersList: PropTypes.string.isRequired, offerItemsContainer: PropTypes.string.isRequired, noOffersColumn: PropTypes.string.isRequired, errorLoadingOffersIcon: PropTypes.string.isRequired, @@ -139,6 +140,7 @@ const SearchResultsDesktop = () => { const offersListClasses = { fullHeight: classes.fullHeight, + heightOffersList: classes.heightOffersList, noOffersColumn: classes.noOffersColumn, errorLoadingOffersIcon: classes.errorLoadingOffersIcon, divider: classes.divider, diff --git a/src/components/HomePage/SearchResultsArea/SearchResultsWidget/searchResultsWidgetStyles.js b/src/components/HomePage/SearchResultsArea/SearchResultsWidget/searchResultsWidgetStyles.js index 49ac6b05..0161ec5c 100644 --- a/src/components/HomePage/SearchResultsArea/SearchResultsWidget/searchResultsWidgetStyles.js +++ b/src/components/HomePage/SearchResultsArea/SearchResultsWidget/searchResultsWidgetStyles.js @@ -13,6 +13,10 @@ export default makeStyles((theme) => ({ fullWidth: { width: "100%", }, + heightOffersList:{ + height: "100%", + overflow: "auto", + }, searchResults: { boxSizing: "border-box", height: "100vh", @@ -58,8 +62,8 @@ export default makeStyles((theme) => ({ display: "flex", justifyContent: "space-between", width: "100%", - height: "100%", - overflow: "auto", + //height: "100%", + //overflow: "auto", }, offerBodyContainer: { height: "100%", @@ -69,7 +73,6 @@ export default makeStyles((theme) => ({ offerHeader: { marginBottom: theme.spacing(1), alignItems: "flex-start", - }, verticalDivider: { "&&": { From 3bc2a112e04d01dfbf4407bf686d571d0f78e916 Mon Sep 17 00:00:00 2001 From: diogofonte Date: Tue, 31 Jan 2023 15:05:27 +0000 Subject: [PATCH 05/15] removed comments --- .../SearchResultsWidget/searchResultsWidgetStyles.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/HomePage/SearchResultsArea/SearchResultsWidget/searchResultsWidgetStyles.js b/src/components/HomePage/SearchResultsArea/SearchResultsWidget/searchResultsWidgetStyles.js index 0161ec5c..0d367df1 100644 --- a/src/components/HomePage/SearchResultsArea/SearchResultsWidget/searchResultsWidgetStyles.js +++ b/src/components/HomePage/SearchResultsArea/SearchResultsWidget/searchResultsWidgetStyles.js @@ -62,8 +62,6 @@ export default makeStyles((theme) => ({ display: "flex", justifyContent: "space-between", width: "100%", - //height: "100%", - //overflow: "auto", }, offerBodyContainer: { height: "100%", From ca02cd0fc8424bf76d5c629d2b8384ec24ff5555 Mon Sep 17 00:00:00 2001 From: diogofonte Date: Tue, 31 Jan 2023 15:54:50 +0000 Subject: [PATCH 06/15] fix lint error --- .../SearchResultsWidget/searchResultsWidgetStyles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/HomePage/SearchResultsArea/SearchResultsWidget/searchResultsWidgetStyles.js b/src/components/HomePage/SearchResultsArea/SearchResultsWidget/searchResultsWidgetStyles.js index 0d367df1..95a3ff80 100644 --- a/src/components/HomePage/SearchResultsArea/SearchResultsWidget/searchResultsWidgetStyles.js +++ b/src/components/HomePage/SearchResultsArea/SearchResultsWidget/searchResultsWidgetStyles.js @@ -13,7 +13,7 @@ export default makeStyles((theme) => ({ fullWidth: { width: "100%", }, - heightOffersList:{ + heightOffersList: { height: "100%", overflow: "auto", }, From acce472697eec6f7266781863afb00129b1fc438 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Dec 2022 05:17:38 +0000 Subject: [PATCH 07/15] Bump qs from 6.5.2 to 6.5.3 Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/ljharb/qs/releases) - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3) --- updated-dependencies: - dependency-name: qs dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c3f94cc8..cec1f655 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22546,9 +22546,9 @@ "dev": true }, "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", "dev": true }, "query-string": { From 6a38e7a85ccb4124ea29fdc11d444f692be1077b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Dec 2022 21:25:00 +0000 Subject: [PATCH 08/15] Bump express from 4.17.1 to 4.18.2 Bumps [express](https://github.com/expressjs/express) from 4.17.1 to 4.18.2. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.17.1...4.18.2) --- updated-dependencies: - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 453 +++++++++++++++++++++------------------------- 1 file changed, 210 insertions(+), 243 deletions(-) diff --git a/package-lock.json b/package-lock.json index cec1f655..ba5b774a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7621,53 +7621,6 @@ "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", "dev": true }, - "body-parser": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", - "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", - "dev": true, - "requires": { - "bytes": "3.1.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.7.0", - "raw-body": "2.4.0", - "type-is": "~1.6.17" - }, - "dependencies": { - "bytes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", - "dev": true - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "qs": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", - "dev": true - } - } - }, "bonjour": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/bonjour/-/bonjour-3.5.0.tgz", @@ -8645,15 +8598,6 @@ "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==", "dev": true }, - "content-disposition": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", - "dev": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", @@ -8669,12 +8613,6 @@ "safe-buffer": "~5.1.1" } }, - "cookie": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", - "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", - "dev": true - }, "cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", @@ -9473,12 +9411,6 @@ "minimalistic-assert": "^1.0.0" } }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true - }, "detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -11046,47 +10978,99 @@ } }, "express": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", - "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "dev": true, "requires": { - "accepts": "~1.3.7", + "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.4.0", + "cookie": "0.5.0", "cookie-signature": "1.0.6", "debug": "2.6.9", - "depd": "~1.1.2", + "depd": "2.0.0", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "~1.1.2", + "finalhandler": "1.2.0", "fresh": "0.5.2", + "http-errors": "2.0.0", "merge-descriptors": "1.0.1", "methods": "~1.1.2", - "on-finished": "~2.3.0", + "on-finished": "2.4.1", "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", "range-parser": "~1.2.1", - "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", - "statuses": "~1.5.0", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" }, "dependencies": { + "accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dev": true, + "requires": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + } + }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "dev": true + }, + "body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dev": true, + "requires": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + } + }, + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true + }, + "content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dev": true, + "requires": { + "safe-buffer": "5.2.1" + } + }, + "cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", "dev": true }, "debug": { @@ -11098,22 +11082,157 @@ "ms": "2.0.0" } }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true + }, + "destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "dev": true + }, + "finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + } + }, + "http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "requires": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true }, + "on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", "dev": true }, "qs": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "requires": { + "side-channel": "^1.0.4" + } + }, + "raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dev": true, + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "dependencies": { + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dev": true, + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + } + }, + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true + }, + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true } } @@ -11422,38 +11541,6 @@ } } }, - "finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, "find-cache-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", @@ -12284,27 +12371,6 @@ "integrity": "sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==", "dev": true }, - "http-errors": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - } - } - }, "http-parser-js": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.5.tgz", @@ -20836,15 +20902,6 @@ "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", "dev": true }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dev": true, - "requires": { - "ee-first": "1.1.1" - } - }, "on-headers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", @@ -22634,26 +22691,6 @@ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true }, - "raw-body": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", - "dev": true, - "requires": { - "bytes": "3.1.0", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "dependencies": { - "bytes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", - "dev": true - } - } - }, "react": { "version": "16.14.0", "resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz", @@ -30399,52 +30436,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, - "send": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", - "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.7.2", - "mime": "1.6.0", - "ms": "2.1.1", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - }, - "dependencies": { - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - } - } - }, "serialize-javascript": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", @@ -30510,18 +30501,6 @@ } } }, - "serve-static": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", - "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", - "dev": true, - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.1" - } - }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -30557,12 +30536,6 @@ "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", "dev": true }, - "setprototypeof": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", - "dev": true - }, "sha.js": { "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", @@ -31969,12 +31942,6 @@ "repeat-string": "^1.6.1" } }, - "toidentifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", - "dev": true - }, "toposort": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz", From 808a4bde5f61982ebb93c7c357658562d1518e2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Feb 2023 12:56:59 +0000 Subject: [PATCH 09/15] Bump decode-uri-component from 0.2.0 to 0.2.2 Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2. - [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases) - [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2) --- updated-dependencies: - dependency-name: decode-uri-component dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba5b774a..2ba8e9f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9223,9 +9223,9 @@ } }, "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", "dev": true }, "dedent": { From da570e771a2c610f2a2a3435392d9765683ff359 Mon Sep 17 00:00:00 2001 From: CarlosMealha Date: Fri, 28 Oct 2022 14:00:48 +0100 Subject: [PATCH 10/15] feature: show hidden button style done on desktop --- .../AdvancedSearch/AdvancedSearchDesktop.js | 20 ++++++++++++++++++- .../AdvancedSearch/useAdvancedSearch.js | 3 +++ .../HomePage/SearchArea/SearchArea.js | 4 +++- .../HomePage/SearchArea/searchAreaStyle.js | 5 +++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/components/HomePage/SearchArea/AdvancedSearch/AdvancedSearchDesktop.js b/src/components/HomePage/SearchArea/AdvancedSearch/AdvancedSearchDesktop.js index 9f226ac6..1c31337b 100644 --- a/src/components/HomePage/SearchArea/AdvancedSearch/AdvancedSearchDesktop.js +++ b/src/components/HomePage/SearchArea/AdvancedSearch/AdvancedSearchDesktop.js @@ -11,6 +11,7 @@ import { FormHelperText, Button, } from "@material-ui/core"; +import useSession from "../../../../hooks/useSession"; import JobOptions from "../../../utils/offers/JobOptions"; import useSearchAreaStyles from "../searchAreaStyle"; @@ -40,11 +41,19 @@ JobDurationCollapse.propTypes = { const AdvancedSearchDesktop = () => { + const { data, + isValidating, + error, + isLoggedIn, + } = useSession(); + const sessionData = (!isValidating && !error && isLoggedIn) ? data : null; + const classes = useSearchAreaStyles(); const { advancedOptions, resetAdvancedSearch, FieldsSelectorProps, TechsSelectorProps, JobTypeSelectorProps, JobDurationSwitchProps, - ResetButtonProps, JobDurationSliderText, JobDurationCollapseProps, JobDurationSwitchLabel, JobDurationSliderProps, + ResetButtonProps, JobDurationSliderText, JobDurationCollapseProps, JobDurationSwitchLabel, JobHiddenSwitchLabel, + JobDurationSliderProps, } = useContext(AdvancedSearchControllerContext); return ( @@ -96,6 +105,7 @@ const AdvancedSearchDesktop = () => { /> {advancedOptions && +
+ {sessionData?.isAdmin && + } + label={JobHiddenSwitchLabel} + /> + }
+
} ); diff --git a/src/components/HomePage/SearchArea/AdvancedSearch/useAdvancedSearch.js b/src/components/HomePage/SearchArea/AdvancedSearch/useAdvancedSearch.js index 7e2aca8f..17ab2b37 100644 --- a/src/components/HomePage/SearchArea/AdvancedSearch/useAdvancedSearch.js +++ b/src/components/HomePage/SearchArea/AdvancedSearch/useAdvancedSearch.js @@ -30,6 +30,8 @@ export default ({ const JobDurationSwitchLabel = "Filter Job Duration"; + const JobHiddenSwitchLabel = "Show Hidden Offers"; + const [advancedOptions, toggleAdvancedOptions] = useToggle(enableAdvancedSearchDefault); const JobTypeSelectorProps = { @@ -98,6 +100,7 @@ export default ({ JobDurationSwitchProps, JobDurationCollapseProps, JobDurationSwitchLabel, + JobHiddenSwitchLabel, JobDurationSliderProps, JobDurationSliderText, ResetButtonProps, diff --git a/src/components/HomePage/SearchArea/SearchArea.js b/src/components/HomePage/SearchArea/SearchArea.js index db00fee4..85443007 100644 --- a/src/components/HomePage/SearchArea/SearchArea.js +++ b/src/components/HomePage/SearchArea/SearchArea.js @@ -11,6 +11,7 @@ import { setFields, setShowJobDurationSlider, setTechs, + hideOffer, } from "../../../actions/searchOffersActions"; import { INITIAL_JOB_TYPE, INITIAL_JOB_DURATION } from "../../../reducers/searchOffersReducer"; @@ -71,6 +72,7 @@ export const AdvancedSearchController = ({ technologies, setTechs: actualSetTechs, resetAdvancedSearchFields: actualResetAdvancedSearchFields, + hideOffer, }); const { search: searchOffers } = useOffersSearcher({ @@ -139,7 +141,7 @@ export const SearchArea = ({ onSubmit, searchValue, { enableAdvancedSearchDefault, showJobDurationSlider, setShowJobDurationSlider, jobMinDuration, jobMaxDuration, setJobDuration, jobType, setJobType, fields, setFields, technologies, setTechs, - resetAdvancedSearchFields, onSubmit, searchValue, setSearchValue, onMobileClose, + resetAdvancedSearchFields, hideOffer, onSubmit, searchValue, setSearchValue, onMobileClose, }, AdvancedSearchControllerContext ); diff --git a/src/components/HomePage/SearchArea/searchAreaStyle.js b/src/components/HomePage/SearchArea/searchAreaStyle.js index ebc6d021..14555fa9 100644 --- a/src/components/HomePage/SearchArea/searchAreaStyle.js +++ b/src/components/HomePage/SearchArea/searchAreaStyle.js @@ -88,4 +88,9 @@ export default makeStyles((theme) => ({ marginLeft: theme.spacing(-1), }, }, + spaceBtwn: { + "& > *": { + justifyContent: "space-between", + }, + }, })); From dc9ea8f984a2c28b5f4130201424f32b57eaa232 Mon Sep 17 00:00:00 2001 From: CarlosMealha Date: Tue, 15 Nov 2022 13:08:42 +0000 Subject: [PATCH 11/15] feat: inserted the reset advanced search and show hidden offers buttons inside of the advancedSearchContainer grid --- .../AdvancedSearch/AdvancedSearchDesktop.js | 30 ++++++++----------- .../HomePage/SearchArea/searchAreaStyle.js | 17 +++++++---- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/components/HomePage/SearchArea/AdvancedSearch/AdvancedSearchDesktop.js b/src/components/HomePage/SearchArea/AdvancedSearch/AdvancedSearchDesktop.js index 1c31337b..d2f31681 100644 --- a/src/components/HomePage/SearchArea/AdvancedSearch/AdvancedSearchDesktop.js +++ b/src/components/HomePage/SearchArea/AdvancedSearch/AdvancedSearchDesktop.js @@ -103,28 +103,24 @@ const AdvancedSearchDesktop = () => { className: "chip-wrapper", }} /> - - {advancedOptions && -
- - {sessionData?.isAdmin && + +
+ {sessionData?.isAdmin && } label={JobHiddenSwitchLabel} /> - } -
-
- } + } + ); }; diff --git a/src/components/HomePage/SearchArea/searchAreaStyle.js b/src/components/HomePage/SearchArea/searchAreaStyle.js index 14555fa9..7db66521 100644 --- a/src/components/HomePage/SearchArea/searchAreaStyle.js +++ b/src/components/HomePage/SearchArea/searchAreaStyle.js @@ -24,7 +24,7 @@ export default makeStyles((theme) => ({ advancedSearchContainer: { display: "grid", gridTemplateColumns: "1fr 1fr", - gridTemplateRows: "1fr 0.7fr auto", + gridTemplateRows: "1fr 0.7fr 1fr 0.7fr", alignItems: "center", gridGap: "1em", }, @@ -82,15 +82,20 @@ export default makeStyles((theme) => ({ gridColumnStart: 2, }, resetBtnWrapper: { - display: "flex", + gridRowStart: 4, + gridColumnStart: 1, "& > *": { marginTop: theme.spacing(2), marginLeft: theme.spacing(-1), }, - }, - spaceBtwn: { - "& > *": { - justifyContent: "space-between", + "& .chip-wrapper": { + gridColumnStart: 2, + gridRowStart: 4, }, }, + jobHiddenSliderToggle: { + gridRowStart: 4, + gridColumnStart: 2, + + }, })); From 8f9efaec0d6a1eaf1e6303f970a55efc9a71ab14 Mon Sep 17 00:00:00 2001 From: CarlosMealha Date: Tue, 15 Nov 2022 14:18:10 +0000 Subject: [PATCH 12/15] feat: showHidden is already working --- src/actions/searchOffersActions.js | 6 +++++ .../AdvancedSearch/AdvancedSearchDesktop.js | 22 +++++++++---------- .../AdvancedSearch/useAdvancedSearch.js | 12 ++++++++++ .../HomePage/SearchArea/SearchArea.js | 15 +++++++++++-- .../HomePage/SearchArea/searchAreaStyle.js | 1 - src/reducers/searchOffersReducer.js | 6 +++++ 6 files changed, 48 insertions(+), 14 deletions(-) diff --git a/src/actions/searchOffersActions.js b/src/actions/searchOffersActions.js index 751cdb0f..6cce5f3e 100644 --- a/src/actions/searchOffersActions.js +++ b/src/actions/searchOffersActions.js @@ -15,6 +15,7 @@ export const OfferSearchTypes = Object.freeze({ DISABLE_OFFER: "DISABLE_OFFER", COMPANY_ENABLE_OFFER: "COMPANY_ENABLE_OFFER", ADMIN_ENABLE_OFFER: "ADMIN_ENABLE_OFFER", + SET_SHOW_HIDDEN: "SET_SHOW_HIDDEN", }); export const setLoadingOffers = (loading) => ({ @@ -100,3 +101,8 @@ export const resetAdvancedSearchFields = () => (dispatch) => { dispatch(setFields([])); dispatch(setTechs([])); }; + +export const setShowHidden = (showHidden) => ({ + type: OfferSearchTypes.SET_SHOW_HIDDEN, + showHidden, +}); diff --git a/src/components/HomePage/SearchArea/AdvancedSearch/AdvancedSearchDesktop.js b/src/components/HomePage/SearchArea/AdvancedSearch/AdvancedSearchDesktop.js index d2f31681..ae88745f 100644 --- a/src/components/HomePage/SearchArea/AdvancedSearch/AdvancedSearchDesktop.js +++ b/src/components/HomePage/SearchArea/AdvancedSearch/AdvancedSearchDesktop.js @@ -53,7 +53,7 @@ const AdvancedSearchDesktop = () => { const { advancedOptions, resetAdvancedSearch, FieldsSelectorProps, TechsSelectorProps, JobTypeSelectorProps, JobDurationSwitchProps, ResetButtonProps, JobDurationSliderText, JobDurationCollapseProps, JobDurationSwitchLabel, JobHiddenSwitchLabel, - JobDurationSliderProps, + JobDurationSliderProps, ShowHiddenSwitchProps, } = useContext(AdvancedSearchControllerContext); return ( @@ -104,19 +104,19 @@ const AdvancedSearchDesktop = () => { }} />
- -
+ +
{sessionData?.isAdmin && } + control={} label={JobHiddenSwitchLabel} /> } diff --git a/src/components/HomePage/SearchArea/AdvancedSearch/useAdvancedSearch.js b/src/components/HomePage/SearchArea/AdvancedSearch/useAdvancedSearch.js index 17ab2b37..39f73710 100644 --- a/src/components/HomePage/SearchArea/AdvancedSearch/useAdvancedSearch.js +++ b/src/components/HomePage/SearchArea/AdvancedSearch/useAdvancedSearch.js @@ -19,6 +19,8 @@ export default ({ technologies, setTechs, resetAdvancedSearchFields, + showHidden, + setShowHidden, }) => { const jobDuration = [jobMinDuration, jobMaxDuration]; @@ -72,6 +74,15 @@ export default ({ const FieldsSelectorProps = useFieldSelector(fields, setFields); const TechsSelectorProps = useTechSelector(technologies, setTechs); + const toggleShowHidden = useCallback(() => { + setShowHidden(!showHidden); + }, [setShowHidden, showHidden]); + + const ShowHiddenSwitchProps = { + checked: showHidden, + onChange: toggleShowHidden, + value: "filterShowHiddenOffers", + }; const advancedOptionsActive = showJobDurationSlider || (jobType !== INITIAL_JOB_TYPE) @@ -104,5 +115,6 @@ export default ({ JobDurationSliderProps, JobDurationSliderText, ResetButtonProps, + ShowHiddenSwitchProps, }; }; diff --git a/src/components/HomePage/SearchArea/SearchArea.js b/src/components/HomePage/SearchArea/SearchArea.js index 85443007..5a99c461 100644 --- a/src/components/HomePage/SearchArea/SearchArea.js +++ b/src/components/HomePage/SearchArea/SearchArea.js @@ -12,6 +12,7 @@ import { setShowJobDurationSlider, setTechs, hideOffer, + setShowHidden, } from "../../../actions/searchOffersActions"; import { INITIAL_JOB_TYPE, INITIAL_JOB_DURATION } from "../../../reducers/searchOffersReducer"; @@ -37,7 +38,8 @@ export const AdvancedSearchControllerContext = React.createContext({}); export const AdvancedSearchController = ({ enableAdvancedSearchDefault, showJobDurationSlider, setShowJobDurationSlider, jobMinDuration, jobMaxDuration, setJobDuration, jobType, setJobType, fields, setFields, technologies, setTechs, - resetAdvancedSearchFields, onSubmit, searchValue, setSearchValue, onMobileClose, + resetAdvancedSearchFields, onSubmit, searchValue, setSearchValue, onMobileClose, showHidden, + setShowHidden, }) => { const { @@ -73,6 +75,8 @@ export const AdvancedSearchController = ({ setTechs: actualSetTechs, resetAdvancedSearchFields: actualResetAdvancedSearchFields, hideOffer, + showHidden, + setShowHidden, }); const { search: searchOffers } = useOffersSearcher({ @@ -82,6 +86,7 @@ export const AdvancedSearchController = ({ jobType, fields, technologies, + showHidden, }); const submitForm = useCallback((e, updateUrl = true) => { @@ -126,7 +131,8 @@ export const AdvancedSearchController = ({ export const SearchArea = ({ onSubmit, searchValue, jobMinDuration = INITIAL_JOB_DURATION, jobMaxDuration = INITIAL_JOB_DURATION + 1, jobType = INITIAL_JOB_TYPE, fields, technologies, showJobDurationSlider, setShowJobDurationSlider, advanced: enableAdvancedSearchDefault = false, - setSearchValue, setJobDuration, setJobType, setFields, setTechs, resetAdvancedSearchFields, onMobileClose }) => { + setSearchValue, setJobDuration, setJobType, setFields, setTechs, resetAdvancedSearchFields, onMobileClose, showHidden, + setShowHidden }) => { const classes = useSearchAreaStyles(); const { @@ -142,6 +148,7 @@ export const SearchArea = ({ onSubmit, searchValue, enableAdvancedSearchDefault, showJobDurationSlider, setShowJobDurationSlider, jobMinDuration, jobMaxDuration, setJobDuration, jobType, setJobType, fields, setFields, technologies, setTechs, resetAdvancedSearchFields, hideOffer, onSubmit, searchValue, setSearchValue, onMobileClose, + showHidden, setShowHidden, }, AdvancedSearchControllerContext ); @@ -206,6 +213,8 @@ SearchArea.propTypes = { setTechs: PropTypes.func.isRequired, setShowJobDurationSlider: PropTypes.func.isRequired, onMobileClose: PropTypes.func, + showHidden: PropTypes.bool, + setShowHidden: PropTypes.func, advanced: PropTypes.bool, }; @@ -217,6 +226,7 @@ export const mapStateToProps = ({ offerSearch }) => ({ fields: offerSearch.fields, technologies: offerSearch.technologies, showJobDurationSlider: offerSearch.filterJobDuration, + showHidden: offerSearch.showHidden, }); export const mapDispatchToProps = (dispatch) => ({ @@ -226,6 +236,7 @@ export const mapDispatchToProps = (dispatch) => ({ setFields: (fields) => dispatch(setFields(fields)), setTechs: (technologies) => dispatch(setTechs(technologies)), setShowJobDurationSlider: (val) => dispatch(setShowJobDurationSlider(val)), + setShowHidden: (val) => dispatch(setShowHidden(val)), resetAdvancedSearchFields: () => dispatch(resetAdvancedSearchFields()), }); diff --git a/src/components/HomePage/SearchArea/searchAreaStyle.js b/src/components/HomePage/SearchArea/searchAreaStyle.js index 7db66521..c13dde37 100644 --- a/src/components/HomePage/SearchArea/searchAreaStyle.js +++ b/src/components/HomePage/SearchArea/searchAreaStyle.js @@ -96,6 +96,5 @@ export default makeStyles((theme) => ({ jobHiddenSliderToggle: { gridRowStart: 4, gridColumnStart: 2, - }, })); diff --git a/src/reducers/searchOffersReducer.js b/src/reducers/searchOffersReducer.js index c07b18f1..1240de74 100644 --- a/src/reducers/searchOffersReducer.js +++ b/src/reducers/searchOffersReducer.js @@ -18,6 +18,7 @@ const initialState = { offers: [], loading: false, error: INITIAL_ERROR, + showHidden: false, }; export default (state = initialState, action) => { @@ -107,6 +108,11 @@ export default (state = initialState, action) => { new Offer({ ...offer, isHidden: false, hiddenReason: null, adminReason: null }) : offer ) }; + case OfferSearchTypes.SET_SHOW_HIDDEN: + return { + ...state, + showHidden: action.showHidden, + }; default: return state; } From e44fb98d190b11eb584ab7cb4ab5ae5a5e88f75f Mon Sep 17 00:00:00 2001 From: CarlosMealha Date: Tue, 24 Jan 2023 16:18:09 +0000 Subject: [PATCH 13/15] test: adds showHidden test --- src/actions/searchOffersActions.js | 1 + src/reducers/searchOffersReducer.spec.js | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/actions/searchOffersActions.js b/src/actions/searchOffersActions.js index 6cce5f3e..2003e4eb 100644 --- a/src/actions/searchOffersActions.js +++ b/src/actions/searchOffersActions.js @@ -100,6 +100,7 @@ export const resetAdvancedSearchFields = () => (dispatch) => { dispatch(setJobDuration(INITIAL_JOB_DURATION, INITIAL_JOB_DURATION + 1)); dispatch(setFields([])); dispatch(setTechs([])); + dispatch(setShowHidden(false)); }; export const setShowHidden = (showHidden) => ({ diff --git a/src/reducers/searchOffersReducer.spec.js b/src/reducers/searchOffersReducer.spec.js index f213ae62..f4378de4 100644 --- a/src/reducers/searchOffersReducer.spec.js +++ b/src/reducers/searchOffersReducer.spec.js @@ -14,6 +14,7 @@ import { disableOffer, companyEnableOffer, adminEnableOffer, + setShowHidden, } from "../actions/searchOffersActions"; describe("Search Offers Reducer", () => { @@ -26,8 +27,10 @@ describe("Search Offers Reducer", () => { offers: [], fields: [], technologies: [], + showHidden: false, loading: false, - error: null }); + error: null, + }); }); it("should set offers when setSearchOffers action is called", () => { @@ -111,6 +114,17 @@ describe("Search Offers Reducer", () => { expect(state.fields).toStrictEqual(["test1", "test2"]); }); + it("should set advanced search fields when setShowHidden action is called", () => { + const state = searchOffersState( + { + showHidden: false, + }, + setShowHidden(true) + ); + + expect(state.showHidden).toBe(true); + }); + it("should set advanced search technologies when setTechs action is called", () => { const state = searchOffersState( { From 02e4711ed794b9a0691768425a2ff52f4e1cfb4d Mon Sep 17 00:00:00 2001 From: CarlosMealha Date: Tue, 7 Feb 2023 14:32:38 +0000 Subject: [PATCH 14/15] tests: adds various tests to showHidden --- src/actions/searchOffersActions.js | 10 +++++----- src/actions/searchOffersActions.spec.js | 12 ++++++++++++ .../HomePage/SearchArea/SearchArea.spec.js | 12 ++++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/actions/searchOffersActions.js b/src/actions/searchOffersActions.js index 2003e4eb..e73bc249 100644 --- a/src/actions/searchOffersActions.js +++ b/src/actions/searchOffersActions.js @@ -94,6 +94,11 @@ export const adminEnableOffer = (offerIdx) => ({ offerIdx, }); +export const setShowHidden = (showHidden) => ({ + type: OfferSearchTypes.SET_SHOW_HIDDEN, + showHidden, +}); + export const resetAdvancedSearchFields = () => (dispatch) => { dispatch(setJobType(INITIAL_JOB_TYPE)); dispatch(setShowJobDurationSlider(false)); @@ -102,8 +107,3 @@ export const resetAdvancedSearchFields = () => (dispatch) => { dispatch(setTechs([])); dispatch(setShowHidden(false)); }; - -export const setShowHidden = (showHidden) => ({ - type: OfferSearchTypes.SET_SHOW_HIDDEN, - showHidden, -}); diff --git a/src/actions/searchOffersActions.spec.js b/src/actions/searchOffersActions.spec.js index fe87c2d6..c117e1dd 100644 --- a/src/actions/searchOffersActions.spec.js +++ b/src/actions/searchOffersActions.spec.js @@ -12,6 +12,7 @@ import { resetAdvancedSearchFields, setOffersFetchError, resetOffersFetchError, + setShowHidden, } from "./searchOffersActions"; import { INITIAL_JOB_TYPE, INITIAL_JOB_DURATION } from "../reducers/searchOffersReducer"; @@ -54,6 +55,17 @@ describe("Search Offers actions", () => { expect(setSearchValue(value)).toEqual(expectedAction); }); + it("should return Set Show Hidden action", () => { + + const showHidden = "show_hidden"; + const expectedAction = { + type: OfferSearchTypes.SET_SHOW_HIDDEN, + showHidden, + }; + + expect(setShowHidden(showHidden)).toEqual(expectedAction); + }); + it("should return Set Job Duration action", () => { const jobDuration = [1, 2]; diff --git a/src/components/HomePage/SearchArea/SearchArea.spec.js b/src/components/HomePage/SearchArea/SearchArea.spec.js index 3de94421..cd888bd3 100644 --- a/src/components/HomePage/SearchArea/SearchArea.spec.js +++ b/src/components/HomePage/SearchArea/SearchArea.spec.js @@ -79,6 +79,15 @@ describe("SearchArea", () => { { }} + setTechs={() => { }} + setJobDuration={() => { }} + setFields={() => { }} + setJobType={() => { }} + setSearchValue={() => { }} + setShowHidden={() => { }} /> , { initialState, theme } @@ -197,6 +206,7 @@ describe("SearchArea", () => { setJobDuration={() => { }} setFields={() => { }} setJobType={() => { }} + setShowHidden={() => { }} onSubmit={onSubmit} fields={[]} technologies={[]} @@ -272,6 +282,7 @@ describe("SearchArea", () => { jobDuration: [1, 2], fields: ["field1", "field2"], technologies: ["tech1", "tech2"], + showHidden: true, }, }; expect(mapStateToProps(mockState)).toEqual({ @@ -281,6 +292,7 @@ describe("SearchArea", () => { jobMaxDuration: 2, fields: ["field1", "field2"], technologies: ["tech1", "tech2"], + showHidden: true, }); }); From 695e80359a48867cac0b276bd1ac4d45fa30d941 Mon Sep 17 00:00:00 2001 From: CarlosMealha Date: Sun, 12 Feb 2023 11:50:59 +0000 Subject: [PATCH 15/15] test: adds more showHidden tests Co-authored-by: Diogo Fonte diogo.fonte2000@gmail.com --- src/actions/searchOffersActions.spec.js | 2 +- src/components/HomePage/SearchArea/SearchArea.spec.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/actions/searchOffersActions.spec.js b/src/actions/searchOffersActions.spec.js index c117e1dd..f886bf09 100644 --- a/src/actions/searchOffersActions.spec.js +++ b/src/actions/searchOffersActions.spec.js @@ -57,7 +57,7 @@ describe("Search Offers actions", () => { it("should return Set Show Hidden action", () => { - const showHidden = "show_hidden"; + const showHidden = true; const expectedAction = { type: OfferSearchTypes.SET_SHOW_HIDDEN, showHidden, diff --git a/src/components/HomePage/SearchArea/SearchArea.spec.js b/src/components/HomePage/SearchArea/SearchArea.spec.js index cd888bd3..1bdfe74d 100644 --- a/src/components/HomePage/SearchArea/SearchArea.spec.js +++ b/src/components/HomePage/SearchArea/SearchArea.spec.js @@ -7,6 +7,7 @@ import { setFields, setTechs, setShowJobDurationSlider, + setShowHidden, } from "../../../actions/searchOffersActions"; import { createTheme } from "@material-ui/core"; import { renderWithStoreAndTheme, screen, fireEvent, act } from "../../../test-utils"; @@ -28,7 +29,7 @@ const SearchAreaWrapper = ({ searchValue = "", jobType = INITIAL_JOB_TYPE, jobDuration = [null, null], filterJobDuration = false, showJobDurationSlider = false, fields = [], technologies = [], setShowJobDurationSlider = () => { }, setTechs = () => { }, setJobDuration = () => { }, setFields = () => { }, setJobType = () => { }, - setSearchValue = () => { }, onSubmit = () => {}, + setSearchValue = () => { }, onSubmit = () => {}, setShowHidden = () => { }, }) => ( ); @@ -63,6 +65,7 @@ SearchAreaWrapper.propTypes = { setShowJobDurationSlider: PropTypes.func.isRequired, jobDuration: PropTypes.number, filterJobDuration: PropTypes.bool, + setShowHidden: PropTypes.bool, }; describe("SearchArea", () => { @@ -321,6 +324,10 @@ describe("SearchArea", () => { props.setShowJobDurationSlider(filterJobDuration); expect(dispatch).toHaveBeenCalledWith(setShowJobDurationSlider(false)); + const showHidden = true; + props.setShowHidden(showHidden); + expect(dispatch).toHaveBeenCalledWith(setShowHidden(true)); + dispatch.mockClear(); props.resetAdvancedSearchFields(); expect(dispatch).toHaveBeenCalled();