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

CLUCK Version 2 #24

Merged
merged 140 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
c962acd
feat: initial commit
rutmanz Jun 17, 2024
01455dd
feat: add member certification management, refactor db
rutmanz Jun 17, 2024
226689d
incomplete: db change hooks
rutmanz Jun 17, 2024
403e9cc
feat: cert change announcements
rutmanz Jun 17, 2024
db90f62
feat: gitignore intellij
rutmanz Jun 17, 2024
565ed26
fix: correct token type for profile updates
rutmanz Jun 17, 2024
5540a47
format
rutmanz Jun 17, 2024
8900459
feat: add ci
rutmanz Jun 17, 2024
6e5f061
feat: add ci markdown summary
rutmanz Jun 17, 2024
cdb3b93
feat: add ci permissions
rutmanz Jun 17, 2024
aa8c5ed
feat: add pre-commit hook
rutmanz Jun 17, 2024
0d60d9d
feat: add auth
rutmanz Jun 18, 2024
fe695e4
feat: start frontend
rutmanz Jun 18, 2024
8f0d65c
format
rutmanz Jun 18, 2024
214c7f0
fix: make linting happy
rutmanz Jun 18, 2024
70f8dd6
feat: frontend building
rutmanz Jun 18, 2024
3dd8fba
fix: stop using custom tag names
rutmanz Jun 18, 2024
87568a8
fix: frontend styling, routing and typing
rutmanz Jun 18, 2024
42069ab
feat: use sockets instead of polling for grid changes
rutmanz Jun 19, 2024
a13d576
cleanup
rutmanz Jun 19, 2024
c640e08
feat: migrate DBs
rutmanz Jun 20, 2024
7ade1f1
feat: add school photo fallback system
rutmanz Jun 20, 2024
33547b4
feat: add meeting attendance
rutmanz Jun 20, 2024
e329442
cleanup
rutmanz Jun 20, 2024
72a0d1d
fix: create attendance records for all members
rutmanz Jun 21, 2024
fbe8961
fix: make attendance updates atomic
rutmanz Jun 21, 2024
09317d4
refactor: clean up db files
rutmanz Jun 21, 2024
5312790
feat: add slack app base
rutmanz Jun 22, 2024
2016eef
feat: add accept handler
rutmanz Jun 22, 2024
cdc56ca
feat: add getAllPendingRequestBlocks
rutmanz Jun 22, 2024
2862a42
feat: add db seeding
rutmanz Jul 8, 2024
bf4b781
feat: seed meeting attendance
rutmanz Jul 8, 2024
d584552
feat: add slack app manifests
rutmanz Jul 8, 2024
f286d84
fix: format manifest
rutmanz Jul 8, 2024
c01a74f
feat: start using node-config
rutmanz Jul 8, 2024
0b91f8c
feat: fully migrate config with typing
rutmanz Jul 8, 2024
8a902d6
fix: use config to generate dev manifests
rutmanz Jul 8, 2024
03ab243
fix: remove unnecessary step from ci
rutmanz Jul 8, 2024
ef15641
WIP: setup guide
rutmanz Jul 8, 2024
e275655
feat: complete setup guide
rutmanz Jul 8, 2024
02c6709
feat: add log command
rutmanz Jul 9, 2024
c97aaa1
feat: add vitest
rutmanz Jul 9, 2024
fbe9764
feat: add /loggedin
rutmanz Jul 9, 2024
dcaaaa8
feat: add /logout
rutmanz Jul 9, 2024
8096a1b
feat: add /voidtime
rutmanz Jul 9, 2024
fac2186
feat: upgrade eslint
rutmanz Jul 9, 2024
0887b98
refactor: change path alias to conflict with npm style less
rutmanz Jul 9, 2024
8c7d875
fix: use approver channel instead of approver user
rutmanz Jul 9, 2024
4e34ea3
feat: add rejection
rutmanz Jul 9, 2024
2ad5c23
feat: cleanup rejection and accept logic
rutmanz Jul 9, 2024
dfbd3b4
feat: add home view
rutmanz Jul 10, 2024
f8f8199
feat: add hours breakdown to home view
rutmanz Jul 10, 2024
b73e993
feat: use slack-block-builder for home tab
rutmanz Jul 10, 2024
23a94d0
feat: show last updated time on app home
rutmanz Jul 10, 2024
cdcf4b5
feat: cleanup response messages
rutmanz Jul 10, 2024
85005a3
feat: cleanup response messages for accept modal
rutmanz Jul 10, 2024
a4f5095
feat: port log modal
rutmanz Jul 10, 2024
a7d3efd
feat: port submission message
rutmanz Jul 10, 2024
a17edec
feat: port submission response modal
rutmanz Jul 10, 2024
9267bdc
feat: add user info screen
rutmanz Jul 10, 2024
4e087a8
feat: improve user info modal
rutmanz Jul 11, 2024
5cce0cd
feat: improve accept and reject message updates
rutmanz Jul 11, 2024
441acef
feat: add sending pending requests
rutmanz Jul 11, 2024
3d6887d
feat: improve formatting, allow syncing individual users
rutmanz Jul 11, 2024
dd4d025
feat: add charts
rutmanz Jul 11, 2024
b421735
feat: hide y-axis ticks, add labels
rutmanz Jul 11, 2024
440e4ec
feat: add additional chart types
rutmanz Jul 11, 2024
82b6630
feat: convert all messages to block kit style
rutmanz Jul 11, 2024
eb03514
feat: add command to show current hours
rutmanz Jul 11, 2024
4c2791e
feat: make qualifying hours category
rutmanz Jul 11, 2024
ce39c09
feat: improve graph command responses
rutmanz Jul 11, 2024
a93d0e9
Improve certification structure and management:
rutmanz Jul 14, 2024
ab38fa1
Add google sheets integration:
rutmanz Jul 14, 2024
1323eef
feat: support adhoc member fields
rutmanz Jul 15, 2024
e2e75cd
feat: view data with ag-grid
rutmanz Jul 15, 2024
16a6493
feat: update member data with ag-grid
rutmanz Jul 15, 2024
db85d7e
feat: separate new member input, support updating emails
rutmanz Jul 16, 2024
42b5fb1
feat: show member photos
rutmanz Jul 16, 2024
bc406a7
feat: show slack link status
rutmanz Jul 16, 2024
805c3f4
feat: move add member button to inside grid
rutmanz Jul 16, 2024
3b278ce
feat: convert certs to ag-grid
rutmanz Jul 17, 2024
89dbd71
feat: support adding certs
rutmanz Jul 17, 2024
2ded0ae
feat: support adding certs with ag-grid
rutmanz Jul 17, 2024
d44f6e1
fix: remove adhoc fields
rutmanz Jul 17, 2024
8ad6039
feat: add frc registered field
rutmanz Jul 17, 2024
c1edb45
docs: document adding fields
rutmanz Jul 17, 2024
2691f7b
docs: add readme
rutmanz Jul 17, 2024
e2f4140
docs: add license
rutmanz Jul 17, 2024
7431b47
docs: add screenshots of different features
rutmanz Jul 17, 2024
1f84e3b
fix: remove frc_registered from database in favor of spreadsheet
rutmanz Jul 17, 2024
37ed9f2
chore: run code cleanup
rutmanz Jul 17, 2024
b9ace29
chore: clean up logging and prints
rutmanz Jul 17, 2024
ce76868
refactor: cleanup slack callback typing
rutmanz Jul 17, 2024
9333753
feat: host sockets on same port
rutmanz Jul 18, 2024
4572709
feat: show pending requests on app home
rutmanz Jul 18, 2024
484b576
refactor: organize blocks more neatly
rutmanz Jul 18, 2024
0fe3e87
refactor: more slack folder restructuring
rutmanz Jul 18, 2024
ceaa1bc
feat: actually schedule tasks
rutmanz Jul 18, 2024
9582ce6
fix: remove reference to hosts and ports
rutmanz Jul 18, 2024
1b2fbd9
feat: add production build process
rutmanz Jul 18, 2024
6e9325c
feat: add department associations
rutmanz Jul 18, 2024
d488469
feat: use department associations in membercerts.tsx
rutmanz Jul 18, 2024
3b872cb
bump: use latest slack bolt version to avoid ws errors
rutmanz Jul 19, 2024
7341587
feat: improve hour message displays in slack and logging
rutmanz Jul 19, 2024
902b7d2
fix: improve certification handling and logging
rutmanz Jul 19, 2024
732e864
feat: add department command
rutmanz Jul 20, 2024
2685463
feat: add department management and usergroups
rutmanz Jul 20, 2024
13c0c21
docs: add manifest for user token
rutmanz Jul 20, 2024
324bd97
feat: add department associations
rutmanz Jul 29, 2024
fb17b82
feat: add adjustable dates and deletion to meetings
rutmanz Jul 31, 2024
5cdac8d
feat: add disabled members
rutmanz Jul 31, 2024
d0c6683
feat: filter hours by start date
rutmanz Jul 31, 2024
36c6d71
feat: use students group to filter active members
rutmanz Aug 1, 2024
5afbb0c
feat: add onboarding modal
rutmanz Aug 1, 2024
526116f
feat: move unneeded db fields to spreadsheet
rutmanz Aug 2, 2024
66acc0b
refactor: clean up slack handler organization and logic
rutmanz Aug 2, 2024
004b156
feat: allow graphing departments
rutmanz Aug 2, 2024
7e59e98
feat: allow adjusting meeting fields and dates
rutmanz Aug 2, 2024
a878888
feat: support ad-hoc task running
rutmanz Aug 2, 2024
b15df18
reset
rutmanz Aug 2, 2024
8fdd426
CLUCK v2
rutmanz Aug 2, 2024
aaa9ce4
feat: merge dash
rutmanz Aug 22, 2024
c190cd2
feat: finish migrating dash
rutmanz Aug 23, 2024
0ef7704
fix: count meeting hours
rutmanz Aug 23, 2024
66b0952
feat: add back chiefdelphi
rutmanz Aug 23, 2024
2cb7750
fix: linting and formatting
rutmanz Aug 23, 2024
3c9e2d1
fix: crop fallback photos appropriately
rutmanz Aug 29, 2024
dfa4893
fix: update profile fields periodically
rutmanz Aug 30, 2024
12f3e5f
fix: force lowercase emails
rutmanz Aug 30, 2024
924b6a7
fix: correct fallback for display names
rutmanz Aug 30, 2024
1a959ff
feat: better account creation flow
rutmanz Aug 30, 2024
ecf9d31
feat: store user team, improve image logic
rutmanz Sep 1, 2024
264c4bc
fix: only use slack photos when appropriate
rutmanz Sep 1, 2024
b4f387b
feat: add manual fallback linking
rutmanz Sep 1, 2024
c488cfc
fix: slack api can only handle 5 overflow items
rutmanz Sep 1, 2024
f1d8314
fix: only update active member photos
rutmanz Sep 1, 2024
275b741
fix: don't reactivate automatically
rutmanz Sep 1, 2024
c04c273
fix: don't move around existing slack members
rutmanz Sep 1, 2024
af7b300
fix: auto logout at midnight
rutmanz Sep 3, 2024
38c1f1c
feat: add no-unused-vars exceptions
rutmanz Sep 4, 2024
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
85 changes: 0 additions & 85 deletions .eslintrc.json

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on: [push, pull_request]

