Skip to content

Commit

Permalink
Removing instances of "test" as a substring in the events page - #6369 (
Browse files Browse the repository at this point in the history
#7464)

* add vrms events filter "test"

* use regex for test testing search instead

* update vrms regex
  • Loading branch information
dcotelessa authored Sep 24, 2024
1 parent 76d34bf commit d45ca48
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions assets/js/utility/vrms-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
{% assign vrmsData = site.data.external.vrms_data %}
const vrmsData = JSON.parse(decodeURIComponent("{{ vrmsData | jsonify | uri_escape }}"));

/* vrmsDataFetch calls sortByDate function and passes vrmsData variable, current page which can either be "events" for the right-col-content.html page or
/* vrmsDataFilter is a function that filters the vrmsData array to remove the instances of "test" or "testing" from the events page.
We need to add logic for removing any event that contain "test" or "testing" (case-insensitive) from the events page.
*/
const vrmsDataFilter = (vrmsData) => vrmsData.filter(data => data.name.match(/\btest(ing)?\b/i) === null);
const filteredVrmsData = vrmsDataFilter(vrmsData);

/* vrmsDataFetch calls sortByDate function and passes filteredVrmsData variable, current page which can either be "events" for the right-col-content.html page or
"project" from the project.html page, and passes the appendMeetingTimes function from projects.js that appends the sorted vrmsData
returned by sortByDate to project.html. AppendMeetingTimes is only called if vrmsDataFetch is being called from project.js for the project.html page
*/
export const vrmsDataFetch = (currentPage, appendMeetingTimes) => {
return sortByDate(vrmsData, currentPage, appendMeetingTimes)
return sortByDate(filteredVrmsData, currentPage, appendMeetingTimes)
}

// Helper function used for project.html and right-col-content.html to sort VRMS data by day of the week from "date" key and meeting time from "startTime" key
Expand Down

0 comments on commit d45ca48

Please sign in to comment.