From 8ef39026c8ec691e29b623e2b77458ae104b7ee1 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 11:23:56 -0400 Subject: [PATCH 01/37] Push wip to build env --- _data/assetPaths.json | 2 +- _includes/layouts/jointts/home.html | 10 +--- _includes/layouts/jointts/jobs.html | 17 ++++++ _includes/scripts.html | 54 +++++++++++++++++-- .../positions/PX-Contact Center Analyst.md | 2 +- .../positions/login-gov-data-analyist.md | 4 +- 6 files changed, 72 insertions(+), 17 deletions(-) create mode 100644 _includes/layouts/jointts/jobs.html diff --git a/_data/assetPaths.json b/_data/assetPaths.json index bc6d8cd1..e35e2aab 100644 --- a/_data/assetPaths.json +++ b/_data/assetPaths.json @@ -6,4 +6,4 @@ "uswds.js": "/assets/js/uswds-init.js", "styles.css": "/assets/styles/styles-6UNDCLW2.css", "styles.map": "/assets/styles/styles-6UNDCLW2.css.map" -} +} \ No newline at end of file diff --git a/_includes/layouts/jointts/home.html b/_includes/layouts/jointts/home.html index c5f7920e..bc7d58c7 100644 --- a/_includes/layouts/jointts/home.html +++ b/_includes/layouts/jointts/home.html @@ -27,14 +27,8 @@

{{ title }}

- -

Open positions

-

We are hiring and will be sharing upcoming jobs and open positions as they are available.

- {% include "layouts/jointts/open-jobs.html" %} - - -

Upcoming positions

- {% include "layouts/jointts/upcoming-jobs.html" %} + + {% include "layouts/jointts/jobs.html" %}

Other GSA Opportunities

diff --git a/_includes/layouts/jointts/jobs.html b/_includes/layouts/jointts/jobs.html new file mode 100644 index 00000000..ca01e2b8 --- /dev/null +++ b/_includes/layouts/jointts/jobs.html @@ -0,0 +1,17 @@ + +
+

Open positions

+

We are hiring and will be sharing upcoming jobs and open positions as they are available.

+ + +
+ +
+

Upcoming positions

+ + +
+ + + diff --git a/_includes/scripts.html b/_includes/scripts.html index 2a79346c..8bb30f09 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -48,10 +48,55 @@ diff --git a/pages/jointts/positions/PX-Contact Center Analyst.md b/pages/jointts/positions/PX-Contact Center Analyst.md index 2ad26e07..b8f96c4d 100644 --- a/pages/jointts/positions/PX-Contact Center Analyst.md +++ b/pages/jointts/positions/PX-Contact Center Analyst.md @@ -43,7 +43,7 @@ external_url: # Put the opening and closing dates of your posting here, if you have them # These dates MUST be formatted as YYYY-MM-DD, where month and day are 2-digits -opens: 2024-09-13 00:00:00 -0400 +opens: 2024-09-13 closes: 2024-09-24 # To show the status alert for this job, leave this set to true. To hide it, change to false diff --git a/pages/jointts/positions/login-gov-data-analyist.md b/pages/jointts/positions/login-gov-data-analyist.md index 89a53be6..4a5edec1 100644 --- a/pages/jointts/positions/login-gov-data-analyist.md +++ b/pages/jointts/positions/login-gov-data-analyist.md @@ -43,8 +43,8 @@ external_url: # Put the opening and closing dates of your posting here, if you have them # These dates MUST be formatted as YYYY-MM-DD, where month and day are 2-digits -opens: -closes: +opens: 2024-10-03 +closes: 2024-10-30 # To show the status alert for this job, leave this set to true. To hide it, change to false # To show the alert keyword association message, add the keywords separated by a semi-colon From 6fbf54db12c4ca44d45ac494c5259489bd6c4232 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 11:38:13 -0400 Subject: [PATCH 02/37] Full job logging --- _includes/scripts.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index 8bb30f09..d6fb8255 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -81,11 +81,12 @@ const today = formatDate(now); allJobs.forEach(job => { + console.log(job) const opens = job.opens !== '' ? job.opens : ''; const closes = job.closes !== '' ? job.closes : ''; - console.log(closes); + //console.log(closes); // If today is after or equal to the opens date and before the closes date, add the job to the openJobs array. if ( today >= opens && closes > today ) { From b2c3c5d4eb8a3de77aac884889a8f046e63de707 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 11:39:27 -0400 Subject: [PATCH 03/37] More logging --- _includes/scripts.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_includes/scripts.html b/_includes/scripts.html index d6fb8255..5ab24640 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -60,6 +60,7 @@ } if ( window.location.pathname === '/join/' ) { + console.log(true); const allJobs = []; {% for job in collections.jobs %} allJobs.push({ @@ -75,6 +76,8 @@ } + console.log(allJobs); + function sortJobs(allJobs) { const openJobs = []; const upcomingJobs = []; From 375bfad0758037531b912fbdc33e5ae4561ec8a5 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 11:40:27 -0400 Subject: [PATCH 04/37] Window location log --- _includes/scripts.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index 5ab24640..2388739e 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -76,7 +76,7 @@ } - console.log(allJobs); + console.log(window.location.pathname); function sortJobs(allJobs) { const openJobs = []; From 90905f1557e3363a17c6b672d15a617785c4819e Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 11:42:56 -0400 Subject: [PATCH 05/37] Test pathname fix --- _includes/scripts.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index 2388739e..51bba992 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -59,8 +59,11 @@ return `${year}-${month}-${day}`; // Format as 'yyyy-mm-dd' } - if ( window.location.pathname === '/join/' ) { - console.log(true); + const path = window.location.pathname; + const pathSegments = path.split('/'); + const lastPathItem = pathSegments[pathSegments.length - 1]; + + if ( lastPathItem === '/join/' ) { const allJobs = []; {% for job in collections.jobs %} allJobs.push({ From e991cf7fd8b96dc324428cda4224f9909e0bce37 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 11:43:41 -0400 Subject: [PATCH 06/37] Readd other logging --- _includes/scripts.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index 51bba992..9fe7f2ed 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -64,6 +64,7 @@ const lastPathItem = pathSegments[pathSegments.length - 1]; if ( lastPathItem === '/join/' ) { + console.log(true) const allJobs = []; {% for job in collections.jobs %} allJobs.push({ @@ -79,7 +80,7 @@ } - console.log(window.location.pathname); + console.log(allJobs); function sortJobs(allJobs) { const openJobs = []; From b074ff0d37d5f1e397decb75d8c959a5ed34a118 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 11:44:54 -0400 Subject: [PATCH 07/37] More logging --- _includes/scripts.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_includes/scripts.html b/_includes/scripts.html index 9fe7f2ed..cc467876 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -63,6 +63,8 @@ const pathSegments = path.split('/'); const lastPathItem = pathSegments[pathSegments.length - 1]; + console.log(lastPathItem); + if ( lastPathItem === '/join/' ) { console.log(true) const allJobs = []; From d03b08127314b4f1ecf08e3d21377f0bfca5b699 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 11:46:45 -0400 Subject: [PATCH 08/37] Ignore the last / --- _includes/scripts.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index cc467876..567991a7 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -61,7 +61,7 @@ const path = window.location.pathname; const pathSegments = path.split('/'); - const lastPathItem = pathSegments[pathSegments.length - 1]; + const lastPathItem = pathSegments.filter(segment => segment !== '').pop(); console.log(lastPathItem); From b00c56d31a1aabd9d6e2faacfec08418d8118274 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 11:47:41 -0400 Subject: [PATCH 09/37] Lets get going --- _includes/scripts.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index 567991a7..e307d8b6 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -63,9 +63,7 @@ const pathSegments = path.split('/'); const lastPathItem = pathSegments.filter(segment => segment !== '').pop(); - console.log(lastPathItem); - - if ( lastPathItem === '/join/' ) { + if ( lastPathItem === 'join' ) { console.log(true) const allJobs = []; {% for job in collections.jobs %} From 7e5a3c9d87494854c3f3c9d5eb7451d31a34ac79 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 11:51:45 -0400 Subject: [PATCH 10/37] Check filtered dates --- _includes/scripts.html | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index e307d8b6..9a71d726 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -64,24 +64,21 @@ const lastPathItem = pathSegments.filter(segment => segment !== '').pop(); if ( lastPathItem === 'join' ) { - console.log(true) const allJobs = []; - {% for job in collections.jobs %} - allJobs.push({ - title: "{{ job.data.title }}", - url: "{{ job.url }}", - external_url: "{{ pg.data.external_url }}", - opens: "{{ job.data.opens }}", - closes: "{{ job.data.closes }}" - }); - {% endfor %} + + {% for job in collections.jobs %} + allJobs.push({ + title: "{{ job.data.title }}", + url: "{{ job.url }}", + external_url: "{{ pg.data.external_url }}", + opens: "{{ job.data.opens | htmlDateString }}", + closes: "{{ job.data.closes | htmlDateString }}" + }); + {% endfor %} sortJobs(allJobs); - } - console.log(allJobs); - function sortJobs(allJobs) { const openJobs = []; const upcomingJobs = []; @@ -93,7 +90,7 @@ const closes = job.closes !== '' ? job.closes : ''; - //console.log(closes); + console.log(today); // If today is after or equal to the opens date and before the closes date, add the job to the openJobs array. if ( today >= opens && closes > today ) { @@ -101,7 +98,7 @@ } }); - console.log(openJobs) + console.log('openJobs', openJobs) } function hidePastInfoSessions(currentTimestamp) { From c08bdc2e39ba856b745684ad9449710f2ff9fc1f Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 11:53:04 -0400 Subject: [PATCH 11/37] Update htmlDateString function --- .eleventy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eleventy.js b/.eleventy.js index 74bcc438..ba1ebf6c 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -249,7 +249,7 @@ module.exports = function (config) { // https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string config.addFilter("htmlDateString", (dateObj) => { - return DateTime.fromJSDate(dateObj, { zone: "America/New_York" }).toFormat( + return DateTime.fromJSDate(dateObj).toFormat( "yyyy-LL-dd", ); }); From f412f1555ed0f0a13db6188696d50d5da0ca2bbc Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 12:18:32 -0400 Subject: [PATCH 12/37] Refactors the htmlDateString --- .eleventy.js | 16 +++++++++++++--- _includes/scripts.html | 3 +-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index ba1ebf6c..c013770c 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -249,9 +249,19 @@ module.exports = function (config) { // https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string config.addFilter("htmlDateString", (dateObj) => { - return DateTime.fromJSDate(dateObj).toFormat( - "yyyy-LL-dd", - ); + + if ( dateObj !== undefined && dateObj !== null ) { + let dateTime = DateTime.fromJSDate(dateObj); + + // If working locally, add one day to the date to match what is in the actual environments. + if ( baseUrl.includes('localhost') ) { + dateTime = dateTime.plus({ days: 1 }); + return dateTime.toFormat("yyyy-LL-dd"); + } else { + return dateTime.toFormat("yyyy-LL-dd"); + } + } + }); // Get the first `n` elements of a collection. diff --git a/_includes/scripts.html b/_includes/scripts.html index 9a71d726..c5c571ad 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -85,12 +85,11 @@ const today = formatDate(now); allJobs.forEach(job => { - console.log(job) const opens = job.opens !== '' ? job.opens : ''; const closes = job.closes !== '' ? job.closes : ''; - console.log(today); + console.log(closes); // If today is after or equal to the opens date and before the closes date, add the job to the openJobs array. if ( today >= opens && closes > today ) { From cd2b1c7f23c2c897df661c6ccbbe6a7f0640bd8c Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 12:51:29 -0400 Subject: [PATCH 13/37] Dom manipulation --- _includes/layouts/jointts/jobs.html | 5 - _includes/scripts.html | 120 +++++++++++++++--- .../positions/login-gov-data-analyist.md | 12 +- 3 files changed, 107 insertions(+), 30 deletions(-) diff --git a/_includes/layouts/jointts/jobs.html b/_includes/layouts/jointts/jobs.html index ca01e2b8..6b15e2c7 100644 --- a/_includes/layouts/jointts/jobs.html +++ b/_includes/layouts/jointts/jobs.html @@ -2,15 +2,10 @@