jobs:
lint:
name: 'Lint'
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 21
cache: 'npm'
- name: Install Node Dependencies
run: npm ci

# Linting
- name: Create ESLint Report
run: node_modules/.bin/eslint --output-file eslint_report.json --format json .
continue-on-error: true
- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@v3
continue-on-error: true
with:
report-json: 'eslint_report.json'
- name: Run ESLint
run: node_modules/.bin/eslint .

build:
name: 'Build'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 21
cache: 'npm'
- name: Install Node Dependencies
run: npm ci
# Build
- name: Build
run: npm run build
54 changes: 0 additions & 54 deletions .github/workflows/ci.yml

This file was deleted.

46 changes: 38 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
/node_modules/
/secrets/*
!/secrets/*.example.*
/coverage/
/dist/
/data/
# dev
.yarn/
!.yarn/releases
.vscode/*
!.vscode/launch.json
!.vscode/*.code-snippets
.idea/workspace.xml
.idea/usage.statistics.xml
.idea/shelf

**/.DS_Store
npm-debug.log
# deps
node_modules/

# env
.env
.env.production

# logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# misc
.DS_Store


/config/*.*
!/config/custom-environment-variables.json
!/config/example.json
/static/app.css
_*.ts
/.idea
/public/

/dev/*.manifest.json
/build/
17 changes: 17 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"trailingComma": "none",
"bracketSpacing": true,
"quoteProps": "consistent",
"tabWidth": 4,
"semi": false,
"singleQuote": true,
rutmanz marked this conversation as resolved.
Show resolved Hide resolved
"printWidth": 1000,
"overrides": [
{
"files": ["**/*.ts"],
"options": {
"printWidth": 180
}
}
]
}
File renamed without changes.
65 changes: 65 additions & 0 deletions MAINTAINING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 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](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date)

