Skip to content

Latest commit

 

History

History
65 lines (50 loc) · 2.77 KB

MAINTAINING.md

File metadata and controls

65 lines (50 loc) · 2.77 KB

Maintaining

Adding Members

Visit /admin/members/ and enter data in the bottom row. Slack IDs will automatically populate by the email Alternatively use the onboarding button on the app home

Creating Accounts

To create an account, Role should be "read" "write" or "admin"

npm run createaccount youruser yourpassword role

Adjusting Seasons

Set the start_date field to the date you want to start tracking current hour information from, typically around kickoff or the end of summer. Any hour submissions after this point will be counted towards totals. It can be in any format accepted by the Javascript Date constructor

Refreshing Veracross photos

Open the student directory and paste the following into the browser console. You may need to disable CSP to run this script.

function loadNext() {
    console.log('loading more pages...')
    const elem = document.querySelector('.DirectoryEntries_LoadMoreEntriesButton')
    if (elem) {
        elem.click()
        setTimeout(loadNext, 1000)
    } else {
        const people = document.querySelectorAll('.directory-Entry_Header')
        const data = {}
        people.forEach((person) => {
            const email = person.querySelector('a')?.innerHTML?.trim()
            const photo = person.querySelector('.directory-Entry_PersonPhoto--full')?.src
            if (email && photo) {
                data[email] = photo.replace('c_limit', 'c_fill,g_north')
            } else {
                console.log('missing data for', person)
            }
        })
        fetch('https://cluck.team1540.org/api/members/fallback_photos', {
            method: 'POST',
            headers: { 'X-Api-Key': 'YOUR-API-KEY' },
            body: JSON.stringify(data)
        })
            .then((resp) => resp.text())
            .then(console.log)
    }
}

loadNext()

Adding Member Fields

Additional fields not used by CLUCK can be added to the spreadsheet directly. See the registered column and 'extra' sheet in the template spreadsheet for an example

  • Hours & Certs row 3 represents the table that the column is found in
  • Hours & Certs row 4 is the column name
  • Hours & Certs row 5 is automatically calculated to be the column index

Make sure to update the db model, the spreadsheet mapping, and the member dashboard if adding new fields to CLUCK.