Constructor
constructor()
Initializes a new instance of the MicrocredentialsFilter
class.
Properties
jsonData
The raw JSON data.
Type: Array
filteredData
The filtered data.
Type: Array
activeFilters
The active filters.
Type: Object
Properties:
searchTerm
:string
instructionMethod
:string
interest
:string
creditType
:string
Methods
fetchData(sheetUrl)
Fetches data from a specified sheet URL and initializes the filters and event listeners.
Parameters: sheetUrl
(string) - The URL of the sheet containing the data.
processData(data)
Processes the given data and returns an array of objects.
Parameters: data
(Object) - The data to be processed.
Returns: Array
- An array of objects representing the processed data.
displayFeaturedMicrocredentials()
Displays featured microcredentials.
displayFilteredMicrocredentials()
Displays filtered microcredentials.
initializeEventListeners()
Initializes event listeners for the searchbox, instruction method, interest, and credit type dropdowns.
clearInput()
Clears the input value of the searchbox.
applyFilters()
Applies all active filters and updates the display.
filterBySearchTerm(item)
Filters by search term.
Parameters: item
(Object) - The item to filter.
Returns: boolean
- True if the item matches the filter, false otherwise.
filterByInstructionMethod(item)
Filters by instruction method.
Parameters: item
(Object) - The item to filter.
Returns: boolean
- True if the item matches the filter, false otherwise.
filterByInterest(item)
Filters by interest.
Parameters: item
(Object) - The item to filter.
Returns: boolean
- True if the item matches the filter, false otherwise.
filterByCreditType(item)
Filters by credit type.
Parameters: item
(Object) - The item to filter.
Returns: boolean
- True if the item matches the filter, false otherwise.
static sortAtoZ(a, b)
Sorts an array of objects in ascending order based on the "MicrocredentialsName" property.
Parameters: a
(Object) - The first object to compare. b
(Object) - The second object to compare.
Returns: number
- Returns a negative value if a should be sorted before b, a positive value if a should be sorted after b, or 0 if they are equal.
static createHtmlTemplate(item)
Creates an HTML template for a microcredential item.
Parameters: item
(Object) - The microcredential item.
URL
(string) - The URL of the microcredential.ImageURL
(string) - The URL of the microcredential image.Level
(string) - The level of the microcredential.Industry
(string) - The industry of the microcredential.CreditNoncredit
(string) - The credit/non-credit status of the microcredential.InstructionMethod
(string) - The instruction method of the microcredential.MicrocredentialsName
(string) - The name of the microcredential.Text
(string) - The description of the microcredential.
Returns: string
- The HTML template for the microcredential item.
Video Tutorials
How to Create a Microcredential
How to Update a Microcredential
How to Delete a Microcredential
Steps to Manage Microcredentials
Create a Microcredential
Follow these steps to create a new microcredential:
- Navigate to the microcredentials google sheet.
- Fill in the required fields such as featured, name, description, and other relevant information.
- Head to the microcredential finder page to see the changes
- If the changes are not showing
- Refresh the page and check again.
- Scroll down and click the "Updated {Todays Date}" button.
- Click the "Source" Tab.
- Scroll down to line 652 and look for the "const range".
- Change value of the range to match the number of new microcredentials you added.
- For example if the current range is "DB!A1:J103", and you just added 1 microcredential.
- You would need to change the range to "DB!A1:J104".
Update a Microcredential
Follow these steps to update an existing microcredential:
- Navigate to the microcredentials google sheet.
- Select the microcredential you want to update.
- Make the necessary changes in the microcredential.
- Head back to the microcredential finder page to see the changes(remember to refresh the page incase the changes are not showing).
Delete a Microcredential
Follow these steps to delete a microcredential:
- Navigate to the microcredentials google sheet.
- Select the row of the microcredential you want to delete.
- Left click and select the "Delete Row" button.
- Head back to the microcredential finder page to see the changes(remember to refresh the page incase the changes are not showing).