From e7433d803f43d7bb3f258152378e7cfa1f10a213 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Thu, 6 Aug 2020 10:51:49 -0700
Subject: [PATCH 01/43] =?UTF-8?q?=F0=9F=93=A6=20Bump=20Version=20-=20Bump?=
=?UTF-8?q?=20version=20to=20v1.4.0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package-lock.json | 2 +-
package.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index dfae6f6..8934f9d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "gh-jobs",
- "version": "1.3.0",
+ "version": "1.4.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index d46ed2c..eea6c82 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "gh-jobs",
- "version": "1.3.0",
+ "version": "1.4.0",
"description": "A MERN application bootstrapped with create-mern-application.",
"main": "build/index.js",
"scripts": {
From 174738fc3cb1d7c6d561bc1020bb9612e1653bb3 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Thu, 6 Aug 2020 10:59:19 -0700
Subject: [PATCH 02/43] =?UTF-8?q?=F0=9F=93=9D=20CHANGELOG=20-=20Add=20v1.4?=
=?UTF-8?q?.0=20to=20CHANGELOG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
CHANGELOG.md | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 95efdb8..3ed6f1f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,16 @@ 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.4.0] - _Unreleased_
+
+### Added
+
+### Changed
+
+### Removed
+
+### Fixed
+
## [1.3.0] - 2020-08-06
### 🙈 Hide Job
From ef9f37bb2eb675320299a4da0e43b092e75b5527 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Thu, 6 Aug 2020 11:47:09 -0700
Subject: [PATCH 03/43] =?UTF-8?q?=E2=8C=9B=20LoadingIndicator=20Stops=20Be?=
=?UTF-8?q?fore=20Jobs=20Response=20Received=20#68=20-=20Adjust=20thunk?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/redux/thunks.ts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/client/redux/thunks.ts b/src/client/redux/thunks.ts
index 091ce49..1721cea 100644
--- a/src/client/redux/thunks.ts
+++ b/src/client/redux/thunks.ts
@@ -66,6 +66,8 @@ import {
export const getJobs = (): AppThunk => async (dispatch) => {
try {
+ dispatch(setIsLoading(true));
+
const result = (await fetchServerData("/jobs", "GET")) as
| GetJobsErrorResponse
| GetJobsSuccessResponse;
@@ -240,7 +242,6 @@ export const checkAuthentication = (): AppThunk => async (dispatch) => {
// eslint-disable-next-line no-console
console.error(error);
}
- dispatch(setIsLoading(false));
};
export const logOut = (): AppThunk => async (dispatch) => {
From d1066ee66a48503ccb4ce2e73fa37000df8ceb1b Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Thu, 6 Aug 2020 13:12:02 -0700
Subject: [PATCH 04/43] =?UTF-8?q?=E2=8C=9B=20LoadingIndicator=20Stops=20Be?=
=?UTF-8?q?fore=20Jobs=20Response=20Received=20#68=20-=20Add=20test=20case?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
cypress/integration/search.spec.js | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/cypress/integration/search.spec.js b/cypress/integration/search.spec.js
index 4b63222..40b89ad 100644
--- a/cypress/integration/search.spec.js
+++ b/cypress/integration/search.spec.js
@@ -82,3 +82,31 @@ context("Search - No Results", () => {
);
});
});
+
+context("Search - Loading Indicator", () => {
+ beforeEach(() => {
+ cy.fixture("jobs50").then((jobsJson) => {
+ cy.server();
+ cy.route({
+ method: "GET",
+ url: "/jobs",
+ status: 200,
+ response: jobsJson,
+ delay: 3000,
+ });
+ });
+ });
+
+ it("Should display note when there are no results", () => {
+ cy.visit("http://localhost:3000");
+ cy.get("#no-results").should("be.visible");
+ cy.get("[data-cy=orbit-container] > :nth-child(3)").should("be.visible");
+
+ cy.wait(3100);
+
+ cy.get("#no-results").should("not.be.visible");
+ cy.get("[data-cy=orbit-container] > :nth-child(3)").should(
+ "not.be.visible"
+ );
+ });
+});
From 062717ad8361e193edb92fe6adc57f2bbb52a3d2 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Thu, 6 Aug 2020 13:23:55 -0700
Subject: [PATCH 05/43] =?UTF-8?q?=F0=9F=92=AC=20User=20Not=20Found=20Messa?=
=?UTF-8?q?ge=20#67=20-=20Modify=20'UserController'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/server/controllers/user.ts | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/server/controllers/user.ts b/src/server/controllers/user.ts
index 2e7ad88..e4e006d 100644
--- a/src/server/controllers/user.ts
+++ b/src/server/controllers/user.ts
@@ -131,6 +131,15 @@ class UserController {
return res.status(400).send({ error: "Invalid email" });
}
+ const usersWithEmail = await User.findOne({ email: req.body.email });
+
+ if (!usersWithEmail) {
+ return res.status(401).send({
+ error:
+ "We couldn't find a user with that email address. Please create an account, or provide another email address.",
+ });
+ }
+
const user: UserDocument = await User.findByCredentials(
req.body.email,
req.body.password
From 37ce54f69da2a323584af0af9d86f0794cbac64d Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Thu, 6 Aug 2020 13:25:52 -0700
Subject: [PATCH 06/43] =?UTF-8?q?=F0=9F=92=AC=20User=20Not=20Found=20Messa?=
=?UTF-8?q?ge=20#67=20-=20Add=20test=20case?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
cypress/integration/login.spec.js | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/cypress/integration/login.spec.js b/cypress/integration/login.spec.js
index 177d248..fae6a31 100644
--- a/cypress/integration/login.spec.js
+++ b/cypress/integration/login.spec.js
@@ -61,11 +61,22 @@ context("Login - Error", () => {
cy.get("h1").should("have.text", "Login");
});
- it("Should not allow to login with invalid credentials", () => {
+ it("Should not allow to login with invalid credentials for an existing account", () => {
+ cy.get("#email").type("bobtest@email.com");
+ cy.get("#password").type("Blue123456!!!");
+ cy.get("#log-in").click();
+ cy.wait(500);
+ cy.get("#notification").should("have.text", "Invalid credentials.");
+ });
+
+ it("Should not allow to login with an account that does not exist", () => {
cy.get("#email").type("fake@email.com");
cy.get("#password").type("Red123456!!!");
cy.get("#log-in").click();
cy.wait(500);
- cy.get("#notification").should("have.text", "Invalid credentials.");
+ cy.get("#notification").should(
+ "have.text",
+ "We couldn't find a user with that email address. Please create an account, or provide another email address."
+ );
});
});
From 404ce3ac5f0fdf7731dd354205e233e646f94f32 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Thu, 6 Aug 2020 13:31:53 -0700
Subject: [PATCH 07/43] =?UTF-8?q?=E2=8C=9B=20LoadingIndicator=20Stops=20Be?=
=?UTF-8?q?fore=20Jobs=20Response=20Received=20#68=20-=20Change=20test=20c?=
=?UTF-8?q?ase=20title?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
cypress/integration/search.spec.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cypress/integration/search.spec.js b/cypress/integration/search.spec.js
index 40b89ad..b6dbe17 100644
--- a/cypress/integration/search.spec.js
+++ b/cypress/integration/search.spec.js
@@ -97,7 +97,7 @@ context("Search - Loading Indicator", () => {
});
});
- it("Should display note when there are no results", () => {
+ it("Should display LoadingIndicator correctly on jobs loading", () => {
cy.visit("http://localhost:3000");
cy.get("#no-results").should("be.visible");
cy.get("[data-cy=orbit-container] > :nth-child(3)").should("be.visible");
From 0c993df8ec8b99da29b0833f2701140469b32570 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Thu, 6 Aug 2020 13:34:27 -0700
Subject: [PATCH 08/43] =?UTF-8?q?=F0=9F=8C=90=20Forward=20Heroku=20to=20Gi?=
=?UTF-8?q?tHubJobs.io=20#46=20-=20Attempt=20another=20redirect?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/server/app.ts | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/server/app.ts b/src/server/app.ts
index f07488e..d32f659 100644
--- a/src/server/app.ts
+++ b/src/server/app.ts
@@ -74,9 +74,15 @@ class App {
this.app.use(express.static(path.join(__dirname, "../dist")));
this.app.get("*", (req: Request, res: Response) => {
- console.log({ hostname: req.hostname });
- console.log({ referrer: req.headers.referer });
- // return res.status(301).redirect("https://www.githubjobs.io/");
+ if (req.headers.host === "gh-jobs.herokuapp.com") {
+ return res.status(301).redirect("https://www.githubjobs.io/");
+ }
+ console.log(
+ chalk.blueBright.inverse({
+ host: req.headers.host,
+ referrer: req.headers.referer,
+ })
+ );
res.sendFile(path.join(__dirname, "../dist/index.html"));
});
}
From d794eeaf522df772e76c11ef4bcf2b6d08aafa4f Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Thu, 6 Aug 2020 14:05:26 -0700
Subject: [PATCH 09/43] =?UTF-8?q?=E2=9C=85=20OptionsPanel=20Search=20#43?=
=?UTF-8?q?=20-=20Create=20Button?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/components/OptionsPanel/OptionsPanel.tsx | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/client/components/OptionsPanel/OptionsPanel.tsx b/src/client/components/OptionsPanel/OptionsPanel.tsx
index 94fb9a9..f858d0c 100644
--- a/src/client/components/OptionsPanel/OptionsPanel.tsx
+++ b/src/client/components/OptionsPanel/OptionsPanel.tsx
@@ -1,6 +1,7 @@
import * as React from "react";
import { connect } from "react-redux";
+import Button from "../Button";
import Checkbox from "../Checkbox";
import Input from "../Input";
@@ -64,6 +65,8 @@ const OptionsPanel: React.SFC = (
value={location.name}
/>
))}
+
+
);
};
From 4a4540032254146f812d6148cdb1362a4b3816e4 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Fri, 7 Aug 2020 09:58:48 -0700
Subject: [PATCH 10/43] =?UTF-8?q?=E2=9C=85=20OptionsPanel=20Search=20#43?=
=?UTF-8?q?=20-=20Add=20search=20functionality?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/components/OptionsPanel/OptionsPanel.tsx | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/client/components/OptionsPanel/OptionsPanel.tsx b/src/client/components/OptionsPanel/OptionsPanel.tsx
index f858d0c..e60bcee 100644
--- a/src/client/components/OptionsPanel/OptionsPanel.tsx
+++ b/src/client/components/OptionsPanel/OptionsPanel.tsx
@@ -11,12 +11,14 @@ import {
setFullTime,
setLocationSearch,
} from "../../redux/actions/application";
+import { searchJobs } from "../../redux/thunks";
import { LocationOption, RootState } from "../../types";
export interface OptionsPanelProps {
fullTime: boolean;
handleCheckBox: (e: React.ChangeEvent) => void;
+ handleSearch: (search: string, locationOptions: LocationOption[]) => void;
handleSetFullTime: (fullTime: boolean) => void;
handleSetLocationSearch: (locationSearch: string) => void;
locationOptions: LocationOption[];
@@ -29,6 +31,7 @@ const OptionsPanel: React.SFC = (
const {
fullTime,
handleCheckBox,
+ handleSearch,
handleSetFullTime,
handleSetLocationSearch,
locationOptions,
@@ -66,7 +69,12 @@ const OptionsPanel: React.SFC = (
/>
))}
-
+
+
+
User Information
+
+
+
+ );
+};
+
+const mapStateToProps = (state: RootState) => ({
+ email: state.user.email,
+ name: state.user.name,
+});
+
+export default connect(mapStateToProps)(ProfileAccountDetails);
diff --git a/src/client/components/Profile/index.ts b/src/client/components/Profile/index.ts
index d915c39..b2ecc0b 100644
--- a/src/client/components/Profile/index.ts
+++ b/src/client/components/Profile/index.ts
@@ -1,3 +1,4 @@
+import ProfileAccountDetails from "./ProfileAccountDetails";
import ProfileDelete from "./ProfileDelete";
import ProfileDisplay from "./ProfileDisplay";
import ProfileEdit from "./ProfileEdit";
@@ -7,6 +8,7 @@ import ProfileReset from "./ProfileReset";
import ProfileSavedJobs from "./ProfileSavedJobs";
export {
+ ProfileAccountDetails,
ProfileDelete,
ProfileDisplay,
ProfileEdit,
diff --git a/src/client/pages/Profile/Profile.tsx b/src/client/pages/Profile/Profile.tsx
index c4c8497..e84c0fa 100644
--- a/src/client/pages/Profile/Profile.tsx
+++ b/src/client/pages/Profile/Profile.tsx
@@ -3,6 +3,7 @@ import { connect } from "react-redux";
import { Redirect } from "react-router-dom";
import {
+ ProfileAccountDetails,
ProfileDelete,
ProfileDisplay,
ProfileEdit,
@@ -59,6 +60,7 @@ const Profile: React.SFC = (props: ProfileProps) => {
return (
+
Date: Mon, 10 Aug 2020 09:23:00 -0700
Subject: [PATCH 14/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Add=20Account=20Details=20(Styled)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/Profile/Profile-styled.tsx | 46 ++++++++++++++++++-
.../Profile/ProfileAccountDetails.tsx | 14 ++++--
2 files changed, 54 insertions(+), 6 deletions(-)
diff --git a/src/client/components/Profile/Profile-styled.tsx b/src/client/components/Profile/Profile-styled.tsx
index 5c4dba0..1f37fa2 100644
--- a/src/client/components/Profile/Profile-styled.tsx
+++ b/src/client/components/Profile/Profile-styled.tsx
@@ -121,9 +121,53 @@ const ProfileHeroContainer = styled.div`
padding: 50px;
`;
-const ProfileAccountDetailsContainer = styled.div``;
+const ProfileAccountDetailsContentContainer = styled.div`
+ padding: 25px;
+
+ h4 {
+ font-size: 14px;
+ margin: 0;
+ text-transform: uppercase;
+ }
+
+ input {
+ border-bottom-left-radius: 4px;
+ border-left: 1px solid #b9bdcf;
+ border-top-left-radius: 4px;
+ color: #b9bdcf;
+ }
+
+ div {
+ max-width: 100%;
+ }
+`;
+
+const ProfileAccountDetailsHeadingContainer = styled.div`
+ align-items: center;
+ background-color: #ffffff;
+ border-top-left-radius: 1.25rem;
+ border-top-right-radius: 1.25rem;
+ display: flex;
+ height: 50px;
+ padding-left: 25px;
+ padding-right: 25px;
+
+ h3 {
+ margin: 0;
+ }
+`;
+
+const ProfileAccountDetailsContainer = styled.div`
+ background-color: rgba(246, 249, 251, 1);
+ border-radius: 1.25rem;
+ box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
+ margin-top: -100px;
+ width: 50%;
+`;
export {
+ ProfileAccountDetailsContentContainer,
+ ProfileAccountDetailsHeadingContainer,
ProfileAccountDetailsContainer,
ProfileActionsContainer,
ProfilePage,
diff --git a/src/client/components/Profile/ProfileAccountDetails.tsx b/src/client/components/Profile/ProfileAccountDetails.tsx
index bf890bf..474febb 100644
--- a/src/client/components/Profile/ProfileAccountDetails.tsx
+++ b/src/client/components/Profile/ProfileAccountDetails.tsx
@@ -3,7 +3,11 @@ import { connect } from "react-redux";
import Input from "../Input";
-import { ProfileAccountDetailsContainer } from "./Profile-styled";
+import {
+ ProfileAccountDetailsContentContainer,
+ ProfileAccountDetailsHeadingContainer,
+ ProfileAccountDetailsContainer,
+} from "./Profile-styled";
import { RootState } from "../../types";
@@ -18,16 +22,16 @@ const ProfileAccountDetails: React.SFC = (
const { email, name } = props;
return (
-
-
+
);
};
From 3cd7cdd1b5727fba93e14f10ce5d229358484780 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Mon, 10 Aug 2020 10:30:25 -0700
Subject: [PATCH 15/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Add=20Account=20Stats=20(Unstyled)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/Profile/Profile-styled.tsx | 32 ++++++++++++++--
.../Profile/ProfileAccountDetails.tsx | 20 +++++++++-
.../Profile/ProfileAccountStats.tsx | 37 +++++++++++++++++++
src/client/components/Profile/index.ts | 2 +
src/client/pages/Profile/Profile.tsx | 8 +++-
5 files changed, 92 insertions(+), 7 deletions(-)
create mode 100644 src/client/components/Profile/ProfileAccountStats.tsx
diff --git a/src/client/components/Profile/Profile-styled.tsx b/src/client/components/Profile/Profile-styled.tsx
index 1f37fa2..c6f5426 100644
--- a/src/client/components/Profile/Profile-styled.tsx
+++ b/src/client/components/Profile/Profile-styled.tsx
@@ -131,9 +131,6 @@ const ProfileAccountDetailsContentContainer = styled.div`
}
input {
- border-bottom-left-radius: 4px;
- border-left: 1px solid #b9bdcf;
- border-top-left-radius: 4px;
color: #b9bdcf;
}
@@ -162,10 +159,37 @@ const ProfileAccountDetailsContainer = styled.div`
border-radius: 1.25rem;
box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
margin-top: -100px;
- width: 50%;
+ width: 40%;
+`;
+
+const ProfileAccountStatsContainer = styled.div`
+ background-color: rgba(246, 249, 251, 1);
+ border-radius: 1.25rem;
+ box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
+ display: flex;
+ flex-direction: column;
+ margin-top: -100px;
+ width: 40%;
+`;
+
+const ProfileAccountStatsAvatar = styled.img`
+ background-image: linear-gradient(135deg, #ce9ffc 10%, #7367f0 100%);
+ border-radius: 50%;
+ height: 150px;
+ margin: -75px auto;
+ width: 150px;
+`;
+
+const ProfileInnerContainer = styled.div`
+ display: flex;
+ flex-direction: row;
+ justify-content: space-around;
`;
export {
+ ProfileInnerContainer,
+ ProfileAccountStatsAvatar,
+ ProfileAccountStatsContainer,
ProfileAccountDetailsContentContainer,
ProfileAccountDetailsHeadingContainer,
ProfileAccountDetailsContainer,
diff --git a/src/client/components/Profile/ProfileAccountDetails.tsx b/src/client/components/Profile/ProfileAccountDetails.tsx
index 474febb..b8fbccc 100644
--- a/src/client/components/Profile/ProfileAccountDetails.tsx
+++ b/src/client/components/Profile/ProfileAccountDetails.tsx
@@ -28,8 +28,24 @@ const ProfileAccountDetails: React.SFC = (
User Information
diff --git a/src/client/components/Profile/ProfileAccountStats.tsx b/src/client/components/Profile/ProfileAccountStats.tsx
new file mode 100644
index 0000000..705e9a4
--- /dev/null
+++ b/src/client/components/Profile/ProfileAccountStats.tsx
@@ -0,0 +1,37 @@
+import * as React from "react";
+import { connect } from "react-redux";
+
+import {
+ ProfileAccountStatsContainer,
+ ProfileAccountStatsAvatar,
+} from "./Profile-styled";
+
+import { RootState } from "../../types";
+
+export interface ProfileAccountStatsProps {
+ hiddenJobs: string[];
+ name: string;
+ savedJobs: string[];
+}
+
+const ProfileAccountStats: React.SFC = (
+ props: ProfileAccountStatsProps
+) => {
+ const { hiddenJobs, name, savedJobs } = props;
+ return (
+
+
+ {name}
+ {hiddenJobs.length} hidden jobs
+ {savedJobs.length} saved jobs
+
+ );
+};
+
+const mapStateToProps = (state: RootState) => ({
+ hiddenJobs: state.user.hiddenJobs,
+ name: state.user.name,
+ savedJobs: state.user.savedJobs,
+});
+
+export default connect(mapStateToProps)(ProfileAccountStats);
diff --git a/src/client/components/Profile/index.ts b/src/client/components/Profile/index.ts
index b2ecc0b..e91a593 100644
--- a/src/client/components/Profile/index.ts
+++ b/src/client/components/Profile/index.ts
@@ -1,4 +1,5 @@
import ProfileAccountDetails from "./ProfileAccountDetails";
+import ProfileAccountStats from "./ProfileAccountStats";
import ProfileDelete from "./ProfileDelete";
import ProfileDisplay from "./ProfileDisplay";
import ProfileEdit from "./ProfileEdit";
@@ -9,6 +10,7 @@ import ProfileSavedJobs from "./ProfileSavedJobs";
export {
ProfileAccountDetails,
+ ProfileAccountStats,
ProfileDelete,
ProfileDisplay,
ProfileEdit,
diff --git a/src/client/pages/Profile/Profile.tsx b/src/client/pages/Profile/Profile.tsx
index e84c0fa..d566976 100644
--- a/src/client/pages/Profile/Profile.tsx
+++ b/src/client/pages/Profile/Profile.tsx
@@ -4,6 +4,7 @@ import { Redirect } from "react-router-dom";
import {
ProfileAccountDetails,
+ ProfileAccountStats,
ProfileDelete,
ProfileDisplay,
ProfileEdit,
@@ -17,6 +18,7 @@ import {
ProfilePage,
ProfileForm,
ProfileTitleContainer,
+ ProfileInnerContainer,
} from "../../components/Profile/Profile-styled";
import { RootState } from "../../types";
@@ -60,7 +62,11 @@ const Profile: React.SFC = (props: ProfileProps) => {
return (
-
+
+
+
+
+
Date: Mon, 10 Aug 2020 13:29:22 -0700
Subject: [PATCH 16/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Add=20Account=20Stats=20(Styled)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/Profile/Profile-styled.tsx | 19 ++++++++++++++++--
.../Profile/ProfileAccountStats.tsx | 9 +++++++--
src/client/components/Stat/Stat-styled.tsx | 17 ++++++++++++++++
src/client/components/Stat/Stat.tsx | 20 +++++++++++++++++++
src/client/components/Stat/index.ts | 1 +
5 files changed, 62 insertions(+), 4 deletions(-)
create mode 100644 src/client/components/Stat/Stat-styled.tsx
create mode 100644 src/client/components/Stat/Stat.tsx
create mode 100644 src/client/components/Stat/index.ts
diff --git a/src/client/components/Profile/Profile-styled.tsx b/src/client/components/Profile/Profile-styled.tsx
index c6f5426..bca5019 100644
--- a/src/client/components/Profile/Profile-styled.tsx
+++ b/src/client/components/Profile/Profile-styled.tsx
@@ -158,18 +158,24 @@ const ProfileAccountDetailsContainer = styled.div`
background-color: rgba(246, 249, 251, 1);
border-radius: 1.25rem;
box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
- margin-top: -100px;
+ margin-top: -200px;
width: 40%;
`;
const ProfileAccountStatsContainer = styled.div`
+ align-items: center;
background-color: rgba(246, 249, 251, 1);
border-radius: 1.25rem;
box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
display: flex;
flex-direction: column;
- margin-top: -100px;
+ height: fit-content;
+ margin-top: -200px;
width: 40%;
+
+ h2 {
+ margin-top: 100px;
+ }
`;
const ProfileAccountStatsAvatar = styled.img`
@@ -186,7 +192,16 @@ const ProfileInnerContainer = styled.div`
justify-content: space-around;
`;
+const ProfileAccountStatsInnerContainer = styled.div`
+ display: flex;
+ flex-direction: row;
+ justify-content: space-evenly;
+ margin-bottom: 25px;
+ width: 100%;
+`;
+
export {
+ ProfileAccountStatsInnerContainer,
ProfileInnerContainer,
ProfileAccountStatsAvatar,
ProfileAccountStatsContainer,
diff --git a/src/client/components/Profile/ProfileAccountStats.tsx b/src/client/components/Profile/ProfileAccountStats.tsx
index 705e9a4..cea12dd 100644
--- a/src/client/components/Profile/ProfileAccountStats.tsx
+++ b/src/client/components/Profile/ProfileAccountStats.tsx
@@ -1,9 +1,12 @@
import * as React from "react";
import { connect } from "react-redux";
+import Stat from "../Stat";
+
import {
ProfileAccountStatsContainer,
ProfileAccountStatsAvatar,
+ ProfileAccountStatsInnerContainer,
} from "./Profile-styled";
import { RootState } from "../../types";
@@ -22,8 +25,10 @@ const ProfileAccountStats: React.SFC = (
{name}
- {hiddenJobs.length} hidden jobs
- {savedJobs.length} saved jobs
+
+
+
+
);
};
diff --git a/src/client/components/Stat/Stat-styled.tsx b/src/client/components/Stat/Stat-styled.tsx
new file mode 100644
index 0000000..f701b4d
--- /dev/null
+++ b/src/client/components/Stat/Stat-styled.tsx
@@ -0,0 +1,17 @@
+import styled from "styled-components";
+
+const Container = styled.div`
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+`;
+
+const Figure = styled.span`
+ font-weight: bold;
+`;
+
+const Label = styled.span`
+ font-weight: lighter;
+`;
+
+export { Container, Figure, Label };
diff --git a/src/client/components/Stat/Stat.tsx b/src/client/components/Stat/Stat.tsx
new file mode 100644
index 0000000..3d045f3
--- /dev/null
+++ b/src/client/components/Stat/Stat.tsx
@@ -0,0 +1,20 @@
+import * as React from "react";
+
+import { Container, Figure, Label } from "./Stat-styled";
+
+export interface StatProps {
+ figure: number | string;
+ label: number | string;
+}
+
+const Stat: React.SFC = (props: StatProps) => {
+ const { figure, label } = props;
+ return (
+
+
+
+
+ );
+};
+
+export default Stat;
diff --git a/src/client/components/Stat/index.ts b/src/client/components/Stat/index.ts
new file mode 100644
index 0000000..736d301
--- /dev/null
+++ b/src/client/components/Stat/index.ts
@@ -0,0 +1 @@
+export { default } from "./Stat";
From 25791be822d363da35559523d6bd86068fa6587e Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Mon, 10 Aug 2020 13:32:51 -0700
Subject: [PATCH 17/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Remove=20old=20profile=20sections?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/pages/Profile/Profile.tsx | 72 +---------------------------
1 file changed, 2 insertions(+), 70 deletions(-)
diff --git a/src/client/pages/Profile/Profile.tsx b/src/client/pages/Profile/Profile.tsx
index d566976..a44eafc 100644
--- a/src/client/pages/Profile/Profile.tsx
+++ b/src/client/pages/Profile/Profile.tsx
@@ -5,56 +5,22 @@ import { Redirect } from "react-router-dom";
import {
ProfileAccountDetails,
ProfileAccountStats,
- ProfileDelete,
- ProfileDisplay,
- ProfileEdit,
ProfileHero,
- ProfileHiddenJobs,
- ProfileReset,
- ProfileSavedJobs,
} from "../../components/Profile";
import {
- ProfilePage,
- ProfileForm,
- ProfileTitleContainer,
ProfileInnerContainer,
+ ProfilePage,
} from "../../components/Profile/Profile-styled";
import { RootState } from "../../types";
export interface ProfileProps {
- isDeletingProfile: boolean;
- isEditingProfile: boolean;
isLoggedIn: boolean;
- isResettingPassword: boolean;
- isViewingHiddenJobs: boolean;
- isViewingSavedJobs: boolean;
}
const Profile: React.SFC = (props: ProfileProps) => {
- const {
- isDeletingProfile,
- isEditingProfile,
- isLoggedIn,
- isResettingPassword,
- isViewingHiddenJobs,
- isViewingSavedJobs,
- } = props;
-
- let heading = "Profile";
-
- if (isResettingPassword) {
- heading = "Reset Password";
- } else if (isEditingProfile) {
- heading = "Edit Profile";
- } else if (isDeletingProfile) {
- heading = "Delete Profile";
- } else if (isViewingHiddenJobs) {
- heading = "Hidden Jobs";
- } else if (isViewingSavedJobs) {
- heading = "Saved Jobs";
- }
+ const { isLoggedIn } = props;
if (!isLoggedIn) {
return ;
@@ -66,47 +32,13 @@ const Profile: React.SFC = (props: ProfileProps) => {
-
- e.preventDefault()}
- >
-
-
- account_circle
-
- {heading}
-
-
- {isResettingPassword && }
-
- {isEditingProfile && }
-
- {isDeletingProfile && }
-
- {isViewingHiddenJobs && }
-
- {isViewingSavedJobs && }
-
- {!isResettingPassword &&
- !isEditingProfile &&
- !isDeletingProfile &&
- !isViewingHiddenJobs &&
- !isViewingSavedJobs && }
-
);
}
};
const mapStateToProps = (state: RootState) => ({
- isDeletingProfile: state.user.isDeletingProfile,
- isEditingProfile: state.user.isEditingProfile,
isLoggedIn: state.user.isLoggedIn,
- isResettingPassword: state.user.isResettingPassword,
- isViewingHiddenJobs: state.user.isViewingHiddenJobs,
- isViewingSavedJobs: state.user.isViewingSavedJobs,
});
export default connect(mapStateToProps)(Profile);
From 6ad0541e99b6bd966f489a18f9ceaa7eea74dbb8 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Mon, 10 Aug 2020 13:51:40 -0700
Subject: [PATCH 18/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Ability=20to=20Edit=20in=20Page?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/Profile/Profile-styled.tsx | 5 +-
.../Profile/ProfileAccountDetails.tsx | 52 ++++++++++++++++---
src/client/components/Profile/ProfileEdit.tsx | 21 +++++---
src/client/components/Profile/ProfileHero.tsx | 23 ++++++--
src/client/redux/actions/user.ts | 12 -----
src/client/redux/reducers/user.ts | 6 ---
src/client/redux/thunks.ts | 22 ++------
src/client/types.ts | 2 -
8 files changed, 88 insertions(+), 55 deletions(-)
diff --git a/src/client/components/Profile/Profile-styled.tsx b/src/client/components/Profile/Profile-styled.tsx
index bca5019..fac3eb6 100644
--- a/src/client/components/Profile/Profile-styled.tsx
+++ b/src/client/components/Profile/Profile-styled.tsx
@@ -131,7 +131,10 @@ const ProfileAccountDetailsContentContainer = styled.div`
}
input {
- color: #b9bdcf;
+ :disabled {
+ color: #b9bdcf;
+ }
+ color: #000000;
}
div {
diff --git a/src/client/components/Profile/ProfileAccountDetails.tsx b/src/client/components/Profile/ProfileAccountDetails.tsx
index b8fbccc..e072020 100644
--- a/src/client/components/Profile/ProfileAccountDetails.tsx
+++ b/src/client/components/Profile/ProfileAccountDetails.tsx
@@ -1,6 +1,7 @@
import * as React from "react";
import { connect } from "react-redux";
+import Button from "../Button";
import Input from "../Input";
import {
@@ -9,17 +10,25 @@ import {
ProfileAccountDetailsContainer,
} from "./Profile-styled";
+import { editProfile } from "../../redux/thunks";
+
import { RootState } from "../../types";
export interface ProfileAccountDetailsProps {
email: string;
+ handleEditProfile: (email: string, name: string) => void;
+ isEditingProfile: boolean;
name: string;
}
const ProfileAccountDetails: React.SFC = (
props: ProfileAccountDetailsProps
) => {
- const { email, name } = props;
+ const { email, handleEditProfile, isEditingProfile, name } = props;
+
+ const [newName, setNewName] = React.useState(name);
+ const [newEmail, setNewEmail] = React.useState(email);
+
return (
@@ -27,25 +36,45 @@ const ProfileAccountDetails: React.SFC = (
User Information
-
@@ -54,7 +83,16 @@ const ProfileAccountDetails: React.SFC = (
const mapStateToProps = (state: RootState) => ({
email: state.user.email,
+ isEditingProfile: state.user.isEditingProfile,
name: state.user.name,
});
-export default connect(mapStateToProps)(ProfileAccountDetails);
+const mapDispatchToProps = (dispatch) => ({
+ handleEditProfile: (email: string, name: string) =>
+ dispatch(editProfile(email, name)),
+});
+
+export default connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(ProfileAccountDetails);
diff --git a/src/client/components/Profile/ProfileEdit.tsx b/src/client/components/Profile/ProfileEdit.tsx
index 96aa1c4..4f1d22a 100644
--- a/src/client/components/Profile/ProfileEdit.tsx
+++ b/src/client/components/Profile/ProfileEdit.tsx
@@ -6,7 +6,7 @@ import Input from "../Input";
import { ProfileActionsContainer } from "./Profile-styled";
-import { setEditEmail, setEditName } from "../../redux/actions/user";
+// import { setEditEmail, setEditName } from "../../redux/actions/user";
import { cancelEditProfile, editProfile } from "../../redux/thunks";
import { RootState } from "../../types";
@@ -81,17 +81,26 @@ const ProfileEdit: React.SFC = (props: ProfileEditProps) => {
};
const mapStateToProps = (state: RootState) => ({
- editEmail: state.user.editEmail,
- editName: state.user.editName,
+ editEmail: "",
+ editName: "",
email: state.user.email,
name: state.user.name,
});
const mapDispatchToProps = (dispatch) => ({
handleCancelEditProfile: () => dispatch(cancelEditProfile()),
- handleEditProfile: () => dispatch(editProfile()),
- handleSetEditEmail: (editEmail: string) => dispatch(setEditEmail(editEmail)),
- handleSetEditName: (editName: string) => dispatch(setEditName(editName)),
+ // handleEditProfile: () => dispatch(editProfile()),
+ handleEditProfile: () => {
+ console.log("EMPTY FUNCTION");
+ },
+ // handleSetEditEmail: (editEmail: string) => dispatch(setEditEmail(editEmail)),
+ handleSetEditEmail: (editEmail: string) => {
+ console.log("EMPTY FUNCTION");
+ },
+ // handleSetEditName: (editName: string) => dispatch(setEditName(editName)),
+ handleSetEditName: (editName: string) => {
+ console.log("EMPTY FUNCTION");
+ },
});
export default connect(mapStateToProps, mapDispatchToProps)(ProfileEdit);
diff --git a/src/client/components/Profile/ProfileHero.tsx b/src/client/components/Profile/ProfileHero.tsx
index a730209..8f82d95 100644
--- a/src/client/components/Profile/ProfileHero.tsx
+++ b/src/client/components/Profile/ProfileHero.tsx
@@ -3,16 +3,22 @@ import { connect } from "react-redux";
import { ProfileHeroContainer } from "./Profile-styled";
-import { RootState } from "../../types";
import Button from "../Button";
+import { setIsEditingProfile } from "../../redux/actions/user";
+
+import { RootState } from "../../types";
+
export interface ProfileHeroProps {
+ handleEditProfile: () => void;
name: string;
}
const ProfileHero: React.SFC = (props: ProfileHeroProps) => {
- const { name } = props;
+ const { handleEditProfile, name } = props;
+
const firstName = name.split(/ /gm)[0];
+
return (
Hello, {firstName}
@@ -20,7 +26,12 @@ const ProfileHero: React.SFC = (props: ProfileHeroProps) => {
This is your profile page. You can view your favorite job listings, and
manage your information.
-
+ handleEditProfile()}
+ type="button"
+ />
);
};
@@ -29,4 +40,8 @@ const mapStateToProps = (state: RootState) => ({
name: state.user.name,
});
-export default connect(mapStateToProps)(ProfileHero);
+const mapDispatchToProps = (dispatch) => ({
+ handleEditProfile: () => dispatch(setIsEditingProfile(true)),
+});
+
+export default connect(mapStateToProps, mapDispatchToProps)(ProfileHero);
diff --git a/src/client/redux/actions/user.ts b/src/client/redux/actions/user.ts
index cff41ba..8eac9bc 100644
--- a/src/client/redux/actions/user.ts
+++ b/src/client/redux/actions/user.ts
@@ -1,7 +1,5 @@
import {
SET_CONFIRM_PASSWORD,
- SET_EDIT_EMAIL,
- SET_EDIT_NAME,
SET_EMAIL,
SET_HIDDEN_JOBS,
SET_HIDDEN_JOBS_CURRENT_PAGE,
@@ -31,16 +29,6 @@ export const setConfirmPassword = (confirmPassword: string): UserAction => ({
payload: { confirmPassword },
});
-export const setEditEmail = (editEmail: string): UserAction => ({
- type: SET_EDIT_EMAIL,
- payload: { editEmail },
-});
-
-export const setEditName = (editName: string): UserAction => ({
- type: SET_EDIT_NAME,
- payload: { editName },
-});
-
export const setEmail = (email: string): UserAction => ({
type: SET_EMAIL,
payload: { email },
diff --git a/src/client/redux/reducers/user.ts b/src/client/redux/reducers/user.ts
index 5baca90..b714dc3 100644
--- a/src/client/redux/reducers/user.ts
+++ b/src/client/redux/reducers/user.ts
@@ -1,7 +1,5 @@
import {
SET_CONFIRM_PASSWORD,
- SET_EDIT_EMAIL,
- SET_EDIT_NAME,
SET_EMAIL,
SET_HIDDEN_JOBS,
SET_HIDDEN_JOBS_CURRENT_PAGE,
@@ -28,8 +26,6 @@ import { UserAction, UserState } from "../../types";
export const initialState: UserState = {
confirmPassword: "",
- editEmail: "",
- editName: "",
email: "",
hiddenJobs: [],
hiddenJobsCurrentPage: 1,
@@ -63,8 +59,6 @@ const reducer = (state = initialState, action: UserAction): UserState => {
switch (action.type) {
case SET_CONFIRM_PASSWORD:
- case SET_EDIT_EMAIL:
- case SET_EDIT_NAME:
case SET_EMAIL:
case SET_HIDDEN_JOBS:
case SET_HIDDEN_JOBS_CURRENT_PAGE:
diff --git a/src/client/redux/thunks.ts b/src/client/redux/thunks.ts
index 1721cea..b5caac4 100644
--- a/src/client/redux/thunks.ts
+++ b/src/client/redux/thunks.ts
@@ -11,8 +11,6 @@ import {
} from "./actions/application";
import {
setConfirmPassword,
- setEditEmail,
- setEditName,
setEmail,
setIsDeletingProfile,
setIsEditingProfile,
@@ -355,36 +353,28 @@ export const cancelResetPassword = (): AppThunk => (dispatch) => {
dispatch(setIsResettingPassword(false));
};
-export const clickEditProfile = (): AppThunk => (dispatch, getState) => {
- const state: RootState = getState();
-
- const { email, name } = state.user;
-
+export const clickEditProfile = (): AppThunk => (dispatch) => {
dispatch(displayNotification("", "default"));
- dispatch(setEditEmail(email));
- dispatch(setEditName(name));
dispatch(setIsEditingProfile(true));
};
export const cancelEditProfile = (): AppThunk => (dispatch) => {
- dispatch(setEditEmail(""));
- dispatch(setEditName(""));
dispatch(displayNotification("", "default"));
dispatch(setIsEditingProfile(false));
};
-export const editProfile = (): AppThunk => async (dispatch, getState) => {
+export const editProfile = (email: string, name: string): AppThunk => async (
+ dispatch
+) => {
dispatch(setIsLoading(true));
dispatch(displayNotification("", "default"));
- const state: RootState = getState();
- const { editEmail, editName } = state.user;
try {
// TODO - Modify
const response: EditProfileResponse = await fetchServerData(
"/user/me",
"PATCH",
- JSON.stringify({ email: editEmail, name: editName })
+ JSON.stringify({ email, name })
);
if (response.error) {
@@ -399,8 +389,6 @@ export const editProfile = (): AppThunk => async (dispatch, getState) => {
"success"
)
);
- dispatch(setEditEmail(""));
- dispatch(setEditName(""));
dispatch(setEmail(response.email));
dispatch(setName(response.name));
dispatch(setIsEditingProfile(false));
diff --git a/src/client/types.ts b/src/client/types.ts
index 36390c7..f2e4224 100644
--- a/src/client/types.ts
+++ b/src/client/types.ts
@@ -278,8 +278,6 @@ export interface UserAction {
export interface UserState {
confirmPassword: string;
- editEmail: string;
- editName: string;
email: string;
hiddenJobs: string[];
hiddenJobsCurrentPage: number;
From fc47416d68c508b643c77d46f4a1cc363619ac1d Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Mon, 10 Aug 2020 14:25:17 -0700
Subject: [PATCH 19/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Add=20settings=20button?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/components/Profile/Profile-styled.tsx | 1 +
src/client/components/Profile/ProfileAccountDetails.tsx | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/src/client/components/Profile/Profile-styled.tsx b/src/client/components/Profile/Profile-styled.tsx
index fac3eb6..446d0a4 100644
--- a/src/client/components/Profile/Profile-styled.tsx
+++ b/src/client/components/Profile/Profile-styled.tsx
@@ -149,6 +149,7 @@ const ProfileAccountDetailsHeadingContainer = styled.div`
border-top-right-radius: 1.25rem;
display: flex;
height: 50px;
+ justify-content: space-between;
padding-left: 25px;
padding-right: 25px;
diff --git a/src/client/components/Profile/ProfileAccountDetails.tsx b/src/client/components/Profile/ProfileAccountDetails.tsx
index e072020..b13d1c6 100644
--- a/src/client/components/Profile/ProfileAccountDetails.tsx
+++ b/src/client/components/Profile/ProfileAccountDetails.tsx
@@ -33,6 +33,12 @@ const ProfileAccountDetails: React.SFC = (
My account
+
User Information
From b099d47fe27041bf208935c37462ab475328d041 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Tue, 11 Aug 2020 07:26:33 -0700
Subject: [PATCH 20/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Add=20Modal?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/App.tsx | 2 +
src/client/components/Modal/Modal-styled.tsx | 65 +++++++++++++++++++
src/client/components/Modal/Modal.tsx | 54 +++++++++++++++
src/client/components/Modal/index.ts | 1 +
.../Profile/ProfileAccountDetails.tsx | 20 +++++-
src/client/redux/actionTypes.ts | 3 +
src/client/redux/actions/application.ts | 18 +++++
src/client/redux/reducers/application.ts | 9 +++
src/client/redux/thunks.ts | 9 +++
src/client/types.ts | 3 +
10 files changed, 183 insertions(+), 1 deletion(-)
create mode 100644 src/client/components/Modal/Modal-styled.tsx
create mode 100644 src/client/components/Modal/Modal.tsx
create mode 100644 src/client/components/Modal/index.ts
diff --git a/src/client/App.tsx b/src/client/App.tsx
index 032421b..ad67819 100644
--- a/src/client/App.tsx
+++ b/src/client/App.tsx
@@ -12,6 +12,7 @@ import Signup from "./pages/Signup";
import ErrorFallback from "./components/ErrorFallback";
import LoadingIndicator from "./components/LoadingIndicator";
+import Modal from "./components/Modal";
import Navigation from "./components/Navigation";
import { setError } from "./redux/actions/application";
@@ -71,6 +72,7 @@ const App: React.SFC = (props: AppProps) => {
+
);
diff --git a/src/client/components/Modal/Modal-styled.tsx b/src/client/components/Modal/Modal-styled.tsx
new file mode 100644
index 0000000..1871480
--- /dev/null
+++ b/src/client/components/Modal/Modal-styled.tsx
@@ -0,0 +1,65 @@
+import styled from "styled-components";
+
+interface ModalContainerProps {
+ isModalOpen: boolean;
+}
+
+const ModalContainer = styled.div`
+ align-items: center;
+ background-color: transparent;
+ bottom: 0;
+ display: ${(props) => (props.isModalOpen ? "flex" : "none")};
+ left: 0;
+ justify-content: center;
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 100%;
+ z-index: 10;
+`;
+
+const ModalInnerContainer = styled.div`
+ background-color: #ffffff;
+ border-radius: 1.25rem;
+ height: 50%;
+ padding: 25px;
+ width: 50%;
+`;
+
+const ModalTitle = styled.div`
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ margin-bottom: 25px;
+
+ button {
+ background: transparent;
+ border: 0;
+ font-size: 20px;
+
+ &:hover {
+ cursor: pointer;
+ }
+ }
+
+ h2 {
+ margin: 0;
+ }
+`;
+
+interface ShadeProps {
+ isModalOpen: boolean;
+}
+
+const Shade = styled.div`
+ background-color: rgba(0, 0, 0, 0.75);
+ bottom: 0;
+ display: ${(props) => (props.isModalOpen ? "block" : "none")};
+ left: 0;
+ position: fixed;
+ right: 0;
+ top: 0;
+ z-index: 5;
+`;
+
+export { ModalContainer, ModalInnerContainer, ModalTitle, Shade };
diff --git a/src/client/components/Modal/Modal.tsx b/src/client/components/Modal/Modal.tsx
new file mode 100644
index 0000000..fc1c189
--- /dev/null
+++ b/src/client/components/Modal/Modal.tsx
@@ -0,0 +1,54 @@
+import * as React from "react";
+import { connect } from "react-redux";
+
+import {
+ ModalContainer,
+ ModalInnerContainer,
+ ModalTitle,
+ Shade,
+} from "./Modal-styled";
+
+import { resetModal } from "../../redux/thunks";
+
+import { RootState } from "../../types";
+
+export interface ModalProps {
+ handleCloseModal: () => void;
+ isModalOpen: boolean;
+ modalContent: any;
+ modalTitle: string;
+}
+
+const Modal: React.SFC = (props: ModalProps) => {
+ const { handleCloseModal, isModalOpen, modalContent, modalTitle } = props;
+
+ console.log(typeof modalContent);
+ return (
+ <>
+
+
+
+
+ {modalTitle}
+ handleCloseModal()}>
+ x
+
+
+ {modalContent}
+
+
+ >
+ );
+};
+
+const mapStateToProps = (state: RootState) => ({
+ isModalOpen: state.application.isModalOpen,
+ modalContent: state.application.modalContent,
+ modalTitle: state.application.modalTitle,
+});
+
+const mapDispatchToProps = (dispatch) => ({
+ handleCloseModal: () => dispatch(resetModal()),
+});
+
+export default connect(mapStateToProps, mapDispatchToProps)(Modal);
diff --git a/src/client/components/Modal/index.ts b/src/client/components/Modal/index.ts
new file mode 100644
index 0000000..09b91f7
--- /dev/null
+++ b/src/client/components/Modal/index.ts
@@ -0,0 +1 @@
+export { default } from "./Modal";
diff --git a/src/client/components/Profile/ProfileAccountDetails.tsx b/src/client/components/Profile/ProfileAccountDetails.tsx
index b13d1c6..bb18e7b 100644
--- a/src/client/components/Profile/ProfileAccountDetails.tsx
+++ b/src/client/components/Profile/ProfileAccountDetails.tsx
@@ -13,10 +13,16 @@ import {
import { editProfile } from "../../redux/thunks";
import { RootState } from "../../types";
+import {
+ setModalContent,
+ setModalTitle,
+ setIsModalOpen,
+} from "../../redux/actions/application";
export interface ProfileAccountDetailsProps {
email: string;
handleEditProfile: (email: string, name: string) => void;
+ handleSettingsClick: () => void;
isEditingProfile: boolean;
name: string;
}
@@ -24,7 +30,13 @@ export interface ProfileAccountDetailsProps {
const ProfileAccountDetails: React.SFC = (
props: ProfileAccountDetailsProps
) => {
- const { email, handleEditProfile, isEditingProfile, name } = props;
+ const {
+ email,
+ handleEditProfile,
+ handleSettingsClick,
+ isEditingProfile,
+ name,
+ } = props;
const [newName, setNewName] = React.useState(name);
const [newEmail, setNewEmail] = React.useState(email);
@@ -37,6 +49,7 @@ const ProfileAccountDetails: React.SFC = (
buttonStyle="secondary"
id="settings"
label="settings"
+ onClick={() => handleSettingsClick()}
type="button"
/>
@@ -96,6 +109,11 @@ const mapStateToProps = (state: RootState) => ({
const mapDispatchToProps = (dispatch) => ({
handleEditProfile: (email: string, name: string) =>
dispatch(editProfile(email, name)),
+ handleSettingsClick: () => {
+ dispatch(setModalContent("SETTINGS CONTENT"));
+ dispatch(setModalTitle("Settings"));
+ dispatch(setIsModalOpen(true));
+ },
});
export default connect(
diff --git a/src/client/redux/actionTypes.ts b/src/client/redux/actionTypes.ts
index b6f17cb..1288c6c 100644
--- a/src/client/redux/actionTypes.ts
+++ b/src/client/redux/actionTypes.ts
@@ -5,9 +5,12 @@ export const SET_CURRENT_PAGE = "SET_CURRENT_PAGE";
export const SET_ERROR = "SET_ERROR";
export const SET_FULL_TIME = "SET_FULL_TIME";
export const SET_IS_LOADING = "SET_IS_LOADING";
+export const SET_IS_MODAL_OPEN = "SET_IS_MODAL_OPEN";
export const SET_JOB_DETAILS = "SET_JOB_DETAILS";
export const SET_JOBS = "SET_JOBS";
export const SET_LOCATION_SEARCH = "SET_LOCATION_SEARCH";
+export const SET_MODAL_CONTENT = "SET_MODAL_CONTENT";
+export const SET_MODAL_TITLE = "SET_MODAL_TITLE";
export const SET_SEARCH_VALUE = "SET_SEARCH_VALUE";
export const SET_TOTAL_PAGES = "SET_TOTAL_PAGES";
diff --git a/src/client/redux/actions/application.ts b/src/client/redux/actions/application.ts
index adff082..9bcf2fe 100644
--- a/src/client/redux/actions/application.ts
+++ b/src/client/redux/actions/application.ts
@@ -5,9 +5,12 @@ import {
SET_ERROR,
SET_FULL_TIME,
SET_IS_LOADING,
+ SET_IS_MODAL_OPEN,
SET_JOB_DETAILS,
SET_JOBS,
SET_LOCATION_SEARCH,
+ SET_MODAL_CONTENT,
+ SET_MODAL_TITLE,
SET_SEARCH_VALUE,
SET_TOTAL_PAGES,
} from "../actionTypes";
@@ -50,6 +53,11 @@ export const setIsLoading = (isLoading: boolean): ApplicationAction => ({
payload: { isLoading },
});
+export const setIsModalOpen = (isModalOpen: boolean): ApplicationAction => ({
+ type: SET_IS_MODAL_OPEN,
+ payload: { isModalOpen },
+});
+
export const setJobDetails = (jobDetails: Job): ApplicationAction => ({
type: SET_JOB_DETAILS,
payload: { jobDetails },
@@ -67,6 +75,16 @@ export const setLocationSearch = (
payload: { locationSearch },
});
+export const setModalContent = (modalContent: any): ApplicationAction => ({
+ type: SET_MODAL_CONTENT,
+ payload: { modalContent },
+});
+
+export const setModalTitle = (modalTitle: string): ApplicationAction => ({
+ type: SET_MODAL_TITLE,
+ payload: { modalTitle },
+});
+
export const setSearchValue = (searchValue: string): ApplicationAction => ({
type: SET_SEARCH_VALUE,
payload: { searchValue },
diff --git a/src/client/redux/reducers/application.ts b/src/client/redux/reducers/application.ts
index 7f29d94..b5ad282 100644
--- a/src/client/redux/reducers/application.ts
+++ b/src/client/redux/reducers/application.ts
@@ -7,9 +7,12 @@ import {
SET_ERROR,
SET_FULL_TIME,
SET_IS_LOADING,
+ SET_IS_MODAL_OPEN,
SET_JOB_DETAILS,
SET_JOBS,
SET_LOCATION_SEARCH,
+ SET_MODAL_CONTENT,
+ SET_MODAL_TITLE,
SET_SEARCH_VALUE,
SET_TOTAL_PAGES,
} from "../actionTypes";
@@ -22,9 +25,12 @@ export const initialState: ApplicationState = {
error: null,
fullTime: false,
isLoading: true,
+ isModalOpen: false,
jobDetails: null,
jobs: [],
locationSearch: "",
+ modalContent: null,
+ modalTitle: "",
notificationMessage: "",
notificationType: "default",
searchValue: "",
@@ -89,9 +95,12 @@ const reducer = (
case SET_CURRENT_PAGE:
case SET_FULL_TIME:
case SET_IS_LOADING:
+ case SET_IS_MODAL_OPEN:
case SET_JOB_DETAILS:
case SET_JOBS:
case SET_LOCATION_SEARCH:
+ case SET_MODAL_CONTENT:
+ case SET_MODAL_TITLE:
case SET_SEARCH_VALUE:
case SET_TOTAL_PAGES: {
return { ...state, [key]: value };
diff --git a/src/client/redux/thunks.ts b/src/client/redux/thunks.ts
index b5caac4..6bb3fb0 100644
--- a/src/client/redux/thunks.ts
+++ b/src/client/redux/thunks.ts
@@ -8,6 +8,9 @@ import {
setTotalPages,
setJobDetails,
setError,
+ setModalContent,
+ setModalTitle,
+ setIsModalOpen,
} from "./actions/application";
import {
setConfirmPassword,
@@ -662,3 +665,9 @@ export const getHiddenJobsDetails = (): AppThunk => async (dispatch) => {
dispatch(setIsLoading(false));
}
};
+
+export const resetModal = (): AppThunk => (dispatch) => {
+ dispatch(setIsModalOpen(false));
+ dispatch(setModalContent(null));
+ dispatch(setModalTitle(""));
+};
diff --git a/src/client/types.ts b/src/client/types.ts
index f2e4224..4b46a0e 100644
--- a/src/client/types.ts
+++ b/src/client/types.ts
@@ -48,9 +48,12 @@ export interface ApplicationState {
error: ApplicationError;
fullTime: boolean;
isLoading: boolean;
+ isModalOpen: boolean;
jobDetails: Job;
jobs: Job[];
locationSearch: string;
+ modalContent: any;
+ modalTitle: string;
notificationMessage: string;
notificationType: NotificationType;
searchValue: string;
From 120aa90cab3d5b162752a78b3c64ec03de213b5d Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Tue, 11 Aug 2020 07:56:01 -0700
Subject: [PATCH 21/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Add=20Modal=20Content?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/components/Modal/Modal.tsx | 9 +++++---
src/client/components/Modal/contents.ts | 7 ++++++
.../Profile/ProfileAccountDetails.tsx | 4 +++-
.../modals/Settings/Settings-styled.tsx | 3 +++
src/client/modals/Settings/Settings.tsx | 23 +++++++++++++++++++
src/client/modals/Settings/index.ts | 1 +
src/client/redux/actions/application.ts | 2 +-
src/client/redux/reducers/application.ts | 2 +-
src/client/redux/thunks.ts | 3 +++
src/client/types.ts | 2 +-
10 files changed, 49 insertions(+), 7 deletions(-)
create mode 100644 src/client/components/Modal/contents.ts
create mode 100644 src/client/modals/Settings/Settings-styled.tsx
create mode 100644 src/client/modals/Settings/Settings.tsx
create mode 100644 src/client/modals/Settings/index.ts
diff --git a/src/client/components/Modal/Modal.tsx b/src/client/components/Modal/Modal.tsx
index fc1c189..43af45b 100644
--- a/src/client/components/Modal/Modal.tsx
+++ b/src/client/components/Modal/Modal.tsx
@@ -8,6 +8,8 @@ import {
Shade,
} from "./Modal-styled";
+import contents from "./contents";
+
import { resetModal } from "../../redux/thunks";
import { RootState } from "../../types";
@@ -15,14 +17,15 @@ import { RootState } from "../../types";
export interface ModalProps {
handleCloseModal: () => void;
isModalOpen: boolean;
- modalContent: any;
+ modalContent: string;
modalTitle: string;
}
const Modal: React.SFC = (props: ModalProps) => {
const { handleCloseModal, isModalOpen, modalContent, modalTitle } = props;
- console.log(typeof modalContent);
+ const Content = contents[modalContent];
+
return (
<>
@@ -34,7 +37,7 @@ const Modal: React.SFC = (props: ModalProps) => {
x
- {modalContent}
+ {Content && }
>
diff --git a/src/client/components/Modal/contents.ts b/src/client/components/Modal/contents.ts
new file mode 100644
index 0000000..fc94f67
--- /dev/null
+++ b/src/client/components/Modal/contents.ts
@@ -0,0 +1,7 @@
+import Settings from "../../modals/Settings";
+
+const contents = {
+ settings: Settings,
+};
+
+export default contents;
diff --git a/src/client/components/Profile/ProfileAccountDetails.tsx b/src/client/components/Profile/ProfileAccountDetails.tsx
index bb18e7b..f5a5b4c 100644
--- a/src/client/components/Profile/ProfileAccountDetails.tsx
+++ b/src/client/components/Profile/ProfileAccountDetails.tsx
@@ -10,6 +10,8 @@ import {
ProfileAccountDetailsContainer,
} from "./Profile-styled";
+import Settings from "../../modals/Settings/Settings";
+
import { editProfile } from "../../redux/thunks";
import { RootState } from "../../types";
@@ -110,7 +112,7 @@ const mapDispatchToProps = (dispatch) => ({
handleEditProfile: (email: string, name: string) =>
dispatch(editProfile(email, name)),
handleSettingsClick: () => {
- dispatch(setModalContent("SETTINGS CONTENT"));
+ dispatch(setModalContent("settings"));
dispatch(setModalTitle("Settings"));
dispatch(setIsModalOpen(true));
},
diff --git a/src/client/modals/Settings/Settings-styled.tsx b/src/client/modals/Settings/Settings-styled.tsx
new file mode 100644
index 0000000..09e6701
--- /dev/null
+++ b/src/client/modals/Settings/Settings-styled.tsx
@@ -0,0 +1,3 @@
+import styled from "styled-components";
+
+export {};
diff --git a/src/client/modals/Settings/Settings.tsx b/src/client/modals/Settings/Settings.tsx
new file mode 100644
index 0000000..9b1b134
--- /dev/null
+++ b/src/client/modals/Settings/Settings.tsx
@@ -0,0 +1,23 @@
+import * as React from "react";
+import { connect } from "react-redux";
+import { RootState } from "../../types";
+
+export interface SettingsProps {
+ email: string;
+}
+
+const Settings: React.SFC = (props: SettingsProps) => {
+ const { email } = props;
+
+ return (
+
+ {email}
+
+ );
+};
+
+const mapStateToProps = (state: RootState) => ({
+ email: state.user.email,
+});
+
+export default connect(mapStateToProps)(Settings);
diff --git a/src/client/modals/Settings/index.ts b/src/client/modals/Settings/index.ts
new file mode 100644
index 0000000..41d6622
--- /dev/null
+++ b/src/client/modals/Settings/index.ts
@@ -0,0 +1 @@
+export { default } from "./Settings";
diff --git a/src/client/redux/actions/application.ts b/src/client/redux/actions/application.ts
index 9bcf2fe..54eb47f 100644
--- a/src/client/redux/actions/application.ts
+++ b/src/client/redux/actions/application.ts
@@ -75,7 +75,7 @@ export const setLocationSearch = (
payload: { locationSearch },
});
-export const setModalContent = (modalContent: any): ApplicationAction => ({
+export const setModalContent = (modalContent: string): ApplicationAction => ({
type: SET_MODAL_CONTENT,
payload: { modalContent },
});
diff --git a/src/client/redux/reducers/application.ts b/src/client/redux/reducers/application.ts
index b5ad282..fe966d7 100644
--- a/src/client/redux/reducers/application.ts
+++ b/src/client/redux/reducers/application.ts
@@ -29,7 +29,7 @@ export const initialState: ApplicationState = {
jobDetails: null,
jobs: [],
locationSearch: "",
- modalContent: null,
+ modalContent: "",
modalTitle: "",
notificationMessage: "",
notificationType: "default",
diff --git a/src/client/redux/thunks.ts b/src/client/redux/thunks.ts
index 6bb3fb0..0867b14 100644
--- a/src/client/redux/thunks.ts
+++ b/src/client/redux/thunks.ts
@@ -220,6 +220,9 @@ export const initializeApplication = (): AppThunk => async (dispatch) => {
dispatch(setJobDetails(null));
dispatch(setJobs([]));
dispatch(setTotalPages(1));
+ dispatch(setIsModalOpen(false));
+ dispatch(setModalContent(""));
+ dispatch(setModalTitle(""));
// * Establish Job Data
dispatch(getJobs());
diff --git a/src/client/types.ts b/src/client/types.ts
index 4b46a0e..2c00493 100644
--- a/src/client/types.ts
+++ b/src/client/types.ts
@@ -52,7 +52,7 @@ export interface ApplicationState {
jobDetails: Job;
jobs: Job[];
locationSearch: string;
- modalContent: any;
+ modalContent: string;
modalTitle: string;
notificationMessage: string;
notificationType: NotificationType;
From a9d64112d08f373d6d278fc6cae2b8a32bac6221 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Tue, 11 Aug 2020 09:52:06 -0700
Subject: [PATCH 22/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Ability=20to=20Log=20Out?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/modals/Settings/Settings.tsx | 23 ++++++++++++++++-------
src/client/redux/thunks.ts | 3 +++
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/src/client/modals/Settings/Settings.tsx b/src/client/modals/Settings/Settings.tsx
index 9b1b134..2ad0896 100644
--- a/src/client/modals/Settings/Settings.tsx
+++ b/src/client/modals/Settings/Settings.tsx
@@ -1,23 +1,32 @@
import * as React from "react";
import { connect } from "react-redux";
-import { RootState } from "../../types";
+
+import Button from "../../components/Button";
+
+import { logOut } from "../../redux/thunks";
export interface SettingsProps {
- email: string;
+ handleLogOut: () => void;
}
const Settings: React.SFC = (props: SettingsProps) => {
- const { email } = props;
+ const { handleLogOut } = props;
return (
- {email}
+ handleLogOut()}
+ type="button"
+ />
);
};
-const mapStateToProps = (state: RootState) => ({
- email: state.user.email,
+const mapDispatchToProps = (dispatch) => ({
+ handleLogOut: () => dispatch(logOut()),
});
-export default connect(mapStateToProps)(Settings);
+export default connect(null, mapDispatchToProps)(Settings);
diff --git a/src/client/redux/thunks.ts b/src/client/redux/thunks.ts
index 0867b14..845f11d 100644
--- a/src/client/redux/thunks.ts
+++ b/src/client/redux/thunks.ts
@@ -272,6 +272,9 @@ export const logOut = (): AppThunk => async (dispatch) => {
dispatch(setSavedJobs([]));
dispatch(setHiddenJobs([]));
dispatch(setIsLoggedIn(false));
+ dispatch(setIsModalOpen(false));
+ dispatch(setModalContent(""));
+ dispatch(setModalTitle(""));
dispatch(setIsLoading(false));
};
From 18251fd36d4996e119a305033d273dd2da08c65b Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Tue, 11 Aug 2020 12:40:28 -0700
Subject: [PATCH 23/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Ability=20to=20Log=20Out=20All?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/modals/Settings/Settings.tsx | 13 +++++++++++--
src/client/redux/thunks.ts | 3 +++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/client/modals/Settings/Settings.tsx b/src/client/modals/Settings/Settings.tsx
index 2ad0896..35fb6d3 100644
--- a/src/client/modals/Settings/Settings.tsx
+++ b/src/client/modals/Settings/Settings.tsx
@@ -3,14 +3,15 @@ import { connect } from "react-redux";
import Button from "../../components/Button";
-import { logOut } from "../../redux/thunks";
+import { logOut, logOutAll } from "../../redux/thunks";
export interface SettingsProps {
handleLogOut: () => void;
+ handleLogOutAll: () => void;
}
const Settings: React.SFC = (props: SettingsProps) => {
- const { handleLogOut } = props;
+ const { handleLogOut, handleLogOutAll } = props;
return (
@@ -21,12 +22,20 @@ const Settings: React.SFC = (props: SettingsProps) => {
onClick={() => handleLogOut()}
type="button"
/>
+ handleLogOutAll()}
+ type="button"
+ />
);
};
const mapDispatchToProps = (dispatch) => ({
handleLogOut: () => dispatch(logOut()),
+ handleLogOutAll: () => dispatch(logOutAll()),
});
export default connect(null, mapDispatchToProps)(Settings);
diff --git a/src/client/redux/thunks.ts b/src/client/redux/thunks.ts
index 845f11d..47b2351 100644
--- a/src/client/redux/thunks.ts
+++ b/src/client/redux/thunks.ts
@@ -303,6 +303,9 @@ export const logOutAll = (): AppThunk => async (dispatch) => {
dispatch(setSavedJobs([]));
dispatch(setHiddenJobs([]));
dispatch(setIsLoggedIn(false));
+ dispatch(setIsModalOpen(false));
+ dispatch(setModalContent(""));
+ dispatch(setModalTitle(""));
dispatch(setIsLoading(false));
};
From 0197b3b006604b80fd1c235f7dc4945ec324f990 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Tue, 11 Aug 2020 13:11:23 -0700
Subject: [PATCH 24/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Ability=20to=20Delete=20Profile?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/components/Modal/contents.ts | 2 +
.../DeleteProfile/DeleteProfile-styled.tsx | 0
.../modals/DeleteProfile/DeleteProfile.tsx | 52 +++++++++++++++++++
src/client/modals/DeleteProfile/index.ts | 1 +
src/client/modals/Settings/Settings.tsx | 25 ++++++++-
src/client/redux/thunks.ts | 5 +-
6 files changed, 83 insertions(+), 2 deletions(-)
create mode 100644 src/client/modals/DeleteProfile/DeleteProfile-styled.tsx
create mode 100644 src/client/modals/DeleteProfile/DeleteProfile.tsx
create mode 100644 src/client/modals/DeleteProfile/index.ts
diff --git a/src/client/components/Modal/contents.ts b/src/client/components/Modal/contents.ts
index fc94f67..8c50a95 100644
--- a/src/client/components/Modal/contents.ts
+++ b/src/client/components/Modal/contents.ts
@@ -1,6 +1,8 @@
+import DeleteProfile from "../../modals/DeleteProfile/DeleteProfile";
import Settings from "../../modals/Settings";
const contents = {
+ deleteProfile: DeleteProfile,
settings: Settings,
};
diff --git a/src/client/modals/DeleteProfile/DeleteProfile-styled.tsx b/src/client/modals/DeleteProfile/DeleteProfile-styled.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/client/modals/DeleteProfile/DeleteProfile.tsx b/src/client/modals/DeleteProfile/DeleteProfile.tsx
new file mode 100644
index 0000000..1341719
--- /dev/null
+++ b/src/client/modals/DeleteProfile/DeleteProfile.tsx
@@ -0,0 +1,52 @@
+import * as React from "react";
+import { connect } from "react-redux";
+
+import Button from "../../components/Button";
+
+import {
+ displayNotification,
+ setModalContent,
+ setModalTitle,
+} from "../../redux/actions/application";
+import { deleteProfile } from "../../redux/thunks";
+
+export interface DeleteProfileProps {
+ handleCancelDeleteProfile: () => void;
+ handleDeleteProfile: () => void;
+}
+
+const DeleteProfile: React.SFC = (
+ props: DeleteProfileProps
+) => {
+ const { handleCancelDeleteProfile, handleDeleteProfile } = props;
+
+ return (
+
+ handleCancelDeleteProfile()}
+ type="button"
+ />
+ handleDeleteProfile()}
+ type="button"
+ />
+
+ );
+};
+
+const mapDispatchToProps = (dispatch) => ({
+ handleCancelDeleteProfile: () => {
+ dispatch(displayNotification("", "default"));
+ dispatch(setModalContent("settings"));
+ dispatch(setModalTitle("Settings"));
+ },
+ handleDeleteProfile: () => dispatch(deleteProfile()),
+});
+
+export default connect(null, mapDispatchToProps)(DeleteProfile);
diff --git a/src/client/modals/DeleteProfile/index.ts b/src/client/modals/DeleteProfile/index.ts
new file mode 100644
index 0000000..6783475
--- /dev/null
+++ b/src/client/modals/DeleteProfile/index.ts
@@ -0,0 +1 @@
+export { default } from "./DeleteProfile";
diff --git a/src/client/modals/Settings/Settings.tsx b/src/client/modals/Settings/Settings.tsx
index 35fb6d3..38152b8 100644
--- a/src/client/modals/Settings/Settings.tsx
+++ b/src/client/modals/Settings/Settings.tsx
@@ -3,15 +3,21 @@ import { connect } from "react-redux";
import Button from "../../components/Button";
+import {
+ displayNotification,
+ setModalContent,
+ setModalTitle,
+} from "../../redux/actions/application";
import { logOut, logOutAll } from "../../redux/thunks";
export interface SettingsProps {
+ handleClickDeleteProfile: () => void;
handleLogOut: () => void;
handleLogOutAll: () => void;
}
const Settings: React.SFC = (props: SettingsProps) => {
- const { handleLogOut, handleLogOutAll } = props;
+ const { handleClickDeleteProfile, handleLogOut, handleLogOutAll } = props;
return (
@@ -29,11 +35,28 @@ const Settings: React.SFC = (props: SettingsProps) => {
onClick={() => handleLogOutAll()}
type="button"
/>
+ handleClickDeleteProfile()}
+ type="button"
+ />
);
};
const mapDispatchToProps = (dispatch) => ({
+ handleClickDeleteProfile: () => {
+ dispatch(
+ displayNotification(
+ "Are you sure you would like to delete your profile? This can not be reversed.",
+ "warning"
+ )
+ );
+ dispatch(setModalContent("deleteProfile"));
+ dispatch(setModalTitle("Delete Profile"));
+ },
handleLogOut: () => dispatch(logOut()),
handleLogOutAll: () => dispatch(logOutAll()),
});
diff --git a/src/client/redux/thunks.ts b/src/client/redux/thunks.ts
index 47b2351..f690d75 100644
--- a/src/client/redux/thunks.ts
+++ b/src/client/redux/thunks.ts
@@ -452,6 +452,9 @@ export const deleteProfile = (): AppThunk => async (dispatch) => {
dispatch(setIsDeletingProfile(false));
dispatch(setIsLoggedIn(false));
dispatch(setIsLoading(false));
+ dispatch(setIsModalOpen(false));
+ dispatch(setModalContent(""));
+ dispatch(setModalTitle(""));
} catch (error) {
console.error(error);
dispatch(displayNotification(error, "error"));
@@ -677,6 +680,6 @@ export const getHiddenJobsDetails = (): AppThunk => async (dispatch) => {
export const resetModal = (): AppThunk => (dispatch) => {
dispatch(setIsModalOpen(false));
- dispatch(setModalContent(null));
+ dispatch(setModalContent(""));
dispatch(setModalTitle(""));
};
From e19d54f30e77f5f7c90424f0a23a90d797efe6e6 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Tue, 11 Aug 2020 13:39:21 -0700
Subject: [PATCH 25/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Ability=20to=20Reset=20Password?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/components/Modal/contents.ts | 2 +
.../components/Profile/ProfileReset.tsx | 2 +-
.../ResetPassword/ResetPassword-styled.tsx | 0
.../modals/ResetPassword/ResetPassword.tsx | 117 ++++++++++++++++++
src/client/modals/ResetPassword/index.ts | 1 +
src/client/modals/Settings/Settings.tsx | 19 ++-
src/client/redux/thunks.ts | 28 ++---
7 files changed, 151 insertions(+), 18 deletions(-)
create mode 100644 src/client/modals/ResetPassword/ResetPassword-styled.tsx
create mode 100644 src/client/modals/ResetPassword/ResetPassword.tsx
create mode 100644 src/client/modals/ResetPassword/index.ts
diff --git a/src/client/components/Modal/contents.ts b/src/client/components/Modal/contents.ts
index 8c50a95..85b68a6 100644
--- a/src/client/components/Modal/contents.ts
+++ b/src/client/components/Modal/contents.ts
@@ -1,8 +1,10 @@
import DeleteProfile from "../../modals/DeleteProfile/DeleteProfile";
+import ResetPassword from "../../modals/ResetPassword";
import Settings from "../../modals/Settings";
const contents = {
deleteProfile: DeleteProfile,
+ resetPassword: ResetPassword,
settings: Settings,
};
diff --git a/src/client/components/Profile/ProfileReset.tsx b/src/client/components/Profile/ProfileReset.tsx
index 6ab447f..cbbc569 100644
--- a/src/client/components/Profile/ProfileReset.tsx
+++ b/src/client/components/Profile/ProfileReset.tsx
@@ -107,7 +107,7 @@ const mapStateToProps = (state: RootState) => ({
const mapDispatchToProps = (dispatch) => ({
handleCancelResetPassword: () => dispatch(cancelResetPassword()),
- handleResetPassword: () => dispatch(resetPassword()),
+ handleResetPassword: () => dispatch(resetPassword("", "")),
handleSetResetConfirmNewPassword: (resetConfirmNewPassword: string) =>
dispatch(setResetConfirmNewPassword(resetConfirmNewPassword)),
handleSetResetCurrentPassword: (resetCurrentPassword: string) =>
diff --git a/src/client/modals/ResetPassword/ResetPassword-styled.tsx b/src/client/modals/ResetPassword/ResetPassword-styled.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/client/modals/ResetPassword/ResetPassword.tsx b/src/client/modals/ResetPassword/ResetPassword.tsx
new file mode 100644
index 0000000..b794d24
--- /dev/null
+++ b/src/client/modals/ResetPassword/ResetPassword.tsx
@@ -0,0 +1,117 @@
+import * as React from "react";
+import { connect } from "react-redux";
+
+import Button from "../../components/Button";
+import Input from "../../components/Input";
+
+import {
+ displayNotification,
+ setModalContent,
+ setModalTitle,
+} from "../../redux/actions/application";
+import { resetPassword } from "../../redux/thunks";
+
+export interface ResetPasswordProps {
+ handleCancelResetPassword: () => void;
+ handleResetPassword: (
+ currentPassword: string,
+ newPassword: string,
+ confirmNewPassword: string
+ ) => void;
+}
+
+const ResetPassword: React.SFC = (
+ props: ResetPasswordProps
+) => {
+ const [resetCurrentPassword, setResetCurrentPassword] = React.useState("");
+ const [resetNewPassword, setResetNewPassword] = React.useState("");
+ const [resetConfirmNewPassword, setResetConfirmNewPassword] = React.useState(
+ ""
+ );
+
+ const { handleCancelResetPassword, handleResetPassword } = props;
+
+ return (
+
+ setResetCurrentPassword(e.target.value)}
+ type="password"
+ value={resetCurrentPassword}
+ />
+
+ setResetNewPassword(e.target.value)}
+ type="password"
+ value={resetNewPassword}
+ />
+
+ setResetConfirmNewPassword(e.target.value)}
+ type="password"
+ value={resetConfirmNewPassword}
+ />
+
+ handleCancelResetPassword()}
+ type="button"
+ />
+
+ handleResetPassword(
+ resetCurrentPassword,
+ resetNewPassword,
+ resetConfirmNewPassword
+ )
+ }
+ type="button"
+ />
+
+ );
+};
+
+const mapDispatchToProps = (dispatch) => ({
+ handleCancelResetPassword: () => {
+ dispatch(displayNotification("", "default"));
+ dispatch(setModalContent("settings"));
+ dispatch(setModalTitle("Settings"));
+ },
+ handleResetPassword: (
+ currentPassword: string,
+ newPassword: string,
+ confirmNewPassword: string
+ ) => {
+ if (newPassword !== confirmNewPassword) {
+ dispatch(displayNotification("Passwords do not match.", "error"));
+ return;
+ }
+ dispatch(resetPassword(currentPassword, newPassword));
+ },
+});
+
+export default connect(null, mapDispatchToProps)(ResetPassword);
diff --git a/src/client/modals/ResetPassword/index.ts b/src/client/modals/ResetPassword/index.ts
new file mode 100644
index 0000000..e600549
--- /dev/null
+++ b/src/client/modals/ResetPassword/index.ts
@@ -0,0 +1 @@
+export { default } from "./ResetPassword";
diff --git a/src/client/modals/Settings/Settings.tsx b/src/client/modals/Settings/Settings.tsx
index 38152b8..49f034a 100644
--- a/src/client/modals/Settings/Settings.tsx
+++ b/src/client/modals/Settings/Settings.tsx
@@ -12,12 +12,18 @@ import { logOut, logOutAll } from "../../redux/thunks";
export interface SettingsProps {
handleClickDeleteProfile: () => void;
+ handleClickResetPassword: () => void;
handleLogOut: () => void;
handleLogOutAll: () => void;
}
const Settings: React.SFC = (props: SettingsProps) => {
- const { handleClickDeleteProfile, handleLogOut, handleLogOutAll } = props;
+ const {
+ handleClickDeleteProfile,
+ handleClickResetPassword,
+ handleLogOut,
+ handleLogOutAll,
+ } = props;
return (
@@ -42,6 +48,13 @@ const Settings: React.SFC = (props: SettingsProps) => {
onClick={() => handleClickDeleteProfile()}
type="button"
/>
+ handleClickResetPassword()}
+ type="button"
+ />
);
};
@@ -57,6 +70,10 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(setModalContent("deleteProfile"));
dispatch(setModalTitle("Delete Profile"));
},
+ handleClickResetPassword: () => {
+ dispatch(setModalContent("resetPassword"));
+ dispatch(setModalTitle("Reset Password"));
+ },
handleLogOut: () => dispatch(logOut()),
handleLogOutAll: () => dispatch(logOutAll()),
});
diff --git a/src/client/redux/thunks.ts b/src/client/redux/thunks.ts
index f690d75..a702c03 100644
--- a/src/client/redux/thunks.ts
+++ b/src/client/redux/thunks.ts
@@ -310,22 +310,12 @@ export const logOutAll = (): AppThunk => async (dispatch) => {
dispatch(setIsLoading(false));
};
-export const resetPassword = (): AppThunk => async (dispatch, getState) => {
+export const resetPassword = (
+ currentPassword: string,
+ newPassword: string
+): AppThunk => async (dispatch) => {
dispatch(setIsLoading(true));
dispatch(displayNotification("", "default"));
- const state: RootState = getState();
-
- const {
- resetConfirmNewPassword,
- resetCurrentPassword,
- resetNewPassword,
- } = state.user;
-
- if (resetConfirmNewPassword !== resetNewPassword) {
- dispatch(displayNotification("Passwords do not match.", "error"));
- dispatch(setIsLoading(false));
- return;
- }
try {
// TODO - Modify
@@ -333,8 +323,8 @@ export const resetPassword = (): AppThunk => async (dispatch, getState) => {
"/user/me",
"PATCH",
JSON.stringify({
- currentPassword: resetCurrentPassword,
- newPassword: resetNewPassword,
+ currentPassword,
+ newPassword,
})
);
@@ -349,6 +339,9 @@ export const resetPassword = (): AppThunk => async (dispatch, getState) => {
dispatch(setResetCurrentPassword(""));
dispatch(setResetNewPassword(""));
dispatch(setIsResettingPassword(false));
+ dispatch(setIsModalOpen(false));
+ dispatch(setModalContent(""));
+ dispatch(setModalTitle(""));
dispatch(setIsLoading(false));
} catch (error) {
console.error(error);
@@ -357,6 +350,7 @@ export const resetPassword = (): AppThunk => async (dispatch, getState) => {
}
};
+// TODO - Remove
export const cancelResetPassword = (): AppThunk => (dispatch) => {
dispatch(setResetConfirmNewPassword(""));
dispatch(setResetCurrentPassword(""));
@@ -365,11 +359,13 @@ export const cancelResetPassword = (): AppThunk => (dispatch) => {
dispatch(setIsResettingPassword(false));
};
+// TODO - Remove
export const clickEditProfile = (): AppThunk => (dispatch) => {
dispatch(displayNotification("", "default"));
dispatch(setIsEditingProfile(true));
};
+// TODO - Remove
export const cancelEditProfile = (): AppThunk => (dispatch) => {
dispatch(displayNotification("", "default"));
dispatch(setIsEditingProfile(false));
From ff26e716bac41b4d8f7f08ab31c9ac3d1eb75319 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Tue, 11 Aug 2020 13:59:31 -0700
Subject: [PATCH 26/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Style=20Modal?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/components/Modal/Modal-styled.tsx | 2 +-
.../modals/Settings/Settings-styled.tsx | 17 ++++-
src/client/modals/Settings/Settings.tsx | 66 ++++++++++---------
3 files changed, 53 insertions(+), 32 deletions(-)
diff --git a/src/client/components/Modal/Modal-styled.tsx b/src/client/components/Modal/Modal-styled.tsx
index 1871480..df0c468 100644
--- a/src/client/components/Modal/Modal-styled.tsx
+++ b/src/client/components/Modal/Modal-styled.tsx
@@ -21,7 +21,7 @@ const ModalContainer = styled.div`
const ModalInnerContainer = styled.div`
background-color: #ffffff;
border-radius: 1.25rem;
- height: 50%;
+ height: fit-content;
padding: 25px;
width: 50%;
`;
diff --git a/src/client/modals/Settings/Settings-styled.tsx b/src/client/modals/Settings/Settings-styled.tsx
index 09e6701..fb494a8 100644
--- a/src/client/modals/Settings/Settings-styled.tsx
+++ b/src/client/modals/Settings/Settings-styled.tsx
@@ -1,3 +1,18 @@
import styled from "styled-components";
-export {};
+const Container = styled.div`
+ display: flex;
+ flex-direction: column;
+`;
+
+const Row = styled.div`
+ display: flex;
+ flex-direction: row;
+ justify-content: space-evenly;
+
+ button {
+ width: 45%;
+ }
+`;
+
+export { Container, Row };
diff --git a/src/client/modals/Settings/Settings.tsx b/src/client/modals/Settings/Settings.tsx
index 49f034a..d18aa74 100644
--- a/src/client/modals/Settings/Settings.tsx
+++ b/src/client/modals/Settings/Settings.tsx
@@ -3,6 +3,8 @@ import { connect } from "react-redux";
import Button from "../../components/Button";
+import { Container, Row } from "./Settings-styled";
+
import {
displayNotification,
setModalContent,
@@ -26,36 +28,40 @@ const Settings: React.SFC = (props: SettingsProps) => {
} = props;
return (
-
- handleLogOut()}
- type="button"
- />
- handleLogOutAll()}
- type="button"
- />
- handleClickDeleteProfile()}
- type="button"
- />
- handleClickResetPassword()}
- type="button"
- />
-
+
+
+ handleLogOut()}
+ type="button"
+ />
+ handleLogOutAll()}
+ type="button"
+ />
+
+
+ handleClickDeleteProfile()}
+ type="button"
+ />
+ handleClickResetPassword()}
+ type="button"
+ />
+
+
);
};
From 27f262f00f81c0d8daca62aba3dee8961d0dc03d Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Tue, 11 Aug 2020 14:16:50 -0700
Subject: [PATCH 27/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Mobile=20Optimization?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/components/Modal/Modal-styled.tsx | 4 ++++
.../components/Profile/Profile-styled.tsx | 19 +++++++++++++++++--
.../Profile/ProfileAccountDetails.tsx | 2 --
.../modals/Settings/Settings-styled.tsx | 8 ++++++++
4 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/src/client/components/Modal/Modal-styled.tsx b/src/client/components/Modal/Modal-styled.tsx
index df0c468..9132b3e 100644
--- a/src/client/components/Modal/Modal-styled.tsx
+++ b/src/client/components/Modal/Modal-styled.tsx
@@ -24,6 +24,10 @@ const ModalInnerContainer = styled.div`
height: fit-content;
padding: 25px;
width: 50%;
+
+ @media only screen and (max-width: 600px) {
+ width: 100%;
+ }
`;
const ModalTitle = styled.div`
diff --git a/src/client/components/Profile/Profile-styled.tsx b/src/client/components/Profile/Profile-styled.tsx
index 446d0a4..8cbd509 100644
--- a/src/client/components/Profile/Profile-styled.tsx
+++ b/src/client/components/Profile/Profile-styled.tsx
@@ -148,13 +148,14 @@ const ProfileAccountDetailsHeadingContainer = styled.div`
border-top-left-radius: 1.25rem;
border-top-right-radius: 1.25rem;
display: flex;
- height: 50px;
+ height: fit-content;
justify-content: space-between;
padding-left: 25px;
padding-right: 25px;
h3 {
- margin: 0;
+ margin-bottom: 20px;
+ margin-top: 20px;
}
`;
@@ -164,6 +165,10 @@ const ProfileAccountDetailsContainer = styled.div`
box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
margin-top: -200px;
width: 40%;
+
+ @media only screen and (max-width: 600px) {
+ width: 100%;
+ }
`;
const ProfileAccountStatsContainer = styled.div`
@@ -180,6 +185,12 @@ const ProfileAccountStatsContainer = styled.div`
h2 {
margin-top: 100px;
}
+
+ @media only screen and (max-width: 600px) {
+ margin-bottom: 50px;
+ margin-top: 100px;
+ width: 100%;
+ }
`;
const ProfileAccountStatsAvatar = styled.img`
@@ -194,6 +205,10 @@ const ProfileInnerContainer = styled.div`
display: flex;
flex-direction: row;
justify-content: space-around;
+
+ @media only screen and (max-width: 600px) {
+ flex-direction: column;
+ }
`;
const ProfileAccountStatsInnerContainer = styled.div`
diff --git a/src/client/components/Profile/ProfileAccountDetails.tsx b/src/client/components/Profile/ProfileAccountDetails.tsx
index f5a5b4c..d1c901b 100644
--- a/src/client/components/Profile/ProfileAccountDetails.tsx
+++ b/src/client/components/Profile/ProfileAccountDetails.tsx
@@ -10,8 +10,6 @@ import {
ProfileAccountDetailsContainer,
} from "./Profile-styled";
-import Settings from "../../modals/Settings/Settings";
-
import { editProfile } from "../../redux/thunks";
import { RootState } from "../../types";
diff --git a/src/client/modals/Settings/Settings-styled.tsx b/src/client/modals/Settings/Settings-styled.tsx
index fb494a8..7564314 100644
--- a/src/client/modals/Settings/Settings-styled.tsx
+++ b/src/client/modals/Settings/Settings-styled.tsx
@@ -13,6 +13,14 @@ const Row = styled.div`
button {
width: 45%;
}
+
+ @media only screen and (max-width: 600px) {
+ flex-direction: column;
+
+ button {
+ width: 100%;
+ }
+ }
`;
export { Container, Row };
From ea58dac5fbde61b12b094b1164c7b2e5c8737bd7 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Tue, 11 Aug 2020 14:19:14 -0700
Subject: [PATCH 28/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Lint?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/components/Profile/ProfileEdit.tsx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/client/components/Profile/ProfileEdit.tsx b/src/client/components/Profile/ProfileEdit.tsx
index 4f1d22a..89a3b96 100644
--- a/src/client/components/Profile/ProfileEdit.tsx
+++ b/src/client/components/Profile/ProfileEdit.tsx
@@ -7,7 +7,7 @@ import Input from "../Input";
import { ProfileActionsContainer } from "./Profile-styled";
// import { setEditEmail, setEditName } from "../../redux/actions/user";
-import { cancelEditProfile, editProfile } from "../../redux/thunks";
+import { cancelEditProfile } from "../../redux/thunks";
import { RootState } from "../../types";
@@ -94,11 +94,11 @@ const mapDispatchToProps = (dispatch) => ({
console.log("EMPTY FUNCTION");
},
// handleSetEditEmail: (editEmail: string) => dispatch(setEditEmail(editEmail)),
- handleSetEditEmail: (editEmail: string) => {
+ handleSetEditEmail: () => {
console.log("EMPTY FUNCTION");
},
// handleSetEditName: (editName: string) => dispatch(setEditName(editName)),
- handleSetEditName: (editName: string) => {
+ handleSetEditName: () => {
console.log("EMPTY FUNCTION");
},
});
From f3d3fd5068e910ac8ad824b0fa20b7eb24d704c5 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Tue, 11 Aug 2020 14:50:52 -0700
Subject: [PATCH 29/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20View=20Saved/Hidden=20Jobs?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/components/Modal/contents.ts | 6 +-
.../components/Profile/Profile-styled.tsx | 1 +
.../Profile/ProfileAccountStats.tsx | 36 +++++++++-
.../modals/HiddenJobs/HiddenJobs-styled.tsx | 0
src/client/modals/HiddenJobs/HiddenJobs.tsx | 66 +++++++++++++++++++
src/client/modals/HiddenJobs/index.ts | 1 +
.../modals/SavedJobs/SavedJobs-styled.tsx | 0
src/client/modals/SavedJobs/SavedJobs.tsx | 66 +++++++++++++++++++
src/client/modals/SavedJobs/index.ts | 1 +
src/client/redux/thunks.ts | 8 ++-
10 files changed, 180 insertions(+), 5 deletions(-)
create mode 100644 src/client/modals/HiddenJobs/HiddenJobs-styled.tsx
create mode 100644 src/client/modals/HiddenJobs/HiddenJobs.tsx
create mode 100644 src/client/modals/HiddenJobs/index.ts
create mode 100644 src/client/modals/SavedJobs/SavedJobs-styled.tsx
create mode 100644 src/client/modals/SavedJobs/SavedJobs.tsx
create mode 100644 src/client/modals/SavedJobs/index.ts
diff --git a/src/client/components/Modal/contents.ts b/src/client/components/Modal/contents.ts
index 85b68a6..dd24143 100644
--- a/src/client/components/Modal/contents.ts
+++ b/src/client/components/Modal/contents.ts
@@ -1,10 +1,14 @@
-import DeleteProfile from "../../modals/DeleteProfile/DeleteProfile";
+import DeleteProfile from "../../modals/DeleteProfile";
+import HiddenJobs from "../../modals/HiddenJobs";
import ResetPassword from "../../modals/ResetPassword";
+import SavedJobs from "../../modals/SavedJobs";
import Settings from "../../modals/Settings";
const contents = {
deleteProfile: DeleteProfile,
+ hiddenJobs: HiddenJobs,
resetPassword: ResetPassword,
+ savedJobs: SavedJobs,
settings: Settings,
};
diff --git a/src/client/components/Profile/Profile-styled.tsx b/src/client/components/Profile/Profile-styled.tsx
index 8cbd509..1ea235d 100644
--- a/src/client/components/Profile/Profile-styled.tsx
+++ b/src/client/components/Profile/Profile-styled.tsx
@@ -180,6 +180,7 @@ const ProfileAccountStatsContainer = styled.div`
flex-direction: column;
height: fit-content;
margin-top: -200px;
+ padding: 25px;
width: 40%;
h2 {
diff --git a/src/client/components/Profile/ProfileAccountStats.tsx b/src/client/components/Profile/ProfileAccountStats.tsx
index cea12dd..745f167 100644
--- a/src/client/components/Profile/ProfileAccountStats.tsx
+++ b/src/client/components/Profile/ProfileAccountStats.tsx
@@ -10,8 +10,12 @@ import {
} from "./Profile-styled";
import { RootState } from "../../types";
+import Button from "../Button";
+import { clickViewHiddenJobs, clickViewSavedJobs } from "../../redux/thunks";
export interface ProfileAccountStatsProps {
+ handleClickViewHiddenJobs: () => void;
+ handleClickViewSavedJobs: () => void;
hiddenJobs: string[];
name: string;
savedJobs: string[];
@@ -20,7 +24,13 @@ export interface ProfileAccountStatsProps {
const ProfileAccountStats: React.SFC = (
props: ProfileAccountStatsProps
) => {
- const { hiddenJobs, name, savedJobs } = props;
+ const {
+ handleClickViewHiddenJobs,
+ handleClickViewSavedJobs,
+ hiddenJobs,
+ name,
+ savedJobs,
+ } = props;
return (
@@ -29,6 +39,20 @@ const ProfileAccountStats: React.SFC = (
+ handleClickViewHiddenJobs()}
+ type="button"
+ />
+ handleClickViewSavedJobs()}
+ type="button"
+ />
);
};
@@ -39,4 +63,12 @@ const mapStateToProps = (state: RootState) => ({
savedJobs: state.user.savedJobs,
});
-export default connect(mapStateToProps)(ProfileAccountStats);
+const mapDispatchToProps = (dispatch) => ({
+ handleClickViewHiddenJobs: () => dispatch(clickViewHiddenJobs()),
+ handleClickViewSavedJobs: () => dispatch(clickViewSavedJobs()),
+});
+
+export default connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(ProfileAccountStats);
diff --git a/src/client/modals/HiddenJobs/HiddenJobs-styled.tsx b/src/client/modals/HiddenJobs/HiddenJobs-styled.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/client/modals/HiddenJobs/HiddenJobs.tsx b/src/client/modals/HiddenJobs/HiddenJobs.tsx
new file mode 100644
index 0000000..60dcc0e
--- /dev/null
+++ b/src/client/modals/HiddenJobs/HiddenJobs.tsx
@@ -0,0 +1,66 @@
+import * as React from "react";
+import { connect } from "react-redux";
+
+import JobCard from "../../components/JobCard";
+import Pagination from "../../components/Pagination";
+
+import { getHiddenJobsDetails } from "../../redux/thunks";
+
+import { RootState, Job } from "../../types";
+
+export interface HiddenJobsProps {
+ handleGetHiddenJobsDetails: () => void;
+ hiddenJobsCurrentPage: number;
+ hiddenJobsDetails: Job[];
+ hiddenJobsTotalPages: number;
+}
+
+const HiddenJobs: React.SFC = (props: HiddenJobsProps) => {
+ const {
+ handleGetHiddenJobsDetails,
+ hiddenJobsCurrentPage,
+ hiddenJobsDetails,
+ hiddenJobsTotalPages,
+ } = props;
+
+ const jobsOnPage =
+ hiddenJobsDetails &&
+ hiddenJobsDetails.slice(
+ hiddenJobsCurrentPage * 5 - 5,
+ hiddenJobsCurrentPage * 5
+ );
+
+ React.useEffect((): void => {
+ handleGetHiddenJobsDetails();
+ }, []);
+
+ return (
+
+ {jobsOnPage &&
+ jobsOnPage.map((job: Job) =>
)}
+ {jobsOnPage.length > 0 && (
+
+ )}
+ {jobsOnPage.length === 0 && (
+
+ No results. Please modify your search and try again.
+
+ )}
+
+ );
+};
+
+const mapStateToProps = (state: RootState) => ({
+ hiddenJobsCurrentPage: state.user.hiddenJobsCurrentPage,
+ hiddenJobsDetails: state.user.hiddenJobsDetails,
+ hiddenJobsTotalPages: state.user.hiddenJobsTotalPages,
+});
+
+const mapDispatchToProps = (dispatch) => ({
+ handleGetHiddenJobsDetails: () => dispatch(getHiddenJobsDetails()),
+});
+
+export default connect(mapStateToProps, mapDispatchToProps)(HiddenJobs);
diff --git a/src/client/modals/HiddenJobs/index.ts b/src/client/modals/HiddenJobs/index.ts
new file mode 100644
index 0000000..9ea2e4e
--- /dev/null
+++ b/src/client/modals/HiddenJobs/index.ts
@@ -0,0 +1 @@
+export { default } from "./HiddenJobs";
diff --git a/src/client/modals/SavedJobs/SavedJobs-styled.tsx b/src/client/modals/SavedJobs/SavedJobs-styled.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/client/modals/SavedJobs/SavedJobs.tsx b/src/client/modals/SavedJobs/SavedJobs.tsx
new file mode 100644
index 0000000..c0856b5
--- /dev/null
+++ b/src/client/modals/SavedJobs/SavedJobs.tsx
@@ -0,0 +1,66 @@
+import * as React from "react";
+import { connect } from "react-redux";
+
+import JobCard from "../../components/JobCard";
+import Pagination from "../../components/Pagination";
+
+import { getSavedJobsDetails } from "../../redux/thunks";
+
+import { RootState, Job } from "../../types";
+
+export interface SavedJobsProps {
+ handleGetSavedJobsDetails: () => void;
+ savedJobsCurrentPage: number;
+ savedJobsDetails: Job[];
+ savedJobsTotalPages: number;
+}
+
+const SavedJobs: React.SFC = (props: SavedJobsProps) => {
+ const {
+ handleGetSavedJobsDetails,
+ savedJobsCurrentPage,
+ savedJobsDetails,
+ savedJobsTotalPages,
+ } = props;
+
+ const jobsOnPage =
+ savedJobsDetails &&
+ savedJobsDetails.slice(
+ savedJobsCurrentPage * 5 - 5,
+ savedJobsCurrentPage * 5
+ );
+
+ React.useEffect((): void => {
+ handleGetSavedJobsDetails();
+ }, []);
+
+ return (
+
+ {jobsOnPage &&
+ jobsOnPage.map((job: Job) =>
)}
+ {jobsOnPage.length > 0 && (
+
+ )}
+ {jobsOnPage.length === 0 && (
+
+ No results. Please modify your search and try again.
+
+ )}
+
+ );
+};
+
+const mapStateToProps = (state: RootState) => ({
+ savedJobsCurrentPage: state.user.savedJobsCurrentPage,
+ savedJobsDetails: state.user.savedJobsDetails,
+ savedJobsTotalPages: state.user.savedJobsTotalPages,
+});
+
+const mapDispatchToProps = (dispatch) => ({
+ handleGetSavedJobsDetails: () => dispatch(getSavedJobsDetails()),
+});
+
+export default connect(mapStateToProps, mapDispatchToProps)(SavedJobs);
diff --git a/src/client/modals/SavedJobs/index.ts b/src/client/modals/SavedJobs/index.ts
new file mode 100644
index 0000000..6ad4ef0
--- /dev/null
+++ b/src/client/modals/SavedJobs/index.ts
@@ -0,0 +1 @@
+export { default } from "./SavedJobs";
diff --git a/src/client/redux/thunks.ts b/src/client/redux/thunks.ts
index a702c03..da179f2 100644
--- a/src/client/redux/thunks.ts
+++ b/src/client/redux/thunks.ts
@@ -589,13 +589,17 @@ export const removeSavedJob = (id: string): AppThunk => async (dispatch) => {
export const clickViewHiddenJobs = (): AppThunk => (dispatch) => {
dispatch(setCurrentPage(1));
dispatch(displayNotification("", "default"));
- dispatch(setIsViewingHiddenJobs(true));
+ dispatch(setModalContent("hiddenJobs"));
+ dispatch(setModalTitle("Hidden Jobs"));
+ dispatch(setIsModalOpen(true));
};
export const clickViewSavedJobs = (): AppThunk => (dispatch) => {
dispatch(setCurrentPage(1));
dispatch(displayNotification("", "default"));
- dispatch(setIsViewingSavedJobs(true));
+ dispatch(setModalContent("savedJobs"));
+ dispatch(setModalTitle("Saved Jobs"));
+ dispatch(setIsModalOpen(true));
};
export const getJobDetails = (id: string): AppThunk => async (dispatch) => {
From 507328a53c070c0de8cc6da85c061573321c8dfc Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Wed, 12 Aug 2020 07:18:41 -0700
Subject: [PATCH 30/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Update=20Tests?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
cypress/integration/hiddenJobs.spec.js | 11 +-
cypress/integration/notification.spec.js | 30 ++---
cypress/integration/profile.spec.js | 118 +++++++++---------
cypress/integration/savedJobs.spec.js | 9 +-
src/client/components/Modal/Modal-styled.tsx | 2 +
src/client/components/Modal/Modal.tsx | 2 +-
.../components/Profile/Profile-styled.tsx | 2 +-
.../Profile/ProfileAccountDetails.tsx | 45 ++++---
.../Profile/ProfileAccountStats.tsx | 2 +-
src/client/components/Profile/ProfileHero.tsx | 1 +
.../modals/DeleteProfile/DeleteProfile.tsx | 2 +-
11 files changed, 117 insertions(+), 107 deletions(-)
diff --git a/cypress/integration/hiddenJobs.spec.js b/cypress/integration/hiddenJobs.spec.js
index f4f28a1..8862e12 100644
--- a/cypress/integration/hiddenJobs.spec.js
+++ b/cypress/integration/hiddenJobs.spec.js
@@ -74,22 +74,22 @@ context("Hidden Jobs", () => {
cy.get("#nav-profile").click();
cy.get("#view-hidden-jobs").click();
- cy.get("h1").should("have.text", "Hidden Jobs");
+ cy.get("#modal-title").should("have.text", "Hidden Jobs");
cy.get("#f1884b46-ecb4-473c-81f5-08d9bf2ab3bb").should("exist");
// * Cleanup
cy.get("#show-job-f1884b46-ecb4-473c-81f5-08d9bf2ab3bb").click();
});
- it("Should be able to return to the profile display page", () => {
+ it("Should be able to return to the profile page", () => {
cy.get("#hide-job-f1884b46-ecb4-473c-81f5-08d9bf2ab3bb").click();
cy.get("#nav-profile").click();
cy.get("#view-hidden-jobs").click();
- cy.get("h1").should("have.text", "Hidden Jobs");
+ cy.get("#modal-title").should("have.text", "Hidden Jobs");
- cy.get("#back-to-profile").click();
- cy.get("h1").should("have.text", "Profile");
+ cy.get("#modal-close").click();
+ cy.get("h2").should("have.text", "Hello, Bob");
// * Cleanup
cy.get("#view-hidden-jobs").click();
@@ -119,6 +119,7 @@ context("Hidden Jobs", () => {
);
// * Cleanup
+ cy.get("#modal-close").click();
cy.get("header").click();
cy.get("#show-job-f1884b46-ecb4-473c-81f5-08d9bf2ab3bb").click();
cy.get("#show-job-72de09f2-5bc6-489f-be90-3d38e505e20a").click();
diff --git a/cypress/integration/notification.spec.js b/cypress/integration/notification.spec.js
index 97e143b..9405d86 100644
--- a/cypress/integration/notification.spec.js
+++ b/cypress/integration/notification.spec.js
@@ -26,15 +26,13 @@ context("Notification", () => {
cy.get("#nav-login").should("not.exist");
cy.get("#search").should("be.visible");
cy.get("#nav-profile").click();
- cy.get("#edit").click();
- cy.get("h1").should("have.text", "Edit Profile");
- cy.get("#edit-name").clear();
- cy.get("#edit-name").type("Cool Bob");
+ cy.get("#edit-profile").click();
+ cy.get("#name").clear();
+ cy.get("#name").type("Cool Bob");
cy.get("#edit-confirm").click();
cy.wait(500);
- cy.get("h1").should("have.text", "Profile");
cy.get("#notification").should(
"have.text",
"Profile information updated successfully."
@@ -45,13 +43,12 @@ context("Notification", () => {
cy.get("#notification").should("not.exist");
// * Reset to normal data (Cleanup)
- cy.get("#edit").click();
+ cy.get("#edit-profile").click();
cy.get("#notification").should("not.exist");
- cy.get("#edit-name").clear();
- cy.get("#edit-name").type("Bob Test");
+ cy.get("#name").clear();
+ cy.get("#name").type("Bob Test");
cy.get("#edit-confirm").click();
cy.wait(500);
- cy.get("h1").should("have.text", "Profile");
cy.get("#name").should("have.value", "Bob Test");
cy.get("#email").should("have.value", "bobtest@email.com");
});
@@ -66,15 +63,13 @@ context("Notification", () => {
cy.get("#nav-login").should("not.exist");
cy.get("#search").should("be.visible");
cy.get("#nav-profile").click();
- cy.get("#edit").click();
- cy.get("h1").should("have.text", "Edit Profile");
- cy.get("#edit-name").clear();
- cy.get("#edit-name").type("Cool Bob");
+ cy.get("#edit-profile").click();
+ cy.get("#name").clear();
+ cy.get("#name").type("Cool Bob");
cy.get("#edit-confirm").click();
cy.wait(500);
- cy.get("h1").should("have.text", "Profile");
cy.get("#notification").should(
"have.text",
"Profile information updated successfully."
@@ -83,12 +78,11 @@ context("Notification", () => {
cy.get("#notification").should("not.exist");
// * Reset to normal data (Cleanup)
- cy.get("#edit").click();
- cy.get("#edit-name").clear();
- cy.get("#edit-name").type("Bob Test");
+ cy.get("#edit-profile").click();
+ cy.get("#name").clear();
+ cy.get("#name").type("Bob Test");
cy.get("#edit-confirm").click();
cy.wait(500);
- cy.get("h1").should("have.text", "Profile");
cy.get("#name").should("have.value", "Bob Test");
cy.get("#email").should("have.value", "bobtest@email.com");
});
diff --git a/cypress/integration/profile.spec.js b/cypress/integration/profile.spec.js
index ea65c8c..145fe49 100644
--- a/cypress/integration/profile.spec.js
+++ b/cypress/integration/profile.spec.js
@@ -26,92 +26,72 @@ context("Profile", () => {
});
it("Should display 'Profile' page", () => {
- cy.get("h1").should("have.text", "Profile");
+ cy.get("h2").should("have.text", "Hello, Bob");
cy.get("#name").should("have.value", "Bob Test");
cy.get("#email").should("have.value", "bobtest@email.com");
});
it("Should be able to edit the user profile", () => {
- cy.get("#edit").click();
- cy.get("h1").should("have.text", "Edit Profile");
- cy.get("#edit-name").clear();
- cy.get("#edit-name").type("Cool Name");
- cy.get("#edit-email").clear();
- cy.get("#edit-email").type("bobtest2@email.com");
+ cy.get("#edit-profile").click();
+ cy.get("#name").clear();
+ cy.get("#name").type("Cool Name");
+ cy.get("#email").clear();
+ cy.get("#email").type("bobtest2@email.com");
cy.get("#edit-confirm").click();
cy.wait(1500);
- cy.get("h1").should("have.text", "Profile");
+ cy.get("h2").should("have.text", "Hello, Cool");
cy.get("#notification").should(
"have.text",
"Profile information updated successfully."
);
// * Reset to normal data (Cleanup)
- cy.get("#edit").click();
- cy.get("#notification").should("not.be.visible");
- cy.get("#edit-name").clear();
- cy.get("#edit-name").type("Bob Test");
- cy.get("#edit-email").clear();
- cy.get("#edit-email").type("bobtest@email.com");
+ cy.get("#edit-profile").click();
+ cy.get("#name").clear();
+ cy.get("#name").type("Bob Test");
+ cy.get("#email").clear();
+ cy.get("#email").type("bobtest@email.com");
cy.get("#edit-confirm").click();
cy.wait(500);
- cy.get("h1").should("have.text", "Profile");
+ cy.get("h2").should("have.text", "Hello, Bob");
cy.get("#name").should("have.value", "Bob Test");
cy.get("#email").should("have.value", "bobtest@email.com");
});
it("Should be able to cancel editing the user profile", () => {
- cy.get("#edit").click();
- cy.get("h1").should("have.text", "Edit Profile");
- cy.get("#edit-name").clear();
- cy.get("#edit-name").type("Cool Name");
- cy.get("#edit-email").clear();
- cy.get("#edit-email").type("bobtest2@email.com");
+ cy.get("#edit-profile").click();
+ cy.get("#name").clear();
+ cy.get("#name").type("Cool Name");
+ cy.get("#email").clear();
+ cy.get("#email").type("bobtest2@email.com");
// * Cancel
- cy.get("#cancel").click();
+ cy.get("#edit-cancel").click();
- cy.get("h1").should("have.text", "Profile");
+ cy.get("h2").should("have.text", "Hello, Bob");
cy.get("#notification").should("not.be.visible");
cy.get("#name").should("have.value", "Bob Test");
cy.get("#email").should("have.value", "bobtest@email.com");
});
it("Should not allow to submit edit profile form if information is not changed", () => {
- cy.get("#edit").click();
- cy.get("h1").should("have.text", "Edit Profile");
+ cy.get("#edit-profile").click();
cy.get("#edit-confirm").should("be.disabled");
});
it("Should not allow to submit edit profile form if information is blank", () => {
- cy.get("#edit").click();
- cy.get("h1").should("have.text", "Edit Profile");
- cy.get("#edit-name").clear();
- cy.get("#edit-email").clear();
+ cy.get("#edit-profile").click();
+ cy.get("#name").clear();
+ cy.get("#email").clear();
cy.get("#edit-confirm").should("be.disabled");
});
- it("Should not allow to set newEmail to an invalid email", () => {
- cy.get("#edit").click();
- cy.get("h1").should("have.text", "Edit Profile");
- cy.get("#edit-name").clear();
- cy.get("#edit-name").type("Cool Name");
- cy.get("#edit-email").type("bobtest2@email.com");
- cy.get("#edit-confirm").click();
-
- cy.wait(500);
-
- cy.get("h1").should("have.text", "Edit Profile");
- cy.get("#notification").should("have.text", "Invalid email.");
-
- cy.get("#cancel").click();
- });
-
it("Should be able to reset the password", () => {
+ cy.get("#settings").click();
cy.get("#reset-password").click();
- cy.get("h1").should("have.text", "Reset Password");
+ cy.get("#modal-title").should("have.text", "Reset Password");
cy.get("#current-password").type("Red123456!!!");
cy.get("#new-password").type("Blue123456!!!");
cy.get("#confirm-new-password").type("Blue123456!!!");
@@ -119,29 +99,32 @@ context("Profile", () => {
cy.wait(500);
- cy.get("h1").should("have.text", "Profile");
+ cy.get("h2").should("have.text", "Hello, Bob");
cy.get("#notification").should("have.text", "Password reset successfully.");
// * Reset to normal data (Cleanup)
+ cy.get("#settings").click();
cy.get("#reset-password").click();
- cy.get("h1").should("have.text", "Reset Password");
+ cy.get("#modal-title").should("have.text", "Reset Password");
cy.get("#current-password").type("Blue123456!!!");
cy.get("#new-password").type("Red123456!!!");
cy.get("#confirm-new-password").type("Red123456!!!");
cy.get("#reset").click();
- cy.get("h1").should("have.text", "Profile");
+ cy.get("h2").should("have.text", "Hello, Bob");
cy.get("#notification").should("have.text", "Password reset successfully.");
});
it("Should not allow to submit reset password form if information is not changed", () => {
+ cy.get("#settings").click();
cy.get("#reset-password").click();
- cy.get("h1").should("have.text", "Reset Password");
+ cy.get("#modal-title").should("have.text", "Reset Password");
cy.get("#reset").should("be.disabled");
});
it("Should not allow to submit reset password form if information is blank", () => {
+ cy.get("#settings").click();
cy.get("#reset-password").click();
- cy.get("h1").should("have.text", "Reset Password");
+ cy.get("#modal-title").should("have.text", "Reset Password");
cy.get("#current-password").clear();
cy.get("#new-password").clear();
cy.get("#confirm-new-password").clear();
@@ -149,8 +132,9 @@ context("Profile", () => {
});
it("Should not be able to reset password when using invalid credentials", () => {
+ cy.get("#settings").click();
cy.get("#reset-password").click();
- cy.get("h1").should("have.text", "Reset Password");
+ cy.get("#modal-title").should("have.text", "Reset Password");
cy.get("#current-password").type("Blue123456!!!");
cy.get("#new-password").type("Red123456!!!");
cy.get("#confirm-new-password").type("Red123456!!!");
@@ -158,13 +142,14 @@ context("Profile", () => {
cy.wait(500);
- cy.get("h1").should("have.text", "Reset Password");
+ cy.get("#modal-title").should("have.text", "Reset Password");
cy.get("#notification").should("have.text", "Invalid credentials.");
});
it("Should not be able to reset password if passwords do not match", () => {
+ cy.get("#settings").click();
cy.get("#reset-password").click();
- cy.get("h1").should("have.text", "Reset Password");
+ cy.get("#modal-title").should("have.text", "Reset Password");
cy.get("#current-password").type("Red123456!!!");
cy.get("#new-password").type("Blue123456!!!");
cy.get("#confirm-new-password").type("Yellow123456!!!");
@@ -172,23 +157,26 @@ context("Profile", () => {
cy.wait(500);
- cy.get("h1").should("have.text", "Reset Password");
+ cy.get("#modal-title").should("have.text", "Reset Password");
cy.get("#notification").should("have.text", "Passwords do not match.");
});
it("Should be able to log out on this device", () => {
+ cy.get("#settings").click();
cy.get("#log-out").click();
cy.get("#nav-login").should("exist");
cy.get("#search").should("be.visible");
});
it("Should be able to log out on all devices", () => {
+ cy.get("#settings").click();
cy.get("#log-out-all").click();
cy.get("#nav-login").should("exist");
cy.get("#search").should("be.visible");
});
it("Should be able to delete a user profile", () => {
+ cy.get("#settings").click();
cy.get("#log-out").click();
cy.wait(500);
cy.get("#nav-login").should("exist");
@@ -207,10 +195,11 @@ context("Profile", () => {
cy.get("#nav-login").should("not.exist");
cy.get("#search").should("be.visible");
cy.get("#nav-profile").click();
- cy.get("h1").should("have.text", "Profile");
+ cy.get("h2").should("have.text", "Hello, Delete");
+ cy.get("#settings").click();
cy.get("#delete-profile").click();
- cy.get("h1").should("have.text", "Delete Profile");
+ cy.get("#modal-title").should("have.text", "Delete Profile");
cy.get("#notification").should(
"have.text",
"Are you sure you would like to delete your profile? This can not be reversed."
@@ -222,6 +211,7 @@ context("Profile", () => {
});
it("Should be able to cancel deleting a user profile", () => {
+ cy.get("#settings").click();
cy.get("#log-out").click();
cy.wait(500);
cy.get("#nav-login").should("exist");
@@ -240,22 +230,26 @@ context("Profile", () => {
cy.get("#nav-login").should("not.exist");
cy.get("#search").should("be.visible");
cy.get("#nav-profile").click();
- cy.get("h1").should("have.text", "Profile");
+ cy.get("h2").should("have.text", "Hello, Delete");
+ cy.get("#settings").click();
cy.get("#delete-profile").click();
- cy.get("h1").should("have.text", "Delete Profile");
+ cy.get("#modal-title").should("have.text", "Delete Profile");
cy.get("#notification").should(
"have.text",
"Are you sure you would like to delete your profile? This can not be reversed."
);
- cy.get("#cancel").click();
- cy.get("h1").should("have.text", "Profile");
+ cy.get("#delete-cancel").click();
+ cy.get("#modal-title").should("have.text", "Settings");
+ cy.get("#modal-close").click();
+ cy.get("h2").should("have.text", "Hello, Delete");
cy.get("#name").should("have.value", "Delete Test");
cy.get("#email").should("have.value", "deletetest@email.com");
// * Cleanup
+ cy.get("#settings").click();
cy.get("#delete-profile").click();
- cy.get("h1").should("have.text", "Delete Profile");
+ cy.get("#modal-title").should("have.text", "Delete Profile");
cy.get("#notification").should(
"have.text",
"Are you sure you would like to delete your profile? This can not be reversed."
diff --git a/cypress/integration/savedJobs.spec.js b/cypress/integration/savedJobs.spec.js
index 28bf8b3..6fbb1d9 100644
--- a/cypress/integration/savedJobs.spec.js
+++ b/cypress/integration/savedJobs.spec.js
@@ -74,7 +74,7 @@ context("Saved Jobs", () => {
cy.get("#nav-profile").click();
cy.get("#view-saved-jobs").click();
- cy.get("h1").should("have.text", "Saved Jobs");
+ cy.get("#modal-title").should("have.text", "Saved Jobs");
cy.get("#f1884b46-ecb4-473c-81f5-08d9bf2ab3bb").should("exist");
// * Cleanup
@@ -86,10 +86,10 @@ context("Saved Jobs", () => {
cy.get("#nav-profile").click();
cy.get("#view-saved-jobs").click();
- cy.get("h1").should("have.text", "Saved Jobs");
+ cy.get("#modal-title").should("have.text", "Saved Jobs");
- cy.get("#back-to-profile").click();
- cy.get("h1").should("have.text", "Profile");
+ cy.get("#modal-close").click();
+ cy.get("h2").should("have.text", "Hello, Bob");
// * Cleanup
cy.get("#view-saved-jobs").click();
@@ -119,6 +119,7 @@ context("Saved Jobs", () => {
);
// * Cleanup
+ cy.get("#modal-close").click();
cy.get("header").click();
cy.get("#remove-job-f1884b46-ecb4-473c-81f5-08d9bf2ab3bb").click();
cy.get("#remove-job-72de09f2-5bc6-489f-be90-3d38e505e20a").click();
diff --git a/src/client/components/Modal/Modal-styled.tsx b/src/client/components/Modal/Modal-styled.tsx
index 9132b3e..41c40c3 100644
--- a/src/client/components/Modal/Modal-styled.tsx
+++ b/src/client/components/Modal/Modal-styled.tsx
@@ -22,6 +22,8 @@ const ModalInnerContainer = styled.div`
background-color: #ffffff;
border-radius: 1.25rem;
height: fit-content;
+ max-height: 80%;
+ overflow-y: scroll;
padding: 25px;
width: 50%;
diff --git a/src/client/components/Modal/Modal.tsx b/src/client/components/Modal/Modal.tsx
index 43af45b..1eaa640 100644
--- a/src/client/components/Modal/Modal.tsx
+++ b/src/client/components/Modal/Modal.tsx
@@ -32,7 +32,7 @@ const Modal: React.SFC = (props: ModalProps) => {
- {modalTitle}
+ {modalTitle}
handleCloseModal()}>
x
diff --git a/src/client/components/Profile/Profile-styled.tsx b/src/client/components/Profile/Profile-styled.tsx
index 1ea235d..e3dc1bf 100644
--- a/src/client/components/Profile/Profile-styled.tsx
+++ b/src/client/components/Profile/Profile-styled.tsx
@@ -183,7 +183,7 @@ const ProfileAccountStatsContainer = styled.div`
padding: 25px;
width: 40%;
- h2 {
+ h3 {
margin-top: 100px;
}
diff --git a/src/client/components/Profile/ProfileAccountDetails.tsx b/src/client/components/Profile/ProfileAccountDetails.tsx
index d1c901b..8827833 100644
--- a/src/client/components/Profile/ProfileAccountDetails.tsx
+++ b/src/client/components/Profile/ProfileAccountDetails.tsx
@@ -10,17 +10,19 @@ import {
ProfileAccountDetailsContainer,
} from "./Profile-styled";
-import { editProfile } from "../../redux/thunks";
-
-import { RootState } from "../../types";
import {
setModalContent,
setModalTitle,
setIsModalOpen,
} from "../../redux/actions/application";
+import { setIsEditingProfile } from "../../redux/actions/user";
+import { editProfile } from "../../redux/thunks";
+
+import { RootState } from "../../types";
export interface ProfileAccountDetailsProps {
email: string;
+ handleCancelEditProfile: () => void;
handleEditProfile: (email: string, name: string) => void;
handleSettingsClick: () => void;
isEditingProfile: boolean;
@@ -32,6 +34,7 @@ const ProfileAccountDetails: React.SFC = (
) => {
const {
email,
+ handleCancelEditProfile,
handleEditProfile,
handleSettingsClick,
isEditingProfile,
@@ -82,17 +85,30 @@ const ProfileAccountDetails: React.SFC = (
value={newEmail}
/>
{isEditingProfile && (
-
+
+
+ {
+ setNewName(name);
+ setNewEmail(email);
+ handleCancelEditProfile();
+ }}
+ type="button"
+ />
+
)}
@@ -107,6 +123,7 @@ const mapStateToProps = (state: RootState) => ({
});
const mapDispatchToProps = (dispatch) => ({
+ handleCancelEditProfile: () => dispatch(setIsEditingProfile(false)),
handleEditProfile: (email: string, name: string) =>
dispatch(editProfile(email, name)),
handleSettingsClick: () => {
diff --git a/src/client/components/Profile/ProfileAccountStats.tsx b/src/client/components/Profile/ProfileAccountStats.tsx
index 745f167..b570bf2 100644
--- a/src/client/components/Profile/ProfileAccountStats.tsx
+++ b/src/client/components/Profile/ProfileAccountStats.tsx
@@ -34,7 +34,7 @@ const ProfileAccountStats: React.SFC = (
return (
- {name}
+ {name}
diff --git a/src/client/components/Profile/ProfileHero.tsx b/src/client/components/Profile/ProfileHero.tsx
index 8f82d95..b6cbf91 100644
--- a/src/client/components/Profile/ProfileHero.tsx
+++ b/src/client/components/Profile/ProfileHero.tsx
@@ -29,6 +29,7 @@ const ProfileHero: React.SFC = (props: ProfileHeroProps) => {
handleEditProfile()}
type="button"
/>
diff --git a/src/client/modals/DeleteProfile/DeleteProfile.tsx b/src/client/modals/DeleteProfile/DeleteProfile.tsx
index 1341719..346fa21 100644
--- a/src/client/modals/DeleteProfile/DeleteProfile.tsx
+++ b/src/client/modals/DeleteProfile/DeleteProfile.tsx
@@ -24,7 +24,7 @@ const DeleteProfile: React.SFC = (
handleCancelDeleteProfile()}
type="button"
From a6235fccacb680cb1b4473924656ca561683e9e9 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Wed, 12 Aug 2020 08:11:52 -0700
Subject: [PATCH 31/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Remove=20Unused=20Profile=20and=20Thunks=20files?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/Profile/Profile-styled.tsx | 192 ++++--------------
.../components/Profile/ProfileDelete.tsx | 46 -----
.../components/Profile/ProfileDisplay.tsx | 164 ---------------
src/client/components/Profile/ProfileEdit.tsx | 106 ----------
.../components/Profile/ProfileHiddenJobs.tsx | 87 --------
.../components/Profile/ProfileReset.tsx | 119 -----------
.../components/Profile/ProfileSavedJobs.tsx | 87 --------
src/client/components/Profile/index.ts | 18 +-
src/client/redux/actionTypes.ts | 1 -
src/client/redux/actions/user.ts | 8 -
src/client/redux/reducers/user.ts | 3 -
src/client/redux/thunks.ts | 40 ----
src/client/types.ts | 1 -
13 files changed, 43 insertions(+), 829 deletions(-)
delete mode 100644 src/client/components/Profile/ProfileDelete.tsx
delete mode 100644 src/client/components/Profile/ProfileDisplay.tsx
delete mode 100644 src/client/components/Profile/ProfileEdit.tsx
delete mode 100644 src/client/components/Profile/ProfileHiddenJobs.tsx
delete mode 100644 src/client/components/Profile/ProfileReset.tsx
delete mode 100644 src/client/components/Profile/ProfileSavedJobs.tsx
diff --git a/src/client/components/Profile/Profile-styled.tsx b/src/client/components/Profile/Profile-styled.tsx
index e3dc1bf..2d9cf57 100644
--- a/src/client/components/Profile/Profile-styled.tsx
+++ b/src/client/components/Profile/Profile-styled.tsx
@@ -1,126 +1,17 @@
import styled from "styled-components";
-const ProfileActionsContainer = styled.div`
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- margin-bottom: 25px;
- margin-top: 25px;
-
- @media only screen and (max-width: 600px) {
- align-items: normal;
- flex-direction: column;
- }
-`;
-
-const ProfilePage = styled.div`
- display: flex;
- flex-direction: column;
+const ProfileAccountDetailsContainer = styled.div`
+ background-color: rgba(246, 249, 251, 1);
+ border-radius: 1.25rem;
+ box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
+ margin-top: -200px;
+ width: 40%;
@media only screen and (max-width: 600px) {
- form {
- width: 100%;
- }
- }
-`;
-
-interface ProfileFormProps {
- isViewingHiddenJobs: boolean;
- isViewingSavedJobs: boolean;
-}
-
-const ProfileForm = styled.form`
- max-width: ${(props) =>
- props.isViewingSavedJobs || props.isViewingHiddenJobs ? "800px" : "444px"};
- width: ${(props) =>
- props.isViewingSavedJobs || props.isViewingHiddenJobs ? "100%" : "50%"};
-`;
-
-const ProfileTitleContainer = styled.div`
- align-items: center;
- display: flex;
- flex-direction: column;
-
- h1 {
- color: #282538;
- font-family: Poppins;
- font-style: normal;
- font-weight: 200;
- font-size: 24px;
- line-height: 36px;
- margin: 0;
- }
-
- span {
- align-items: center;
- background: #1e86ff;
- border-radius: 50%;
- display: flex;
- height: 40px;
- justify-content: center;
- margin: 8px;
- width: 40px;
-
- i {
- color: #ffffff;
- }
- }
-`;
-
-const ProfileSavedContainer = styled.div`
- width: 100%;
-`;
-
-const ProfileHiddenContainer = styled.div`
- width: 100%;
-`;
-
-const ProfileNoResults = styled.p`
- text-align: center;
-`;
-
-const ProfileBackButton = styled.button`
- align-items: center;
- background: none;
- border: none;
- color: #1e86ff;
- display: flex;
- font-family: Poppins, sans-serif;
- font-size: 14px;
- font-weight: 500;
- line-height: 21px;
- margin-right: 15px;
- justify-content: flex-start;
- text-decoration: none;
-
- i {
- font-size: 16px;
- margin-right: 5px;
- }
-
- :hover {
- cursor: pointer;
-
- i {
- text-decoration: none;
- }
-
- span {
- text-decoration: underline;
- }
+ width: 100%;
}
`;
-const ProfileHeroContainer = styled.div`
- background: url("/assets/profile.svg");
- background-color: #172b4d;
- border-radius: 1.25rem;
- color: #ffffff;
- height: 400px;
- padding: 50px;
-`;
-
const ProfileAccountDetailsContentContainer = styled.div`
padding: 25px;
@@ -159,16 +50,12 @@ const ProfileAccountDetailsHeadingContainer = styled.div`
}
`;
-const ProfileAccountDetailsContainer = styled.div`
- background-color: rgba(246, 249, 251, 1);
- border-radius: 1.25rem;
- box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
- margin-top: -200px;
- width: 40%;
-
- @media only screen and (max-width: 600px) {
- width: 100%;
- }
+const ProfileAccountStatsAvatar = styled.img`
+ background-image: linear-gradient(135deg, #ce9ffc 10%, #7367f0 100%);
+ border-radius: 50%;
+ height: 150px;
+ margin: -75px auto;
+ width: 150px;
`;
const ProfileAccountStatsContainer = styled.div`
@@ -194,12 +81,21 @@ const ProfileAccountStatsContainer = styled.div`
}
`;
-const ProfileAccountStatsAvatar = styled.img`
- background-image: linear-gradient(135deg, #ce9ffc 10%, #7367f0 100%);
- border-radius: 50%;
- height: 150px;
- margin: -75px auto;
- width: 150px;
+const ProfileAccountStatsInnerContainer = styled.div`
+ display: flex;
+ flex-direction: row;
+ justify-content: space-evenly;
+ margin-bottom: 25px;
+ width: 100%;
+`;
+
+const ProfileHeroContainer = styled.div`
+ background: url("/assets/profile.svg");
+ background-color: #172b4d;
+ border-radius: 1.25rem;
+ color: #ffffff;
+ height: 400px;
+ padding: 50px;
`;
const ProfileInnerContainer = styled.div`
@@ -212,29 +108,25 @@ const ProfileInnerContainer = styled.div`
}
`;
-const ProfileAccountStatsInnerContainer = styled.div`
+const ProfilePage = styled.div`
display: flex;
- flex-direction: row;
- justify-content: space-evenly;
- margin-bottom: 25px;
- width: 100%;
+ flex-direction: column;
+
+ @media only screen and (max-width: 600px) {
+ form {
+ width: 100%;
+ }
+ }
`;
export {
- ProfileAccountStatsInnerContainer,
- ProfileInnerContainer,
- ProfileAccountStatsAvatar,
- ProfileAccountStatsContainer,
+ ProfileAccountDetailsContainer,
ProfileAccountDetailsContentContainer,
ProfileAccountDetailsHeadingContainer,
- ProfileAccountDetailsContainer,
- ProfileActionsContainer,
- ProfilePage,
- ProfileForm,
- ProfileTitleContainer,
- ProfileSavedContainer,
- ProfileNoResults,
- ProfileBackButton,
- ProfileHiddenContainer,
+ ProfileAccountStatsAvatar,
+ ProfileAccountStatsContainer,
+ ProfileAccountStatsInnerContainer,
ProfileHeroContainer,
+ ProfileInnerContainer,
+ ProfilePage,
};
diff --git a/src/client/components/Profile/ProfileDelete.tsx b/src/client/components/Profile/ProfileDelete.tsx
deleted file mode 100644
index edc1d1a..0000000
--- a/src/client/components/Profile/ProfileDelete.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import * as React from "react";
-import { connect } from "react-redux";
-
-import Button from "../Button";
-
-import { ProfileActionsContainer } from "./Profile-styled";
-
-import { cancelDeleteProfile, deleteProfile } from "../../redux/thunks";
-
-export interface ProfileDeleteProps {
- handleCancelDeleteProfile: () => void;
- handleDeleteProfile: () => void;
-}
-
-const ProfileDelete: React.SFC = (
- props: ProfileDeleteProps
-) => {
- const { handleCancelDeleteProfile, handleDeleteProfile } = props;
- return (
- <>
-
- handleCancelDeleteProfile()}
- type="button"
- />
- handleDeleteProfile()}
- type="button"
- />
-
- >
- );
-};
-
-const mapDispatchToProps = (dispatch) => ({
- handleCancelDeleteProfile: () => dispatch(cancelDeleteProfile()),
- handleDeleteProfile: () => dispatch(deleteProfile()),
-});
-
-export default connect(null, mapDispatchToProps)(ProfileDelete);
diff --git a/src/client/components/Profile/ProfileDisplay.tsx b/src/client/components/Profile/ProfileDisplay.tsx
deleted file mode 100644
index de333df..0000000
--- a/src/client/components/Profile/ProfileDisplay.tsx
+++ /dev/null
@@ -1,164 +0,0 @@
-import * as React from "react";
-import { connect } from "react-redux";
-
-import Button from "../Button";
-import Input from "../Input";
-
-import { ProfileActionsContainer } from "./Profile-styled";
-
-import { displayNotification } from "../../redux/actions/application";
-import { setIsResettingPassword } from "../../redux/actions/user";
-import {
- clickEditProfile,
- clickDeleteProfile,
- clickViewHiddenJobs,
- clickViewSavedJobs,
- logOut,
- logOutAll,
-} from "../../redux/thunks";
-
-import { RootState } from "../../types";
-
-export interface ProfileDisplayProps {
- email: string;
- handleClearFormError: () => void;
- handleClickDeleteProfile: () => void;
- handleClickEditProfile: () => void;
- handleClickViewHiddenJobs: () => void;
- handleClickViewSavedJobs: () => void;
- handleLogOut: () => void;
- handleLogOutAll: () => void;
- handleSetIsResettingPassword: (isResettingPassword: boolean) => void;
- hiddenJobs: string[];
- name: string;
- savedJobs: string[];
-}
-
-const ProfileDisplay: React.SFC = (
- props: ProfileDisplayProps
-) => {
- const {
- email,
- handleClearFormError,
- handleClickDeleteProfile,
- handleClickEditProfile,
- handleClickViewHiddenJobs,
- handleClickViewSavedJobs,
- handleLogOut,
- handleLogOutAll,
- handleSetIsResettingPassword,
- hiddenJobs,
- name,
- savedJobs,
- } = props;
- return (
- <>
-
-
-
-
-
- handleClickEditProfile()}
- type="button"
- />
-
-
-
- handleClickViewHiddenJobs()}
- type="button"
- />
- handleClickViewSavedJobs()}
- type="button"
- />
-
-
-
- handleLogOut()}
- type="button"
- />
- handleLogOutAll()}
- type="button"
- />
-
-
-
- handleClickDeleteProfile()}
- type="button"
- />
- {
- handleClearFormError();
- handleSetIsResettingPassword(true);
- }}
- type="button"
- />
-
- >
- );
-};
-
-const mapStateToProps = (state: RootState) => ({
- email: state.user.email,
- hiddenJobs: state.user.hiddenJobs,
- name: state.user.name,
- savedJobs: state.user.savedJobs,
-});
-
-const mapDispatchToProps = (dispatch) => ({
- handleClearFormError: () => dispatch(displayNotification("", "default")),
- handleClickDeleteProfile: () => dispatch(clickDeleteProfile()),
- handleClickEditProfile: () => dispatch(clickEditProfile()),
- handleClickViewHiddenJobs: () => dispatch(clickViewHiddenJobs()),
- handleClickViewSavedJobs: () => dispatch(clickViewSavedJobs()),
- handleLogOut: () => dispatch(logOut()),
- handleLogOutAll: () => dispatch(logOutAll()),
- handleSetIsResettingPassword: (isResettingPassword: boolean) =>
- dispatch(setIsResettingPassword(isResettingPassword)),
-});
-
-export default connect(mapStateToProps, mapDispatchToProps)(ProfileDisplay);
diff --git a/src/client/components/Profile/ProfileEdit.tsx b/src/client/components/Profile/ProfileEdit.tsx
deleted file mode 100644
index 89a3b96..0000000
--- a/src/client/components/Profile/ProfileEdit.tsx
+++ /dev/null
@@ -1,106 +0,0 @@
-import * as React from "react";
-import { connect } from "react-redux";
-
-import Button from "../Button";
-import Input from "../Input";
-
-import { ProfileActionsContainer } from "./Profile-styled";
-
-// import { setEditEmail, setEditName } from "../../redux/actions/user";
-import { cancelEditProfile } from "../../redux/thunks";
-
-import { RootState } from "../../types";
-
-export interface ProfileEditProps {
- editEmail: string;
- editName: string;
- email: string;
- handleEditProfile: () => void;
- handleCancelEditProfile: () => void;
- handleSetEditEmail: (editEmail: string) => void;
- handleSetEditName: (editName: string) => void;
- name: string;
-}
-
-const ProfileEdit: React.SFC = (props: ProfileEditProps) => {
- const {
- editEmail,
- editName,
- email,
- handleCancelEditProfile,
- handleEditProfile,
- handleSetEditEmail,
- handleSetEditName,
- name,
- } = props;
- return (
- <>
- handleSetEditName(e.target.value)}
- type="text"
- value={editName}
- />
-
- handleSetEditEmail(e.target.value)}
- type="email"
- value={editEmail}
- />
-
-
- handleCancelEditProfile()}
- type="button"
- />
- handleEditProfile()}
- type="button"
- />
-
- >
- );
-};
-
-const mapStateToProps = (state: RootState) => ({
- editEmail: "",
- editName: "",
- email: state.user.email,
- name: state.user.name,
-});
-
-const mapDispatchToProps = (dispatch) => ({
- handleCancelEditProfile: () => dispatch(cancelEditProfile()),
- // handleEditProfile: () => dispatch(editProfile()),
- handleEditProfile: () => {
- console.log("EMPTY FUNCTION");
- },
- // handleSetEditEmail: (editEmail: string) => dispatch(setEditEmail(editEmail)),
- handleSetEditEmail: () => {
- console.log("EMPTY FUNCTION");
- },
- // handleSetEditName: (editName: string) => dispatch(setEditName(editName)),
- handleSetEditName: () => {
- console.log("EMPTY FUNCTION");
- },
-});
-
-export default connect(mapStateToProps, mapDispatchToProps)(ProfileEdit);
diff --git a/src/client/components/Profile/ProfileHiddenJobs.tsx b/src/client/components/Profile/ProfileHiddenJobs.tsx
deleted file mode 100644
index 6b099a7..0000000
--- a/src/client/components/Profile/ProfileHiddenJobs.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import * as React from "react";
-import { connect } from "react-redux";
-
-import JobCard from "../JobCard";
-import Pagination from "../Pagination";
-
-import {
- ProfileHiddenContainer,
- ProfileNoResults,
- ProfileBackButton,
-} from "./Profile-styled";
-
-import { setIsViewingHiddenJobs } from "../../redux/actions/user";
-import { getHiddenJobsDetails } from "../../redux/thunks";
-
-import { RootState, Job } from "../../types";
-
-export interface ProfileHiddenJobsProps {
- handleBackToProfile: () => void;
- handleGetHiddenJobsDetails: () => void;
- hiddenJobsCurrentPage: number;
- hiddenJobsDetails: Job[];
- hiddenJobsTotalPages: number;
-}
-
-const ProfileHiddenJobs: React.SFC = (
- props: ProfileHiddenJobsProps
-) => {
- const {
- handleBackToProfile,
- handleGetHiddenJobsDetails,
- hiddenJobsCurrentPage,
- hiddenJobsDetails,
- hiddenJobsTotalPages,
- } = props;
-
- const jobsOnPage =
- hiddenJobsDetails &&
- hiddenJobsDetails.slice(
- hiddenJobsCurrentPage * 5 - 5,
- hiddenJobsCurrentPage * 5
- );
-
- React.useEffect((): void => {
- handleGetHiddenJobsDetails();
- }, []);
-
- return (
- <>
- handleBackToProfile()}
- >
- west
- Back to profile
-
-
- {jobsOnPage &&
- jobsOnPage.map((job: Job) => )}
- {jobsOnPage.length > 0 && (
-
- )}
- {jobsOnPage.length === 0 && (
-
- No results. Please modify your search and try again.
-
- )}
-
- >
- );
-};
-
-const mapStateToProps = (state: RootState) => ({
- hiddenJobsCurrentPage: state.user.hiddenJobsCurrentPage,
- hiddenJobsDetails: state.user.hiddenJobsDetails,
- hiddenJobsTotalPages: state.user.hiddenJobsTotalPages,
-});
-
-const mapDispatchToProps = (dispatch) => ({
- handleBackToProfile: () => dispatch(setIsViewingHiddenJobs(false)),
- handleGetHiddenJobsDetails: () => dispatch(getHiddenJobsDetails()),
-});
-
-export default connect(mapStateToProps, mapDispatchToProps)(ProfileHiddenJobs);
diff --git a/src/client/components/Profile/ProfileReset.tsx b/src/client/components/Profile/ProfileReset.tsx
deleted file mode 100644
index cbbc569..0000000
--- a/src/client/components/Profile/ProfileReset.tsx
+++ /dev/null
@@ -1,119 +0,0 @@
-import * as React from "react";
-import { connect } from "react-redux";
-
-import Button from "../Button";
-import Input from "../Input";
-
-import { ProfileActionsContainer } from "./Profile-styled";
-
-import {
- setResetConfirmNewPassword,
- setResetCurrentPassword,
- setResetNewPassword,
-} from "../../redux/actions/user";
-import { cancelResetPassword, resetPassword } from "../../redux/thunks";
-
-import { RootState } from "../../types";
-
-export interface ProfileResetProps {
- handleCancelResetPassword: () => void;
- handleResetPassword: () => void;
- handleSetResetConfirmNewPassword: (resetConfirmNewPassword: string) => void;
- handleSetResetCurrentPassword: (resetCurrentPassword: string) => void;
- handleSetResetNewPassword: (resetNewPassword: string) => void;
- resetConfirmNewPassword: string;
- resetCurrentPassword: string;
- resetNewPassword: string;
-}
-
-const ProfileReset: React.SFC = (
- props: ProfileResetProps
-) => {
- const {
- handleCancelResetPassword,
- handleResetPassword,
- handleSetResetConfirmNewPassword,
- handleSetResetCurrentPassword,
- handleSetResetNewPassword,
- resetConfirmNewPassword,
- resetCurrentPassword,
- resetNewPassword,
- } = props;
- return (
- <>
- handleSetResetCurrentPassword(e.target.value)}
- type="password"
- value={resetCurrentPassword}
- />
-
- handleSetResetNewPassword(e.target.value)}
- type="password"
- value={resetNewPassword}
- />
-
- handleSetResetConfirmNewPassword(e.target.value)}
- type="password"
- value={resetConfirmNewPassword}
- />
-
-
- handleCancelResetPassword()}
- type="button"
- />
- handleResetPassword()}
- type="button"
- />
-
- >
- );
-};
-
-const mapStateToProps = (state: RootState) => ({
- resetConfirmNewPassword: state.user.resetConfirmNewPassword,
- resetCurrentPassword: state.user.resetCurrentPassword,
- resetNewPassword: state.user.resetNewPassword,
-});
-
-const mapDispatchToProps = (dispatch) => ({
- handleCancelResetPassword: () => dispatch(cancelResetPassword()),
- handleResetPassword: () => dispatch(resetPassword("", "")),
- handleSetResetConfirmNewPassword: (resetConfirmNewPassword: string) =>
- dispatch(setResetConfirmNewPassword(resetConfirmNewPassword)),
- handleSetResetCurrentPassword: (resetCurrentPassword: string) =>
- dispatch(setResetCurrentPassword(resetCurrentPassword)),
- handleSetResetNewPassword: (resetNewPassword: string) =>
- dispatch(setResetNewPassword(resetNewPassword)),
-});
-
-export default connect(mapStateToProps, mapDispatchToProps)(ProfileReset);
diff --git a/src/client/components/Profile/ProfileSavedJobs.tsx b/src/client/components/Profile/ProfileSavedJobs.tsx
deleted file mode 100644
index b1ae8a4..0000000
--- a/src/client/components/Profile/ProfileSavedJobs.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import * as React from "react";
-import { connect } from "react-redux";
-
-import JobCard from "../JobCard";
-import Pagination from "../Pagination";
-
-import {
- ProfileSavedContainer,
- ProfileNoResults,
- ProfileBackButton,
-} from "./Profile-styled";
-
-import { setIsViewingSavedJobs } from "../../redux/actions/user";
-import { getSavedJobsDetails } from "../../redux/thunks";
-
-import { RootState, Job } from "../../types";
-
-export interface ProfileSavedJobsProps {
- handleBackToProfile: () => void;
- handleGetSavedJobsDetails: () => void;
- savedJobsCurrentPage: number;
- savedJobsDetails: Job[];
- savedJobsTotalPages: number;
-}
-
-const ProfileSavedJobs: React.SFC = (
- props: ProfileSavedJobsProps
-) => {
- const {
- handleBackToProfile,
- handleGetSavedJobsDetails,
- savedJobsCurrentPage,
- savedJobsDetails,
- savedJobsTotalPages,
- } = props;
-
- const jobsOnPage =
- savedJobsDetails &&
- savedJobsDetails.slice(
- savedJobsCurrentPage * 5 - 5,
- savedJobsCurrentPage * 5
- );
-
- React.useEffect((): void => {
- handleGetSavedJobsDetails();
- }, []);
-
- return (
- <>
- handleBackToProfile()}
- >
- west
- Back to profile
-
-
- {jobsOnPage &&
- jobsOnPage.map((job: Job) => )}
- {jobsOnPage.length > 0 && (
-
- )}
- {jobsOnPage.length === 0 && (
-
- No results. Please modify your search and try again.
-
- )}
-
- >
- );
-};
-
-const mapStateToProps = (state: RootState) => ({
- savedJobsCurrentPage: state.user.savedJobsCurrentPage,
- savedJobsDetails: state.user.savedJobsDetails,
- savedJobsTotalPages: state.user.savedJobsTotalPages,
-});
-
-const mapDispatchToProps = (dispatch) => ({
- handleBackToProfile: () => dispatch(setIsViewingSavedJobs(false)),
- handleGetSavedJobsDetails: () => dispatch(getSavedJobsDetails()),
-});
-
-export default connect(mapStateToProps, mapDispatchToProps)(ProfileSavedJobs);
diff --git a/src/client/components/Profile/index.ts b/src/client/components/Profile/index.ts
index e91a593..263edb3 100644
--- a/src/client/components/Profile/index.ts
+++ b/src/client/components/Profile/index.ts
@@ -1,21 +1,5 @@
import ProfileAccountDetails from "./ProfileAccountDetails";
import ProfileAccountStats from "./ProfileAccountStats";
-import ProfileDelete from "./ProfileDelete";
-import ProfileDisplay from "./ProfileDisplay";
-import ProfileEdit from "./ProfileEdit";
import ProfileHero from "./ProfileHero";
-import ProfileHiddenJobs from "./ProfileHiddenJobs";
-import ProfileReset from "./ProfileReset";
-import ProfileSavedJobs from "./ProfileSavedJobs";
-export {
- ProfileAccountDetails,
- ProfileAccountStats,
- ProfileDelete,
- ProfileDisplay,
- ProfileEdit,
- ProfileHero,
- ProfileHiddenJobs,
- ProfileReset,
- ProfileSavedJobs,
-};
+export { ProfileAccountDetails, ProfileAccountStats, ProfileHero };
diff --git a/src/client/redux/actionTypes.ts b/src/client/redux/actionTypes.ts
index 1288c6c..531ed2b 100644
--- a/src/client/redux/actionTypes.ts
+++ b/src/client/redux/actionTypes.ts
@@ -23,7 +23,6 @@ export const SET_HIDDEN_JOBS = "SET_HIDDEN_JOBS";
export const SET_HIDDEN_JOBS_CURRENT_PAGE = "SET_HIDDEN_JOBS_CURRENT_PAGE";
export const SET_HIDDEN_JOBS_DETAILS = "SET_HIDDEN_JOBS_DETAILS";
export const SET_HIDDEN_JOBS_TOTAL_PAGES = "SET_HIDDEN_JOBS_TOTAL_PAGES";
-export const SET_IS_DELETING_PROFILE = "SET_IS_DELETING_PROFILE";
export const SET_IS_EDITING_PROFILE = "SET_IS_EDITING_PROFILE";
export const SET_IS_LOGGED_IN = "SET_IS_LOGGED_IN";
export const SET_IS_RESETTING_PASSWORD = "SET_IS_RESETTING_PASSWORD";
diff --git a/src/client/redux/actions/user.ts b/src/client/redux/actions/user.ts
index 8eac9bc..14e27e6 100644
--- a/src/client/redux/actions/user.ts
+++ b/src/client/redux/actions/user.ts
@@ -5,7 +5,6 @@ import {
SET_HIDDEN_JOBS_CURRENT_PAGE,
SET_HIDDEN_JOBS_DETAILS,
SET_HIDDEN_JOBS_TOTAL_PAGES,
- SET_IS_DELETING_PROFILE,
SET_IS_EDITING_PROFILE,
SET_IS_LOGGED_IN,
SET_IS_RESETTING_PASSWORD,
@@ -58,13 +57,6 @@ export const setHiddenJobsTotalPages = (
payload: { hiddenJobsTotalPages },
});
-export const setIsDeletingProfile = (
- isDeletingProfile: boolean
-): UserAction => ({
- type: SET_IS_DELETING_PROFILE,
- payload: { isDeletingProfile },
-});
-
export const setIsEditingProfile = (isEditingProfile: boolean): UserAction => ({
type: SET_IS_EDITING_PROFILE,
payload: { isEditingProfile },
diff --git a/src/client/redux/reducers/user.ts b/src/client/redux/reducers/user.ts
index b714dc3..825e9d4 100644
--- a/src/client/redux/reducers/user.ts
+++ b/src/client/redux/reducers/user.ts
@@ -5,7 +5,6 @@ import {
SET_HIDDEN_JOBS_CURRENT_PAGE,
SET_HIDDEN_JOBS_DETAILS,
SET_HIDDEN_JOBS_TOTAL_PAGES,
- SET_IS_DELETING_PROFILE,
SET_IS_EDITING_PROFILE,
SET_IS_LOGGED_IN,
SET_IS_RESETTING_PASSWORD,
@@ -31,7 +30,6 @@ export const initialState: UserState = {
hiddenJobsCurrentPage: 1,
hiddenJobsDetails: [],
hiddenJobsTotalPages: 1,
- isDeletingProfile: false,
isEditingProfile: false,
isLoggedIn: false,
isResettingPassword: false,
@@ -64,7 +62,6 @@ const reducer = (state = initialState, action: UserAction): UserState => {
case SET_HIDDEN_JOBS_CURRENT_PAGE:
case SET_HIDDEN_JOBS_DETAILS:
case SET_HIDDEN_JOBS_TOTAL_PAGES:
- case SET_IS_DELETING_PROFILE:
case SET_IS_EDITING_PROFILE:
case SET_IS_LOGGED_IN:
case SET_IS_RESETTING_PASSWORD:
diff --git a/src/client/redux/thunks.ts b/src/client/redux/thunks.ts
index da179f2..0bfe92a 100644
--- a/src/client/redux/thunks.ts
+++ b/src/client/redux/thunks.ts
@@ -15,11 +15,8 @@ import {
import {
setConfirmPassword,
setEmail,
- setIsDeletingProfile,
setIsEditingProfile,
setIsLoggedIn,
- setIsViewingHiddenJobs,
- setIsViewingSavedJobs,
setIsResettingPassword,
setName,
setPassword,
@@ -350,27 +347,6 @@ export const resetPassword = (
}
};
-// TODO - Remove
-export const cancelResetPassword = (): AppThunk => (dispatch) => {
- dispatch(setResetConfirmNewPassword(""));
- dispatch(setResetCurrentPassword(""));
- dispatch(setResetNewPassword(""));
- dispatch(displayNotification("", "default"));
- dispatch(setIsResettingPassword(false));
-};
-
-// TODO - Remove
-export const clickEditProfile = (): AppThunk => (dispatch) => {
- dispatch(displayNotification("", "default"));
- dispatch(setIsEditingProfile(true));
-};
-
-// TODO - Remove
-export const cancelEditProfile = (): AppThunk => (dispatch) => {
- dispatch(displayNotification("", "default"));
- dispatch(setIsEditingProfile(false));
-};
-
export const editProfile = (email: string, name: string): AppThunk => async (
dispatch
) => {
@@ -408,21 +384,6 @@ export const editProfile = (email: string, name: string): AppThunk => async (
}
};
-export const cancelDeleteProfile = (): AppThunk => (dispatch) => {
- dispatch(displayNotification("", "default"));
- dispatch(setIsDeletingProfile(false));
-};
-
-export const clickDeleteProfile = (): AppThunk => (dispatch) => {
- dispatch(
- displayNotification(
- "Are you sure you would like to delete your profile? This can not be reversed.",
- "warning"
- )
- );
- dispatch(setIsDeletingProfile(true));
-};
-
export const deleteProfile = (): AppThunk => async (dispatch) => {
dispatch(setIsLoading(true));
dispatch(displayNotification("", "default"));
@@ -445,7 +406,6 @@ export const deleteProfile = (): AppThunk => async (dispatch) => {
dispatch(setName(""));
dispatch(setSavedJobs([]));
dispatch(setHiddenJobs([]));
- dispatch(setIsDeletingProfile(false));
dispatch(setIsLoggedIn(false));
dispatch(setIsLoading(false));
dispatch(setIsModalOpen(false));
diff --git a/src/client/types.ts b/src/client/types.ts
index 2c00493..3baee3c 100644
--- a/src/client/types.ts
+++ b/src/client/types.ts
@@ -286,7 +286,6 @@ export interface UserState {
hiddenJobsCurrentPage: number;
hiddenJobsDetails: Job[];
hiddenJobsTotalPages: number;
- isDeletingProfile: boolean;
isEditingProfile: boolean;
isLoggedIn: false;
isResettingPassword: boolean;
From 3e531261ecee875b67a8f744c91abedb8b4e8f06 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Wed, 12 Aug 2020 08:22:30 -0700
Subject: [PATCH 32/43] =?UTF-8?q?=F0=9F=8E=A8=20Redesign=20Profile=20Displ?=
=?UTF-8?q?ay=20#47=20-=20Remove=20unused=20parts=20of=20UserState?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/redux/actionTypes.ts | 3 ---
src/client/redux/actions/user.ts | 24 ------------------------
src/client/redux/reducers/user.ts | 9 ---------
src/client/redux/thunks.ts | 2 --
src/client/types.ts | 3 ---
5 files changed, 41 deletions(-)
diff --git a/src/client/redux/actionTypes.ts b/src/client/redux/actionTypes.ts
index 531ed2b..e8be0c7 100644
--- a/src/client/redux/actionTypes.ts
+++ b/src/client/redux/actionTypes.ts
@@ -25,9 +25,6 @@ export const SET_HIDDEN_JOBS_DETAILS = "SET_HIDDEN_JOBS_DETAILS";
export const SET_HIDDEN_JOBS_TOTAL_PAGES = "SET_HIDDEN_JOBS_TOTAL_PAGES";
export const SET_IS_EDITING_PROFILE = "SET_IS_EDITING_PROFILE";
export const SET_IS_LOGGED_IN = "SET_IS_LOGGED_IN";
-export const SET_IS_RESETTING_PASSWORD = "SET_IS_RESETTING_PASSWORD";
-export const SET_IS_VIEWING_HIDDEN_JOBS = "SET_IS_VIEWING_HIDDEN_JOBS";
-export const SET_IS_VIEWING_SAVED_JOBS = "SET_IS_VIEWING_SAVED_JOBS";
export const SET_NAME = "SET_NAME";
export const SET_PASSWORD = "SET_PASSWORD";
export const SET_RESET_CONFIRM_NEW_PASSWORD = "SET_RESET_CONFIRM_NEW_PASSWORD";
diff --git a/src/client/redux/actions/user.ts b/src/client/redux/actions/user.ts
index 14e27e6..8fea8a1 100644
--- a/src/client/redux/actions/user.ts
+++ b/src/client/redux/actions/user.ts
@@ -7,9 +7,6 @@ import {
SET_HIDDEN_JOBS_TOTAL_PAGES,
SET_IS_EDITING_PROFILE,
SET_IS_LOGGED_IN,
- SET_IS_RESETTING_PASSWORD,
- SET_IS_VIEWING_HIDDEN_JOBS,
- SET_IS_VIEWING_SAVED_JOBS,
SET_NAME,
SET_PASSWORD,
SET_RESET_CONFIRM_NEW_PASSWORD,
@@ -67,27 +64,6 @@ export const setIsLoggedIn = (isLoggedIn: boolean): UserAction => ({
payload: { isLoggedIn },
});
-export const setIsResettingPassword = (
- isResettingPassword: boolean
-): UserAction => ({
- type: SET_IS_RESETTING_PASSWORD,
- payload: { isResettingPassword },
-});
-
-export const setIsViewingHiddenJobs = (
- isViewingHiddenJobs: boolean
-): UserAction => ({
- type: SET_IS_VIEWING_HIDDEN_JOBS,
- payload: { isViewingHiddenJobs },
-});
-
-export const setIsViewingSavedJobs = (
- isViewingSavedJobs: boolean
-): UserAction => ({
- type: SET_IS_VIEWING_SAVED_JOBS,
- payload: { isViewingSavedJobs },
-});
-
export const setName = (name: string): UserAction => ({
type: SET_NAME,
payload: { name },
diff --git a/src/client/redux/reducers/user.ts b/src/client/redux/reducers/user.ts
index 825e9d4..8a66e19 100644
--- a/src/client/redux/reducers/user.ts
+++ b/src/client/redux/reducers/user.ts
@@ -7,9 +7,6 @@ import {
SET_HIDDEN_JOBS_TOTAL_PAGES,
SET_IS_EDITING_PROFILE,
SET_IS_LOGGED_IN,
- SET_IS_RESETTING_PASSWORD,
- SET_IS_VIEWING_HIDDEN_JOBS,
- SET_IS_VIEWING_SAVED_JOBS,
SET_NAME,
SET_PASSWORD,
SET_RESET_CONFIRM_NEW_PASSWORD,
@@ -32,9 +29,6 @@ export const initialState: UserState = {
hiddenJobsTotalPages: 1,
isEditingProfile: false,
isLoggedIn: false,
- isResettingPassword: false,
- isViewingHiddenJobs: false,
- isViewingSavedJobs: false,
name: "",
password: "",
resetConfirmNewPassword: "",
@@ -64,9 +58,6 @@ const reducer = (state = initialState, action: UserAction): UserState => {
case SET_HIDDEN_JOBS_TOTAL_PAGES:
case SET_IS_EDITING_PROFILE:
case SET_IS_LOGGED_IN:
- case SET_IS_RESETTING_PASSWORD:
- case SET_IS_VIEWING_HIDDEN_JOBS:
- case SET_IS_VIEWING_SAVED_JOBS:
case SET_NAME:
case SET_PASSWORD:
case SET_RESET_CONFIRM_NEW_PASSWORD:
diff --git a/src/client/redux/thunks.ts b/src/client/redux/thunks.ts
index 0bfe92a..1186e64 100644
--- a/src/client/redux/thunks.ts
+++ b/src/client/redux/thunks.ts
@@ -17,7 +17,6 @@ import {
setEmail,
setIsEditingProfile,
setIsLoggedIn,
- setIsResettingPassword,
setName,
setPassword,
setResetConfirmNewPassword,
@@ -335,7 +334,6 @@ export const resetPassword = (
dispatch(setResetConfirmNewPassword(""));
dispatch(setResetCurrentPassword(""));
dispatch(setResetNewPassword(""));
- dispatch(setIsResettingPassword(false));
dispatch(setIsModalOpen(false));
dispatch(setModalContent(""));
dispatch(setModalTitle(""));
diff --git a/src/client/types.ts b/src/client/types.ts
index 3baee3c..081d2bb 100644
--- a/src/client/types.ts
+++ b/src/client/types.ts
@@ -288,9 +288,6 @@ export interface UserState {
hiddenJobsTotalPages: number;
isEditingProfile: boolean;
isLoggedIn: false;
- isResettingPassword: boolean;
- isViewingHiddenJobs: boolean;
- isViewingSavedJobs: boolean;
name: string;
password: string;
resetConfirmNewPassword: string;
From 510a66ffa89efc62d2e2577519e65e6fb4c0a2e0 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Wed, 12 Aug 2020 08:29:23 -0700
Subject: [PATCH 33/43] =?UTF-8?q?=F0=9F=93=83=20ModalState=20#69=20-=20Abs?=
=?UTF-8?q?tract=20into=20'ModalState'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/components/Modal/Modal.tsx | 6 ++--
.../Profile/ProfileAccountDetails.tsx | 4 +--
src/client/redux/actionTypes.ts | 8 +++--
src/client/redux/actions/application.ts | 18 ----------
src/client/redux/actions/modal.ts | 22 ++++++++++++
src/client/redux/reducers/modal.ts | 34 +++++++++++++++++++
src/client/redux/thunks.ts | 6 ++--
src/client/types.ts | 16 +++++++--
8 files changed, 83 insertions(+), 31 deletions(-)
create mode 100644 src/client/redux/actions/modal.ts
create mode 100644 src/client/redux/reducers/modal.ts
diff --git a/src/client/components/Modal/Modal.tsx b/src/client/components/Modal/Modal.tsx
index 1eaa640..45da26e 100644
--- a/src/client/components/Modal/Modal.tsx
+++ b/src/client/components/Modal/Modal.tsx
@@ -45,9 +45,9 @@ const Modal: React.SFC = (props: ModalProps) => {
};
const mapStateToProps = (state: RootState) => ({
- isModalOpen: state.application.isModalOpen,
- modalContent: state.application.modalContent,
- modalTitle: state.application.modalTitle,
+ isModalOpen: state.modal.isModalOpen,
+ modalContent: state.modal.modalContent,
+ modalTitle: state.modal.modalTitle,
});
const mapDispatchToProps = (dispatch) => ({
diff --git a/src/client/components/Profile/ProfileAccountDetails.tsx b/src/client/components/Profile/ProfileAccountDetails.tsx
index 8827833..9d46207 100644
--- a/src/client/components/Profile/ProfileAccountDetails.tsx
+++ b/src/client/components/Profile/ProfileAccountDetails.tsx
@@ -11,10 +11,10 @@ import {
} from "./Profile-styled";
import {
+ setIsModalOpen,
setModalContent,
setModalTitle,
- setIsModalOpen,
-} from "../../redux/actions/application";
+} from "../../redux/actions/modal";
import { setIsEditingProfile } from "../../redux/actions/user";
import { editProfile } from "../../redux/thunks";
diff --git a/src/client/redux/actionTypes.ts b/src/client/redux/actionTypes.ts
index e8be0c7..e9f824c 100644
--- a/src/client/redux/actionTypes.ts
+++ b/src/client/redux/actionTypes.ts
@@ -5,15 +5,17 @@ export const SET_CURRENT_PAGE = "SET_CURRENT_PAGE";
export const SET_ERROR = "SET_ERROR";
export const SET_FULL_TIME = "SET_FULL_TIME";
export const SET_IS_LOADING = "SET_IS_LOADING";
-export const SET_IS_MODAL_OPEN = "SET_IS_MODAL_OPEN";
export const SET_JOB_DETAILS = "SET_JOB_DETAILS";
export const SET_JOBS = "SET_JOBS";
export const SET_LOCATION_SEARCH = "SET_LOCATION_SEARCH";
-export const SET_MODAL_CONTENT = "SET_MODAL_CONTENT";
-export const SET_MODAL_TITLE = "SET_MODAL_TITLE";
export const SET_SEARCH_VALUE = "SET_SEARCH_VALUE";
export const SET_TOTAL_PAGES = "SET_TOTAL_PAGES";
+// * Modal
+export const SET_IS_MODAL_OPEN = "SET_IS_MODAL_OPEN";
+export const SET_MODAL_CONTENT = "SET_MODAL_CONTENT";
+export const SET_MODAL_TITLE = "SET_MODAL_TITLE";
+
// * User
export const SET_CONFIRM_PASSWORD = "SET_CONFIRM_PASSWORD";
export const SET_EDIT_EMAIL = "SET_EDIT_EMAIL";
diff --git a/src/client/redux/actions/application.ts b/src/client/redux/actions/application.ts
index 54eb47f..adff082 100644
--- a/src/client/redux/actions/application.ts
+++ b/src/client/redux/actions/application.ts
@@ -5,12 +5,9 @@ import {
SET_ERROR,
SET_FULL_TIME,
SET_IS_LOADING,
- SET_IS_MODAL_OPEN,
SET_JOB_DETAILS,
SET_JOBS,
SET_LOCATION_SEARCH,
- SET_MODAL_CONTENT,
- SET_MODAL_TITLE,
SET_SEARCH_VALUE,
SET_TOTAL_PAGES,
} from "../actionTypes";
@@ -53,11 +50,6 @@ export const setIsLoading = (isLoading: boolean): ApplicationAction => ({
payload: { isLoading },
});
-export const setIsModalOpen = (isModalOpen: boolean): ApplicationAction => ({
- type: SET_IS_MODAL_OPEN,
- payload: { isModalOpen },
-});
-
export const setJobDetails = (jobDetails: Job): ApplicationAction => ({
type: SET_JOB_DETAILS,
payload: { jobDetails },
@@ -75,16 +67,6 @@ export const setLocationSearch = (
payload: { locationSearch },
});
-export const setModalContent = (modalContent: string): ApplicationAction => ({
- type: SET_MODAL_CONTENT,
- payload: { modalContent },
-});
-
-export const setModalTitle = (modalTitle: string): ApplicationAction => ({
- type: SET_MODAL_TITLE,
- payload: { modalTitle },
-});
-
export const setSearchValue = (searchValue: string): ApplicationAction => ({
type: SET_SEARCH_VALUE,
payload: { searchValue },
diff --git a/src/client/redux/actions/modal.ts b/src/client/redux/actions/modal.ts
new file mode 100644
index 0000000..02733f9
--- /dev/null
+++ b/src/client/redux/actions/modal.ts
@@ -0,0 +1,22 @@
+import {
+ SET_IS_MODAL_OPEN,
+ SET_MODAL_CONTENT,
+ SET_MODAL_TITLE,
+} from "../actionTypes";
+
+import { ModalAction } from "../../types";
+
+export const setIsModalOpen = (isModalOpen: boolean): ModalAction => ({
+ type: SET_IS_MODAL_OPEN,
+ payload: { isModalOpen },
+});
+
+export const setModalContent = (modalContent: string): ModalAction => ({
+ type: SET_MODAL_CONTENT,
+ payload: { modalContent },
+});
+
+export const setModalTitle = (modalTitle: string): ModalAction => ({
+ type: SET_MODAL_TITLE,
+ payload: { modalTitle },
+});
diff --git a/src/client/redux/reducers/modal.ts b/src/client/redux/reducers/modal.ts
new file mode 100644
index 0000000..964c72c
--- /dev/null
+++ b/src/client/redux/reducers/modal.ts
@@ -0,0 +1,34 @@
+import {
+ SET_IS_MODAL_OPEN,
+ SET_MODAL_CONTENT,
+ SET_MODAL_TITLE,
+} from "../actionTypes";
+
+import { ModalAction, ModalState } from "../../types";
+
+export const initialState: ModalState = {
+ isModalOpen: false,
+ modalContent: "",
+ modalTitle: "",
+};
+
+const reducer = (state = initialState, action: ModalAction): ModalState => {
+ let key: string;
+ let value;
+
+ if (action && action.payload) {
+ key = Object.keys(action.payload)[0];
+ value = action.payload[key];
+ }
+
+ switch (action.type) {
+ case SET_IS_MODAL_OPEN:
+ case SET_MODAL_CONTENT:
+ case SET_MODAL_TITLE:
+ return { ...state, [key]: value };
+ default:
+ return state;
+ }
+};
+
+export default reducer;
diff --git a/src/client/redux/thunks.ts b/src/client/redux/thunks.ts
index 1186e64..ecba18c 100644
--- a/src/client/redux/thunks.ts
+++ b/src/client/redux/thunks.ts
@@ -8,10 +8,12 @@ import {
setTotalPages,
setJobDetails,
setError,
+} from "./actions/application";
+import {
+ setIsModalOpen,
setModalContent,
setModalTitle,
- setIsModalOpen,
-} from "./actions/application";
+} from "./actions/modal";
import {
setConfirmPassword,
setEmail,
diff --git a/src/client/types.ts b/src/client/types.ts
index 081d2bb..e716ca7 100644
--- a/src/client/types.ts
+++ b/src/client/types.ts
@@ -48,12 +48,9 @@ export interface ApplicationState {
error: ApplicationError;
fullTime: boolean;
isLoading: boolean;
- isModalOpen: boolean;
jobDetails: Job;
jobs: Job[];
locationSearch: string;
- modalContent: string;
- modalTitle: string;
notificationMessage: string;
notificationType: NotificationType;
searchValue: string;
@@ -192,6 +189,18 @@ export interface LocationOption {
export type LoginResponse = ServerResponseError & ServerResponseUser;
+export interface ModalAction {
+ type: string;
+ // eslint-disable-next-line
+ payload: any;
+}
+
+export interface ModalState {
+ isModalOpen: boolean;
+ modalContent: string;
+ modalTitle: string;
+}
+
export type NotificationType =
| "error"
| "dark"
@@ -238,6 +247,7 @@ export type ResetPasswordResponse = ServerResponseError & ServerResponseUser;
export type RootState = {
application: ApplicationState;
+ modal: ModalState;
user: UserState;
};
From 6d617e10350e82a52aeb6a7b24efcb242a05f1c9 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Wed, 12 Aug 2020 08:35:55 -0700
Subject: [PATCH 34/43] =?UTF-8?q?=F0=9F=93=83=20ModalState=20#69=20-=20Fix?=
=?UTF-8?q?=20imports?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/modals/DeleteProfile/DeleteProfile.tsx | 7 ++-----
src/client/modals/ResetPassword/ResetPassword.tsx | 7 ++-----
src/client/modals/Settings/Settings.tsx | 7 ++-----
src/client/redux/reducers/application.ts | 3 ---
4 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/src/client/modals/DeleteProfile/DeleteProfile.tsx b/src/client/modals/DeleteProfile/DeleteProfile.tsx
index 346fa21..75625f6 100644
--- a/src/client/modals/DeleteProfile/DeleteProfile.tsx
+++ b/src/client/modals/DeleteProfile/DeleteProfile.tsx
@@ -3,11 +3,8 @@ import { connect } from "react-redux";
import Button from "../../components/Button";
-import {
- displayNotification,
- setModalContent,
- setModalTitle,
-} from "../../redux/actions/application";
+import { displayNotification } from "../../redux/actions/application";
+import { setModalContent, setModalTitle } from "../../redux/actions/modal";
import { deleteProfile } from "../../redux/thunks";
export interface DeleteProfileProps {
diff --git a/src/client/modals/ResetPassword/ResetPassword.tsx b/src/client/modals/ResetPassword/ResetPassword.tsx
index b794d24..96a3eab 100644
--- a/src/client/modals/ResetPassword/ResetPassword.tsx
+++ b/src/client/modals/ResetPassword/ResetPassword.tsx
@@ -4,11 +4,8 @@ import { connect } from "react-redux";
import Button from "../../components/Button";
import Input from "../../components/Input";
-import {
- displayNotification,
- setModalContent,
- setModalTitle,
-} from "../../redux/actions/application";
+import { displayNotification } from "../../redux/actions/application";
+import { setModalContent, setModalTitle } from "../../redux/actions/modal";
import { resetPassword } from "../../redux/thunks";
export interface ResetPasswordProps {
diff --git a/src/client/modals/Settings/Settings.tsx b/src/client/modals/Settings/Settings.tsx
index d18aa74..a342b5b 100644
--- a/src/client/modals/Settings/Settings.tsx
+++ b/src/client/modals/Settings/Settings.tsx
@@ -5,11 +5,8 @@ import Button from "../../components/Button";
import { Container, Row } from "./Settings-styled";
-import {
- displayNotification,
- setModalContent,
- setModalTitle,
-} from "../../redux/actions/application";
+import { displayNotification } from "../../redux/actions/application";
+import { setModalContent, setModalTitle } from "../../redux/actions/modal";
import { logOut, logOutAll } from "../../redux/thunks";
export interface SettingsProps {
diff --git a/src/client/redux/reducers/application.ts b/src/client/redux/reducers/application.ts
index fe966d7..2f6016c 100644
--- a/src/client/redux/reducers/application.ts
+++ b/src/client/redux/reducers/application.ts
@@ -25,12 +25,9 @@ export const initialState: ApplicationState = {
error: null,
fullTime: false,
isLoading: true,
- isModalOpen: false,
jobDetails: null,
jobs: [],
locationSearch: "",
- modalContent: "",
- modalTitle: "",
notificationMessage: "",
notificationType: "default",
searchValue: "",
From ddaa3b612d68f58d7b4ef2c46abd70039c80cdbb Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Wed, 12 Aug 2020 08:40:52 -0700
Subject: [PATCH 35/43] =?UTF-8?q?=F0=9F=93=83=20ModalState=20#69=20-=20Add?=
=?UTF-8?q?=20'ModalState'=20to=20'RootState'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/redux/reducers/index.ts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/client/redux/reducers/index.ts b/src/client/redux/reducers/index.ts
index d703133..1b13a16 100644
--- a/src/client/redux/reducers/index.ts
+++ b/src/client/redux/reducers/index.ts
@@ -1,9 +1,11 @@
import { combineReducers } from "redux";
import application from "./application";
+import modal from "./modal";
import user from "./user";
export default combineReducers({
application,
+ modal,
user,
});
From 6c51deba3c5704461f0a4e54db715c045f4b2a73 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Wed, 12 Aug 2020 08:55:44 -0700
Subject: [PATCH 36/43] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Rename=20'created=5F?=
=?UTF-8?q?at'=20#50=20-=20BE=20-=20Rename=20'created=5Fat'=20to=20'listin?=
=?UTF-8?q?gDate'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/server/models/Job.ts | 8 ++++----
src/server/types.ts | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/server/models/Job.ts b/src/server/models/Job.ts
index ad69ed4..14c131b 100644
--- a/src/server/models/Job.ts
+++ b/src/server/models/Job.ts
@@ -16,10 +16,6 @@ const jobSchema = new mongoose.Schema(
required: false,
type: String,
},
- created_at: {
- required: [true, "Field 'created_at' is required."],
- type: String,
- },
description: {
required: [true, "Field 'description' is required."],
type: String,
@@ -32,6 +28,10 @@ const jobSchema = new mongoose.Schema(
required: [true, "Field 'id' is required."],
type: String,
},
+ listingDate: {
+ required: [true, "Field 'listingDate' is required."],
+ type: String,
+ },
location: {
required: [true, "Field 'location' is required."],
type: String,
diff --git a/src/server/types.ts b/src/server/types.ts
index 7c3e27b..31a5cf8 100644
--- a/src/server/types.ts
+++ b/src/server/types.ts
@@ -43,10 +43,10 @@ export interface Job {
company: string;
company_logo: string;
company_url: string;
- created_at: string;
description: string;
how_to_apply: string;
id: string;
+ listingDate: string;
location: string;
title: string;
type: JobType;
@@ -58,10 +58,10 @@ export interface JobDocument extends Document {
company: string;
company_logo: string;
company_url: string;
- created_at: string;
description: string;
how_to_apply: string;
id: string;
+ listingDate: string;
location: string;
title: string;
type: JobType;
From ce41abb0ba319a3977a63cd08be0c69354430fd1 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Wed, 12 Aug 2020 08:56:20 -0700
Subject: [PATCH 37/43] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Rename=20'created=5F?=
=?UTF-8?q?at'=20#50=20-=20FE=20-=20Rename=20'created=5Fat'=20to=20'listin?=
=?UTF-8?q?gDate'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/components/JobCard/JobCard.tsx | 2 +-
src/client/pages/Details/Details.tsx | 2 +-
src/client/types.ts | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/client/components/JobCard/JobCard.tsx b/src/client/components/JobCard/JobCard.tsx
index 91b7131..a2409f9 100644
--- a/src/client/components/JobCard/JobCard.tsx
+++ b/src/client/components/JobCard/JobCard.tsx
@@ -142,7 +142,7 @@ const JobCard: React.SFC = (props: JobCardProps) => {
access_time
- {formatDistanceToNow(new Date(job.created_at), {
+ {formatDistanceToNow(new Date(job.listingDate), {
addSuffix: true,
})}
diff --git a/src/client/pages/Details/Details.tsx b/src/client/pages/Details/Details.tsx
index 9833cfa..39e6436 100644
--- a/src/client/pages/Details/Details.tsx
+++ b/src/client/pages/Details/Details.tsx
@@ -178,7 +178,7 @@ const Details: React.SFC = (props: DetailsProps) => {
access_time
- {formatDistanceToNow(new Date(jobDetails.created_at), {
+ {formatDistanceToNow(new Date(jobDetails.listingDate), {
addSuffix: true,
})}
diff --git a/src/client/types.ts b/src/client/types.ts
index e716ca7..577e5f6 100644
--- a/src/client/types.ts
+++ b/src/client/types.ts
@@ -169,10 +169,10 @@ export interface Job {
company: string;
company_logo: string;
company_url: string;
- created_at: string;
description: string;
how_to_apply: string;
id: string;
+ listingDate: string;
location: string;
title: string;
type: JobType;
From fb794ece943129abe2c7af8cd01a759762ee95fc Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Wed, 12 Aug 2020 08:57:08 -0700
Subject: [PATCH 38/43] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Rename=20'created=5F?=
=?UTF-8?q?at'=20#50=20-=20Update=20Test=20Fixtures?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
cypress/fixtures/chicagoSearch.json | 6 +-
cypress/fixtures/jobDetails.json | 2 +-
cypress/fixtures/jobs10.json | 20 +++---
cypress/fixtures/jobs15.json | 30 ++++-----
cypress/fixtures/jobs20.json | 40 +++++------
cypress/fixtures/jobs5.json | 10 +--
cypress/fixtures/jobs50.json | 100 ++++++++++++++--------------
cypress/fixtures/jobsSearch1.json | 14 ++--
cypress/fixtures/jobsSearch2.json | 8 +--
9 files changed, 115 insertions(+), 115 deletions(-)
diff --git a/cypress/fixtures/chicagoSearch.json b/cypress/fixtures/chicagoSearch.json
index c20e496..a4c3fe6 100644
--- a/cypress/fixtures/chicagoSearch.json
+++ b/cypress/fixtures/chicagoSearch.json
@@ -3,7 +3,7 @@
"id": "b15e4b6a-3498-47fc-b222-62638b802260",
"type": "Full Time",
"url": "https://jobs.github.com/positions/b15e4b6a-3498-47fc-b222-62638b802260",
- "created_at": "Tue Jul 07 20:57:46 UTC 2020",
+ "listingDate": "Tue Jul 07 20:57:46 UTC 2020",
"company": "Cool Chicago Company 1",
"company_url": "https://www.linkstechnology.com/",
"location": "Schaumburg, IL",
@@ -16,7 +16,7 @@
"id": "99a4987e-6b50-11e8-848b-794d9c4e4459",
"type": "Full Time",
"url": "https://jobs.github.com/positions/99a4987e-6b50-11e8-848b-794d9c4e4459",
- "created_at": "Wed Nov 07 20:22:57 UTC 2018",
+ "listingDate": "Wed Nov 07 20:22:57 UTC 2018",
"company": "Cool Chicago Company 2",
"company_url": "https://worldhqinc.com/",
"location": "Chicago",
@@ -29,7 +29,7 @@
"id": "c307e4ca-d6a6-11e8-8f6e-f00ef74f7cb0",
"type": "Full Time",
"url": "https://jobs.github.com/positions/c307e4ca-d6a6-11e8-8f6e-f00ef74f7cb0",
- "created_at": "Tue Oct 23 09:36:02 UTC 2018",
+ "listingDate": "Tue Oct 23 09:36:02 UTC 2018",
"company": "Cool Chicago Company 3",
"company_url": "https://www.squirro.com",
"location": "Zurich",
diff --git a/cypress/fixtures/jobDetails.json b/cypress/fixtures/jobDetails.json
index 8fc8440..45b7a7d 100644
--- a/cypress/fixtures/jobDetails.json
+++ b/cypress/fixtures/jobDetails.json
@@ -2,7 +2,7 @@
"id": "f1884b46-ecb4-473c-81f5-08d9bf2ab3bb",
"type": "Full Time",
"url": "https://jobs.github.com/positions/f1884b46-ecb4-473c-81f5-08d9bf2ab3bb",
- "created_at": "Thu Jul 16 12:03:19 UTC 2020",
+ "listingDate": "Thu Jul 16 12:03:19 UTC 2020",
"company": "Cool Company",
"company_url": "https://www.adswizz.com/",
"location": "Bucharest",
diff --git a/cypress/fixtures/jobs10.json b/cypress/fixtures/jobs10.json
index 2ac803e..c57313d 100644
--- a/cypress/fixtures/jobs10.json
+++ b/cypress/fixtures/jobs10.json
@@ -3,7 +3,7 @@
"id": "f1884b46-ecb4-473c-81f5-08d9bf2ab3bb",
"type": "Full Time",
"url": "https://jobs.github.com/positions/f1884b46-ecb4-473c-81f5-08d9bf2ab3bb",
- "created_at": "Thu Jul 16 12:03:19 UTC 2020",
+ "listingDate": "Thu Jul 16 12:03:19 UTC 2020",
"company": "Cool Company",
"company_url": "https://www.adswizz.com/",
"location": "Bucharest",
@@ -16,7 +16,7 @@
"id": "72de09f2-5bc6-489f-be90-3d38e505e20a",
"type": "Full Time",
"url": "https://jobs.github.com/positions/72de09f2-5bc6-489f-be90-3d38e505e20a",
- "created_at": "Thu Jul 16 12:01:05 UTC 2020",
+ "listingDate": "Thu Jul 16 12:01:05 UTC 2020",
"company": "Cool Company",
"company_url": "https://www.adswizz.com/",
"location": "Bucharest",
@@ -29,7 +29,7 @@
"id": "cc20d9f2-0102-4785-8253-66093d3ca5c0",
"type": "Full Time",
"url": "https://jobs.github.com/positions/cc20d9f2-0102-4785-8253-66093d3ca5c0",
- "created_at": "Thu Jul 16 02:02:01 UTC 2020",
+ "listingDate": "Thu Jul 16 02:02:01 UTC 2020",
"company": "Koffie Labs",
"company_url": "https://www.getkoffie.com/",
"location": "NYC/Remote",
@@ -42,7 +42,7 @@
"id": "65ed6c1f-e74e-47ed-a85f-126ef1071a47",
"type": "Full Time",
"url": "https://jobs.github.com/positions/65ed6c1f-e74e-47ed-a85f-126ef1071a47",
- "created_at": "Wed Jul 15 14:35:57 UTC 2020",
+ "listingDate": "Wed Jul 15 14:35:57 UTC 2020",
"company": "Avans Hogeschool",
"company_url": "http://www.avans.nl",
"location": "Breda",
@@ -55,7 +55,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Full Time",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "OrbitalAds",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -68,7 +68,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -81,7 +81,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -94,7 +94,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -107,7 +107,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -120,7 +120,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
diff --git a/cypress/fixtures/jobs15.json b/cypress/fixtures/jobs15.json
index 4288929..6c5bd6b 100644
--- a/cypress/fixtures/jobs15.json
+++ b/cypress/fixtures/jobs15.json
@@ -3,7 +3,7 @@
"id": "f1884b46-ecb4-473c-81f5-08d9bf2ab3bb",
"type": "Full Time",
"url": "https://jobs.github.com/positions/f1884b46-ecb4-473c-81f5-08d9bf2ab3bb",
- "created_at": "Thu Jul 16 12:03:19 UTC 2020",
+ "listingDate": "Thu Jul 16 12:03:19 UTC 2020",
"company": "Cool Company",
"company_url": "https://www.adswizz.com/",
"location": "Bucharest",
@@ -16,7 +16,7 @@
"id": "72de09f2-5bc6-489f-be90-3d38e505e20a",
"type": "Full Time",
"url": "https://jobs.github.com/positions/72de09f2-5bc6-489f-be90-3d38e505e20a",
- "created_at": "Thu Jul 16 12:01:05 UTC 2020",
+ "listingDate": "Thu Jul 16 12:01:05 UTC 2020",
"company": "Cool Company",
"company_url": "https://www.adswizz.com/",
"location": "Bucharest",
@@ -29,7 +29,7 @@
"id": "cc20d9f2-0102-4785-8253-66093d3ca5c0",
"type": "Full Time",
"url": "https://jobs.github.com/positions/cc20d9f2-0102-4785-8253-66093d3ca5c0",
- "created_at": "Thu Jul 16 02:02:01 UTC 2020",
+ "listingDate": "Thu Jul 16 02:02:01 UTC 2020",
"company": "Koffie Labs",
"company_url": "https://www.getkoffie.com/",
"location": "NYC/Remote",
@@ -42,7 +42,7 @@
"id": "65ed6c1f-e74e-47ed-a85f-126ef1071a47",
"type": "Full Time",
"url": "https://jobs.github.com/positions/65ed6c1f-e74e-47ed-a85f-126ef1071a47",
- "created_at": "Wed Jul 15 14:35:57 UTC 2020",
+ "listingDate": "Wed Jul 15 14:35:57 UTC 2020",
"company": "Avans Hogeschool",
"company_url": "http://www.avans.nl",
"location": "Breda",
@@ -55,7 +55,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Full Time",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "OrbitalAds",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -68,7 +68,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -81,7 +81,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -94,7 +94,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -107,7 +107,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -120,7 +120,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -133,7 +133,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -146,7 +146,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -159,7 +159,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -172,7 +172,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -185,7 +185,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
diff --git a/cypress/fixtures/jobs20.json b/cypress/fixtures/jobs20.json
index 99576d7..9ff7ae3 100644
--- a/cypress/fixtures/jobs20.json
+++ b/cypress/fixtures/jobs20.json
@@ -3,7 +3,7 @@
"id": "f1884b46-ecb4-473c-81f5-08d9bf2ab3bb",
"type": "Full Time",
"url": "https://jobs.github.com/positions/f1884b46-ecb4-473c-81f5-08d9bf2ab3bb",
- "created_at": "Thu Jul 16 12:03:19 UTC 2020",
+ "listingDate": "Thu Jul 16 12:03:19 UTC 2020",
"company": "Cool Company",
"company_url": "https://www.adswizz.com/",
"location": "Bucharest",
@@ -16,7 +16,7 @@
"id": "72de09f2-5bc6-489f-be90-3d38e505e20a",
"type": "Full Time",
"url": "https://jobs.github.com/positions/72de09f2-5bc6-489f-be90-3d38e505e20a",
- "created_at": "Thu Jul 16 12:01:05 UTC 2020",
+ "listingDate": "Thu Jul 16 12:01:05 UTC 2020",
"company": "Cool Company",
"company_url": "https://www.adswizz.com/",
"location": "Bucharest",
@@ -29,7 +29,7 @@
"id": "cc20d9f2-0102-4785-8253-66093d3ca5c0",
"type": "Full Time",
"url": "https://jobs.github.com/positions/cc20d9f2-0102-4785-8253-66093d3ca5c0",
- "created_at": "Thu Jul 16 02:02:01 UTC 2020",
+ "listingDate": "Thu Jul 16 02:02:01 UTC 2020",
"company": "Koffie Labs",
"company_url": "https://www.getkoffie.com/",
"location": "NYC/Remote",
@@ -42,7 +42,7 @@
"id": "65ed6c1f-e74e-47ed-a85f-126ef1071a47",
"type": "Full Time",
"url": "https://jobs.github.com/positions/65ed6c1f-e74e-47ed-a85f-126ef1071a47",
- "created_at": "Wed Jul 15 14:35:57 UTC 2020",
+ "listingDate": "Wed Jul 15 14:35:57 UTC 2020",
"company": "Avans Hogeschool",
"company_url": "http://www.avans.nl",
"location": "Breda",
@@ -55,7 +55,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Full Time",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "OrbitalAds",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -68,7 +68,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -81,7 +81,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -94,7 +94,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -107,7 +107,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -120,7 +120,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -133,7 +133,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -146,7 +146,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -159,7 +159,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -172,7 +172,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -185,7 +185,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -198,7 +198,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -211,7 +211,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -224,7 +224,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -237,7 +237,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
@@ -250,7 +250,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Contract",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "Super Company",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
diff --git a/cypress/fixtures/jobs5.json b/cypress/fixtures/jobs5.json
index 360ced4..0d00281 100644
--- a/cypress/fixtures/jobs5.json
+++ b/cypress/fixtures/jobs5.json
@@ -3,7 +3,7 @@
"id": "f1884b46-ecb4-473c-81f5-08d9bf2ab3bb",
"type": "Full Time",
"url": "https://jobs.github.com/positions/f1884b46-ecb4-473c-81f5-08d9bf2ab3bb",
- "created_at": "Thu Jul 16 12:03:19 UTC 2020",
+ "listingDate": "Thu Jul 16 12:03:19 UTC 2020",
"company": "Cool Company",
"company_url": "https://www.adswizz.com/",
"location": "Bucharest",
@@ -16,7 +16,7 @@
"id": "72de09f2-5bc6-489f-be90-3d38e505e20a",
"type": "Full Time",
"url": "https://jobs.github.com/positions/72de09f2-5bc6-489f-be90-3d38e505e20a",
- "created_at": "Thu Jul 16 12:01:05 UTC 2020",
+ "listingDate": "Thu Jul 16 12:01:05 UTC 2020",
"company": "Cool Company",
"company_url": "https://www.adswizz.com/",
"location": "Bucharest",
@@ -29,7 +29,7 @@
"id": "cc20d9f2-0102-4785-8253-66093d3ca5c0",
"type": "Full Time",
"url": "https://jobs.github.com/positions/cc20d9f2-0102-4785-8253-66093d3ca5c0",
- "created_at": "Thu Jul 16 02:02:01 UTC 2020",
+ "listingDate": "Thu Jul 16 02:02:01 UTC 2020",
"company": "Koffie Labs",
"company_url": "https://www.getkoffie.com/",
"location": "NYC/Remote",
@@ -42,7 +42,7 @@
"id": "65ed6c1f-e74e-47ed-a85f-126ef1071a47",
"type": "Full Time",
"url": "https://jobs.github.com/positions/65ed6c1f-e74e-47ed-a85f-126ef1071a47",
- "created_at": "Wed Jul 15 14:35:57 UTC 2020",
+ "listingDate": "Wed Jul 15 14:35:57 UTC 2020",
"company": "Avans Hogeschool",
"company_url": "http://www.avans.nl",
"location": "Breda",
@@ -55,7 +55,7 @@
"id": "285aa472-990f-418d-b376-e03c27f48d17",
"type": "Full Time",
"url": "https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at": "Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate": "Wed Jul 15 14:22:21 UTC 2020",
"company": "OrbitalAds",
"company_url": "https://orbitalads.com",
"location": "Madrid (Spain)",
diff --git a/cypress/fixtures/jobs50.json b/cypress/fixtures/jobs50.json
index 88b807d..e8b9e94 100644
--- a/cypress/fixtures/jobs50.json
+++ b/cypress/fixtures/jobs50.json
@@ -3,7 +3,7 @@
"id":"f1884b46-ecb4-473c-81f5-08d9bf2ab3bb",
"type":"Full Time",
"url":"https://jobs.github.com/positions/f1884b46-ecb4-473c-81f5-08d9bf2ab3bb",
- "created_at":"Thu Jul 16 12:03:19 UTC 2020",
+ "listingDate":"Thu Jul 16 12:03:19 UTC 2020",
"company":"Cool Company",
"company_url":"https://www.adswizz.com/",
"location":"Bucharest",
@@ -16,7 +16,7 @@
"id":"72de09f2-5bc6-489f-be90-3d38e505e20a",
"type":"Full Time",
"url":"https://jobs.github.com/positions/72de09f2-5bc6-489f-be90-3d38e505e20a",
- "created_at":"Thu Jul 16 12:01:05 UTC 2020",
+ "listingDate":"Thu Jul 16 12:01:05 UTC 2020",
"company":"Cool Company",
"company_url":"https://www.adswizz.com/",
"location":"Bucharest",
@@ -29,7 +29,7 @@
"id":"cc20d9f2-0102-4785-8253-66093d3ca5c0",
"type":"Full Time",
"url":"https://jobs.github.com/positions/cc20d9f2-0102-4785-8253-66093d3ca5c0",
- "created_at":"Thu Jul 16 02:02:01 UTC 2020",
+ "listingDate":"Thu Jul 16 02:02:01 UTC 2020",
"company":"Koffie Labs",
"company_url":"https://www.getkoffie.com/",
"location":"NYC/Remote",
@@ -42,7 +42,7 @@
"id":"65ed6c1f-e74e-47ed-a85f-126ef1071a47",
"type":"Full Time",
"url":"https://jobs.github.com/positions/65ed6c1f-e74e-47ed-a85f-126ef1071a47",
- "created_at":"Wed Jul 15 14:35:57 UTC 2020",
+ "listingDate":"Wed Jul 15 14:35:57 UTC 2020",
"company":"Avans Hogeschool",
"company_url":"http://www.avans.nl",
"location":"Breda",
@@ -55,7 +55,7 @@
"id":"285aa472-990f-418d-b376-e03c27f48d17",
"type":"Full Time",
"url":"https://jobs.github.com/positions/285aa472-990f-418d-b376-e03c27f48d17",
- "created_at":"Wed Jul 15 14:22:21 UTC 2020",
+ "listingDate":"Wed Jul 15 14:22:21 UTC 2020",
"company":"OrbitalAds",
"company_url":"https://orbitalads.com",
"location":"Madrid (Spain)",
@@ -68,7 +68,7 @@
"id":"11cbce13-e6cd-4c79-b904-d292b569b22f",
"type":"Full Time",
"url":"https://jobs.github.com/positions/11cbce13-e6cd-4c79-b904-d292b569b22f",
- "created_at":"Wed Jul 15 12:17:30 UTC 2020",
+ "listingDate":"Wed Jul 15 12:17:30 UTC 2020",
"company":"OpenPlay",
"company_url":"http:",
"location":"Santa Monica",
@@ -81,7 +81,7 @@
"id":"c41512e4-5cf6-46db-b1a0-898c069b3cec",
"type":"Full Time",
"url":"https://jobs.github.com/positions/c41512e4-5cf6-46db-b1a0-898c069b3cec",
- "created_at":"Wed Jul 15 10:10:04 UTC 2020",
+ "listingDate":"Wed Jul 15 10:10:04 UTC 2020",
"company":"Future Plc",
"company_url":"http:",
"location":"Brno",
@@ -94,7 +94,7 @@
"id":"ef8233e5-4064-4c2b-b8a4-7e0259c1e521",
"type":"Full Time",
"url":"https://jobs.github.com/positions/ef8233e5-4064-4c2b-b8a4-7e0259c1e521",
- "created_at":"Tue Jul 14 15:54:37 UTC 2020",
+ "listingDate":"Tue Jul 14 15:54:37 UTC 2020",
"company":"Kelsus Inc",
"company_url":null,
"location":"Argentina",
@@ -107,7 +107,7 @@
"id":"478f76cf-7608-48a3-a07d-5f2281763349",
"type":"Full Time",
"url":"https://jobs.github.com/positions/478f76cf-7608-48a3-a07d-5f2281763349",
- "created_at":"Tue Jul 14 12:01:35 UTC 2020",
+ "listingDate":"Tue Jul 14 12:01:35 UTC 2020",
"company":"Microsoft Israel R\u0026D Center",
"company_url":"http://www.microsoft.com",
"location":"Tel-Aviv-Yafo",
@@ -120,7 +120,7 @@
"id":"377a1ad3-eea3-42bd-846a-7beff0069797",
"type":"Full Time",
"url":"https://jobs.github.com/positions/377a1ad3-eea3-42bd-846a-7beff0069797",
- "created_at":"Tue Jul 14 09:45:02 UTC 2020",
+ "listingDate":"Tue Jul 14 09:45:02 UTC 2020",
"company":"api.video",
"company_url":"https://jobs.api.video",
"location":"Bordeaux",
@@ -133,7 +133,7 @@
"id":"5903afaa-3fcd-440e-a6ee-fed215987718",
"type":"Full Time",
"url":"https://jobs.github.com/positions/5903afaa-3fcd-440e-a6ee-fed215987718",
- "created_at":"Mon Jul 13 16:13:44 UTC 2020",
+ "listingDate":"Mon Jul 13 16:13:44 UTC 2020",
"company":"Valimail",
"company_url":"http://www.Valimail.com",
"location":"Remote ",
@@ -146,7 +146,7 @@
"id":"a34e33ec-d7b3-4b7f-a3c2-1bf6d91b576a",
"type":"Full Time",
"url":"https://jobs.github.com/positions/a34e33ec-d7b3-4b7f-a3c2-1bf6d91b576a",
- "created_at":"Mon Jul 13 11:08:40 UTC 2020",
+ "listingDate":"Mon Jul 13 11:08:40 UTC 2020",
"company":"neubau kompass AG",
"company_url":"https://www.neubaukompass.de/",
"location":"München",
@@ -159,7 +159,7 @@
"id":"3c98aa7e-baf1-4e24-9b4a-4f34f0e06755",
"type":"Full Time",
"url":"https://jobs.github.com/positions/3c98aa7e-baf1-4e24-9b4a-4f34f0e06755",
- "created_at":"Mon Jul 13 08:24:58 UTC 2020",
+ "listingDate":"Mon Jul 13 08:24:58 UTC 2020",
"company":"Instrument Systems Optische Messtechnik GmbH",
"company_url":"https://www.instrumentsystems.com/en/",
"location":"München",
@@ -172,7 +172,7 @@
"id":"7f482982-dec2-47df-bfe2-0cca7fb64464",
"type":"Full Time",
"url":"https://jobs.github.com/positions/7f482982-dec2-47df-bfe2-0cca7fb64464",
- "created_at":"Mon Jul 13 08:21:13 UTC 2020",
+ "listingDate":"Mon Jul 13 08:21:13 UTC 2020",
"company":"VoltStorage GmbH",
"company_url":"https://voltstorage.com/",
"location":"München",
@@ -185,7 +185,7 @@
"id":"ca0b5423-240b-4979-9cab-b863e9a04f4a",
"type":"Full Time",
"url":"https://jobs.github.com/positions/ca0b5423-240b-4979-9cab-b863e9a04f4a",
- "created_at":"Fri Jul 10 09:05:14 UTC 2020",
+ "listingDate":"Fri Jul 10 09:05:14 UTC 2020",
"company":"Echobot Media Technologies GmbH",
"company_url":"https://www.echobot.de/",
"location":"Karlsruhe (Germany)",
@@ -198,7 +198,7 @@
"id":"11b78361-0c51-42af-8e99-7eddf5f0a289",
"type":"Full Time",
"url":"https://jobs.github.com/positions/11b78361-0c51-42af-8e99-7eddf5f0a289",
- "created_at":"Thu Jul 09 15:59:45 UTC 2020",
+ "listingDate":"Thu Jul 09 15:59:45 UTC 2020",
"company":"ILA Capital",
"company_url":"http://ilacapital.com",
"location":"Remote",
@@ -211,7 +211,7 @@
"id":"a728b871-ae77-4768-89b8-c271652062ad",
"type":"Full Time",
"url":"https://jobs.github.com/positions/a728b871-ae77-4768-89b8-c271652062ad",
- "created_at":"Thu Jul 09 08:43:12 UTC 2020",
+ "listingDate":"Thu Jul 09 08:43:12 UTC 2020",
"company":"Unc Inc",
"company_url":"https://www.uncinc.nl",
"location":"Amsterdam",
@@ -224,7 +224,7 @@
"id":"4f42bd23-86c7-40a5-890e-6630567979fd",
"type":"Full Time",
"url":"https://jobs.github.com/positions/4f42bd23-86c7-40a5-890e-6630567979fd",
- "created_at":"Wed Jul 08 20:12:44 UTC 2020",
+ "listingDate":"Wed Jul 08 20:12:44 UTC 2020",
"company":"Rebilly",
"company_url":"https://www.rebilly.com/",
"location":"Remote",
@@ -237,7 +237,7 @@
"id":"f236c93a-1bab-41a3-aef7-6845f2185acd",
"type":"Full Time",
"url":"https://jobs.github.com/positions/f236c93a-1bab-41a3-aef7-6845f2185acd",
- "created_at":"Wed Jul 08 11:36:33 UTC 2020",
+ "listingDate":"Wed Jul 08 11:36:33 UTC 2020",
"company":"Miele X",
"company_url":"https://www.miele-x.com/jobs/head-of-channel-management-amazon/",
"location":"Amsterdam",
@@ -250,7 +250,7 @@
"id":"86c679b3-f4e8-468a-9104-a62a130d1ce4",
"type":"Full Time",
"url":"https://jobs.github.com/positions/86c679b3-f4e8-468a-9104-a62a130d1ce4",
- "created_at":"Wed Jul 08 10:31:08 UTC 2020",
+ "listingDate":"Wed Jul 08 10:31:08 UTC 2020",
"company":"InVision AG",
"company_url":"https://www.ivx.com/jobs",
"location":"Leipzig (Germany)",
@@ -263,7 +263,7 @@
"id":"28663c1c-a2e1-4184-ae11-d52230324dc6",
"type":"Full Time",
"url":"https://jobs.github.com/positions/28663c1c-a2e1-4184-ae11-d52230324dc6",
- "created_at":"Wed Jul 08 10:08:35 UTC 2020",
+ "listingDate":"Wed Jul 08 10:08:35 UTC 2020",
"company":"InVision AG",
"company_url":"https://www.ivx.com/jobs",
"location":"Düsseldorf (Germany)",
@@ -276,7 +276,7 @@
"id":"68d360da-a1a1-4ea5-9f7e-1aaca538dfb5",
"type":"Full Time",
"url":"https://jobs.github.com/positions/68d360da-a1a1-4ea5-9f7e-1aaca538dfb5",
- "created_at":"Tue Jul 07 21:26:13 UTC 2020",
+ "listingDate":"Tue Jul 07 21:26:13 UTC 2020",
"company":"Cloudrise",
"company_url":"http://www.cloudrise.com",
"location":"United States",
@@ -289,7 +289,7 @@
"id":"369fd039-4745-4de4-8286-bc12f427fe1a",
"type":"Full Time",
"url":"https://jobs.github.com/positions/369fd039-4745-4de4-8286-bc12f427fe1a",
- "created_at":"Mon Apr 27 16:28:09 UTC 2020",
+ "listingDate":"Mon Apr 27 16:28:09 UTC 2020",
"company":"KBMax",
"company_url":"https://kbmax.com",
"location":"Remote",
@@ -302,7 +302,7 @@
"id":"b15e4b6a-3498-47fc-b222-62638b802260",
"type":"Full Time",
"url":"https://jobs.github.com/positions/b15e4b6a-3498-47fc-b222-62638b802260",
- "created_at":"Tue Jul 07 20:57:46 UTC 2020",
+ "listingDate":"Tue Jul 07 20:57:46 UTC 2020",
"company":"Links Technology Solutions, Inc.",
"company_url":"https://www.linkstechnology.com/",
"location":"Schaumburg, IL",
@@ -315,7 +315,7 @@
"id":"ecd9db33-f36a-4b07-8e41-b28113c55069",
"type":"Full Time",
"url":"https://jobs.github.com/positions/ecd9db33-f36a-4b07-8e41-b28113c55069",
- "created_at":"Tue Jul 07 18:45:35 UTC 2020",
+ "listingDate":"Tue Jul 07 18:45:35 UTC 2020",
"company":"TutorMe",
"company_url":"https://tutorme.com",
"location":"Los Angeles",
@@ -328,7 +328,7 @@
"id":"017fb2de-083e-4680-a167-468469c0d0cc",
"type":"Full Time",
"url":"https://jobs.github.com/positions/017fb2de-083e-4680-a167-468469c0d0cc",
- "created_at":"Tue Jul 07 18:38:15 UTC 2020",
+ "listingDate":"Tue Jul 07 18:38:15 UTC 2020",
"company":"TutorMe",
"company_url":"https://tutorme.com",
"location":"Los Angeles",
@@ -341,7 +341,7 @@
"id":"230263f8-14ad-423e-b139-e0aec091ba45",
"type":"Full Time",
"url":"https://jobs.github.com/positions/230263f8-14ad-423e-b139-e0aec091ba45",
- "created_at":"Tue Jul 07 13:14:54 UTC 2020",
+ "listingDate":"Tue Jul 07 13:14:54 UTC 2020",
"company":"InVision AG",
"company_url":"https://www.ivx.com/jobs",
"location":"Leipzig (Germany)",
@@ -354,7 +354,7 @@
"id":"8078cedd-12de-4159-bf69-cf18902e899a",
"type":"Full Time",
"url":"https://jobs.github.com/positions/8078cedd-12de-4159-bf69-cf18902e899a",
- "created_at":"Tue Jul 07 11:13:28 UTC 2020",
+ "listingDate":"Tue Jul 07 11:13:28 UTC 2020",
"company":"NH1816 verzekeringen",
"company_url":"http://www.nh1816.nl/",
"location":"Oudkarspel",
@@ -367,7 +367,7 @@
"id":"6e15057c-fc45-4c63-bdad-cdf0b89f105a",
"type":"Full Time",
"url":"https://jobs.github.com/positions/6e15057c-fc45-4c63-bdad-cdf0b89f105a",
- "created_at":"Tue Jul 07 09:02:42 UTC 2020",
+ "listingDate":"Tue Jul 07 09:02:42 UTC 2020",
"company":"Sonova Marketing GmbH\t",
"company_url":"https://www.sonova.com",
"location":"Berlin",
@@ -380,7 +380,7 @@
"id":"de0cf30c-db0a-40f8-91c8-90c590fee1f2",
"type":"Full Time",
"url":"https://jobs.github.com/positions/de0cf30c-db0a-40f8-91c8-90c590fee1f2",
- "created_at":"Tue Jul 07 08:46:36 UTC 2020",
+ "listingDate":"Tue Jul 07 08:46:36 UTC 2020",
"company":"StudySmarter",
"company_url":"https://www.studysmarter.de/",
"location":"München",
@@ -393,7 +393,7 @@
"id":"e9e632a7-c756-40c9-b1ca-c3eb5c7f9ce3",
"type":"Full Time",
"url":"https://jobs.github.com/positions/e9e632a7-c756-40c9-b1ca-c3eb5c7f9ce3",
- "created_at":"Sat Aug 03 00:50:23 UTC 2019",
+ "listingDate":"Sat Aug 03 00:50:23 UTC 2019",
"company":"Game Closure",
"company_url":"http://gameclosure.com",
"location":"San Francisco, Mountain View, Tokyo, Remote",
@@ -406,7 +406,7 @@
"id":"ed19603f-c92a-408e-aea4-daff58b4e46e",
"type":"Full Time",
"url":"https://jobs.github.com/positions/ed19603f-c92a-408e-aea4-daff58b4e46e",
- "created_at":"Mon Jul 06 21:56:54 UTC 2020",
+ "listingDate":"Mon Jul 06 21:56:54 UTC 2020",
"company":"Tripoint Solutions, LLC",
"company_url":"http://www.tripointsolutions.com/careers",
"location":"Rockville, MD",
@@ -419,7 +419,7 @@
"id":"6cfdc451-a7cc-4000-8e2c-1dc83646cf70",
"type":"Full Time",
"url":"https://jobs.github.com/positions/6cfdc451-a7cc-4000-8e2c-1dc83646cf70",
- "created_at":"Mon Jul 06 17:04:40 UTC 2020",
+ "listingDate":"Mon Jul 06 17:04:40 UTC 2020",
"company":"FlatWorld.Co",
"company_url":"https://flatworld.co",
"location":"EU-TimeZones (GMT+3 to GMT-2)",
@@ -432,7 +432,7 @@
"id":"585ed8c9-b612-4a52-a937-1f1e46fed3ac",
"type":"Full Time",
"url":"https://jobs.github.com/positions/585ed8c9-b612-4a52-a937-1f1e46fed3ac",
- "created_at":"Fri Jul 03 08:02:12 UTC 2020",
+ "listingDate":"Fri Jul 03 08:02:12 UTC 2020",
"company":"Craft Courses Limited",
"company_url":null,
"location":"Pembrokeshire",
@@ -445,7 +445,7 @@
"id":"bfda54c4-da1a-4487-a579-637f9c7a0ffb",
"type":"Full Time",
"url":"https://jobs.github.com/positions/bfda54c4-da1a-4487-a579-637f9c7a0ffb",
- "created_at":"Thu Jul 02 22:24:18 UTC 2020",
+ "listingDate":"Thu Jul 02 22:24:18 UTC 2020",
"company":"One More Cloud",
"company_url":"http://bonsai.io",
"location":"Remote",
@@ -458,7 +458,7 @@
"id":"911a5212-129b-491f-95d4-f7eaa19bdefa",
"type":"Full Time",
"url":"https://jobs.github.com/positions/911a5212-129b-491f-95d4-f7eaa19bdefa",
- "created_at":"Thu Jul 02 17:01:53 UTC 2020",
+ "listingDate":"Thu Jul 02 17:01:53 UTC 2020",
"company":"Zappos.com",
"company_url":"http://jobs.zappos.com",
"location":"USA Remote",
@@ -471,7 +471,7 @@
"id":"22098e20-4b3e-48fb-b109-d6dd72bddd70",
"type":"Full Time",
"url":"https://jobs.github.com/positions/22098e20-4b3e-48fb-b109-d6dd72bddd70",
- "created_at":"Wed Jul 01 15:05:54 UTC 2020",
+ "listingDate":"Wed Jul 01 15:05:54 UTC 2020",
"company":"Virtual Pricing Director",
"company_url":"https://www.virtualpricingdirector.com/",
"location":"UK",
@@ -484,7 +484,7 @@
"id":"5ae75da5-fab6-41dd-8fc6-7c5e3b0ae5fe",
"type":"Full Time",
"url":"https://jobs.github.com/positions/5ae75da5-fab6-41dd-8fc6-7c5e3b0ae5fe",
- "created_at":"Wed Jul 01 11:16:56 UTC 2020",
+ "listingDate":"Wed Jul 01 11:16:56 UTC 2020",
"company":"Gothaer Digital GmbH",
"company_url":"http://www.gothaer-digital.de",
"location":"Cologne",
@@ -497,7 +497,7 @@
"id":"a4a03e31-b069-421c-ad0d-14f10fd6a1d3",
"type":"Full Time",
"url":"https://jobs.github.com/positions/a4a03e31-b069-421c-ad0d-14f10fd6a1d3",
- "created_at":"Tue Jun 30 18:48:52 UTC 2020",
+ "listingDate":"Tue Jun 30 18:48:52 UTC 2020",
"company":"Epic",
"company_url":"http://careers.epic.com",
"location":"Madison, WI",
@@ -510,7 +510,7 @@
"id":"cfb3dfc3-1626-4348-88d6-e885a93a28a2",
"type":"Full Time",
"url":"https://jobs.github.com/positions/cfb3dfc3-1626-4348-88d6-e885a93a28a2",
- "created_at":"Tue Jun 30 15:17:35 UTC 2020",
+ "listingDate":"Tue Jun 30 15:17:35 UTC 2020",
"company":"Altaml",
"company_url":"http://www.altaml.com",
"location":"Calgary",
@@ -523,7 +523,7 @@
"id":"94df0e7f-ecdb-489d-b9a5-dda1b121816c",
"type":"Full Time",
"url":"https://jobs.github.com/positions/94df0e7f-ecdb-489d-b9a5-dda1b121816c",
- "created_at":"Tue Jun 30 14:59:42 UTC 2020",
+ "listingDate":"Tue Jun 30 14:59:42 UTC 2020",
"company":"HubTran",
"company_url":"https://www.hubtran.com",
"location":"USA Remote",
@@ -536,7 +536,7 @@
"id":"db893e00-1e48-433d-8120-82326433e876",
"type":"Full Time",
"url":"https://jobs.github.com/positions/db893e00-1e48-433d-8120-82326433e876",
- "created_at":"Tue Jun 30 14:50:59 UTC 2020",
+ "listingDate":"Tue Jun 30 14:50:59 UTC 2020",
"company":"Hopkins",
"company_url":"https://www.hopkins.law/",
"location":"Berlin",
@@ -549,7 +549,7 @@
"id":"f75f8690-c458-4d9e-bd37-10a660ddf712",
"type":"Full Time",
"url":"https://jobs.github.com/positions/f75f8690-c458-4d9e-bd37-10a660ddf712",
- "created_at":"Tue Jun 30 14:00:28 UTC 2020",
+ "listingDate":"Tue Jun 30 14:00:28 UTC 2020",
"company":"YourWork GmbH",
"company_url":"http://www.yourwork.com",
"location":"Erfurt",
@@ -562,7 +562,7 @@
"id":"f1e47ec6-641c-4b4a-a38a-1a57e6af7c93",
"type":"Full Time",
"url":"https://jobs.github.com/positions/f1e47ec6-641c-4b4a-a38a-1a57e6af7c93",
- "created_at":"Mon Jun 29 06:38:28 UTC 2020",
+ "listingDate":"Mon Jun 29 06:38:28 UTC 2020",
"company":"InnoGames GmbH",
"company_url":"https://www.innogames.com",
"location":"Hamburg",
@@ -575,7 +575,7 @@
"id":"8d090215-8f42-4b8d-8a27-44cca0394f68",
"type":"Full Time",
"url":"https://jobs.github.com/positions/8d090215-8f42-4b8d-8a27-44cca0394f68",
- "created_at":"Sat Jun 27 06:33:39 UTC 2020",
+ "listingDate":"Sat Jun 27 06:33:39 UTC 2020",
"company":"Bayforest Technologies",
"company_url":null,
"location":"London",
@@ -588,7 +588,7 @@
"id":"988bf054-4955-4859-a642-062def8017cb",
"type":"Full Time",
"url":"https://jobs.github.com/positions/988bf054-4955-4859-a642-062def8017cb",
- "created_at":"Fri Jun 26 21:02:23 UTC 2020",
+ "listingDate":"Fri Jun 26 21:02:23 UTC 2020",
"company":"General Atomics",
"company_url":"https://bit.ly/2ZeQYUq",
"location":"Centennial, CO",
@@ -601,7 +601,7 @@
"id":"35bca1a2-42d3-4f6c-93ab-efb76dbfaead",
"type":"Full Time",
"url":"https://jobs.github.com/positions/35bca1a2-42d3-4f6c-93ab-efb76dbfaead",
- "created_at":"Fri Jun 26 21:00:36 UTC 2020",
+ "listingDate":"Fri Jun 26 21:00:36 UTC 2020",
"company":"General Atomics",
"company_url":"https://bit.ly/2ZeQYUq",
"location":"Centennial, CO",
@@ -614,7 +614,7 @@
"id":"c019304d-2472-4934-89e2-5e0a33d40226",
"type":"Full Time",
"url":"https://jobs.github.com/positions/c019304d-2472-4934-89e2-5e0a33d40226",
- "created_at":"Fri Jun 26 20:57:54 UTC 2020",
+ "listingDate":"Fri Jun 26 20:57:54 UTC 2020",
"company":"General Atomics",
"company_url":"https://bit.ly/2ZeQYUq",
"location":"Centennial, CO",
@@ -627,7 +627,7 @@
"id":"3076f2fe-b421-4b0d-8876-b20c02322ba7",
"type":"Full Time",
"url":"https://jobs.github.com/positions/3076f2fe-b421-4b0d-8876-b20c02322ba7",
- "created_at":"Fri Jun 26 20:54:58 UTC 2020",
+ "listingDate":"Fri Jun 26 20:54:58 UTC 2020",
"company":"General Atomics",
"company_url":"https://bit.ly/2ZeQYUq",
"location":"Centennial, CO",
@@ -640,7 +640,7 @@
"id":"69f7a578-6a8b-4df4-8088-fb8d94d33060",
"type":"Full Time",
"url":"https://jobs.github.com/positions/69f7a578-6a8b-4df4-8088-fb8d94d33060",
- "created_at":"Fri Jun 26 20:50:03 UTC 2020",
+ "listingDate":"Fri Jun 26 20:50:03 UTC 2020",
"company":"General Atomics",
"company_url":"https://bit.ly/2ZeQYUq",
"location":"Centennial, CO",
diff --git a/cypress/fixtures/jobsSearch1.json b/cypress/fixtures/jobsSearch1.json
index 762bf24..2a188f2 100644
--- a/cypress/fixtures/jobsSearch1.json
+++ b/cypress/fixtures/jobsSearch1.json
@@ -3,7 +3,7 @@
"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",
+ "listingDate": "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",
@@ -16,7 +16,7 @@
"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",
+ "listingDate": "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",
@@ -29,7 +29,7 @@
"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",
+ "listingDate": "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",
@@ -42,7 +42,7 @@
"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",
+ "listingDate": "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",
@@ -55,7 +55,7 @@
"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",
+ "listingDate": "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",
@@ -68,7 +68,7 @@
"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",
+ "listingDate": "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",
@@ -81,7 +81,7 @@
"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",
+ "listingDate": "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",
diff --git a/cypress/fixtures/jobsSearch2.json b/cypress/fixtures/jobsSearch2.json
index 50985c5..69ba2c0 100644
--- a/cypress/fixtures/jobsSearch2.json
+++ b/cypress/fixtures/jobsSearch2.json
@@ -3,7 +3,7 @@
"id": 1,
"type": "Full Time",
"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",
+ "listingDate": "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",
@@ -16,7 +16,7 @@
"id": 2,
"type": "Full Time",
"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",
+ "listingDate": "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",
@@ -29,7 +29,7 @@
"id": 3,
"type": "Full Time",
"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",
+ "listingDate": "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",
@@ -42,7 +42,7 @@
"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",
+ "listingDate": "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",
From d0ae77ba2b959d14f3cfd1e95fea84b39a11390b Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Wed, 12 Aug 2020 09:05:37 -0700
Subject: [PATCH 39/43] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Rename=20'created=5F?=
=?UTF-8?q?at'=20#50=20-=20Modify=20Job=20when=20creating=20in=20DB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/server/controllers/job.ts | 17 +++++++++++++----
src/server/types.ts | 16 +++++++++++++++-
2 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/src/server/controllers/job.ts b/src/server/controllers/job.ts
index c492240..bd7bee2 100644
--- a/src/server/controllers/job.ts
+++ b/src/server/controllers/job.ts
@@ -15,6 +15,7 @@ import {
Job,
GetJobDetailsErrorResponse,
GetJobDetailsSuccessResponse,
+ GitHubJob,
} from "../types";
/**
@@ -46,8 +47,12 @@ class JobController {
}
await Promise.all(
- result.map(async (job: Job) => {
- const newJob = new JobModel(job);
+ result.map(async (job: GitHubJob) => {
+ const newJobObject: Job = {
+ ...job,
+ listingDate: job.created_at,
+ };
+ const newJob = new JobModel(newJobObject);
await newJob.save();
return;
})
@@ -77,8 +82,12 @@ class JobController {
// * Create new Job entries
await Promise.all(
- result.map(async (job: Job) => {
- const newJob = new JobModel(job);
+ result.map(async (job: GitHubJob) => {
+ const newJobObject: Job = {
+ ...job,
+ listingDate: job.created_at,
+ };
+ const newJob = new JobModel(newJobObject);
await newJob.save();
return;
})
diff --git a/src/server/types.ts b/src/server/types.ts
index 31a5cf8..1c2a006 100644
--- a/src/server/types.ts
+++ b/src/server/types.ts
@@ -25,7 +25,7 @@ export interface GetJobsErrorResponse {
error: string;
}
-export type GetJobsSuccessResponse = Job[];
+export type GetJobsSuccessResponse = GitHubJob[];
export interface GetHiddenJobsDetailsErrorResponse {
error: string;
@@ -39,6 +39,20 @@ export interface GetSavedJobsDetailsErrorResponse {
export type GetSavedJobsDetailsSuccessResponse = Job[];
+export interface GitHubJob {
+ company: string;
+ company_logo: string;
+ company_url: string;
+ created_at: string;
+ description: string;
+ how_to_apply: string;
+ id: string;
+ location: string;
+ title: string;
+ type: JobType;
+ url: string;
+}
+
export interface Job {
company: string;
company_logo: string;
From e1ba8a90237c9fd30a9290f6371fe8d0aedf2920 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Wed, 12 Aug 2020 09:06:51 -0700
Subject: [PATCH 40/43] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Rename=20'created=5F?=
=?UTF-8?q?at'=20#50=20-=20Modify=20Job=20when=20creating=20in=20DB=20-=20?=
=?UTF-8?q?adjust=20util?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/server/util.ts | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/server/util.ts b/src/server/util.ts
index 1dfac9b..bdb40bf 100644
--- a/src/server/util.ts
+++ b/src/server/util.ts
@@ -1,6 +1,10 @@
import nfetch from "node-fetch";
-import { GetJobsErrorResponse, GetJobsSuccessResponse, Job } from "./types";
+import {
+ GetJobsErrorResponse,
+ GetJobsSuccessResponse,
+ GitHubJob,
+} from "./types";
/**
* Check if MongoDB is running locally. Stops application from continuing if false.
@@ -47,7 +51,7 @@ export const createSearchURL = (
export const getAllJobsFromAPI = async (): Promise<
GetJobsErrorResponse | GetJobsSuccessResponse
> => {
- const jobs: Job[] = [];
+ const jobs: GitHubJob[] = [];
let jobsInBatch = null;
let page = 1;
@@ -59,7 +63,7 @@ export const getAllJobsFromAPI = async (): Promise<
`https://jobs.github.com/positions.json?page=${page}`,
{ headers: { "Content-Type": "application/json" }, method: "GET" }
);
- const batchJobs: Job[] = await response.json();
+ const batchJobs: GitHubJob[] = await response.json();
jobsInBatch = batchJobs.length;
page++;
if (jobsInBatch !== 0) {
From bbe18eff72c02b21918bf78776e456c3aba1bc69 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Wed, 12 Aug 2020 09:14:29 -0700
Subject: [PATCH 41/43] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Rename=20'created=5F?=
=?UTF-8?q?at'=20#50=20-=20Fix=20OptionsPanel=20Test=20Stub?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
cypress/integration/optionsPanel.spec.js | 4 ++--
src/server/util.ts | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/cypress/integration/optionsPanel.spec.js b/cypress/integration/optionsPanel.spec.js
index cc110ac..af5327e 100644
--- a/cypress/integration/optionsPanel.spec.js
+++ b/cypress/integration/optionsPanel.spec.js
@@ -22,14 +22,14 @@ context("Options Panel", () => {
cy.route({
method: "GET",
url:
- "/jobs/search?full_time=false&description=&location=Los Angeles",
+ "/jobs/search?full_time=false&description=&location1=Los Angeles",
status: 200,
delay: 1000,
response: jobsSearch1Json,
});
cy.route({
method: "GET",
- url: "/jobs/search?full_time=false&description=&location=Chicago",
+ url: "/jobs/search?full_time=false&description=&location1=Chicago",
status: 200,
delay: 1000,
response: jobsSearch1Json,
diff --git a/src/server/util.ts b/src/server/util.ts
index bdb40bf..d4f7942 100644
--- a/src/server/util.ts
+++ b/src/server/util.ts
@@ -24,6 +24,7 @@ export const checkIfMongoDBIsRunning = async (): Promise =>
}
});
+// TODO - Remove
export const createSearchURL = (
page: number,
// eslint-disable-next-line
From ad7dfbea921354c2a9d111276a6bd34afbb4ff69 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Wed, 12 Aug 2020 09:30:42 -0700
Subject: [PATCH 42/43] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Rename=20'created=5F?=
=?UTF-8?q?at'=20#50=20-=20Add=20remove=20todos?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/client/util.ts | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/client/util.ts b/src/client/util.ts
index b8f43cb..9db4e22 100644
--- a/src/client/util.ts
+++ b/src/client/util.ts
@@ -30,6 +30,7 @@ export const fetchServerData = async (
return data;
};
+// TODO - Remove
// eslint-disable-next-line
export const groupBy = (arr: any[], key: any): any =>
arr.reduce(
@@ -37,9 +38,11 @@ export const groupBy = (arr: any[], key: any): any =>
{}
);
+// TODO - Remove
// eslint-disable-next-line
export const unique = (arr: any[]): any[] => [...new Set(arr)];
+// TODO - Remove
export const validURL = (str: string): boolean => {
const pattern = new RegExp(
"^(https?:\\/\\/)?" + // protocol
From 63569354df0709906dfc0e82e3fe4618c82742e8 Mon Sep 17 00:00:00 2001
From: alexlee-dev
Date: Wed, 12 Aug 2020 09:38:07 -0700
Subject: [PATCH 43/43] =?UTF-8?q?=F0=9F=93=9D=20CHANGELOG=20-=20Update=20C?=
=?UTF-8?q?HANGELOG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
CHANGELOG.md | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3ed6f1f..01344d5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,16 +5,27 @@ 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.4.0] - _Unreleased_
+## [1.4.0] - 2020-08-12
+
+### 🎨 Profile Redesign
### Added
+- Message when a user is not found in the DB - [#67](https://github.com/alexlee-dev/gh-jobs/issues/67)
+- Ability to Search from the OptionsPanel - [#43](https://github.com/alexlee-dev/gh-jobs/issues/43)
+- `ModalState` - [#69](https://github.com/alexlee-dev/gh-jobs/issues/69)
+
### Changed
+- Redesign Profile - [#47](https://github.com/alexlee-dev/gh-jobs/issues/47)
+- Rename `created_at` to `listingDate` - [#50](https://github.com/alexlee-dev/gh-jobs/issues/50)
+
### Removed
### Fixed
+- LoadingIndicator stopping before page fully loaded - [#68](https://github.com/alexlee-dev/gh-jobs/issues/68)
+
## [1.3.0] - 2020-08-06
### 🙈 Hide Job