Open positions

We are hiring and will be sharing upcoming jobs and open positions as they are available.

- -

Upcoming positions

- -
diff --git a/_includes/scripts.html b/_includes/scripts.html index c5c571ad..7bc408e0 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -72,7 +72,8 @@ url: "{{ job.url }}", external_url: "{{ pg.data.external_url }}", opens: "{{ job.data.opens | htmlDateString }}", - closes: "{{ job.data.closes | htmlDateString }}" + closes: "{{ job.data.closes | htmlDateString }}", + info_sessions: "{{ job.data.info_sessions }}" }); {% endfor %} @@ -80,26 +81,117 @@ } function sortJobs(allJobs) { - const openJobs = []; - const upcomingJobs = []; - const today = formatDate(now); - - allJobs.forEach(job => { - const opens = job.opens !== '' ? job.opens : ''; + const openJobs = []; + const upcomingJobs = []; + const today = formatDate(now); + + allJobs.forEach(job => { + const opens = job.opens !== '' ? job.opens : ''; + + const closes = job.closes !== '' ? job.closes : ''; + + + // If there is an opens date and; + // If today is after or equal to the opens date and before the closes date, add the job to the openJobs array. + // Also add it if today is after or equal to the opens date and there is no close date. + if ( opens !== '' && ( ( today >= opens && closes > today ) || ( today >= opens && closes === '' ) ) ) { + + // Make sure it doesn't push the base index page. + if ( job.title !== '' ) { + openJobs.push(job); + } + } - const closes = job.closes !== '' ? job.closes : ''; + // If today is before the opens date and before the closes date, add the job to the upcomingJobs array. + // Also add it if no dates are added to the opens and closes fields + // Also add it if today is before the opens date and there is no close date + if ( ( opens > today && closes > today ) || ( opens === '' && closes === '' ) || opens > today && closes > today ) { + // Make sure it doesn't push the base index page. + if ( job.title !== '' ) { + upcomingJobs.push(job); + } + } + }); - console.log(closes); + addOpenJobsToDOM(openJobs); + addUpcomingJobsToDOM(upcomingJobs); + } - // If today is after or equal to the opens date and before the closes date, add the job to the openJobs array. - if ( today >= opens && closes > today ) { - openJobs.push(job); + function addOpenJobsToDOM(openJobs) { + const openJobsSection = document.querySelector('.open-jobs'); + const jobList = document.createElement('ul'); + + jobList.style.paddingLeft = '3ch'; + + if ( openJobs.length > 0 ) { + openJobs.forEach(job => { + const listItem = document.createElement('li'); + const link = document.createElement('a'); + + listItem.style.marginBottom = '0.25em'; + link.style.color = '#005ea2'; + + // Set the link URL + const linkUrl = job.external_url !== '' ? job.external_url : job.url; + link.href = linkUrl; + + // Set the target attribute for external links to open in a new window + if (job.external_url !== '') { + link.target = '_blank'; // Open in a new window } + + // Set the text content to the job title + link.textContent = job.title; + + // Append the link to the list item, and the list item to the list + listItem.appendChild(link); + jobList.appendChild(listItem); }); - console.log('openJobs', openJobs) + openJobsSection.appendChild(jobList); + } else { + const noJobsText = document.createElement('p'); + noJobsText.innerHTML = 'No open positions at this time. Sign up for job alerts!'; + + openJobsSection.appendChild(noJobsText); + } + } + function addUpcomingJobsToDOM(upcomingJobs) { + const upcomingJobsSection = document.querySelector('.upcoming-jobs'); + const jobList = document.createElement('ul'); + + jobList.style.paddingLeft = '3ch'; + + upcomingJobs.forEach(job => { + const listItem = document.createElement('li'); + const link = document.createElement('a'); + + listItem.style.marginBottom = '0.25em'; + link.style.color = '#005ea2'; + + // Set the link URL + const linkUrl = job.external_url !== '' ? job.external_url : job.url; + link.href = linkUrl; + + // Set the target attribute for external links to open in a new window + if (job.external_url !== '') { + link.target = '_blank'; // Open in a new window + } + + // Set the text content to the job title + link.textContent = job.title; + + // Append the link to the list item, and the list item to the list + listItem.appendChild(link); + jobList.appendChild(listItem); + }); + + upcomingJobsSection.appendChild(jobList); + } + + function hidePastInfoSessions(currentTimestamp) { const infoSessionsGroup = document.querySelectorAll(".info-sessions-list"); @@ -110,8 +202,6 @@ Array.from(sessionGroup.children).forEach(session => { const session_timestamp = session.getAttribute('data-session-end-timestamp'); - console.log(currentTimestamp); - // Hide past sessions if (session_timestamp < currentTimestamp) { session.style.display = 'none'; // Hide past session diff --git a/pages/jointts/positions/login-gov-data-analyist.md b/pages/jointts/positions/login-gov-data-analyist.md index 4a5edec1..3b3758fc 100644 --- a/pages/jointts/positions/login-gov-data-analyist.md +++ b/pages/jointts/positions/login-gov-data-analyist.md @@ -43,8 +43,8 @@ external_url: # Put the opening and closing dates of your posting here, if you have them # These dates MUST be formatted as YYYY-MM-DD, where month and day are 2-digits -opens: 2024-10-03 -closes: 2024-10-30 +opens: +closes: # To show the status alert for this job, leave this set to true. To hide it, change to false # To show the alert keyword association message, add the keywords separated by a semi-colon @@ -137,14 +137,6 @@ role_summary: | This position is a tactical, collaborative, outward-facing role that will require a blend of product and data expertise, a focus on consistency and quality, and a future-focused view for how Login.gov can use data in service of its mission. -qualifications: | - Provide as much detail as possible on your resume so that we can evaluate your - previous experience. Follow our [guidance on creating a federal style resume](https://join.tts.gsa.gov/resume/). Failure to provide required information may result in disqualification. - - For each job on your resume, provide: - - The exact dates you held each job (from month/year to month/year or "present") - - Number of hours per week you worked (if part time) - # Make sure to leave the | on the first line. Start your content on the following line. specialized_requirements: | - Implementing and integrating appropriate technology, architecture, and tooling to support data science activities, including artificial intelligence/machine learning capabilities. From 0bdfc90bb5cd2dbcd6b0412ab3b95c551f8ab0fb Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 12:54:31 -0400 Subject: [PATCH 14/37] Styling fixes --- _data/assetPaths.json | 5 ++--- styles/tts-custom-styles.scss | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/_data/assetPaths.json b/_data/assetPaths.json index e35e2aab..22cdf42d 100644 --- a/_data/assetPaths.json +++ b/_data/assetPaths.json @@ -3,7 +3,6 @@ "admin.map": "/assets/js/admin-77FHK54G.js.map", "app.js": "/assets/js/app-U5OIPSUD.js", "app.map": "/assets/js/app-U5OIPSUD.js.map", - "uswds.js": "/assets/js/uswds-init.js", - "styles.css": "/assets/styles/styles-6UNDCLW2.css", - "styles.map": "/assets/styles/styles-6UNDCLW2.css.map" + "styles.css": "/assets/styles/styles-SWKD6Z4A.css", + "styles.map": "/assets/styles/styles-SWKD6Z4A.css.map" } \ No newline at end of file diff --git a/styles/tts-custom-styles.scss b/styles/tts-custom-styles.scss index 14a078f7..be340d25 100644 --- a/styles/tts-custom-styles.scss +++ b/styles/tts-custom-styles.scss @@ -61,6 +61,13 @@ $tts-title-banner-h1-foreground-color: #fff; color: #005ea2 } +.usa-prose h2 { + font-size: 1.95rem; + line-height: 1.2; + font-weight: 700; + margin-top: 1.5em; +} + footer { a { color: color('base-lightest'); From e0c9203a367c220c5c2683f9c2305fbbb3bf5b6b Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Thu, 3 Oct 2024 13:01:10 -0400 Subject: [PATCH 15/37] Adds the no upcoming jobs message --- _includes/scripts.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index 7bc408e0..39443570 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -164,7 +164,8 @@ jobList.style.paddingLeft = '3ch'; - upcomingJobs.forEach(job => { + if ( upcomingJobs.length > 0 ) { + upcomingJobs.forEach(job => { const listItem = document.createElement('li'); const link = document.createElement('a'); @@ -189,6 +190,14 @@ }); upcomingJobsSection.appendChild(jobList); + + } else { + const noJobsText = document.createElement('p'); + noJobsText.innerHTML = 'No upcoming positions at this time. Sign up for job alerts!'; + + openJobsSection.appendChild(noJobsText); + } + } From fc8c6d55ff59ac93d477d5dcd6ab98731cf4cb55 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Fri, 4 Oct 2024 11:31:48 -0400 Subject: [PATCH 16/37] Info sessions JS --- _includes/scripts.html | 110 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index 39443570..037c0372 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -73,7 +73,7 @@ external_url: "{{ pg.data.external_url }}", opens: "{{ job.data.opens | htmlDateString }}", closes: "{{ job.data.closes | htmlDateString }}", - info_sessions: "{{ job.data.info_sessions }}" + info_sessions: {{ job.data.info_sessions | jsonify }} }); {% endfor %} @@ -146,6 +146,12 @@ // Append the link to the list item, and the list item to the list listItem.appendChild(link); jobList.appendChild(listItem); + + // Let's add the future info sessions under this item. + const infoSessions = job.info_sessions; + if ( infoSessions.length > 0 ) { + renderInfoSessions(infoSessions, listItem, job.title); + } }); openJobsSection.appendChild(jobList); @@ -201,6 +207,108 @@ } + function renderInfoSessions(infoSessions, linkItem, jobTitle) { + // Create the unordered list that the info sessions will be assigned to. + const infoSessionsList = document.createElement('ul'); + + // Iterate through all the info sessions. + infoSessions.forEach(session => { + // Lets get all our variables together for converting the end time into a timestamp. + const sessionSimpleDate = session['date'].split('T')[0]; + const sessionTime = session['time']; + const [startTime, endTime] = sessionTime.split('-') + + // Convert the end date and time into a UTC timestamp and get the current time as a UTC timestamp. + const sessionEndDateTime = new Date(`${sessionSimpleDate} ${endTime.replace('pm', ' PM').replace('am', ' AM')}`); + const sessionEndTimestamp = sessionEndDateTime.getTime(); + const now = new Date(); + const nowTimestamp = now.getTime(); + + // If the session hasn't ended, show it. + if ( sessionEndTimestamp > nowTimestamp ) { + const infoSession = document.createElement('li'); + + const sessionDate = new Date(session['date']).toLocaleDateString('en-US', { + weekday: 'long', + year: 'numeric', + month: 'long', + day: 'numeric' + }); + + const formattedTime = formatSessionTimes(sessionTime); + + const infoSessionLink = document.createElement('a'); + infoSessionLink.href = session.link; + infoSessionLink.target = '_blank'; + infoSessionLink.rel = 'noopener noreferrer'; + infoSessionLink.innerText = sessionDate; + + const sessionText = document.createElement('p'); + sessionText.appendChild(infoSessionLink); + + // Add the text for the time after the link + sessionText.appendChild(document.createTextNode(' at ' + formattedTime)); + + // Append the paragraph to the list item + infoSession.appendChild(sessionText); + + // Finally, append the list item to the infoSessionsList + infoSessionsList.appendChild(infoSession); + } + }); + + // If there are info sessions any info sessions in the list, generate the HTML to display them + if ( infoSessionsList.childElementCount !== 0 ) { + const wrapper = document.createElement('aside'); + wrapper.classList.add('usa-alert-info'); + wrapper.classList.add('usa-alert'); + const innerDiv = document.createElement('div'); + innerDiv.classList.add('usa-alert-body'); + const headline = document.createElement('p'); + headline.innerHTML = `Upcoming or ongoing info sessions for ${jobTitle}`; + + wrapper.appendChild(innerDiv); + innerDiv.appendChild(headline); + + innerDiv.appendChild(infoSessionsList); + + linkItem.appendChild(wrapper); + } + + } + + // Function to format the session times into a readable string with Eastern and Pacific times + function formatSessionTimes(sessionTime) { + const [startTime, endTime] = sessionTime.split('-'); + + // Convert the start and end times to both Eastern Time (ET) and Pacific Time (PT) + const startET = convertTimeToZone(startTime, 'America/New_York'); + const endET = convertTimeToZone(endTime, 'America/New_York'); + const startPT = convertTimeToZone(startTime, 'America/Los_Angeles'); + const endPT = convertTimeToZone(endTime, 'America/Los_Angeles'); + + // Format the result: ET times with PT equivalents + return `${startET}-${endET} ET (${startPT}-${endPT} PT)`; + } + + // Helper function to convert the time to a specific timezone + function convertTimeToZone(time, timeZone) { + const now = new Date(); // Get today's date + const [hours, minutes, period] = time.match(/(\d+):(\d+)([ap]m)/i).slice(1); // Extract hours, minutes, period (am/pm) + + // Create a date object using today's date and the given time in the desired timezone (ET or PT) + const date = new Date(`${now.toLocaleDateString()} ${hours}:${minutes} ${period}`); + + // Convert the time to the specified timezone (America/New_York for ET, America/Los_Angeles for PT) + return new Intl.DateTimeFormat('en-US', { + hour: 'numeric', + minute: 'numeric', + hour12: true, + timeZone: timeZone, + }).format(date); + } + + function hidePastInfoSessions(currentTimestamp) { const infoSessionsGroup = document.querySelectorAll(".info-sessions-list"); From 75cbbef0b5fb73ce9471c5dcd045b6f9e05da651 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Fri, 4 Oct 2024 12:05:15 -0400 Subject: [PATCH 17/37] Fix the date day offset --- _includes/scripts.html | 50 ++++++++++-------------------------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index 037c0372..62ba9d32 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -51,14 +51,6 @@ const now = new Date(); const currentTimestamp = Math.floor(new Date(now).getTime() / 1000); - function formatDate(date) { - const year = date.getFullYear(); // Get the four-digit year - const month = String(date.getMonth() + 1).padStart(2, '0'); // Get the month (0-11) and add 1; pad with 0 if needed - const day = String(date.getDate()).padStart(2, '0'); // Get the day of the month; pad with 0 if needed - - return `${year}-${month}-${day}`; // Format as 'yyyy-mm-dd' - } - const path = window.location.pathname; const pathSegments = path.split('/'); const lastPathItem = pathSegments.filter(segment => segment !== '').pop(); @@ -228,11 +220,12 @@ if ( sessionEndTimestamp > nowTimestamp ) { const infoSession = document.createElement('li'); - const sessionDate = new Date(session['date']).toLocaleDateString('en-US', { + const sessionDate = new Date(sessionSimpleDate).toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', - day: 'numeric' + day: 'numeric', + timeZone: 'UTC', }); const formattedTime = formatSessionTimes(sessionTime); @@ -277,6 +270,15 @@ } + // Function to format dates. + function formatDate(date) { + const year = date.getFullYear(); // Get the four-digit year + const month = String(date.getMonth() + 1).padStart(2, '0'); // Get the month (0-11) and add 1; pad with 0 if needed + const day = String(date.getDate()).padStart(2, '0'); // Get the day of the month; pad with 0 if needed + + return `${year}-${month}-${day}`; // Format as 'yyyy-mm-dd' + } + // Function to format the session times into a readable string with Eastern and Pacific times function formatSessionTimes(sessionTime) { const [startTime, endTime] = sessionTime.split('-'); @@ -308,32 +310,4 @@ }).format(date); } - - function hidePastInfoSessions(currentTimestamp) { - const infoSessionsGroup = document.querySelectorAll(".info-sessions-list"); - - infoSessionsGroup.forEach(sessionGroup => { - let visibleSessions = 0; - - // Convert sessionGroup.children to an array and loop over them - Array.from(sessionGroup.children).forEach(session => { - const session_timestamp = session.getAttribute('data-session-end-timestamp'); - - // Hide past sessions - if (session_timestamp < currentTimestamp) { - session.style.display = 'none'; // Hide past session - } else { - visibleSessions++; // Count future session - } - }); - - if (visibleSessions === 0) { - const asideParent = sessionGroup.closest('aside'); - if (asideParent) { - asideParent.style.display = 'none'; - } - } - }); - } - hidePastInfoSessions(currentTimestamp); From 9be788604ef7dbed7ec133e09546e6edc91e768a Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Fri, 4 Oct 2024 12:06:12 -0400 Subject: [PATCH 18/37] Test listing --- pages/jointts/positions/login-gov-data-analyist.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/jointts/positions/login-gov-data-analyist.md b/pages/jointts/positions/login-gov-data-analyist.md index 3b3758fc..5e37d33e 100644 --- a/pages/jointts/positions/login-gov-data-analyist.md +++ b/pages/jointts/positions/login-gov-data-analyist.md @@ -43,8 +43,8 @@ external_url: # Put the opening and closing dates of your posting here, if you have them # These dates MUST be formatted as YYYY-MM-DD, where month and day are 2-digits -opens: -closes: +opens: 2024-10-01 +closes: 2024-10-30 # To show the status alert for this job, leave this set to true. To hide it, change to false # To show the alert keyword association message, add the keywords separated by a semi-colon @@ -123,11 +123,11 @@ key_objectives: # session. If the position does not have any info sessions, you can delete everything # except "info_sessions:" # IMPORTANT: The date MUST be formatted as YYYY-MM-DD, where the month and day -# are TWO digits +# are TWO digits; the time MUST be in ET. info_sessions: - link: https://gsa.zoomgov.com/webinar/register/WN_vCL_dfX_Swqb9ZIbNatDtw - date: 2024-10-01 - time: 3:00pm-4:00pm ET (12:00pm - 1:00pm PT) + date: 2024-10-05 + time: 10:00am-11:00am # Make sure to leave the | on the first line. Start your content on the following line. role_summary: | From f5d34170741bae0a20326075429f1d87a3a2d076 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Fri, 4 Oct 2024 12:20:11 -0400 Subject: [PATCH 19/37] Test removal --- pages/jointts/positions/login-gov-data-analyist.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/jointts/positions/login-gov-data-analyist.md b/pages/jointts/positions/login-gov-data-analyist.md index 5e37d33e..935f2ad6 100644 --- a/pages/jointts/positions/login-gov-data-analyist.md +++ b/pages/jointts/positions/login-gov-data-analyist.md @@ -126,8 +126,8 @@ key_objectives: # are TWO digits; the time MUST be in ET. info_sessions: - link: https://gsa.zoomgov.com/webinar/register/WN_vCL_dfX_Swqb9ZIbNatDtw - date: 2024-10-05 - time: 10:00am-11:00am + date: 2024-10-04 + time: 10:00am-12:25pm # Make sure to leave the | on the first line. Start your content on the following line. role_summary: | From 54a2cd60f7e1c2eb38198c89e3b4280c04ea489c Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Fri, 4 Oct 2024 13:48:27 -0400 Subject: [PATCH 20/37] The global info sessions sidebar --- _data/global_info_sessions.yml | 6 +- .../jointts/info-sessions-sidebar.html | 11 +-- .../jointts/job-listing-info-sessions.html | 57 ------------- .../layouts/jointts/job/status_alert.html | 2 +- _includes/layouts/jointts/open-jobs.html | 29 ------- _includes/layouts/jointts/upcoming-jobs.html | 38 --------- _includes/scripts.html | 84 ++++++++++++++++++- .../Communities-Collaboration-Branch-Chief.md | 1 - .../PX-Content-Outreach-BranchChief.md | 3 - .../positions/login-gov-data-analyist.md | 4 +- .../organizational_culture_specialist.md | 12 +-- pages/jointts/positions/position-template.md | 7 +- 12 files changed, 92 insertions(+), 162 deletions(-) delete mode 100644 _includes/layouts/jointts/job-listing-info-sessions.html delete mode 100644 _includes/layouts/jointts/open-jobs.html delete mode 100644 _includes/layouts/jointts/upcoming-jobs.html diff --git a/_data/global_info_sessions.yml b/_data/global_info_sessions.yml index 00b70f3f..d09fcb72 100644 --- a/_data/global_info_sessions.yml +++ b/_data/global_info_sessions.yml @@ -21,10 +21,8 @@ --- - link: https://gsa.zoomgov.com/meeting/register/vJIsc-qhqj0jHl6nkKV8IA7TyuNDlxlHeV8 date: 2024-10-17 - time-et: 12:30-1:30pm ET - time-pt: 9:30-10:30am PT + time: 12:30pm-1:30pm - link: https://gsa.zoomgov.com/webinar/register/WN_xKx0akUhTLClTGto7jmXeQ# date: 2024-11-21 - time-et: 12:30-1:30pm ET - time-pt: 9:30-10:30am PT + time: 12:30pm-1:30pm diff --git a/_includes/layouts/jointts/info-sessions-sidebar.html b/_includes/layouts/jointts/info-sessions-sidebar.html index 7959b99e..329775a4 100644 --- a/_includes/layouts/jointts/info-sessions-sidebar.html +++ b/_includes/layouts/jointts/info-sessions-sidebar.html @@ -2,17 +2,8 @@

Join an info session

-
+

Join us at one of our monthly online information sessions. Come learn more about working at TTS, available positions, and our application process. Register for a session below.

-
diff --git a/_includes/layouts/jointts/job-listing-info-sessions.html b/_includes/layouts/jointts/job-listing-info-sessions.html deleted file mode 100644 index bef66fa0..00000000 --- a/_includes/layouts/jointts/job-listing-info-sessions.html +++ /dev/null @@ -1,57 +0,0 @@ - -{% assign now = 'now' | date: "%s" %} -{% assign future_sessions = false %} - -{% for session in pg.data.info_sessions %} - - {% assign session_date = session.date | date: "%Y-%m-%d" %} - - - {% assign time_et = session.time | split: " ET" | first %} - - - {% assign session_end_time = time_et | split: "-" | last | strip %} - - - {% assign session_end_str = session_date | append: " " | append: session_end_time %} - - {% capture sessionEndTimestamp %}{% getDateTimeinSeconds session_end_str %}{% endcapture %} - - - {% if sessionEndTimestamp > now %} - {% assign future_sessions = true %} - {% break %} - {% endif %} -{% endfor %} - -{% if future_sessions %} - -{% endif %} diff --git a/_includes/layouts/jointts/job/status_alert.html b/_includes/layouts/jointts/job/status_alert.html index 814f9ace..73dd92a8 100644 --- a/_includes/layouts/jointts/job/status_alert.html +++ b/_includes/layouts/jointts/job/status_alert.html @@ -21,7 +21,7 @@

Coming soon

Apply now!

-

This role is open for applications until {{ closes | date: "%A, %B %d, %Y" }}.

+

This role is open for applications until {{ closes | date: "%A, %B %d, %Y" }} at 11:59 PM ET.

{% endif %} diff --git a/_includes/layouts/jointts/open-jobs.html b/_includes/layouts/jointts/open-jobs.html deleted file mode 100644 index 6b12cf21..00000000 --- a/_includes/layouts/jointts/open-jobs.html +++ /dev/null @@ -1,29 +0,0 @@ -
    - {% assign open_job_count = 0 %} - {% for pg in collections.jobs %} - {% capture state %}{% getStateFromDates pg.data.opens pg.data.closes %}{% endcapture %} - {% if state == "open" %} - {% unless pg.data.path contains 'template' %} - {% unless pg.data.path contains 'performance-profiles' %} - {% assign open_job_count = open_job_count | plus: 1 %} -
  • - {% if pg.data.external_url %} - {{ pg.data.title }} - {% else %} - {{ pg.data.title }} - {% endif %} - (Open now {% if pg.data.weeks_open %}for {% if pg.data.weeks < 52 %}{{ pg.data.weeks }}{% else %} one year or until all selections have been made{% endif %},{% endif %} through {{ pg.data.closes | date: '%A, %B %e, %Y at 11:59pm' }} ET) - - - {% include "layouts/jointts/job-listing-info-sessions.html" %} - -
  • - {% endunless %} - {% endunless %} - {% endif %} - {% endfor %} -
- - {% if open_job_count == 0 %} -

No open positions at this time. Sign up for job alerts!

- {% endif %} \ No newline at end of file diff --git a/_includes/layouts/jointts/upcoming-jobs.html b/_includes/layouts/jointts/upcoming-jobs.html deleted file mode 100644 index dcf0ee28..00000000 --- a/_includes/layouts/jointts/upcoming-jobs.html +++ /dev/null @@ -1,38 +0,0 @@ -
    - {% assign upcoming_job_count = 0 %} - - {% for pg in collections.jobs %} - {% capture state %}{% getStateFromDates pg.data.opens pg.data.closes %}{% endcapture %} - - {% assign show_job = false %} - - {% if pg.data.title != "" %} - {% if state == "upcoming" %} - {% assign show_job = true %} - {% elsif state == "unknown" %} - {% assign show_job = true %} - {% endif %} - {% endif %} - - {% if show_job %} - {% assign upcoming_job_count = upcoming_job_count | plus: 1 %} - {% unless pg.data.path contains 'template' %} - {% unless pg.data.path contains 'performance-profiles' %} -
  • - {% if pg.data.external_url %} - {{ pg.data.title }} - {% else %} - {{ pg.data.title }} - {% endif %} - - {% include "layouts/jointts/job-listing-info-sessions.html" %} -
  • - {% endunless %} - {% endunless %} - {% endif %} - {% endfor %} -
- - {% if upcoming_job_count == 0 %} -

No upcoming positions at this time. Sign up for job alerts!

- {% endif %} \ No newline at end of file diff --git a/_includes/scripts.html b/_includes/scripts.html index 62ba9d32..4fad3784 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -70,6 +70,20 @@ {% endfor %} sortJobs(allJobs); + + + const globalInfoSessions = []; + + {% for session in global_info_sessions %} + globalInfoSessions.push({ + link: "{{ session.link }}", + date: "{{ session.date | htmlDateString }}", + time: "{{ session.time }}", + }); + {% endfor %} + + renderGlobalInfoSessions(globalInfoSessions); + } function sortJobs(allJobs) { @@ -185,6 +199,12 @@ // Append the link to the list item, and the list item to the list listItem.appendChild(link); jobList.appendChild(listItem); + + // Let's add the future info sessions under this item. + const infoSessions = job.info_sessions; + if ( infoSessions && infoSessions.length > 0 ) { + renderInfoSessions(infoSessions, listItem, job.title); + } }); upcomingJobsSection.appendChild(jobList); @@ -205,8 +225,8 @@ // Iterate through all the info sessions. infoSessions.forEach(session => { - // Lets get all our variables together for converting the end time into a timestamp. - const sessionSimpleDate = session['date'].split('T')[0]; + // Lets get all our variables together for converting the end time into a timestamp. + const sessionSimpleDate = session['date'] ? session['date'].split('T')[0] : ''; const sessionTime = session['time']; const [startTime, endTime] = sessionTime.split('-') @@ -270,6 +290,66 @@ } + + function renderGlobalInfoSessions(infoSessions) { + const globalInfoSessionsWrapper = document.getElementById('global-info-sessions-wrapper'); + const infoSessionsList = document.createElement('ul'); + + // Iterate through all the info sessions. + infoSessions.forEach(session => { + // Lets get all our variables together for converting the end time into a timestamp. + const sessionSimpleDate = session['date'].split('T')[0]; + const sessionTime = session['time']; + const [startTime, endTime] = sessionTime.split('-') + + // Convert the end date and time into a UTC timestamp and get the current time as a UTC timestamp. + const sessionEndDateTime = new Date(`${sessionSimpleDate} ${endTime.replace('pm', ' PM').replace('am', ' AM')}`); + const sessionEndTimestamp = sessionEndDateTime.getTime(); + const now = new Date(); + const nowTimestamp = now.getTime(); + + // If the session hasn't ended, show it. + if ( sessionEndTimestamp > nowTimestamp ) { + const infoSession = document.createElement('li'); + + const sessionDate = new Date(sessionSimpleDate).toLocaleDateString('en-US', { + weekday: 'long', + year: 'numeric', + month: 'long', + day: 'numeric', + timeZone: 'UTC', + }); + + const formattedTime = formatSessionTimes(sessionTime); + + const infoSessionLink = document.createElement('a'); + infoSessionLink.href = session.link; + infoSessionLink.target = '_blank'; + infoSessionLink.rel = 'noopener noreferrer'; + infoSessionLink.innerText = sessionDate; + + const sessionText = document.createElement('p'); + sessionText.style.marginTop = '0'; + + // Add the text for the time after the link + sessionText.innerText = formattedTime; + + // Append the paragraph to the list item + infoSession.appendChild(infoSessionLink); + infoSession.appendChild(sessionText); + + // Finally, append the list item to the infoSessionsList + infoSessionsList.appendChild(infoSession); + } + }); + + if ( infoSessionsList.childElementCount !== 0 ) { + globalInfoSessionsWrapper.appendChild(infoSessionsList); + } + + } + + // Function to format dates. function formatDate(date) { const year = date.getFullYear(); // Get the four-digit year diff --git a/pages/jointts/positions/Communities-Collaboration-Branch-Chief.md b/pages/jointts/positions/Communities-Collaboration-Branch-Chief.md index 81e417d3..ebd3b5b8 100644 --- a/pages/jointts/positions/Communities-Collaboration-Branch-Chief.md +++ b/pages/jointts/positions/Communities-Collaboration-Branch-Chief.md @@ -126,7 +126,6 @@ key_objectives: info_sessions: - link: https://gsa.zoomgov.com/meeting/register/vJItcOirqDMjGb3OT--z16iSZK_zxHHV85Y#/registration date: 2024-09-19 - headline: Thursday, September 19th, 2024 time: 1:30-2:30pm ET (10:30am -11:30am PT) diff --git a/pages/jointts/positions/PX-Content-Outreach-BranchChief.md b/pages/jointts/positions/PX-Content-Outreach-BranchChief.md index 9e041b81..3928c153 100644 --- a/pages/jointts/positions/PX-Content-Outreach-BranchChief.md +++ b/pages/jointts/positions/PX-Content-Outreach-BranchChief.md @@ -123,9 +123,6 @@ key_objectives: # IMPORTANT: The date MUST be formatted as YYYY-MM-DD, where the month and day # are TWO digits info_sessions: - - link: - date: - headline: # Make sure to leave the | on the first line. role_summary: | diff --git a/pages/jointts/positions/login-gov-data-analyist.md b/pages/jointts/positions/login-gov-data-analyist.md index 935f2ad6..bbffabb8 100644 --- a/pages/jointts/positions/login-gov-data-analyist.md +++ b/pages/jointts/positions/login-gov-data-analyist.md @@ -120,13 +120,13 @@ key_objectives: # If there are any info sessions associated with this position, list them here # See the placeholder below for an example of how to add an info -# session. If the position does not have any info sessions, you can delete everything +# session. If the position does not have any info sessions, you MUST delete everything # except "info_sessions:" # IMPORTANT: The date MUST be formatted as YYYY-MM-DD, where the month and day # are TWO digits; the time MUST be in ET. info_sessions: - link: https://gsa.zoomgov.com/webinar/register/WN_vCL_dfX_Swqb9ZIbNatDtw - date: 2024-10-04 + date: 2024-10-05 time: 10:00am-12:25pm # Make sure to leave the | on the first line. Start your content on the following line. diff --git a/pages/jointts/positions/organizational_culture_specialist.md b/pages/jointts/positions/organizational_culture_specialist.md index fc86a62e..a1efb10b 100644 --- a/pages/jointts/positions/organizational_culture_specialist.md +++ b/pages/jointts/positions/organizational_culture_specialist.md @@ -128,20 +128,12 @@ key_objectives: # If there are any info sessions associated with this position, list them here # See the placeholder below for an example of how to add an info -# session. If the position does not have any info sessions, you can delete everything +# session. If the position does not have any info sessions, you MUST delete everything # except "info_sessions:" - # IMPORTANT: The date MUST be formatted as YYYY-MM-DD, where the month and day # are TWO digits info_sessions: - - link: - date: - headline: - time: - - link: - date: - headline: - time: + # Make sure to leave the | on the first line. role_summary: | diff --git a/pages/jointts/positions/position-template.md b/pages/jointts/positions/position-template.md index 334f7674..48c514c6 100644 --- a/pages/jointts/positions/position-template.md +++ b/pages/jointts/positions/position-template.md @@ -109,19 +109,16 @@ key_objectives: # If there are any info sessions associated with this position, list them here # See the placeholder below for an example of how to add an info -# session. If the position does not have any info sessions, you can delete everything +# session. If the position does not have any info sessions, you MUST delete everything # except "info_sessions:" - # IMPORTANT: The date MUST be formatted as YYYY-MM-DD, where the month and day -# are TWO digits +# are TWO digits; the time MUST be in ET. info_sessions: - link: date: - headline: time: - link: date: - headline: time: # Make sure to leave the | on the first line. From f0daa99f18ea38c75afa380a1d0e7dc939c9604c Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Fri, 4 Oct 2024 14:11:33 -0400 Subject: [PATCH 21/37] Show/hide info sessions on single job template --- _includes/layouts/jointts/job-listing.html | 77 +------------------ _includes/scripts.html | 66 +++++++++++----- .../positions/login-gov-data-analyist.md | 3 - 3 files changed, 51 insertions(+), 95 deletions(-) diff --git a/_includes/layouts/jointts/job-listing.html b/_includes/layouts/jointts/job-listing.html index df10d152..532c48be 100644 --- a/_includes/layouts/jointts/job-listing.html +++ b/_includes/layouts/jointts/job-listing.html @@ -2,12 +2,6 @@ layout: layouts/default --- -{% if info_sessions.size > 0 %} - {%- assign sorted_info_sessions = info_sessions | sort: 'date' -%} -{% else %} - {%- assign sorted_info_sessions = global_info_sessions | sort: 'data' -%} -{% endif %} - {% capture state %}{% getStateFromDates opens closes %}{% endcapture %}
@@ -27,74 +21,6 @@

{{ title }}

{% endif %}
-
- {% assign now = 'now' | date: "%s" %} - {% assign future_sessions = false %} - - {% for session in sorted_info_sessions %} - - {% assign session_date = session.date | date: "%Y-%m-%d" %} - - - {% assign time_et = session.time | split: " ET" | first %} - - - {% assign session_end_time = time_et | split: "-" | last | strip %} - - - {% assign session_end_str = session_date | append: " " | append: session_end_time %} - - {% capture sessionEndTimestamp %}{% getDateTimeinSeconds session_end_str %}{% endcapture %} - - - {% if sessionEndTimestamp > now %} - {% assign future_sessions = true %} - {% break %} - {% endif %} - {% endfor %} - - {% if future_sessions %} -
-
-

- Attend an information session for this position -

-
- Attend an information session to learn more about these roles, working at TTS, and our application process. Register for a session using the links below. -
    - {% for session in sorted_info_sessions %} - - {% assign session_date = session.date | date: "%Y-%m-%d" %} - - - {% assign time_et = session.time | split: " ET" | first %} - - - {% assign session_end_time = time_et | split: "-" | last | strip %} - - - {% assign session_end_str = session_date | append: " " | append: session_end_time %} - - {% capture sessionEndTimestamp %}{% getDateTimeinSeconds session_end_str %}{% endcapture %} - - {{ session_end_time }} - {{ sessionEndTimestamp }} - {{ now }} - - - {% if sessionEndTimestamp > now %} -
  • -

    {{ session.date | date: "%A, %B %d, %Y" }} at {{session.time}}

    -
  • - {% endif %} - {% endfor %} -
-
-
-
- {% endif %} -
-
{% if updated %} {% assign updated_date = updated | date: "%B %d, %Y" %} @@ -112,6 +38,9 @@

{% endif %} {% include "layouts/jointts/job/how_to_apply.html" %}

+
+ +
diff --git a/_includes/scripts.html b/_includes/scripts.html index 4fad3784..edb24a18 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -51,11 +51,12 @@ const now = new Date(); const currentTimestamp = Math.floor(new Date(now).getTime() / 1000); - const path = window.location.pathname; - const pathSegments = path.split('/'); - const lastPathItem = pathSegments.filter(segment => segment !== '').pop(); + const layout = "{{layout}}"; - if ( lastPathItem === 'join' ) { + console.log(layout) + + // Initialize the functions needed for the main join page + if ( layout.includes('/jointts/home') ) { const allJobs = []; {% for job in collections.jobs %} @@ -86,6 +87,22 @@ } + // Initialize the functions needed for the job listings. + if ( layout.includes('/jointts/job-listing') ) { + const infoSessions = []; + {% for session in info_sessions %} + infoSessions.push({ + link: "{{ session.link }}", + date: "{{ session.date | htmlDateString }}", + time: "{{ session.time }}", + }); + {% endfor %} + + const infoSessionsWrapper = document.getElementById('job-listing-info-sessions'); + + renderInfoSessions(infoSessions, infoSessionsWrapper); + } + function sortJobs(allJobs) { const openJobs = []; const upcomingJobs = []; @@ -219,7 +236,7 @@ } - function renderInfoSessions(infoSessions, linkItem, jobTitle) { + function renderInfoSessions(infoSessions, linkItem, title = '') { // Create the unordered list that the info sessions will be assigned to. const infoSessionsList = document.createElement('ul'); @@ -272,20 +289,33 @@ // If there are info sessions any info sessions in the list, generate the HTML to display them if ( infoSessionsList.childElementCount !== 0 ) { - const wrapper = document.createElement('aside'); - wrapper.classList.add('usa-alert-info'); - wrapper.classList.add('usa-alert'); - const innerDiv = document.createElement('div'); - innerDiv.classList.add('usa-alert-body'); - const headline = document.createElement('p'); - headline.innerHTML = `Upcoming or ongoing info sessions for ${jobTitle}`; - wrapper.appendChild(innerDiv); - innerDiv.appendChild(headline); - - innerDiv.appendChild(infoSessionsList); - - linkItem.appendChild(wrapper); + if ( layout.includes('/home/') ) { + const wrapper = document.createElement('aside'); + wrapper.classList.add('usa-alert-info'); + wrapper.classList.add('usa-alert'); + const innerDiv = document.createElement('div'); + innerDiv.classList.add('usa-alert-body'); + const headline = document.createElement('p'); + headline.innerHTML = `Upcoming or ongoing info sessions for ${title}`; + wrapper.appendChild(innerDiv); + innerDiv.appendChild(headline); + + innerDiv.appendChild(infoSessionsList); + + linkItem.appendChild(wrapper); + } else { + const wrapper = document.createElement('div'); + wrapper.classList.add('usa-summary-box'); + const headline = document.createElement('h3'); + headline.innerHTML = `Attend an information session for this position`; + const subHeadline = document.createElement('p'); + subHeadline.innerText = `Attend an information session to learn more about these roles, working at TTS, and our application process. Register for a session using the links below.`; + wrapper.appendChild(headline); + wrapper.appendChild(subHeadline); + wrapper.appendChild(infoSessionsList); + linkItem.appendChild(wrapper); + } } } diff --git a/pages/jointts/positions/login-gov-data-analyist.md b/pages/jointts/positions/login-gov-data-analyist.md index bbffabb8..d192159f 100644 --- a/pages/jointts/positions/login-gov-data-analyist.md +++ b/pages/jointts/positions/login-gov-data-analyist.md @@ -125,9 +125,6 @@ key_objectives: # IMPORTANT: The date MUST be formatted as YYYY-MM-DD, where the month and day # are TWO digits; the time MUST be in ET. info_sessions: - - link: https://gsa.zoomgov.com/webinar/register/WN_vCL_dfX_Swqb9ZIbNatDtw - date: 2024-10-05 - time: 10:00am-12:25pm # Make sure to leave the | on the first line. Start your content on the following line. role_summary: | From 37e090b6b32f49ab72f901e1f1ca9158844f0fc3 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Fri, 4 Oct 2024 14:12:17 -0400 Subject: [PATCH 22/37] Remove test data from the login gov listing --- _data/assetPaths.json | 1 + .../positions/login-gov-data-analyist.md | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/_data/assetPaths.json b/_data/assetPaths.json index 22cdf42d..28483e04 100644 --- a/_data/assetPaths.json +++ b/_data/assetPaths.json @@ -3,6 +3,7 @@ "admin.map": "/assets/js/admin-77FHK54G.js.map", "app.js": "/assets/js/app-U5OIPSUD.js", "app.map": "/assets/js/app-U5OIPSUD.js.map", + "uswds.js": "/assets/js/uswds-init.js", "styles.css": "/assets/styles/styles-SWKD6Z4A.css", "styles.map": "/assets/styles/styles-SWKD6Z4A.css.map" } \ No newline at end of file diff --git a/pages/jointts/positions/login-gov-data-analyist.md b/pages/jointts/positions/login-gov-data-analyist.md index d192159f..89a53be6 100644 --- a/pages/jointts/positions/login-gov-data-analyist.md +++ b/pages/jointts/positions/login-gov-data-analyist.md @@ -43,8 +43,8 @@ external_url: # Put the opening and closing dates of your posting here, if you have them # These dates MUST be formatted as YYYY-MM-DD, where month and day are 2-digits -opens: 2024-10-01 -closes: 2024-10-30 +opens: +closes: # To show the status alert for this job, leave this set to true. To hide it, change to false # To show the alert keyword association message, add the keywords separated by a semi-colon @@ -120,11 +120,14 @@ key_objectives: # If there are any info sessions associated with this position, list them here # See the placeholder below for an example of how to add an info -# session. If the position does not have any info sessions, you MUST delete everything +# session. If the position does not have any info sessions, you can delete everything # except "info_sessions:" # IMPORTANT: The date MUST be formatted as YYYY-MM-DD, where the month and day -# are TWO digits; the time MUST be in ET. +# are TWO digits info_sessions: + - link: https://gsa.zoomgov.com/webinar/register/WN_vCL_dfX_Swqb9ZIbNatDtw + date: 2024-10-01 + time: 3:00pm-4:00pm ET (12:00pm - 1:00pm PT) # Make sure to leave the | on the first line. Start your content on the following line. role_summary: | @@ -134,6 +137,14 @@ role_summary: | This position is a tactical, collaborative, outward-facing role that will require a blend of product and data expertise, a focus on consistency and quality, and a future-focused view for how Login.gov can use data in service of its mission. +qualifications: | + Provide as much detail as possible on your resume so that we can evaluate your + previous experience. Follow our [guidance on creating a federal style resume](https://join.tts.gsa.gov/resume/). Failure to provide required information may result in disqualification. + + For each job on your resume, provide: + - The exact dates you held each job (from month/year to month/year or "present") + - Number of hours per week you worked (if part time) + # Make sure to leave the | on the first line. Start your content on the following line. specialized_requirements: | - Implementing and integrating appropriate technology, architecture, and tooling to support data science activities, including artificial intelligence/machine learning capabilities. From db86645d092aef150840bcae62567d7e7f317ab3 Mon Sep 17 00:00:00 2001 From: Wesley Dean Date: Fri, 4 Oct 2024 18:16:32 +0000 Subject: [PATCH 23/37] [MegaLinter] Apply linters fixes --- .eleventy.js | 6 ++---- _data/assetPaths.json | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index c013770c..84d00dcf 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -249,19 +249,17 @@ module.exports = function (config) { // https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string config.addFilter("htmlDateString", (dateObj) => { - - if ( dateObj !== undefined && dateObj !== null ) { + if (dateObj !== undefined && dateObj !== null) { let dateTime = DateTime.fromJSDate(dateObj); // If working locally, add one day to the date to match what is in the actual environments. - if ( baseUrl.includes('localhost') ) { + if (baseUrl.includes("localhost")) { dateTime = dateTime.plus({ days: 1 }); return dateTime.toFormat("yyyy-LL-dd"); } else { return dateTime.toFormat("yyyy-LL-dd"); } } - }); // Get the first `n` elements of a collection. diff --git a/_data/assetPaths.json b/_data/assetPaths.json index 6d3efaf7..fcb2c8af 100644 --- a/_data/assetPaths.json +++ b/_data/assetPaths.json @@ -6,4 +6,4 @@ "uswds.js": "/assets/js/uswds-init.js", "styles.css": "/assets/styles/styles-EQTR2GJL.css", "styles.map": "/assets/styles/styles-EQTR2GJL.css.map" -} \ No newline at end of file +} From 8120bd390ef15f39cfb8ecd7cb2d1c67c80b92a3 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Tue, 8 Oct 2024 12:03:43 -0400 Subject: [PATCH 24/37] Max applications on single listing --- _includes/layouts/jointts/job/how_to_apply.html | 12 +++++++++--- _includes/layouts/jointts/job/status_alert.html | 8 +++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/_includes/layouts/jointts/job/how_to_apply.html b/_includes/layouts/jointts/job/how_to_apply.html index 28576311..dc253630 100644 --- a/_includes/layouts/jointts/job/how_to_apply.html +++ b/_includes/layouts/jointts/job/how_to_apply.html @@ -14,9 +14,15 @@

This job posting has closed.

{% endif %}

{% elsif state == 'open' %} -

This role is open for applications until {{ closes | date: "%A, %B %d, %Y" }} at 11:59PM ET. - Please fill out all applicable fields. Click here to apply. -

+ {% if max_applications != 0 %} +

This role is open for applications until {{ closes | date: "%A, %B %d, %Y" }} at 11:59PM ET or until {{max_applications}} applications have been received. + Please fill out all applicable fields. Click here to apply. +

+ {% else %} +

This role is open for applications until {{ closes | date: "%A, %B %d, %Y" }} at 11:59PM ET. + Please fill out all applicable fields. Click here to apply. +

+ {% endif %}

Need Assistance in applying or have questions regarding this job opportunity, please email the TTS Talent Team at jointts@gsa.gov.

{% endif %} diff --git a/_includes/layouts/jointts/job/status_alert.html b/_includes/layouts/jointts/job/status_alert.html index 814f9ace..7b0939bf 100644 --- a/_includes/layouts/jointts/job/status_alert.html +++ b/_includes/layouts/jointts/job/status_alert.html @@ -21,7 +21,13 @@

Coming soon

Apply now!

-

This role is open for applications until {{ closes | date: "%A, %B %d, %Y" }}.

+ {% if max_applications != 0 %} +

+ This role is open for applications until {{ closes | date: "%A, %B %d, %Y" }} at 11:59PM ET or until {{max_applications}} applications have been received. +

+ {% else %} +

This role is open for applications until {{ closes | date: "%A, %B %d, %Y" }}.

+ {% endif %}
{% endif %} From 5b368fbe8cda780b7040f29e4323e582d9fe41a7 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Tue, 8 Oct 2024 12:10:56 -0400 Subject: [PATCH 25/37] Add max applicant language to /join/ page --- _includes/layouts/jointts/open-jobs.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_includes/layouts/jointts/open-jobs.html b/_includes/layouts/jointts/open-jobs.html index 6b12cf21..62026cf8 100644 --- a/_includes/layouts/jointts/open-jobs.html +++ b/_includes/layouts/jointts/open-jobs.html @@ -12,7 +12,8 @@ {% else %} {{ pg.data.title }} {% endif %} - (Open now {% if pg.data.weeks_open %}for {% if pg.data.weeks < 52 %}{{ pg.data.weeks }}{% else %} one year or until all selections have been made{% endif %},{% endif %} through {{ pg.data.closes | date: '%A, %B %e, %Y at 11:59pm' }} ET) + (Open now through {{ pg.data.closes | date: '%A, %B %e, %Y at 11:59pm' }} ET + {% if pg.data.max_applications != 0 %} or until {{pg.data.max_applications}} applications have been received.{% endif %}) {% include "layouts/jointts/job-listing-info-sessions.html" %} From b515858f769a3302f5c84fab991e4d5460365e6e Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Tue, 8 Oct 2024 14:19:47 -0400 Subject: [PATCH 26/37] Redelete unused template --- _includes/layouts/jointts/open-jobs.html | 30 ------------------------ 1 file changed, 30 deletions(-) delete mode 100644 _includes/layouts/jointts/open-jobs.html diff --git a/_includes/layouts/jointts/open-jobs.html b/_includes/layouts/jointts/open-jobs.html deleted file mode 100644 index 63143e19..00000000 --- a/_includes/layouts/jointts/open-jobs.html +++ /dev/null @@ -1,30 +0,0 @@ -
    - {% assign open_job_count = 0 %} - {% for pg in collections.jobs %} - {% capture state %}{% getStateFromDates pg.data.opens pg.data.closes %}{% endcapture %} - {% if state == "open" %} - {% unless pg.data.path contains 'template' %} - {% unless pg.data.path contains 'performance-profiles' %} - {% assign open_job_count = open_job_count | plus: 1 %} -
  • - {% if pg.data.external_url %} - {{ pg.data.title }} - {% else %} - {{ pg.data.title }} - {% endif %} - (Open now through {{ pg.data.closes | date: '%A, %B %e, %Y at 11:59pm' }} ET - {% if pg.data.max_applications != 0 %} or until {{pg.data.max_applications}} applications have been received.{% endif %}) - - - {% include "layouts/jointts/job-listing-info-sessions.html" %} - -
  • - {% endunless %} - {% endunless %} - {% endif %} - {% endfor %} -
- - {% if open_job_count == 0 %} -

No open positions at this time. Sign up for job alerts!

- {% endif %} From 3ff27586f67bf692cac5883d6b019c2507c2705d Mon Sep 17 00:00:00 2001 From: Wes Dean Date: Tue, 8 Oct 2024 14:26:35 -0400 Subject: [PATCH 27/37] Initial commit --- .../0009-javascript-testing-framework.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 docs/architecture/decisions/0009-javascript-testing-framework.md diff --git a/docs/architecture/decisions/0009-javascript-testing-framework.md b/docs/architecture/decisions/0009-javascript-testing-framework.md new file mode 100644 index 00000000..54aea357 --- /dev/null +++ b/docs/architecture/decisions/0009-javascript-testing-framework.md @@ -0,0 +1,29 @@ +# 9. JavaScript Testing Framework + +Date: 2024-10-08 + +## Status + +Accepted + +## Context + +The TTS Website is using an increasingly complex logical functions to +determine what data are displayed (e.g., job postings, informational +sessions, etc.); this logic requires a robust testing suite to verify +that what is expected is what is being produced. + +## Decision + +The team will adopt the [Jest](https://jestjs.io) JavaScript testing +framework. The test suite may be run by executing the script specified +in the `package.json` file (e.g., `npm jest` or `npx jest`). + +## Consequences + +The primary risk here relates to "going slow to go fast." That is, it +will take time to write tests and when tests fail, either the code +or the test will need to be fixed before the CI/CD pipeline will allow +merges to take place. The upfront investment in writing tests will +allow for faster development by finding problematic logic (i.e., bugs) +before they're introduced into the system. From 43e1b4f844846cf54b0f0679f3239b8b11084b00 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Tue, 8 Oct 2024 14:34:14 -0400 Subject: [PATCH 28/37] Undefined variable fix --- _data/assetPaths.json | 6 +++--- _includes/scripts.html | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/_data/assetPaths.json b/_data/assetPaths.json index 374e011a..6d3efaf7 100644 --- a/_data/assetPaths.json +++ b/_data/assetPaths.json @@ -4,6 +4,6 @@ "app.js": "/assets/js/app-U5OIPSUD.js", "app.map": "/assets/js/app-U5OIPSUD.js.map", "uswds.js": "/assets/js/uswds-init.js", - "styles.css": "/assets/styles/styles-6QTB7FLT.css", - "styles.map": "/assets/styles/styles-6QTB7FLT.css.map" -} + "styles.css": "/assets/styles/styles-EQTR2GJL.css", + "styles.map": "/assets/styles/styles-EQTR2GJL.css.map" +} \ No newline at end of file diff --git a/_includes/scripts.html b/_includes/scripts.html index edb24a18..4491f876 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -53,7 +53,6 @@ const layout = "{{layout}}"; - console.log(layout) // Initialize the functions needed for the main join page if ( layout.includes('/jointts/home') ) { @@ -172,7 +171,7 @@ // Let's add the future info sessions under this item. const infoSessions = job.info_sessions; - if ( infoSessions.length > 0 ) { + if ( infoSessions && infoSessions.length > 0 ) { renderInfoSessions(infoSessions, listItem, job.title); } }); From 2fd8e3e7f20ecf5db1c3938b0dc64a0f55428f30 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Tue, 8 Oct 2024 14:35:09 -0400 Subject: [PATCH 29/37] Remove extra sentence --- _includes/layouts/jointts/job/status_alert.html | 1 - 1 file changed, 1 deletion(-) diff --git a/_includes/layouts/jointts/job/status_alert.html b/_includes/layouts/jointts/job/status_alert.html index 146699f6..7b0939bf 100644 --- a/_includes/layouts/jointts/job/status_alert.html +++ b/_includes/layouts/jointts/job/status_alert.html @@ -21,7 +21,6 @@

Coming soon

Apply now!

-

This role is open for applications until {{ closes | date: "%A, %B %d, %Y" }} at 11:59 PM ET.

{% if max_applications != 0 %}

This role is open for applications until {{ closes | date: "%A, %B %d, %Y" }} at 11:59PM ET or until {{max_applications}} applications have been received. From dc61d7b80cd3357307a31bdc8f80ce2efafbe8dd Mon Sep 17 00:00:00 2001 From: Wesley Dean Date: Tue, 8 Oct 2024 18:37:03 +0000 Subject: [PATCH 30/37] [MegaLinter] Apply linters fixes --- _data/assetPaths.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_data/assetPaths.json b/_data/assetPaths.json index 6d3efaf7..fcb2c8af 100644 --- a/_data/assetPaths.json +++ b/_data/assetPaths.json @@ -6,4 +6,4 @@ "uswds.js": "/assets/js/uswds-init.js", "styles.css": "/assets/styles/styles-EQTR2GJL.css", "styles.map": "/assets/styles/styles-EQTR2GJL.css.map" -} \ No newline at end of file +} From 411112cd6e1f8cad9d9aac2afef63d3c80732665 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Tue, 8 Oct 2024 14:52:23 -0400 Subject: [PATCH 31/37] Log the env window location --- _includes/scripts.html | 1 + 1 file changed, 1 insertion(+) diff --git a/_includes/scripts.html b/_includes/scripts.html index 4491f876..f85dc42f 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -156,6 +156,7 @@ // Set the link URL const linkUrl = job.external_url !== '' ? job.external_url : job.url; link.href = linkUrl; + console.log(window.location); // Set the target attribute for external links to open in a new window if (job.external_url !== '') { From 8b07e0e8ad2f6cc7f72699585821bde73409cf58 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Tue, 8 Oct 2024 15:03:17 -0400 Subject: [PATCH 32/37] Test link --- _includes/scripts.html | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index f85dc42f..e9ca1fa0 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -154,9 +154,20 @@ link.style.color = '#005ea2'; // Set the link URL - const linkUrl = job.external_url !== '' ? job.external_url : job.url; + let linkUrl = job.external_url !== '' ? job.external_url : job.url; + if (linkUrl === job.url) { + if (window.location.href.includes('pages.cloud.gov')) { + // Remove '/join/' from job.url if it exists and append to window.location.href + linkUrl = job.url.replace('/join/', ''); + linkUrl = `${window.location.href}${linkUrl}`; + } else { + // Just return job.url if not on pages.cloud.gov + linkUrl = job.url; + } + } + link.href = linkUrl; - console.log(window.location); + // Set the target attribute for external links to open in a new window if (job.external_url !== '') { From 57deef066df6793789c4103e2be1965f10fe23e4 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Tue, 8 Oct 2024 15:05:50 -0400 Subject: [PATCH 33/37] Set upcoming links --- _includes/scripts.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index e9ca1fa0..e9758d32 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -213,7 +213,18 @@ link.style.color = '#005ea2'; // Set the link URL - const linkUrl = job.external_url !== '' ? job.external_url : job.url; + let linkUrl = job.external_url !== '' ? job.external_url : job.url; + if (linkUrl === job.url) { + if (window.location.href.includes('pages.cloud.gov')) { + // Remove '/join/' from job.url if it exists and append to window.location.href + linkUrl = job.url.replace('/join/', ''); + linkUrl = `${window.location.href}${linkUrl}`; + } else { + // Just return job.url if not on pages.cloud.gov + linkUrl = job.url; + } + } + link.href = linkUrl; // Set the target attribute for external links to open in a new window From 911da17cf4540c43103d4733b1cfc9a7e45a8ba2 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Tue, 8 Oct 2024 15:19:53 -0400 Subject: [PATCH 34/37] Adds the open until message under open jobs --- _includes/scripts.html | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index e9758d32..ebb3c2e1 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -57,7 +57,7 @@ // Initialize the functions needed for the main join page if ( layout.includes('/jointts/home') ) { const allJobs = []; - + let test = '' {% for job in collections.jobs %} allJobs.push({ title: "{{ job.data.title }}", @@ -65,6 +65,7 @@ external_url: "{{ pg.data.external_url }}", opens: "{{ job.data.opens | htmlDateString }}", closes: "{{ job.data.closes | htmlDateString }}", + max_applications: "{{ job.data.max_applications }}", info_sessions: {{ job.data.info_sessions | jsonify }} }); {% endfor %} @@ -174,11 +175,29 @@ link.target = '_blank'; // Open in a new window } - // Set the text content to the job title - link.textContent = job.title; + // Set the text content to the job title. + link.textContent = job.title; + + // Format the job closes date + const closesDate = new Date(job.closes).toLocaleDateString('en-US', { + weekday: 'long', + year: 'numeric', + month: 'long', + day: 'numeric', + timeZone: 'UTC', + }); + + // Add the open until message. + let openUntilMessage = ''; + if ( job.max_applications !== 0 ) { + openUntilMessage = ` (Open now through ${closesDate} at 11:59pm ET or until ${job.max_applications} has been received.)`; + } else { + openUntilMessage = ` (Open now through ${closesDate} at 11:59pm ET.)`; + } // Append the link to the list item, and the list item to the list listItem.appendChild(link); + link.insertAdjacentHTML("afterend", openUntilMessage); jobList.appendChild(listItem); // Let's add the future info sessions under this item. From ab694f81d6c106265f84d808fa28f959ac202ea3 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Tue, 8 Oct 2024 15:25:39 -0400 Subject: [PATCH 35/37] Fix message --- _includes/scripts.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/scripts.html b/_includes/scripts.html index ebb3c2e1..cc086cdb 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -190,7 +190,7 @@ // Add the open until message. let openUntilMessage = ''; if ( job.max_applications !== 0 ) { - openUntilMessage = ` (Open now through ${closesDate} at 11:59pm ET or until ${job.max_applications} has been received.)`; + openUntilMessage = ` (Open now through ${closesDate} at 11:59pm ET or until ${job.max_applications} applications have been received.)`; } else { openUntilMessage = ` (Open now through ${closesDate} at 11:59pm ET.)`; } From e9a364f7551fa54a0f6c2305c1333c9996251576 Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Tue, 8 Oct 2024 15:37:20 -0400 Subject: [PATCH 36/37] Fix appointment type language --- pages/jointts/positions/PX-Content-Outreach-BranchChief.md | 4 ++-- pages/jointts/positions/login-gov-data-analyist.md | 4 ++-- pages/jointts/positions/organizational_culture_specialist.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pages/jointts/positions/PX-Content-Outreach-BranchChief.md b/pages/jointts/positions/PX-Content-Outreach-BranchChief.md index e5389828..63c43b78 100644 --- a/pages/jointts/positions/PX-Content-Outreach-BranchChief.md +++ b/pages/jointts/positions/PX-Content-Outreach-BranchChief.md @@ -54,8 +54,8 @@ work_schedule: Full time. # Set to 0 if there is no limit max_applications: "150" -# Use either "perm" or "term" to indicate a permanent or temporary position -appointment_type: "perm" +# Use either "permanent" or "temporary" +appointment_type: permanent # List key objectives here. Key objectives and sub-bullets will be displayed in # the order they are listed here. You do not need to include key objective diff --git a/pages/jointts/positions/login-gov-data-analyist.md b/pages/jointts/positions/login-gov-data-analyist.md index ad202d8a..45494ee0 100644 --- a/pages/jointts/positions/login-gov-data-analyist.md +++ b/pages/jointts/positions/login-gov-data-analyist.md @@ -81,8 +81,8 @@ work_schedule: Full time. # Set to 0 if there is no limit to the number of applications accepted max_applications: 150 -# Use either "perm" or "term" to indicate a permanent or temporary position -appointment_type: "perm" +# Use either "permanent" or "temporary" +appointment_type: permanent # List key objectives here. Key objectives and sub-bullets will be displayed in # the order they are listed here. You do not need to include key objective diff --git a/pages/jointts/positions/organizational_culture_specialist.md b/pages/jointts/positions/organizational_culture_specialist.md index 7205654c..67547b81 100644 --- a/pages/jointts/positions/organizational_culture_specialist.md +++ b/pages/jointts/positions/organizational_culture_specialist.md @@ -78,8 +78,8 @@ work_schedule: Full time. # Set to 0 if there is no limit max_applications: 0 -# Use either "perm" or "term" to indicate a permanent or temporary position -appointment_type: "perm" +# Use either "permanent" or "temporary" +appointment_type: permanent # List key objectives here. Key objectives and sub-bullets will be displayed in # the order they are listed here. You do not need to include key objective From 2f417b6595a27c7a2ef954dd96a6936328ae5bab Mon Sep 17 00:00:00 2001 From: Ximena Kilroe Date: Tue, 8 Oct 2024 15:44:30 -0400 Subject: [PATCH 37/37] Update position template --- pages/jointts/positions/position-template.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pages/jointts/positions/position-template.md b/pages/jointts/positions/position-template.md index 48c514c6..23f89a07 100644 --- a/pages/jointts/positions/position-template.md +++ b/pages/jointts/positions/position-template.md @@ -79,8 +79,8 @@ work_schedule: Full time. # Set to 0 if there is no limit max_applications: 0 -# Use either "perm" or "term" to indicate a permanent or temporary position -appointment_type: +# Use either "permanent" or "temporary" +appointment_type: permanent # List key objectives here. Key objectives and sub-bullets will be displayed in # the order they are listed here. You do not need to include key objective @@ -121,17 +121,19 @@ info_sessions: date: time: -# Make sure to leave the | on the first line. +# Make sure to leave the | on the first line. Begin your text by returning to the next line and +# indenting once. role_summary: | -# Make sure to leave the | on the first line. +# Make sure to leave the | on the first line. Begin your text by returning to the next line and +# indenting once. qualifications: | -# Make sure to leave the | on the first line. +# Make sure to leave the | on the first line. Begin your text by returning to the next line and +# indenting once. specialized_requirements: | # This can be filled prior to the job posting going live or left blank # # The application button will only show after the open date # application_link: - ---