Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next.js migration #2802

Open
wants to merge 55 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
5823a00
next.js migration
ChelseaKR Aug 21, 2024
f505e96
Update .gitignore
scwambach Aug 21, 2024
b28d081
Update .gitignore
scwambach Aug 21, 2024
81c5b9e
converted from GIF labeled as a PNG to a true PNG
ChelseaKR Aug 23, 2024
451d183
latest
ChelseaKR Aug 23, 2024
2404067
added a proxy to redirect API calls
ChelseaKR Sep 30, 2024
a092c62
layout cleanup
scwambach Nov 4, 2024
afd5c18
Update page.tsx
scwambach Nov 4, 2024
04c963f
data
scwambach Nov 4, 2024
d8b89f4
Update homePage.ts
scwambach Nov 4, 2024
49d9015
types organization
scwambach Nov 4, 2024
cc79ffa
test fixes
scwambach Nov 4, 2024
14a6198
various updates
scwambach Nov 4, 2024
3e2b9bb
Update _fancyBanner.scss
scwambach Nov 4, 2024
3e86eb7
Update _fancyBanner.scss
scwambach Nov 4, 2024
1c371f8
content and typography
scwambach Nov 4, 2024
144a84a
Update Footer.tsx
scwambach Nov 6, 2024
c649c4f
industry selector
scwambach Nov 6, 2024
6ae1b49
cp landing page
scwambach Nov 6, 2024
aafb96e
tooltip fix
scwambach Nov 6, 2024
be5715b
layout changes
scwambach Nov 7, 2024
08cf7bf
manufacturing select
scwambach Nov 7, 2024
b074139
Update ManufacturingSelect.tsx
scwambach Nov 7, 2024
dd1f94b
Update _manufacturingSelect.scss
scwambach Nov 7, 2024
9e9614f
occupationGroups
scwambach Nov 7, 2024
98a7d57
Update OccupationGroups.tsx
scwambach Nov 7, 2024
b102bd5
Update ManufacturingSelect.tsx
scwambach Nov 7, 2024
f75a2e9
career pathways
scwambach Nov 12, 2024
b8a08ce
backend update
scwambach Nov 12, 2024
884a176
occupation details
scwambach Nov 12, 2024
559d775
training fix
scwambach Nov 13, 2024
1c0a2fe
Update CardSlider.tsx
scwambach Nov 13, 2024
a6e0eb4
Update CardSlider.tsx
scwambach Nov 13, 2024
e86a74e
Update CardSlider.tsx
scwambach Nov 13, 2024
f1c756b
Update IntroBlocks.tsx
scwambach Nov 13, 2024
4b6415c
button on training page
scwambach Nov 18, 2024
ed6a2e8
sass and backend update
scwambach Nov 19, 2024
987fa35
pageProp fixes
scwambach Nov 19, 2024
4c1c875
Merge pull request #3022 from newjersey/production-design-updates
ChelseaKR Nov 19, 2024
722f096
search fix
scwambach Dec 4, 2024
55f5a69
program banner
scwambach Dec 5, 2024
8065c9d
content start
scwambach Dec 5, 2024
d5e8e27
styles
scwambach Dec 6, 2024
9ef2249
Update Content.tsx
scwambach Dec 6, 2024
e409452
code cleanup
scwambach Dec 6, 2024
8818d1e
Update DrawerButton.tsx
scwambach Dec 6, 2024
1127de2
Update _drawer.scss
scwambach Dec 6, 2024
aa651dd
Update _infoBlocks.scss
scwambach Dec 6, 2024
48751be
Update _buttons.scss
scwambach Dec 6, 2024
fb0b832
notes
scwambach Dec 11, 2024
35db192
quick fixes
scwambach Dec 11, 2024
a66c408
Merge pull request #3093 from newjersey/ce-styles
ChelseaKR Jan 3, 2025
adf89b9
NJWE-2519 / basic content (#3153)
scwambach Jan 16, 2025
b7cd730
Njwe 2406/scott training results page (#3169)
scwambach Jan 21, 2025
92ae718
bug fixes (#3187)
scwambach Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
sass and backend update
scwambach committed Nov 19, 2024

Verified

This commit was signed with the committer’s verified signature.
the-praxs Pratyush Shukla
commit ed6a2e84d80655763d23917a3f85315bf7bbb5ce
38 changes: 0 additions & 38 deletions .husky/pre-commit

This file was deleted.

155 changes: 155 additions & 0 deletions backend/dist/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const dotenv = tslib_1.__importStar(require("dotenv"));
require("./utils/global");
const Sentry = tslib_1.__importStar(require("@sentry/node"));
const express_1 = tslib_1.__importDefault(require("express"));
const path_1 = tslib_1.__importDefault(require("path"));
const cors_1 = tslib_1.__importDefault(require("cors"));
const aws_sdk_1 = tslib_1.__importDefault(require("aws-sdk"));
const router_1 = require("./routes/router");
const emailRoutes_1 = tslib_1.__importDefault(require("./routes/emailRoutes"));
const index_1 = tslib_1.__importDefault(require("./contentful/index"));
const contactRoutes_1 = tslib_1.__importDefault(require("./routes/contactRoutes"));
const PostgresDataClient_1 = require("./database/data/PostgresDataClient");
const PostgresSearchClient_1 = require("./database/search/PostgresSearchClient");
const findTrainingsBy_1 = require("./domain/training/findTrainingsBy");
const searchTrainings_1 = require("./domain/search/searchTrainings");
const getInDemandOccupations_1 = require("./domain/occupations/getInDemandOccupations");
const getOccupationDetail_1 = require("./domain/occupations/getOccupationDetail");
const OnetClient_1 = require("./oNET/OnetClient");
const getEducationText_1 = require("./domain/occupations/getEducationText");
const getSalaryEstimate_1 = require("./domain/occupations/getSalaryEstimate");
const CareerOneStopClient_1 = require("./careeronestop/CareerOneStopClient");
const getOccupationDetailByCIP_1 = require("./domain/occupations/getOccupationDetailByCIP");
dotenv.config();
const app = (0, express_1.default)();
Sentry.init({
dsn: process.env.SENTRY_DSN,
integrations: [
new Sentry.Integrations.Http({ tracing: true }),
new Sentry.Integrations.Express({ app }),
...Sentry.autoDiscoverNodePerformanceMonitoringIntegrations(),
],
tracesSampleRate: 1.0,
});
process.on('uncaughtException', function (exception) {
Sentry.captureException(exception);
});
process.on("unhandledRejection", (reason) => {
Sentry.captureException(reason);
});
const corsOptions = {
origin: ['https://mycareer.nj.gov', 'http://localhost:3000'],
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
allowedHeaders: ['Content-Type', 'Authorization'],
optionsSuccessStatus: 200
};
app.use((0, cors_1.default)(corsOptions));
app.use(Sentry.Handlers.requestHandler());
app.use(Sentry.Handlers.tracingHandler());
const awsConfig = new aws_sdk_1.default.Config({
accessKeyId: process.env.AWS_ACCESS_KEY_ID || undefined,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY || undefined,
region: process.env.AWS_REGION
});
let connection = null;
switch (process.env.NODE_ENV) {
case "dev":
connection = {
user: "postgres",
host: process.env.DB_HOST_DEV || '',
database: "d4adlocal",
password: process.env.DB_PASS_DEV || '',
port: 5432,
};
break;
case "test":
connection = {
user: "postgres",
host: process.env.DB_HOST_TEST || '',
database: "d4adtest",
password: process.env.DB_PASS_TEST || '',
port: 5432,
};
break;
case "awsdev":
connection = {
user: "postgres",
host: process.env.DB_HOST_WRITER_AWSDEV || '',
database: "d4addev",
password: process.env.DB_PASS_AWSDEV || '',
port: 5432,
};
break;
case "awstest":
connection = {
user: "postgres",
host: process.env.DB_HOST_WRITER_AWSTEST || '',
database: "d4adtest",
password: process.env.DB_PASS_AWSTEST || '',
port: 5432,
};
break;
case "awsprod":
connection = {
user: "postgres",
host: process.env.DB_HOST_WRITER_AWSPROD || '',
database: "d4adprod",
password: process.env.DB_PASS_AWSPROD || '',
port: 5432,
};
break;
default:
console.error("Invalid NODE_ENV. Please set NODE_ENV to one of: dev, test, awsdev, awstest, awsprod.");
process.exit(1);
}
const isCI = process.env.IS_CI;
const apiValues = {
onetBaseUrl: "http://localhost:8090",
onetAuth: {
username: "ONET_USERNAME",
password: "ONET_PASSWORD",
},
careerOneStopBaseUrl: "http://localhost:8090",
careerOneStopUserId: "CAREER_ONESTOP_USERID",
careerOneStopAuthToken: "CAREER_ONESTOP_AUTH_TOKEN",
};
if (!isCI) {
apiValues.onetBaseUrl = process.env.ONET_BASEURL || "http://localhost:8090";
apiValues.onetAuth = {
username: process.env.ONET_USERNAME || "ONET_USERNAME",
password: process.env.ONET_PASSWORD || "ONET_PASSWORD",
};
apiValues.careerOneStopBaseUrl = process.env.CAREER_ONESTOP_BASEURL || "http://localhost:8090";
apiValues.careerOneStopUserId = process.env.CAREER_ONESTOP_USERID || "CAREER_ONESTOP_USERID";
apiValues.careerOneStopAuthToken =
process.env.CAREER_ONESTOP_AUTH_TOKEN || "CAREER_ONESTOP_AUTH_TOKEN";
}
const postgresDataClient = new PostgresDataClient_1.PostgresDataClient(connection);
const postgresSearchClient = new PostgresSearchClient_1.PostgresSearchClient(connection);
const findTrainingsBy = (0, findTrainingsBy_1.findTrainingsByFactory)(postgresDataClient);
const router = (0, router_1.routerFactory)({
searchTrainings: (0, searchTrainings_1.searchTrainingsFactory)(findTrainingsBy, postgresSearchClient),
findTrainingsBy: findTrainingsBy,
getInDemandOccupations: (0, getInDemandOccupations_1.getInDemandOccupationsFactory)(postgresDataClient),
getOccupationDetail: (0, getOccupationDetail_1.getOccupationDetailFactory)((0, OnetClient_1.OnetClient)(apiValues.onetBaseUrl, apiValues.onetAuth, postgresDataClient.find2018OccupationsBySoc2010), (0, getEducationText_1.getEducationTextFactory)(postgresDataClient), (0, getSalaryEstimate_1.getSalaryEstimateFactory)(postgresDataClient), (0, CareerOneStopClient_1.CareerOneStopClient)(apiValues.careerOneStopBaseUrl, apiValues.careerOneStopUserId, apiValues.careerOneStopAuthToken), findTrainingsBy, postgresDataClient),
getOccupationDetailByCIP: (0, getOccupationDetailByCIP_1.getOccupationDetailByCIPFactory)((0, OnetClient_1.OnetClient)(apiValues.onetBaseUrl, apiValues.onetAuth, postgresDataClient.find2018OccupationsBySoc2010), (0, getEducationText_1.getEducationTextFactory)(postgresDataClient), (0, getSalaryEstimate_1.getSalaryEstimateFactory)(postgresDataClient), (0, CareerOneStopClient_1.CareerOneStopClient)(apiValues.careerOneStopBaseUrl, apiValues.careerOneStopUserId, apiValues.careerOneStopAuthToken), findTrainingsBy, postgresDataClient),
});
app.use(express_1.default.static(path_1.default.join(__dirname, "build"), { etag: false, lastModified: false }));
app.use(express_1.default.json());
app.use("/api", router);
app.use('/api/contact', contactRoutes_1.default);
app.use('/api/emails', emailRoutes_1.default);
app.use('/api/contentful', index_1.default);
app.get("/", (req, res) => {
res.setHeader("Cache-Control", "no-cache");
res.sendFile(path_1.default.join(__dirname, "build", "index.html"));
});
app.get("*", (req, res) => {
res.setHeader("Cache-Control", "no-cache");
res.sendFile(path_1.default.join(__dirname, "build", "index.html"));
});
app.use(Sentry.Handlers.errorHandler());
exports.default = app;
23 changes: 23 additions & 0 deletions backend/dist/careeronestop/CareerOneStopClient.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CareerOneStopClient = void 0;
const tslib_1 = require("tslib");
const axios_1 = tslib_1.__importDefault(require("axios"));
const CareerOneStopClient = (baseUrl, userId, authToken) => {
return (soc) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
return axios_1.default
.get(`${baseUrl}/v1/jobsearch/${userId}/${soc}/NJ/1000/0/0/0/10/0?source=NLx&showFilters=false`, {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${authToken}`,
},
})
.then((response) => {
return parseInt(response.data.Jobcount);
})
.catch(() => {
return null;
});
});
};
exports.CareerOneStopClient = CareerOneStopClient;
20 changes: 20 additions & 0 deletions backend/dist/contentful/client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.contentfulClient = void 0;
const graphql_request_1 = require("graphql-request");
const contentfulClient = ({ query, variables, includeDrafts, excludeInvalid, accessToken }) => {
const headers = {
authorization: `Bearer ${accessToken}`,
};
if (includeDrafts) {
headers["X-Include-Drafts"] = "true";
}
if (excludeInvalid) {
headers["X-Exclude-Invalid"] = "true";
}
const client = new graphql_request_1.GraphQLClient(`https://${process.env.BASE_URL}/${process.env.SPACE_ID}`, {
headers,
});
return client.request(query, variables);
};
exports.contentfulClient = contentfulClient;
39 changes: 39 additions & 0 deletions backend/dist/contentful/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const express_1 = tslib_1.__importDefault(require("express"));
const homePage_1 = require("./queries/homePage");
const routeHandler_1 = require("./routeHandler");
const careerNavigator_1 = require("./queries/careerNavigator");
const allSupportPage_1 = require("./queries/allSupportPage");
const faq_1 = require("./queries/faq");
const careerMapNode_1 = require("./queries/careerMapNode");
const careerPathways_1 = require("./queries/careerPathways");
const navMenu_1 = require("./queries/navMenu");
const occupation_1 = require("./queries/occupation");
const pathMenu_1 = require("./queries/pathMenu");
const resourceCategory_1 = require("./queries/resourceCategory");
const trainingExplorer_1 = require("./queries/trainingExplorer");
const trainingProvider_1 = require("./queries/trainingProvider");
const tuitionAssistance_1 = require("./queries/tuitionAssistance");
const industry_1 = require("./queries/industry");
const careerPathway_1 = require("./queries/careerPathway");
const router = express_1.default.Router();
router.get("/all-support", (0, routeHandler_1.routeHandler)(allSupportPage_1.ALL_SUPPORT_PAGE_QUERY));
router.get("/career-map-occupation/:id", (0, routeHandler_1.routeHandler)(occupation_1.OCCUPATION_QUERY));
router.get("/career-map-node/:id", (0, routeHandler_1.routeHandler)(careerMapNode_1.CAREER_MAP_NODE_QUERY));
router.get("/career-navigator", (0, routeHandler_1.routeHandler)(careerNavigator_1.CAREER_NAVIGATOR_QUERY));
router.get("/career-pathways", (0, routeHandler_1.routeHandler)(careerPathways_1.CAREER_PATHWAYS_PAGE_QUERY));
router.get("/pathway-group/:id", (0, routeHandler_1.routeHandler)(careerPathway_1.CAREER_PATHWAY_QUERY));
router.get("/faq", (0, routeHandler_1.routeHandler)(faq_1.FAQ_PAGE_QUERY));
router.get("/home-page", (0, routeHandler_1.routeHandler)(homePage_1.HOMEPAGE_QUERY));
router.get("/nav-menu/:id", (0, routeHandler_1.routeHandler)(navMenu_1.NAV_MENU_QUERY));
router.get("/occupation/:id", (0, routeHandler_1.routeHandler)(occupation_1.OCCUPATION_QUERY));
router.get("/path-menu/:id", (0, routeHandler_1.routeHandler)(pathMenu_1.PATH_MENU_QUERY));
router.get("/resource-category/:slug", (0, routeHandler_1.routeHandler)(resourceCategory_1.RESOURCE_CATEGORY_QUERY));
router.get("/resource-listing/:tags", (0, routeHandler_1.routeHandler)(resourceCategory_1.RESOURCE_LISTING_QUERY));
router.get("/training-explorer", (0, routeHandler_1.routeHandler)(trainingExplorer_1.TRAINING_EXPLORER_PAGE_QUERY));
router.get("/training-provider", (0, routeHandler_1.routeHandler)(trainingProvider_1.TRAINING_PROVIDER_PAGE_QUERY));
router.get("/tution-assistance", (0, routeHandler_1.routeHandler)(tuitionAssistance_1.TUITION_ASSISTANCE_PAGE_QUERY));
router.get("/industry/:slug", (0, routeHandler_1.routeHandler)(industry_1.INDUSTRY_QUERY));
exports.default = router;
31 changes: 31 additions & 0 deletions backend/dist/contentful/queries/allSupportPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ALL_SUPPORT_PAGE_QUERY = void 0;
const fragments_1 = require("./fragments");
const seoQuery_1 = require("./seoQuery");
exports.ALL_SUPPORT_PAGE_QUERY = `query AllSupport {
page: allSupportPage(id: "5q3sZR3WinrIUq7uWw2rdG") {
${seoQuery_1.SEO_QUERY}
pageBanner {
...PageBanner
}
footerCtaHeading
footerCtaLink {
copy
screenReaderOnlyCopy
url
}
}
categories: resourceCategoryCollection(limit: 30, where: {title_not: "Audience"}, order: title_ASC) {
items {
sys {
id
}
title
slug
description
}
}
}
${fragments_1.fragments.pageBanner}
`;
16 changes: 16 additions & 0 deletions backend/dist/contentful/queries/careerMapNode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CAREER_MAP_NODE_QUERY = void 0;
exports.CAREER_MAP_NODE_QUERY = `query MapNode($id:String!) {
careerMapObject(id: $id) {
sys {
id
}
title
shortTitle
description
salaryRangeEnd
educationLevel
salaryRangeStart
}
}`;
65 changes: 65 additions & 0 deletions backend/dist/contentful/queries/careerNavigator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CAREER_NAVIGATOR_QUERY = void 0;
const fragments_1 = require("./fragments");
exports.CAREER_NAVIGATOR_QUERY = `query CareerNavigator {
page: careerNavigatorPage(id: "1jPbENKfUfAUhsh6ZWxjz8") {
title
pageBanner {
...PageBanner
}
opportunitiesHeading
opportunityCards: opportunityCardsCollection(limit: 4) {
items {
...LinkObject
}
}
stepsHeading
stepsCollection(limit: 3) {
items {
...IconCard
}
}
midPageCtaHeading
midPageCtaLinks: midPageCtaLinksCollection(limit: 2) {
items {
...LinkObject
}
}
interrupterHeading
interrupterLinks: interrupterLinksCollection(limit: 4) {
items {
...LinkObject
}
}
infoHeading
infoCards: infoCardsCollection(limit: 3) {
items {
...IconCard
}
}
river: riverItemsCollection(limit: 4) {
items {
sys {
id
}
image {
url
description
height
width
}
heading
copy
}
}
footerCtaHeading
footerCtaLink {
...LinkObject
}
}
}
${fragments_1.fragments.pageBanner}
${fragments_1.fragments.linkObject}
${fragments_1.fragments.iconCard}
`;
Loading