## Refreshing Veracross photos

Open [the student directory](https://portals.veracross.com/catlin/student/directory/1) and paste the following into the browser console. You may need to disable CSP to run this script.

```js
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](https://docs.google.com/spreadsheets/d/1p18eJW29CzLn-zZKBKm-OOM6BtR-oLlrZVfNJtNPl9A/edit?gid=568325748#gid=568325748&range=B2:B46) and ['extra' sheet](https://docs.google.com/spreadsheets/d/1p18eJW29CzLn-zZKBKm-OOM6BtR-oLlrZVfNJtNPl9A/edit?gid=2140052736#gid=2140052736) 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](prisma/schema.prisma), [the spreadsheet mapping](src/spreadsheet/index.ts), and the [member dashboard](src/views/admin_members) if adding new fields to CLUCK.
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
[![CI](https://github.com/flamingchickens1540/CLUCK/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/flamingchickens1540/CLUCK/actions/workflows/ci.yml)
# CLUCK

1. Install all node dependencies
2. Change port/public ip in src/consts.ts if needed
3. Run `npm run build` and `npm run serve`!
CLUCK is a team management tool designed by and for FRC Team 1540. It manages hour tracking and certifications, integrating with Slack and Google Sheets.

Pages:
- `/grid/`
- `/dash/`
## Installation

API:
- `POST /api/clock`
- `POST /api/log`
- `POST /api/void`
- `GET /api/loggedin`
- `GET /api/ping`
- `GET /api/members`
- `GET /api/members/refresh`
See [SETUP.md](SETUP.md) for installation instructions.

## Feature Showcase

| Label | Image |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Spreadsheet | [![Spreadsheet](https://github.com/user-attachments/assets/1cbaee67-7ab1-4e45-9774-339cd8300b24)](https://docs.google.com/spreadsheets/d/1p18eJW29CzLn-zZKBKm-OOM6BtR-oLlrZVfNJtNPl9A/edit?gid=568325748#gid=568325748) |
| Slack Time Logging | ![Slack](https://github.com/user-attachments/assets/80a61a51-43b1-4673-a483-513a408e6726) |
| Slack User Info | ![Slack](https://github.com/user-attachments/assets/df06e2c2-933e-4472-a1c3-cf830798bffa) |
| Member Dashboard | ![Dashboard](https://github.com/user-attachments/assets/3e1229ec-ecdf-44c8-9ab9-4ed958d4e78b) |
| Certifications Dashboard | ![Certifications](https://github.com/user-attachments/assets/cdd3dbf4-bbce-4a3b-9463-8fe612d294e5) |
Loading
Loading