Compare commits
33 Commits
derek/coll
...
v2.3.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
518a3286fa | ||
|
|
2d18553f98 | ||
|
|
68e3fe45fa | ||
|
|
38bb29b20b | ||
|
|
8ccf7fb37e | ||
|
|
b406d4dd24 | ||
|
|
d12c8bd7b7 | ||
|
|
ea5d1e2b16 | ||
|
|
c2b43dc949 | ||
| 8d2fdfa63c | |||
| c1ffd89dbe | |||
|
|
dd8187d6da | ||
| 5028d07f0b | |||
| 4f5d8c6d20 | |||
|
|
6a67a32e4f | ||
|
|
549c52a39f | ||
|
|
36007b9d1a | ||
| cee5f0284f | |||
|
|
e8a8b8e1ae | ||
|
|
c21cbd77f0 | ||
| 99a035e29d | |||
|
|
64baa6d290 | ||
|
|
46fe591fa7 | ||
|
|
8f7e1bc0af | ||
|
|
9fc1098ef7 | ||
|
|
ae094416fc | ||
|
|
2e7dac1e3e | ||
|
|
7bea23a655 | ||
|
|
3d28869e92 | ||
|
|
f0f1f0b365 | ||
| be861b823c | |||
|
|
95de8df372 | ||
| 5994ded8be |
@@ -8,5 +8,5 @@ trim_trailing_whitespace = true
|
|||||||
indent_size = 4
|
indent_size = 4
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|
||||||
[*.nix]
|
[*.{nix,yaml,yml}]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|||||||
3
.env.example
Normal file
3
.env.example
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
SENTRY_ORG=longhorn-developers
|
||||||
|
SENTRY_PROJECT=ut-registration-plus
|
||||||
|
SENTRY_AUTH_TOKEN=
|
||||||
23
.github/ISSUE_TEMPLATE/bug_report.md
vendored
23
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,21 +1,20 @@
|
|||||||
---
|
---
|
||||||
name: Bug report
|
name: Bug report
|
||||||
about: Create a report to help us improve
|
about: Create a report to help us improve
|
||||||
title: "[BUG] "
|
title: '[BUG] '
|
||||||
labels: ''
|
labels: ''
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Pre-submission Checklist**
|
**Pre-submission Checklist**
|
||||||
|
|
||||||
<!-- Please check all applicable boxes before submitting your issue -->
|
<!-- Please check all applicable boxes before submitting your issue -->
|
||||||
|
|
||||||
- [ ] I have searched existing issues to make sure this is not a duplicate
|
- [ ] I have searched existing issues to make sure this is not a duplicate
|
||||||
- [ ] I have cleared my browser cache and confirmed the issue persists
|
- [ ] I have cleared my browser cache and confirmed the issue persists
|
||||||
- [ ] I have checked this issue affects the latest version of the extension
|
- [ ] I have checked this issue affects the latest version of the extension
|
||||||
- [ ] I have disabled other extensions to ensure this isn't a conflict issue
|
- [ ] I have disabled other extensions to ensure this isn't a conflict issue
|
||||||
- [ ] I have included all the information requested below
|
- [ ] I have included all the information requested below
|
||||||
|
|
||||||
**Bug Description**
|
**Bug Description**
|
||||||
|
|
||||||
@@ -30,11 +29,11 @@ assignees: ''
|
|||||||
|
|
||||||
**Expected Behavior**
|
**Expected Behavior**
|
||||||
|
|
||||||
<!-- A clear and concise description of what you expected to happen -->
|
<!-- What you expected to happen -->
|
||||||
|
|
||||||
**Current Behavior**
|
**Current Behavior**
|
||||||
|
|
||||||
<!-- A clear and concise description of what actually happened -->
|
<!-- What actually happened -->
|
||||||
|
|
||||||
**Screenshots**
|
**Screenshots**
|
||||||
|
|
||||||
@@ -42,9 +41,9 @@ assignees: ''
|
|||||||
|
|
||||||
**Debug Information**
|
**Debug Information**
|
||||||
|
|
||||||
- UTRP Extension Version: [e.g. 1.2.0]
|
- UTRP Extension Version: [e.g. 1.2.0]
|
||||||
- Browser Info: [e.g. Chrome 120.0.0]
|
- Browser Info: [e.g. Chrome 120.0.0]
|
||||||
- OS: [e.g. Windows 11, macOS Sonoma]
|
- OS: [e.g. Windows 11, macOS Sonoma]
|
||||||
|
|
||||||
**Console Logs**
|
**Console Logs**
|
||||||
|
|
||||||
|
|||||||
27
.github/ISSUE_TEMPLATE/feature_request.md
vendored
27
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,34 +1,29 @@
|
|||||||
---
|
---
|
||||||
name: Feature Request
|
name: Feature Request
|
||||||
about: Suggest an idea for this project
|
about: Suggest an idea for this project
|
||||||
title: "[FEATURE] "
|
title: '[FEATURE] '
|
||||||
labels: feature
|
labels: feature
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Pre-submission Checklist**
|
**Pre-submission Checklist**
|
||||||
|
|
||||||
<!-- Please check all applicable boxes before submitting your feature request -->
|
<!-- Please check all applicable boxes before submitting your feature request -->
|
||||||
|
|
||||||
- [ ] I have searched existing issues to ensure this feature hasn't been requested
|
- [ ] I have searched existing issues to ensure this feature hasn't been requested
|
||||||
- [ ] I have searched closed issues to check if this was previously rejected/implemented
|
- [ ] I have searched closed issues to check if this was previously rejected/implemented
|
||||||
- [ ] I have checked the project roadmap (if available) for planned similar features
|
- [ ] I have checked the project roadmap (if available) for planned similar features
|
||||||
- [ ] I have reviewed the documentation to confirm this feature doesn't exist
|
- [ ] I have reviewed the documentation to confirm this feature doesn't exist
|
||||||
- [ ] I have completed all sections below with detailed information
|
- [ ] I have completed all sections below with detailed information
|
||||||
|
|
||||||
**Feature Description**
|
**Your Idea**
|
||||||
|
|
||||||
<!-- A clear and concise description of the feature you'd like to see -->
|
<!-- A clear and concise description of the feature you'd like to see, and how it would work -->
|
||||||
|
|
||||||
**Proposed Solution**
|
|
||||||
|
|
||||||
<!-- A clear and concise description of what you want to happen -->
|
|
||||||
|
|
||||||
**UI/UX Considerations**
|
**UI/UX Considerations**
|
||||||
|
|
||||||
<!-- If this feature involves UI changes, please describe the visual aspects -->
|
<!-- If this feature involves UI changes (aka how it looks), please describe the visual aspects -->
|
||||||
|
|
||||||
**Technical Implementation Details**
|
**Other**
|
||||||
|
|
||||||
<!-- If you have specific technical suggestions, list them here -->
|
<!-- Any other comments you have can go here! -->
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ about: Updating Build Dependencies
|
|||||||
title: ''
|
title: ''
|
||||||
labels: build, dependencies
|
labels: build, dependencies
|
||||||
assignees: doprz, Razboy20
|
assignees: doprz, Razboy20
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- [ ] Updated Nix Flake
|
- [ ] Updated Nix Flake
|
||||||
|
|||||||
37
.github/dependabot.yml
vendored
37
.github/dependabot.yml
vendored
@@ -1,21 +1,20 @@
|
|||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: 'npm'
|
- package-ecosystem: 'npm'
|
||||||
directory: '/'
|
directory: '/'
|
||||||
schedule:
|
schedule:
|
||||||
interval: 'weekly'
|
interval: 'weekly'
|
||||||
day: 'monday'
|
day: 'monday'
|
||||||
time: '09:00'
|
time: '09:00'
|
||||||
timezone: 'America/Chicago'
|
timezone: 'America/Chicago'
|
||||||
groups:
|
groups:
|
||||||
minor-and-patch-updates:
|
minor-and-patch-updates:
|
||||||
update-types:
|
update-types:
|
||||||
- 'minor'
|
- 'minor'
|
||||||
- 'patch'
|
- 'patch'
|
||||||
major-updates:
|
major-updates:
|
||||||
update-types:
|
update-types:
|
||||||
- 'major'
|
- 'major'
|
||||||
|
ignore:
|
||||||
ignore:
|
- dependency-name: '@crxjs/vite-plugin'
|
||||||
- dependency-name: '@crxjs/vite-plugin'
|
- dependency-name: '@unocss/vite'
|
||||||
- dependency-name: '@unocss/vite'
|
|
||||||
|
|||||||
70
.github/workflows/best-practices.yml
vendored
70
.github/workflows/best-practices.yml
vendored
@@ -1,43 +1,33 @@
|
|||||||
name: Best Practices
|
name: Best Practices
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
steps:
|
- name: Checkout code
|
||||||
- name: Checkout code
|
uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
with:
|
||||||
with:
|
fetch-depth: 0
|
||||||
fetch-depth: 0
|
- name: Setup pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
- name: Setup pnpm
|
with:
|
||||||
uses: pnpm/action-setup@v4
|
version: 10
|
||||||
with:
|
- name: Install dependencies
|
||||||
version: 10
|
run: pnpm install
|
||||||
|
- name: Run ESLint
|
||||||
- name: Install dependencies
|
run: pnpm run lint
|
||||||
run: pnpm install
|
format:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
- name: Run ESLint
|
steps:
|
||||||
run: pnpm run lint
|
- name: Checkout code
|
||||||
format:
|
uses: actions/checkout@v4
|
||||||
runs-on: ubuntu-latest
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
steps:
|
- name: Setup pnpm
|
||||||
- name: Checkout code
|
uses: pnpm/action-setup@v4
|
||||||
uses: actions/checkout@v4
|
with:
|
||||||
with:
|
version: 10
|
||||||
fetch-depth: 0
|
- name: Install dependencies
|
||||||
|
run: pnpm install
|
||||||
- name: Setup pnpm
|
- name: Run Prettier
|
||||||
uses: pnpm/action-setup@v4
|
run: pnpm run prettier
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Run Prettier
|
|
||||||
run: pnpm run prettier
|
|
||||||
|
|||||||
36
.github/workflows/check-types.yml
vendored
36
.github/workflows/check-types.yml
vendored
@@ -1,24 +1,18 @@
|
|||||||
name: Type Check
|
name: Type Check
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
type-check:
|
type-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
steps:
|
- name: Checkout code
|
||||||
- name: Checkout code
|
uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
with:
|
||||||
with:
|
fetch-depth: 0
|
||||||
fetch-depth: 0
|
- name: Setup pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
- name: Setup pnpm
|
with:
|
||||||
uses: pnpm/action-setup@v4
|
version: 10
|
||||||
with:
|
- name: Install dependencies
|
||||||
version: 10
|
run: pnpm install
|
||||||
|
- name: Run tests
|
||||||
- name: Install dependencies
|
run: pnpm run check-types
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: pnpm run check-types
|
|
||||||
|
|||||||
42
.github/workflows/chromatic.yml
vendored
42
.github/workflows/chromatic.yml
vendored
@@ -1,26 +1,22 @@
|
|||||||
name: 'Chromatic'
|
name: 'Chromatic'
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
chromatic:
|
chromatic:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 10
|
version: 10
|
||||||
|
- name: Install dependencies
|
||||||
- name: Install dependencies
|
run: pnpm install
|
||||||
run: pnpm install
|
- name: Publish to Chromatic
|
||||||
|
uses: chromaui/action@latest
|
||||||
- name: Publish to Chromatic
|
with:
|
||||||
uses: chromaui/action@latest
|
projectToken: chpt_e8bd07b0b27d8eb
|
||||||
with:
|
exitZeroOnChanges: true
|
||||||
projectToken: chpt_e8bd07b0b27d8eb
|
autoAcceptChanges: 'main'
|
||||||
exitZeroOnChanges: true
|
|
||||||
autoAcceptChanges: 'main'
|
|
||||||
|
|||||||
43
.github/workflows/release.yml
vendored
43
.github/workflows/release.yml
vendored
@@ -1,25 +1,24 @@
|
|||||||
name: Create Release
|
name: Create Release
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- production
|
- production
|
||||||
- preview
|
- preview
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: build extension & create release
|
name: build extension & create release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.ref }}
|
group: ${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Get file permission
|
- name: Get file permission
|
||||||
run: chmod -R 777 .
|
run: chmod -R 777 .
|
||||||
|
- name: Install dependencies
|
||||||
- name: Install dependencies
|
run: npm ci
|
||||||
run: npm ci
|
- name: Release with semantic-release
|
||||||
- name: Release with semantic-release
|
id: semantic-release
|
||||||
id: semantic-release
|
run: npx --no-install semantic-release
|
||||||
run: npx --no-install semantic-release
|
env:
|
||||||
env:
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|||||||
36
.github/workflows/tests.yml
vendored
36
.github/workflows/tests.yml
vendored
@@ -1,24 +1,18 @@
|
|||||||
name: Tests
|
name: Tests
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
steps:
|
- name: Checkout code
|
||||||
- name: Checkout code
|
uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
with:
|
||||||
with:
|
fetch-depth: 0
|
||||||
fetch-depth: 0
|
- name: Setup pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
- name: Setup pnpm
|
with:
|
||||||
uses: pnpm/action-setup@v4
|
version: 10
|
||||||
with:
|
- name: Install dependencies
|
||||||
version: 10
|
run: pnpm install
|
||||||
|
- name: Run tests
|
||||||
- name: Install dependencies
|
run: pnpm test
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: pnpm test
|
|
||||||
|
|||||||
73
.github/workflows/validate-pr.yml
vendored
73
.github/workflows/validate-pr.yml
vendored
@@ -1,43 +1,40 @@
|
|||||||
name: Validate PR Title
|
name: Validate PR Title
|
||||||
|
|
||||||
# thank you ben limmer for this workflow:
|
# thank you ben limmer for this workflow:
|
||||||
# https://github.com/blimmer/semantic-release-demo-2/blob/main/.github/workflows/lint-pr.yml
|
# https://github.com/blimmer/semantic-release-demo-2/blob/main/.github/workflows/lint-pr.yml
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- reopened
|
- reopened
|
||||||
- edited
|
- edited
|
||||||
- synchronize
|
- synchronize
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
main:
|
main:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: amannn/action-semantic-pull-request@v3.2.6
|
- uses: amannn/action-semantic-pull-request@v3.2.6
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Post Conventional Commit Comment (on failure)
|
- name: Post Conventional Commit Comment (on failure)
|
||||||
uses: jungwinter/comment@v1
|
uses: jungwinter/comment@v1
|
||||||
id: conventional-commit-help
|
id: conventional-commit-help
|
||||||
with:
|
with:
|
||||||
type: create
|
type: create
|
||||||
issue_number: ${{ github.event.pull_request.number }}
|
issue_number: ${{ github.event.pull_request.number }}
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
body: |
|
body: |
|
||||||
Your pull request title did not conform to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standards. Our upcoming automated release pipeline will automatically determine
|
Your pull request title did not conform to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standards. Our upcoming automated release pipeline will automatically determine
|
||||||
the proper release version based on your pull request title.
|
the proper release version based on your pull request title.
|
||||||
**Cheat Sheet**
|
**Cheat Sheet**
|
||||||
- feat: A new feature
|
- feat: A new feature
|
||||||
- fix: A bug fix
|
- fix: A bug fix
|
||||||
- docs: Documentation only changes
|
- docs: Documentation only changes
|
||||||
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
||||||
- refactor: A code change that neither fixes a bug nor adds a feature
|
- refactor: A code change that neither fixes a bug nor adds a feature
|
||||||
- perf: A code change that improves performance
|
- perf: A code change that improves performance
|
||||||
- test: Adding missing tests or correcting existing tests
|
- test: Adding missing tests or correcting existing tests
|
||||||
- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
|
- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
|
||||||
- ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
|
- ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
|
||||||
- chore: Other changes that don't modify src or test files
|
- chore: Other changes that don't modify src or test files
|
||||||
- revert: Reverts a previous commit
|
- revert: Reverts a previous commit
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
|
|||||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -212,4 +212,9 @@ package-lock.json
|
|||||||
storybook-static/
|
storybook-static/
|
||||||
package/
|
package/
|
||||||
|
|
||||||
.direnv/
|
# Nix
|
||||||
|
result
|
||||||
|
result-*
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
.direnv
|
||||||
|
|||||||
8
.vscode/launch.json
vendored
8
.vscode/launch.json
vendored
@@ -6,13 +6,9 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Run current script",
|
"name": "Run current script",
|
||||||
"runtimeExecutable": "npx",
|
"runtimeExecutable": "npx",
|
||||||
"runtimeArgs": [
|
"runtimeArgs": ["tsx"],
|
||||||
"tsx"
|
|
||||||
],
|
|
||||||
"program": "${file}",
|
"program": "${file}",
|
||||||
"skipFiles": [
|
"skipFiles": ["<node_internals>/**"]
|
||||||
"<node_internals>/**"
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -26,7 +26,7 @@
|
|||||||
"navigation": "Routes",
|
"navigation": "Routes",
|
||||||
"logging": "log",
|
"logging": "log",
|
||||||
"popup": "Layout",
|
"popup": "Layout",
|
||||||
"storage": "Database",
|
"storage": "Database"
|
||||||
},
|
},
|
||||||
"material-icon-theme.files.associations": {
|
"material-icon-theme.files.associations": {
|
||||||
"tsconfig.extension.json": "tsconfig",
|
"tsconfig.extension.json": "tsconfig",
|
||||||
@@ -36,5 +36,5 @@
|
|||||||
"[html]": {
|
"[html]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
},
|
},
|
||||||
"typescript.tsdk": "node_modules/typescript/lib",
|
"typescript.tsdk": "node_modules/typescript/lib"
|
||||||
}
|
}
|
||||||
|
|||||||
34
CHANGELOG.md
34
CHANGELOG.md
@@ -1,9 +1,43 @@
|
|||||||
|
## [2.3.0](https://github.com/Longhorn-Developers/UT-Registration-Plus/compare/v2.2.2...v2.3.0) (2026-01-07)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add drag-and-drop import for schedules ([#661](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/661)) ([549c52a](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/549c52a39fee718f2bb07cfce33a294835a2246b)), closes [#446](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/446)
|
||||||
|
* allow bypassing the 10-schedule limit ([#675](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/675)) ([6a67a32](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/6a67a32e4f50a5bdd20aa43789f199b822483e2d))
|
||||||
|
* condense resourceLinks course schedule ([#676](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/676)) ([cee5f02](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/cee5f0284f09f39ca5ae64559d0b697646c77e74))
|
||||||
|
* LHD birthday ([#717](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/717)) ([2d18553](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/2d18553f98c5146fa18699ae20462e7dcbc9d35c))
|
||||||
|
* **nix:** add prettier-version-match check ([#713](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/713)) ([8ccf7fb](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/8ccf7fb37e769ba445f39c140ca9c1c4245cc1c1))
|
||||||
|
* **nix:** build UTRP ([#714](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/714)) ([38bb29b](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/38bb29b20b97ed3cf8fd6511df16553fed1d58bb))
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* .editorconfig syntax for nix files ([b406d4d](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/b406d4dd244a25688c2b9621cf5d441228bd8913))
|
||||||
|
* toSorted outdated chrome bug ([#694](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/694)) ([4f5d8c6](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/4f5d8c6d20e3cfeb7b62520ba1819e297d2cc60f))
|
||||||
|
## [2.2.2](https://github.com/Longhorn-Developers/UT-Registration-Plus/compare/v2.2.1...v2.2.2) (2025-10-13)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add nix flake ([#593](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/593)) ([7b401ad](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/7b401add1565ff401bad99745ff9e53b9a7f899f))
|
||||||
|
* automatically select new or duplicated schedules ([#583](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/583)) ([#589](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/589)) ([2a50f55](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/2a50f5580d3dbeb0d66546c23cf29bbb37d80da2))
|
||||||
|
* **env:** add SENTRY env vars ([8f7e1bc](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/8f7e1bc0af6336549068e02b80df21d4e8f4ef9c))
|
||||||
|
* export schedule button add to calendar ([#594](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/594)) ([5994ded](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/5994ded8be876cb55174d27d3fdb0832b21a0ff9))
|
||||||
|
* **release:** v2.2.2 ([c21cbd7](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/c21cbd77f0764c03a711589ff4f957cb8c936eec))
|
||||||
|
* search result shading ([#617](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/617)) ([be861b8](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/be861b823cb2cb7f6f4a1f266351eec3fc1c2f99))
|
||||||
|
* show warning for courses of different semesters ([#570](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/570)) ([2e7dac1](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/2e7dac1e3eba757231ac07ac966231c08c703a16))
|
||||||
|
* support summer grades, fix summer course parser ([#596](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/596)) ([2d92dd4](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/2d92dd47f00a44b7d48e92a8ffba94480e4e73f9))
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fix or ignore various eslint warning ([#609](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/609)) ([95de8df](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/95de8df37243b6d59625df515a60442f11b7a9d3))
|
||||||
|
* limit height of schedule list dropdown in the extension popup ([#543](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/543)) ([eb8141e](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/eb8141ee8c3d32bce901457178d50781b78f86dd))
|
||||||
|
* whitespace wrapping in semester warning ([#629](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/629)) ([46fe591](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/46fe591fa72ef017eea7cfb8aa37d12d8f223926))
|
||||||
## [2.2.1](https://github.com/Longhorn-Developers/UT-Registration-Plus/compare/v2.2.0...v2.2.1) (2025-06-04)
|
## [2.2.1](https://github.com/Longhorn-Developers/UT-Registration-Plus/compare/v2.2.0...v2.2.1) (2025-06-04)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add dining app promo ([#598](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/598)) ([be1dccf](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/be1dccfcb9d052c6b291b50cc53418d6bb645beb))
|
* add dining app promo ([#598](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/598)) ([be1dccf](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/be1dccfcb9d052c6b291b50cc53418d6bb645beb))
|
||||||
* inside jokes005 ([#590](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/590)) ([37471ef](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/37471efb740c7a5828cf3b54bac70954694359d7))
|
* inside jokes005 ([#590](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/590)) ([37471ef](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/37471efb740c7a5828cf3b54bac70954694359d7))
|
||||||
|
* **release:** v2.2.1 ([234f3d6](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/234f3d627d603adf8555b4d0e93106d198918169))
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
|||||||
32
CODE_OF_CONDUCT.md
Normal file
32
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# UT Registration Plus Code of Conduct
|
||||||
|
|
||||||
|
Like the technical community as a whole, the UT Registration Plus team and community is made up of a mixture of professionals and volunteers from all over the world, working on every aspect of the mission - including mentorship, teaching, and connecting people.
|
||||||
|
|
||||||
|
Diversity is one of our huge strengths, but it can also lead to communication issues and unhappiness. To that end, we have a few ground rules that we ask people to adhere to. This code applies equally to founders, mentors and those seeking help and guidance.
|
||||||
|
|
||||||
|
This isn’t an exhaustive list of things that you can’t do. Rather, take it in the spirit in which it’s intended - a guide to make it easier to enrich all of us and the technical communities in which we participate.
|
||||||
|
|
||||||
|
This code of conduct applies to all spaces managed by the UT Registration Plus project or Longhorn Developers. This includes IRC, the mailing lists, the issue tracker, DSF events, and any other forums created by the project team which the community uses for communication. In addition, violations of this code outside these spaces may affect a person's ability to participate within them.
|
||||||
|
|
||||||
|
If you believe someone is violating the code of conduct, we ask that you report it by emailing [contact@longhorns.dev](mailto:contact@longhorns.dev). For more details please see our
|
||||||
|
|
||||||
|
- **Be friendly and patient.**
|
||||||
|
- **Be welcoming.** We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.
|
||||||
|
- **Be considerate.** Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, and you should take those consequences into account when making decisions. Remember that we're a world-wide community, so you might not be communicating in someone else's primary language.
|
||||||
|
- **Be respectful.** Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It’s important to remember that a community where people feel uncomfortable or threatened is not a productive one. Members of the UT Registration Plus community should be respectful when dealing with other members as well as with people outside the UT Registration Plus community.
|
||||||
|
- **Be careful in the words that you choose.** We are a community of professionals, and we conduct ourselves professionally. Be kind to others. Do not insult or put down other participants. Harassment and other exclusionary behavior aren't acceptable. This includes, but is not limited to:
|
||||||
|
- Violent threats or language directed against another person.
|
||||||
|
- Discriminatory jokes and language.
|
||||||
|
- Posting sexually explicit or violent material.
|
||||||
|
- Posting (or threatening to post) other people's personally identifying information ("doxing").
|
||||||
|
- Personal insults, especially those using racist or sexist terms.
|
||||||
|
- Unwelcome sexual attention.
|
||||||
|
- Advocating for, or encouraging, any of the above behavior.
|
||||||
|
- Repeated harassment of others. In general, if someone asks you to stop, then stop.
|
||||||
|
- **When we disagree, try to understand why.** Disagreements, both social and technical, happen all the time and UT Registration Plus is no exception. It is important that we resolve disagreements and differing views constructively. Remember that we’re different. The strength of UT Registration Plus comes from its varied community, people from a wide range of backgrounds. Different people have different perspectives on issues. Being unable to understand why someone holds a viewpoint doesn’t mean that they’re wrong. Don’t forget that it is human to err and blaming each other doesn’t get us anywhere. Instead, focus on helping to resolve issues and learning from mistakes.
|
||||||
|
|
||||||
|
Original text courtesy of the [Speak Up! project](http://web.archive.org/web/20141109123859/http://speakup.io/coc.html).
|
||||||
|
|
||||||
|
## Questions?
|
||||||
|
|
||||||
|
If you have questions, please see . If that doesn't answer your questions, feel free to [contact us](mailto:contact@longhorns.dev).
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
- Docker installed on your machine
|
- Docker installed on your machine
|
||||||
- Git (to clone the repository)
|
- Git (to clone the repository)
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
@@ -70,9 +70,9 @@ docker run -it --rm -v $(pwd)/dist:/extension/dist -p 5173:5173 -e BUILD_MODE=de
|
|||||||
|
|
||||||
## Accessing the Built Extension
|
## Accessing the Built Extension
|
||||||
|
|
||||||
- For build mode, the extension files will be in the `dist` directory on your host machine.
|
- For build mode, the extension files will be in the `dist` directory on your host machine.
|
||||||
- For zip mode, the zipped extension will be in the `package` directory on your host machine.
|
- For zip mode, the zipped extension will be in the `package` directory on your host machine.
|
||||||
- For dev mode, the extension will be continuously built in the `dist` directory, and you can load it as an unpacked extension in Chrome.
|
- For dev mode, the extension will be continuously built in the `dist` directory, and you can load it as an unpacked extension in Chrome.
|
||||||
|
|
||||||
## Docker Development Workflow
|
## Docker Development Workflow
|
||||||
|
|
||||||
@@ -85,5 +85,5 @@ When working on the extension:
|
|||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
- If you encounter permission issues with the output directories, ensure that the directories exist on your host machine and have the correct permissions.
|
- If you encounter permission issues with the output directories, ensure that the directories exist on your host machine and have the correct permissions.
|
||||||
- For any other issues, please check the Docker logs or open an issue in the GitHub repository.
|
- For any other issues, please check the Docker logs or open an issue in the GitHub repository.
|
||||||
|
|||||||
118
README.md
118
README.md
@@ -14,37 +14,37 @@
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Quick Access to Class Info**: For each class in the UT Course Schedule, UTRP provides a "breakdown" popup with direct links to RateMyProfessor, Course Evaluation Surveys (CES), and past syllabi.
|
- **Quick Access to Class Info**: For each class in the UT Course Schedule, UTRP provides a "breakdown" popup with direct links to RateMyProfessor, Course Evaluation Surveys (CES), and past syllabi.
|
||||||
- **Prerequisite & Restriction Highlights**: Displays course descriptions with highlighted details on prerequisites, restrictions, and other important info.
|
- **Prerequisite & Restriction Highlights**: Displays course descriptions with highlighted details on prerequisites, restrictions, and other important info.
|
||||||
- **Grade Distribution Graphs**: View an aggregate and semester-specific graph of grade distributions for each course.
|
- **Grade Distribution Graphs**: View an aggregate and semester-specific graph of grade distributions for each course.
|
||||||
- **Saved Courses List**: Easily add courses to a list and view them in the extension popup. Copy unique numbers with a single click.
|
- **Saved Courses List**: Easily add courses to a list and view them in the extension popup. Copy unique numbers with a single click.
|
||||||
- **Conflict Detection**: Automatically highlights and strikes out courses that conflict with your saved courses in the UT Course Catalog.
|
- **Conflict Detection**: Automatically highlights and strikes out courses that conflict with your saved courses in the UT Course Catalog.
|
||||||
- **Weekly Schedule View**: Displays your saved courses in a weekly schedule format for easier planning.
|
- **Weekly Schedule View**: Displays your saved courses in a weekly schedule format for easier planning.
|
||||||
- **Multiple Schedule Support**: Create multiple schedules to plan for different registration scenarios.
|
- **Multiple Schedule Support**: Create multiple schedules to plan for different registration scenarios.
|
||||||
- **And much more!**
|
- **And much more!**
|
||||||
|
|
||||||
## Toolchain
|
## Toolchain
|
||||||
|
|
||||||
- React v20.9.0 (LTS)
|
- React v20.9.0 (LTS)
|
||||||
- TypeScript v5.x
|
- TypeScript v5.x
|
||||||
- Vite v5.x
|
- Vite v5.x
|
||||||
- pnpm v10.x
|
- pnpm v10.x
|
||||||
- UnoCSS
|
- UnoCSS
|
||||||
- ESLint
|
- ESLint
|
||||||
- Prettier
|
- Prettier
|
||||||
- Storybook
|
- Storybook
|
||||||
- Figma
|
- Figma
|
||||||
- Semantic-Release
|
- Semantic-Release
|
||||||
- Custom Messaging & Storage Wrappers
|
- Custom Messaging & Storage Wrappers
|
||||||
|
|
||||||
## VSCode Extensions
|
## VSCode Extensions
|
||||||
|
|
||||||
We recommend using the following VSCode extensions to improve your development experience:
|
We recommend using the following VSCode extensions to improve your development experience:
|
||||||
|
|
||||||
- **[ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)**: For identifying and fixing linting issues.
|
- **[ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)**: For identifying and fixing linting issues.
|
||||||
- **[Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)**: For automatic code formatting.
|
- **[Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)**: For automatic code formatting.
|
||||||
- **[Tailwind CSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss)**: For Tailwind CSS class autocomplete and IntelliSense.
|
- **[Tailwind CSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss)**: For Tailwind CSS class autocomplete and IntelliSense.
|
||||||
- **[UnoCSS](https://marketplace.visualstudio.com/items?itemName=antfu.unocss)**: For better support with UnoCSS utilities.
|
- **[UnoCSS](https://marketplace.visualstudio.com/items?itemName=antfu.unocss)**: For better support with UnoCSS utilities.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ Once set up, the extension can be built to the `dist/` directory using the follo
|
|||||||
|
|
||||||
### Development Builds
|
### Development Builds
|
||||||
|
|
||||||
- Run the development server:
|
- Run the development server:
|
||||||
```bash
|
```bash
|
||||||
pnpm dev
|
pnpm dev
|
||||||
```
|
```
|
||||||
@@ -92,7 +92,7 @@ Once set up, the extension can be built to the `dist/` directory using the follo
|
|||||||
|
|
||||||
### Production Builds
|
### Production Builds
|
||||||
|
|
||||||
- To generate production builds:
|
- To generate production builds:
|
||||||
```bash
|
```bash
|
||||||
pnpm build
|
pnpm build
|
||||||
```
|
```
|
||||||
@@ -121,10 +121,10 @@ To load the extension manually in Chrome:
|
|||||||
|
|
||||||
If you encounter bugs or issues, please report them in the [Issues](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues) section, including:
|
If you encounter bugs or issues, please report them in the [Issues](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues) section, including:
|
||||||
|
|
||||||
- A clear, descriptive title
|
- A clear, descriptive title
|
||||||
- Steps to reproduce the issue
|
- Steps to reproduce the issue
|
||||||
- Expected behavior
|
- Expected behavior
|
||||||
- Screenshots or logs (if applicable)
|
- Screenshots or logs (if applicable)
|
||||||
|
|
||||||
We aim to address issues promptly.
|
We aim to address issues promptly.
|
||||||
|
|
||||||
@@ -142,14 +142,14 @@ Follow this structure for commit messages:
|
|||||||
|
|
||||||
Where:
|
Where:
|
||||||
|
|
||||||
- **type**: One of the following:
|
- **type**: One of the following:
|
||||||
- `feat`: A new feature
|
- `feat`: A new feature
|
||||||
- `fix`: A bug fix
|
- `fix`: A bug fix
|
||||||
- `docs`: Documentation updates
|
- `docs`: Documentation updates
|
||||||
- `style`: Code formatting changes (whitespace, semicolons, etc.)
|
- `style`: Code formatting changes (whitespace, semicolons, etc.)
|
||||||
- `refactor`: Code restructuring (without adding features or fixing bugs)
|
- `refactor`: Code restructuring (without adding features or fixing bugs)
|
||||||
- `test`: Adding or modifying tests
|
- `test`: Adding or modifying tests
|
||||||
- `chore`: Maintenance tasks or build process changes
|
- `chore`: Maintenance tasks or build process changes
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
@@ -168,9 +168,9 @@ Branch names should follow the format:
|
|||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
- `feat/user-login`
|
- `feat/user-login`
|
||||||
- `fix/navbar-layout`
|
- `fix/navbar-layout`
|
||||||
- `docs/update-readme`
|
- `docs/update-readme`
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
@@ -184,28 +184,28 @@ We maintain a strict code of conduct. By contributing, you agree to adhere to th
|
|||||||
|
|
||||||
Special thanks to the developers and contributors behind these amazing tools and libraries:
|
Special thanks to the developers and contributors behind these amazing tools and libraries:
|
||||||
|
|
||||||
- React v20.9.0 (LTS)
|
- React v20.9.0 (LTS)
|
||||||
- TypeScript v5.x
|
- TypeScript v5.x
|
||||||
- Vite v5.x
|
- Vite v5.x
|
||||||
- pnpm v10.x
|
- pnpm v10.x
|
||||||
- UnoCSS
|
- UnoCSS
|
||||||
- ESLint
|
- ESLint
|
||||||
- Prettier
|
- Prettier
|
||||||
- Storybook
|
- Storybook
|
||||||
- Figma
|
- Figma
|
||||||
- Semantic-Release
|
- Semantic-Release
|
||||||
- [chrome-extension-toolkit](https://github.com/sghsri/chrome-extension-toolkit)
|
- [chrome-extension-toolkit](https://github.com/sghsri/chrome-extension-toolkit)
|
||||||
- [UT_Grade_Parser](https://github.com/doprz/UT_Grade_Parser)
|
- [UT_Grade_Parser](https://github.com/doprz/UT_Grade_Parser)
|
||||||
- [eslint-plugin-import-essentials](https://github.com/doprz/eslint-plugin-import-essentials)
|
- [eslint-plugin-import-essentials](https://github.com/doprz/eslint-plugin-import-essentials)
|
||||||
- [UT Registration Plus v1.2.2.7](https://github.com/Longhorn-Developers/UT-Registration-Plus/tree/legacy) by @sghsri
|
- [UT Registration Plus v1.2.2.7](https://github.com/Longhorn-Developers/UT-Registration-Plus/tree/legacy) by @sghsri
|
||||||
- [UT Registration Planner](https://github.com/doprz/UT-Registration-Planner) by @doprz
|
- [UT Registration Planner](https://github.com/doprz/UT-Registration-Planner) by @doprz
|
||||||
- [Figma Designs](https://www.figma.com/design/8tsCay2FRqctrdcZ3r9Ahw/UTRP) by @IsaDavRod
|
- [Figma Designs](https://www.figma.com/design/8tsCay2FRqctrdcZ3r9Ahw/UTRP) by @IsaDavRod
|
||||||
- [Longhorn Developers](https://github.com/Longhorn-Developers) - established in 2024
|
- [Longhorn Developers](https://github.com/Longhorn-Developers) - established in 2024
|
||||||
- The UTRP devs, beta testers, and all supporters of the project!
|
- The UTRP devs, beta testers, and all supporters of the project!
|
||||||
|
|
||||||
## Activity
|
## Activity
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Star History
|
## Star History
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"onlyChanged": true,
|
"onlyChanged": true,
|
||||||
"projectId": "Project:65c5172964f36dcf207985bf",
|
"projectId": "Project:65c5172964f36dcf207985bf",
|
||||||
"zip": true
|
"zip": true
|
||||||
}
|
}
|
||||||
|
|||||||
10
default.nix
Normal file
10
default.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
(import (
|
||||||
|
let
|
||||||
|
rev = "v1.1.0";
|
||||||
|
sha256 = "sha256:19d2z6xsvpxm184m41qrpi1bplilwipgnzv9jy17fgw421785q1m";
|
||||||
|
in
|
||||||
|
fetchTarball {
|
||||||
|
inherit sha256;
|
||||||
|
url = "https://github.com/NixOS/flake-compat/archive/${rev}.tar.gz";
|
||||||
|
}
|
||||||
|
) { src = ./.; }).defaultNix
|
||||||
@@ -24,7 +24,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Validate the mode
|
# Validate the mode
|
||||||
if [[ ! " ${SUPPORTED_MODES[*]} " =~ " ${mode} " ]]; then
|
if [[ ! " ${SUPPORTED_MODES[*]} " =~ ${mode} ]]; then
|
||||||
echo "Error: Invalid mode '${mode}'" >&2
|
echo "Error: Invalid mode '${mode}'" >&2
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|||||||
0
docs/WebSocket-Implementation-Tutorial.md
Normal file
0
docs/WebSocket-Implementation-Tutorial.md
Normal file
87
flake.lock
generated
87
flake.lock
generated
@@ -1,30 +1,30 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-utils": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731533236,
|
"lastModified": 1767609335,
|
||||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
"narHash": "sha256-feveD98mQpptwrAEggBQKJTYbvwwglSbOv53uCfH9PY=",
|
||||||
"owner": "numtide",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-parts",
|
||||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
"rev": "250481aafeb741edfe23d29195671c19b36b6dca",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "numtide",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-parts",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1744932701,
|
"lastModified": 1767640445,
|
||||||
"narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=",
|
"narHash": "sha256-UWYqmD7JFBEDBHWYcqE6s6c77pWdcU/i+bwD6XxMb8A=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef",
|
"rev": "9f0c42f8bc7151b8e7e5840fb3bd454ad850d8c5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -34,24 +34,59 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"nixpkgs-lib": {
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": "nixpkgs"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems": {
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681028828,
|
"lastModified": 1765674936,
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
"narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=",
|
||||||
"owner": "nix-systems",
|
"owner": "nix-community",
|
||||||
"repo": "default",
|
"repo": "nixpkgs.lib",
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
"rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-systems",
|
"owner": "nix-community",
|
||||||
"repo": "default",
|
"repo": "nixpkgs.lib",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1761236834,
|
||||||
|
"narHash": "sha256-+pthv6hrL5VLW2UqPdISGuLiUZ6SnAXdd2DdUE+fV2Q=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "d5faa84122bc0a1fd5d378492efce4e289f8eac1",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"treefmt-nix": "treefmt-nix"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"treefmt-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1767468822,
|
||||||
|
"narHash": "sha256-MpffQxHxmjVKMiQd0Tg2IM/bSjjdQAM+NDcX6yxj7rE=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"rev": "d56486eb9493ad9c4777c65932618e9c2d0468fc",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
45
flake.nix
45
flake.nix
@@ -1,32 +1,33 @@
|
|||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
inputs:
|
inputs@{ flake-parts, ... }:
|
||||||
inputs.flake-utils.lib.eachDefaultSystem (
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
system:
|
systems = inputs.nixpkgs.lib.systems.flakeExposed;
|
||||||
let
|
|
||||||
pkgs = (import (inputs.nixpkgs) { inherit system; });
|
|
||||||
in
|
|
||||||
{
|
|
||||||
formatter = pkgs.nixfmt-rfc-style;
|
|
||||||
|
|
||||||
devShell = pkgs.mkShell {
|
imports = [
|
||||||
buildInputs = with pkgs; [
|
./nix/packages.nix
|
||||||
nodejs_20 # v20.19.0
|
./nix/devShells.nix
|
||||||
pnpm_10 # v10.8.1
|
./nix/treefmt.nix
|
||||||
just
|
];
|
||||||
];
|
|
||||||
|
|
||||||
shellHook = ''
|
perSystem =
|
||||||
echo "UTRP Nix Flake Environment Loaded"
|
{ system, ... }:
|
||||||
echo "Node: $(node --version)"
|
{
|
||||||
echo "pnpm: $(pnpm --version)"
|
_module.args.pkgs = import inputs.nixpkgs {
|
||||||
'';
|
inherit system;
|
||||||
|
overlays = [
|
||||||
|
(final: prev: {
|
||||||
|
nodejs = prev.nodejs_20; # v20.19.5
|
||||||
|
})
|
||||||
|
];
|
||||||
|
config = { };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
30
nix/devShells.nix
Normal file
30
nix/devShells.nix
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
perSystem =
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
commonPackages = with pkgs; [
|
||||||
|
nodejs # Defined in overlay
|
||||||
|
pnpm_10 # v10.18.2
|
||||||
|
];
|
||||||
|
|
||||||
|
additionalPackages = with pkgs; [
|
||||||
|
bun
|
||||||
|
nodePackages.conventional-changelog-cli
|
||||||
|
sentry-cli
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
name = "utrp-dev";
|
||||||
|
packages = commonPackages;
|
||||||
|
};
|
||||||
|
|
||||||
|
devShells.full = pkgs.mkShell {
|
||||||
|
name = "utrp-dev-full";
|
||||||
|
packages = commonPackages ++ additionalPackages;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
51
nix/package.nix
Normal file
51
nix/package.nix
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
stdenv,
|
||||||
|
lib,
|
||||||
|
nodejs,
|
||||||
|
pnpm_10,
|
||||||
|
git,
|
||||||
|
version ? "dev",
|
||||||
|
gitRev ? "unknown",
|
||||||
|
gitBranch ? "unknown",
|
||||||
|
buildScript ? "build",
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
|
inherit version;
|
||||||
|
pname = "ut-registration-plus";
|
||||||
|
|
||||||
|
src = ../.;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
nodejs
|
||||||
|
pnpm_10.configHook
|
||||||
|
git
|
||||||
|
];
|
||||||
|
|
||||||
|
pnpmDeps = pnpm_10.fetchDeps {
|
||||||
|
inherit (finalAttrs) pname version src;
|
||||||
|
fetcherVersion = 2;
|
||||||
|
hash = "sha256-UqHymJWvlTV4glra/6DkxuCxbG5dpPkFcnvq3vuxsJ8=";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Pass git info to the build
|
||||||
|
VITE_GIT_COMMIT = gitRev;
|
||||||
|
VITE_GIT_BRANCH = gitBranch;
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
pnpm run ${buildScript}
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp -r dist/* $out/
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "UT Registration Plus";
|
||||||
|
homepage = "https://github.com/Longhorn-Developers/UT-Registration-Plus";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
maintainers = lib.maintainers.doprz;
|
||||||
|
platforms = lib.platforms.unix;
|
||||||
|
};
|
||||||
|
})
|
||||||
40
nix/packages.nix
Normal file
40
nix/packages.nix
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
perSystem =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
let
|
||||||
|
packageJson = builtins.fromJSON (builtins.readFile ../package.json);
|
||||||
|
gitRev = inputs.self.shortRev or inputs.self.dirtyShortRev or "dev";
|
||||||
|
gitBranch = if inputs.self ? ref then inputs.self.ref else "unknown";
|
||||||
|
baseVersion = packageJson.version;
|
||||||
|
|
||||||
|
commonArgs = {
|
||||||
|
inherit gitRev gitBranch;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Prod variant
|
||||||
|
ut-registration-plus = pkgs.callPackage ./package.nix (
|
||||||
|
commonArgs
|
||||||
|
// {
|
||||||
|
version = "${baseVersion}+git.${gitRev}";
|
||||||
|
buildScript = "build";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
# Dev variant
|
||||||
|
ut-registration-plus-dev = pkgs.callPackage ./package.nix (
|
||||||
|
commonArgs
|
||||||
|
// {
|
||||||
|
version = "${baseVersion}-dev+git.${gitRev}";
|
||||||
|
buildScript = "build:dev";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = {
|
||||||
|
inherit ut-registration-plus ut-registration-plus-dev;
|
||||||
|
default = ut-registration-plus;
|
||||||
|
dev = ut-registration-plus-dev;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
63
nix/treefmt.nix
Normal file
63
nix/treefmt.nix
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.treefmt-nix.flakeModule
|
||||||
|
];
|
||||||
|
|
||||||
|
perSystem =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
treefmt = {
|
||||||
|
projectRootFile = "flake.nix";
|
||||||
|
programs.nixfmt.enable = pkgs.lib.meta.availableOn pkgs.stdenv.buildPlatform pkgs.nixfmt-rfc-style.compiler;
|
||||||
|
programs.nixfmt.package = pkgs.nixfmt-rfc-style;
|
||||||
|
|
||||||
|
# NOTE: Make sure the prettier version in package.json and the one used by treefmt are the same for consistent results
|
||||||
|
programs.prettier.enable = true;
|
||||||
|
programs.shellcheck.enable = true;
|
||||||
|
programs.yamlfmt.enable = true;
|
||||||
|
programs.dockerfmt.enable = true;
|
||||||
|
|
||||||
|
settings.formatter.prettier.excludes = [ "pnpm-lock.yaml" ];
|
||||||
|
settings.formatter.shellcheck.excludes = [ ".envrc" ];
|
||||||
|
settings.formatter.yamlfmt.excludes = [ "pnpm-lock.yaml" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
checks = {
|
||||||
|
prettier-version-match =
|
||||||
|
pkgs.runCommand "check-prettier-version"
|
||||||
|
{
|
||||||
|
buildInputs = [ pkgs.jq ];
|
||||||
|
}
|
||||||
|
''
|
||||||
|
# Extract prettier version from package.json
|
||||||
|
packageJsonVersion=$(jq -r '.devDependencies.prettier // empty' ${../package.json})
|
||||||
|
|
||||||
|
if [ -z "$packageJsonVersion" ]; then
|
||||||
|
echo "Error: prettier not found in package.json devDependencies"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove any semver prefix characters (^, ~, etc...)
|
||||||
|
packageJsonVersion=$(echo "$packageJsonVersion" | sed 's/^[\^~>=<]*//')
|
||||||
|
|
||||||
|
# Get prettier version from nixpkgs
|
||||||
|
nixVersion="${pkgs.nodePackages.prettier.version}"
|
||||||
|
|
||||||
|
if [ "$packageJsonVersion" != "$nixVersion" ]; then
|
||||||
|
echo ""
|
||||||
|
echo "ERROR: Prettier version mismatch!"
|
||||||
|
echo " package.json: $packageJsonVersion"
|
||||||
|
echo " nixpkgs: $nixVersion"
|
||||||
|
echo ""
|
||||||
|
echo "Please update one of the following:"
|
||||||
|
echo " - Update prettier in package.json to match nixpkgs: $nixVersion"
|
||||||
|
echo " - Override prettier in your flake to match package.json"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
touch $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
18
package.json
18
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ut-registration-plus",
|
"name": "ut-registration-plus",
|
||||||
"displayName": "UT Registration Plus",
|
"displayName": "UT Registration Plus",
|
||||||
"version": "2.2.1",
|
"version": "2.3.0",
|
||||||
"description": "UT Registration Plus is a Chrome extension that allows students to easily register for classes.",
|
"description": "UT Registration Plus is a Chrome extension that allows students to easily register for classes.",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://github.com/Longhorn-Developers/UT-Registration-Plus",
|
"homepage": "https://github.com/Longhorn-Developers/UT-Registration-Plus",
|
||||||
@@ -39,6 +39,9 @@
|
|||||||
"@phosphor-icons/react": "^2.1.7",
|
"@phosphor-icons/react": "^2.1.7",
|
||||||
"@sentry/react": "^8.55.0",
|
"@sentry/react": "^8.55.0",
|
||||||
"@tanstack/react-query": "^5.69.0",
|
"@tanstack/react-query": "^5.69.0",
|
||||||
|
"@tsparticles/engine": "^3.9.1",
|
||||||
|
"@tsparticles/react": "^3.0.0",
|
||||||
|
"@tsparticles/slim": "^3.9.1",
|
||||||
"@unocss/vite": "^0.63.6",
|
"@unocss/vite": "^0.63.6",
|
||||||
"@vitejs/plugin-react": "^4.3.4",
|
"@vitejs/plugin-react": "^4.3.4",
|
||||||
"chrome-extension-toolkit": "^0.0.54",
|
"chrome-extension-toolkit": "^0.0.54",
|
||||||
@@ -136,7 +139,7 @@
|
|||||||
"gulp-zip": "^6.1.0",
|
"gulp-zip": "^6.1.0",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"postcss": "^8.5.3",
|
"postcss": "^8.5.3",
|
||||||
"prettier": "^3.5.2",
|
"prettier": "3.6.2",
|
||||||
"react-dev-utils": "^12.0.1",
|
"react-dev-utils": "^12.0.1",
|
||||||
"semantic-release": "^24.2.3",
|
"semantic-release": "^24.2.3",
|
||||||
"storybook": "^8.6.0",
|
"storybook": "^8.6.0",
|
||||||
@@ -144,7 +147,7 @@
|
|||||||
"unocss": "^0.63.6",
|
"unocss": "^0.63.6",
|
||||||
"unocss-preset-primitives": "0.0.2-beta.1",
|
"unocss-preset-primitives": "0.0.2-beta.1",
|
||||||
"unplugin-icons": "^0.19.3",
|
"unplugin-icons": "^0.19.3",
|
||||||
"vite": "^5.4.14",
|
"vite": "^5.4.20",
|
||||||
"vite-plugin-inspect": "^0.8.9",
|
"vite-plugin-inspect": "^0.8.9",
|
||||||
"vitest": "^2.1.9"
|
"vitest": "^2.1.9"
|
||||||
},
|
},
|
||||||
@@ -159,10 +162,13 @@
|
|||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"es-module-lexer": "^1.5.4"
|
"es-module-lexer": "^1.5.4"
|
||||||
}
|
},
|
||||||
|
"onlyBuiltDependencies": [
|
||||||
|
"@tsparticles/engine"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"volta": {
|
"volta": {
|
||||||
"node": "20.9.0",
|
"node": "20.19.4",
|
||||||
"pnpm": "10.6.5"
|
"pnpm": "10.14.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1423
pnpm-lock.yaml
generated
1423
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Binary file not shown.
10
shell.nix
Normal file
10
shell.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
(import (
|
||||||
|
let
|
||||||
|
rev = "v1.1.0";
|
||||||
|
sha256 = "sha256:19d2z6xsvpxm184m41qrpi1bplilwipgnzv9jy17fgw421785q1m";
|
||||||
|
in
|
||||||
|
fetchTarball {
|
||||||
|
inherit sha256;
|
||||||
|
url = "https://github.com/NixOS/flake-compat/archive/${rev}.tar.gz";
|
||||||
|
}
|
||||||
|
) { src = ./.; }).shellNix
|
||||||
@@ -271,12 +271,12 @@ export default function Page404(): JSX.Element {
|
|||||||
}
|
}
|
||||||
function _0x5629d1() {
|
function _0x5629d1() {
|
||||||
let _0x13c635 = _0xdd3699;
|
let _0x13c635 = _0xdd3699;
|
||||||
_0x5b7f43(),
|
(_0x5b7f43(),
|
||||||
_0x16f39e[_0x13c635(0x81)](
|
_0x16f39e[_0x13c635(0x81)](
|
||||||
_0x228047,
|
_0x228047,
|
||||||
0x9c + -0x1 * 0x23ab + 0x230f * 0x1,
|
0x9c + -0x1 * 0x23ab + 0x230f * 0x1,
|
||||||
-0x1c26 + 0x7bf + -0x6cd * -0x3
|
-0x1c26 + 0x7bf + -0x6cd * -0x3
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
let _0x93f360 = 0x64 * 0x49 + 0x1e1e + -0x3aa2;
|
let _0x93f360 = 0x64 * 0x49 + 0x1e1e + -0x3aa2;
|
||||||
function _0x5b7f43() {
|
function _0x5b7f43() {
|
||||||
@@ -373,12 +373,12 @@ export default function Page404(): JSX.Element {
|
|||||||
(-0x2469 + 0x156a * -0x1 + 0x39e2)) +
|
(-0x2469 + 0x156a * -0x1 + 0x39e2)) +
|
||||||
(-0x1 * 0x13f8 + 0x6df + -0x1 * -0xd29);
|
(-0x1 * 0x13f8 + 0x6df + -0x1 * -0xd29);
|
||||||
if (_0x3e178a == 0x1 * -0x1a87 + 0x1fdd + -0x555 * 0x1) {
|
if (_0x3e178a == 0x1 * -0x1a87 + 0x1fdd + -0x555 * 0x1) {
|
||||||
(_0x546fb5 =
|
((_0x546fb5 =
|
||||||
(_0x227002 * (-0x10d7 + 0x1 * 0x15ad + -0x2 * 0x263)) &
|
(_0x227002 * (-0x10d7 + 0x1 * 0x15ad + -0x2 * 0x263)) &
|
||||||
(-0x25ca * 0x1 + 0x8 * 0x278 + -0x1 * -0x1219)),
|
(-0x25ca * 0x1 + 0x8 * 0x278 + -0x1 * -0x1219)),
|
||||||
(_0x1667c5 =
|
(_0x1667c5 =
|
||||||
(_0x32116b * (0x4d3 + 0x1c09 * -0x1 + 0x3 * 0x7c2)) &
|
(_0x32116b * (0x4d3 + 0x1c09 * -0x1 + 0x3 * 0x7c2)) &
|
||||||
(-0xf06 * 0x2 + -0x144f * -0x1 + -0x344 * -0x3));
|
(-0xf06 * 0x2 + -0x144f * -0x1 + -0x344 * -0x3)));
|
||||||
if (_0x5b3085 < -0xa * 0xed + -0xd19 + 0x1 * 0x165b)
|
if (_0x5b3085 < -0xa * 0xed + -0xd19 + 0x1 * 0x165b)
|
||||||
_0x1667c5 += -0xd48 + 0xf6c + 0xc * -0x2b;
|
_0x1667c5 += -0xd48 + 0xf6c + 0xc * -0x2b;
|
||||||
}
|
}
|
||||||
@@ -410,10 +410,10 @@ export default function Page404(): JSX.Element {
|
|||||||
(-0x2709 + -0x6 * -0x312 + -0x39a * -0x6)),
|
(-0x2709 + -0x6 * -0x312 + -0x39a * -0x6)),
|
||||||
(_0x267dd3 = _0x38c463));
|
(_0x267dd3 = _0x38c463));
|
||||||
}
|
}
|
||||||
(_0x227002 += _0x4b089b),
|
((_0x227002 += _0x4b089b),
|
||||||
(_0x2aec99 += _0x5b3085),
|
(_0x2aec99 += _0x5b3085),
|
||||||
(_0x32116b += _0x1eaaad),
|
(_0x32116b += _0x1eaaad),
|
||||||
(_0x38c463 += _0x57383c);
|
(_0x38c463 += _0x57383c));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let _0x5cba48 =
|
let _0x5cba48 =
|
||||||
@@ -430,7 +430,7 @@ export default function Page404(): JSX.Element {
|
|||||||
let _0xdf8389 =
|
let _0xdf8389 =
|
||||||
((_0x13f1b0 & (-0x247a + -0x4 * -0x9c2 + -0x39 * 0x7)) * _0x2062a9 * _0x5c387a) /
|
((_0x13f1b0 & (-0x247a + -0x4 * -0x9c2 + -0x39 * 0x7)) * _0x2062a9 * _0x5c387a) /
|
||||||
((0x1d5 * 0xa + -0x250a + -0x31 * -0x67) * (-0x7 * 0x25f + -0xae7 + 0x1c7f * 0x1));
|
((0x1d5 * 0xa + -0x250a + -0x31 * -0x67) * (-0x7 * 0x25f + -0xae7 + 0x1c7f * 0x1));
|
||||||
(_0x228047[_0x4626de(0x8e)][
|
((_0x228047[_0x4626de(0x8e)][
|
||||||
(_0x132623 + _0x1a573d * _0x124180) * (0x29 * -0xa9 + -0x94 * -0x2b + -0x239 * -0x1) +
|
(_0x132623 + _0x1a573d * _0x124180) * (0x29 * -0xa9 + -0x94 * -0x2b + -0x239 * -0x1) +
|
||||||
(0x55d * 0x2 + 0xeed * 0x1 + -0xc7 * 0x21)
|
(0x55d * 0x2 + 0xeed * 0x1 + -0xc7 * 0x21)
|
||||||
] = _0x5cba48),
|
] = _0x5cba48),
|
||||||
@@ -441,7 +441,7 @@ export default function Page404(): JSX.Element {
|
|||||||
(_0x228047[_0x4626de(0x8e)][
|
(_0x228047[_0x4626de(0x8e)][
|
||||||
(_0x132623 + _0x1a573d * _0x124180) * (0x1e2a + -0x21df + -0x1 * -0x3b9) +
|
(_0x132623 + _0x1a573d * _0x124180) * (0x1e2a + -0x21df + -0x1 * -0x3b9) +
|
||||||
(0x1e79 + 0x860 * -0x2 + 0x1 * -0xdb7)
|
(0x1e79 + 0x860 * -0x2 + 0x1 * -0xdb7)
|
||||||
] = _0xdf8389);
|
] = _0xdf8389));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import CourseCatalogMain from '@views/components/CourseCatalogMain';
|
import CourseCatalogMain from '@views/components/CourseCatalogMain';
|
||||||
import InjectedButton from '@views/components/injected/AddAllButton';
|
import InjectedButton from '@views/components/injected/AddAllButton';
|
||||||
import DaysCheckbox from '@views/components/injected/DaysCheckbox';
|
import DaysCheckbox from '@views/components/injected/DaysCheckbox';
|
||||||
|
import ShadedResults from '@views/components/injected/SearchResultShader';
|
||||||
import getSiteSupport, { SiteSupport } from '@views/lib/getSiteSupport';
|
import getSiteSupport, { SiteSupport } from '@views/lib/getSiteSupport';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { createRoot } from 'react-dom/client';
|
import { createRoot } from 'react-dom/client';
|
||||||
@@ -30,3 +31,7 @@ if (support === SiteSupport.MY_UT) {
|
|||||||
if (support === SiteSupport.COURSE_CATALOG_SEARCH) {
|
if (support === SiteSupport.COURSE_CATALOG_SEARCH) {
|
||||||
renderComponent(DaysCheckbox);
|
renderComponent(DaysCheckbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (support === SiteSupport.COURSE_CATALOG_KWS) {
|
||||||
|
renderComponent(ShadedResults);
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ export interface IOptionsStore {
|
|||||||
|
|
||||||
/** whether the promo should be shown */
|
/** whether the promo should be shown */
|
||||||
showUTDiningPromo: boolean;
|
showUTDiningPromo: boolean;
|
||||||
|
/** whether users are allowed to bypass the 10 schedule limit */
|
||||||
|
allowMoreSchedules: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const OptionsStore = createSyncStore<IOptionsStore>({
|
export const OptionsStore = createSyncStore<IOptionsStore>({
|
||||||
@@ -34,6 +36,7 @@ export const OptionsStore = createSyncStore<IOptionsStore>({
|
|||||||
alwaysOpenCalendarInNewTab: false,
|
alwaysOpenCalendarInNewTab: false,
|
||||||
showCalendarSidebar: true,
|
showCalendarSidebar: true,
|
||||||
showUTDiningPromo: true,
|
showUTDiningPromo: true,
|
||||||
|
allowMoreSchedules: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,6 +53,7 @@ export const initSettings = async () =>
|
|||||||
alwaysOpenCalendarInNewTab: await OptionsStore.get('alwaysOpenCalendarInNewTab'),
|
alwaysOpenCalendarInNewTab: await OptionsStore.get('alwaysOpenCalendarInNewTab'),
|
||||||
showCalendarSidebar: await OptionsStore.get('showCalendarSidebar'),
|
showCalendarSidebar: await OptionsStore.get('showCalendarSidebar'),
|
||||||
showUTDiningPromo: await OptionsStore.get('showUTDiningPromo'),
|
showUTDiningPromo: await OptionsStore.get('showUTDiningPromo'),
|
||||||
|
allowMoreSchedules: await OptionsStore.get('allowMoreSchedules'),
|
||||||
}) satisfies IOptionsStore;
|
}) satisfies IOptionsStore;
|
||||||
|
|
||||||
// Clothing retailer right
|
// Clothing retailer right
|
||||||
|
|||||||
19
src/stories/components/CalendarFooter.stories.tsx
Normal file
19
src/stories/components/CalendarFooter.stories.tsx
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
|
import CalendarFooter from '@views/components/calendar/CalendarFooter';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
const meta = {
|
||||||
|
title: 'Components/Calendar/CalendarFooter',
|
||||||
|
component: CalendarFooter,
|
||||||
|
parameters: {
|
||||||
|
layout: 'centered',
|
||||||
|
},
|
||||||
|
tags: ['autodocs'],
|
||||||
|
} satisfies Meta<typeof CalendarFooter>;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
export const Default: Story = {
|
||||||
|
args: {},
|
||||||
|
};
|
||||||
@@ -15,6 +15,8 @@ import type { SiteSupportType } from '@views/lib/getSiteSupport';
|
|||||||
import { populateSearchInputs } from '@views/lib/populateSearchInputs';
|
import { populateSearchInputs } from '@views/lib/populateSearchInputs';
|
||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import DialogProvider from './common/DialogProvider/DialogProvider';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
support: Extract<SiteSupportType, 'COURSE_CATALOG_DETAILS' | 'COURSE_CATALOG_LIST'>;
|
support: Extract<SiteSupportType, 'COURSE_CATALOG_DETAILS' | 'COURSE_CATALOG_LIST'>;
|
||||||
}
|
}
|
||||||
@@ -82,28 +84,30 @@ export default function CourseCatalogMain({ support }: Props): JSX.Element | nul
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ExtensionRoot>
|
<ExtensionRoot>
|
||||||
<NewSearchLink />
|
<DialogProvider>
|
||||||
<RecruitmentBanner />
|
<NewSearchLink />
|
||||||
<TableHead>Plus</TableHead>
|
<RecruitmentBanner />
|
||||||
{rows.map(
|
<TableHead>Plus</TableHead>
|
||||||
row =>
|
{rows.map(
|
||||||
row.course && (
|
row =>
|
||||||
<TableRow
|
row.course && (
|
||||||
key={row.course.uniqueId}
|
<TableRow
|
||||||
row={row}
|
key={row.course.uniqueId}
|
||||||
isSelected={row.course.uniqueId === selectedCourse?.uniqueId}
|
row={row}
|
||||||
activeSchedule={activeSchedule}
|
isSelected={row.course.uniqueId === selectedCourse?.uniqueId}
|
||||||
onClick={handleRowButtonClick(row.course)}
|
activeSchedule={activeSchedule}
|
||||||
/>
|
onClick={handleRowButtonClick(row.course)}
|
||||||
)
|
/>
|
||||||
)}
|
)
|
||||||
<CourseCatalogInjectedPopup
|
)}
|
||||||
course={selectedCourse!} // always defined when showPopup is true
|
<CourseCatalogInjectedPopup
|
||||||
show={showPopup}
|
course={selectedCourse!} // always defined when showPopup is true
|
||||||
onClose={() => setShowPopup(false)}
|
show={showPopup}
|
||||||
afterLeave={() => setSelectedCourse(null)}
|
onClose={() => setShowPopup(false)}
|
||||||
/>
|
afterLeave={() => setSelectedCourse(null)}
|
||||||
{enableScrollToLoad && <AutoLoad addRows={addRows} />}
|
/>
|
||||||
|
{enableScrollToLoad && <AutoLoad addRows={addRows} />}
|
||||||
|
</DialogProvider>
|
||||||
</ExtensionRoot>
|
</ExtensionRoot>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,11 +114,12 @@ export default function Calendar(): ReactNode {
|
|||||||
<LargeLogo />
|
<LargeLogo />
|
||||||
<Button
|
<Button
|
||||||
variant='minimal'
|
variant='minimal'
|
||||||
|
size='small'
|
||||||
color='theme-black'
|
color='theme-black'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setShowSidebar(!showSidebar);
|
setShowSidebar(!showSidebar);
|
||||||
}}
|
}}
|
||||||
className='h-fit screenshot:hidden !p-0'
|
className='screenshot:hidden'
|
||||||
icon={Sidebar}
|
icon={Sidebar}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -124,17 +124,15 @@ export default function CourseCellColorPicker({ defaultColor }: CourseCellColorP
|
|||||||
<>
|
<>
|
||||||
<Divider orientation='horizontal' size='100%' className='my-1' />
|
<Divider orientation='horizontal' size='100%' className='my-1' />
|
||||||
<div className='grid grid-cols-6 gap-1'>
|
<div className='grid grid-cols-6 gap-1'>
|
||||||
{colorPatchColors
|
{colorPatchColors.get(selectedBaseColor)?.map(shadeColor => (
|
||||||
.get(selectedBaseColor)
|
<ColorPatch
|
||||||
?.map(shadeColor => (
|
key={shadeColor}
|
||||||
<ColorPatch
|
color={shadeColor}
|
||||||
key={shadeColor}
|
isSelected={shadeColor === hexCodeWithHash}
|
||||||
color={shadeColor}
|
handleSelectColorPatch={handleSelectColorPatch}
|
||||||
isSelected={shadeColor === hexCodeWithHash}
|
defaultColor={defaultColor}
|
||||||
handleSelectColorPatch={handleSelectColorPatch}
|
/>
|
||||||
defaultColor={defaultColor}
|
))}
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -27,12 +27,10 @@ export default function HexColorEditor({ hexCode, setHexCode }: HexColorEditorPr
|
|||||||
const tagColor = pickFontColor(previewColor.slice(1) as `#${string}`);
|
const tagColor = pickFontColor(previewColor.slice(1) as `#${string}`);
|
||||||
|
|
||||||
const [localHexCode, setLocalHexCode] = React.useState(hexCode);
|
const [localHexCode, setLocalHexCode] = React.useState(hexCode);
|
||||||
const debouncedSetHexCode = useDebounce((value: string) => setHexCode(value), 500);
|
const debouncedSetHexCode = useDebounce(setHexCode, 500);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (hexCode !== localHexCode) {
|
setLocalHexCode(hexCode);
|
||||||
setLocalHexCode(hexCode);
|
|
||||||
}
|
|
||||||
}, [hexCode]);
|
}, [hexCode]);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
|||||||
@@ -58,13 +58,7 @@ export default function CalendarFooter(): JSX.Element {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button variant='minimal' size='small' icon={GearSix} color='ut-black' onClick={handleOpenOptions} />
|
||||||
className='h-fit w-fit !p-0'
|
|
||||||
variant='minimal'
|
|
||||||
icon={GearSix}
|
|
||||||
color='ut-black'
|
|
||||||
onClick={handleOpenOptions}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/react';
|
import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/react';
|
||||||
import { CalendarDots, Export, FilePng, Sidebar } from '@phosphor-icons/react';
|
import { CalendarDots, Export, FileCode, FilePng, Sidebar } from '@phosphor-icons/react';
|
||||||
import styles from '@views/components/calendar/CalendarHeader/CalendarHeader.module.scss';
|
import styles from '@views/components/calendar/CalendarHeader/CalendarHeader.module.scss';
|
||||||
import { Button } from '@views/components/common/Button';
|
import { Button } from '@views/components/common/Button';
|
||||||
import DialogProvider from '@views/components/common/DialogProvider/DialogProvider';
|
import DialogProvider from '@views/components/common/DialogProvider/DialogProvider';
|
||||||
@@ -11,7 +11,7 @@ import useSchedules from '@views/hooks/useSchedules';
|
|||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { saveAsCal, saveCalAsPng } from '../utils';
|
import { handleExportJson, saveAsCal, saveCalAsPng } from '../utils';
|
||||||
|
|
||||||
interface CalendarHeaderProps {
|
interface CalendarHeaderProps {
|
||||||
sidebarOpen?: boolean;
|
sidebarOpen?: boolean;
|
||||||
@@ -28,14 +28,15 @@ export default function CalendarHeader({ sidebarOpen, onSidebarToggle }: Calenda
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{ scrollbarGutter: 'stable' }}
|
style={{ scrollbarGutter: 'stable' }}
|
||||||
className='sticky left-0 right-0 top-0 z-10 min-h-[85px] flex items-center gap-5 overflow-x-scroll overflow-y-hidden bg-white pl-spacing-7 pt-spacing-5'
|
className='sticky left-0 right-0 top-0 z-10 min-h-[85px] flex items-center gap-5 overflow-x-auto overflow-y-hidden bg-white pl-spacing-7 pt-spacing-5'
|
||||||
>
|
>
|
||||||
{!sidebarOpen && (
|
{!sidebarOpen && (
|
||||||
<Button
|
<Button
|
||||||
variant='minimal'
|
variant='minimal'
|
||||||
|
size='small'
|
||||||
color='theme-black'
|
color='theme-black'
|
||||||
onClick={onSidebarToggle}
|
onClick={onSidebarToggle}
|
||||||
className='h-fit w-fit screenshot:hidden !p-0'
|
className='screenshot:hidden'
|
||||||
icon={Sidebar}
|
icon={Sidebar}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -98,6 +99,18 @@ export default function CalendarHeader({ sidebarOpen, onSidebarToggle }: Calenda
|
|||||||
Save as .cal
|
Save as .cal
|
||||||
</Button>
|
</Button>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
<MenuItem>
|
||||||
|
<Button
|
||||||
|
className='w-full flex justify-start'
|
||||||
|
onClick={() => handleExportJson(activeSchedule.id)}
|
||||||
|
color='ut-black'
|
||||||
|
size='small'
|
||||||
|
variant='minimal'
|
||||||
|
icon={FileCode}
|
||||||
|
>
|
||||||
|
Save as .json
|
||||||
|
</Button>
|
||||||
|
</MenuItem>
|
||||||
{/* <MenuItem>
|
{/* <MenuItem>
|
||||||
<Button color='ut-black' size='small' variant='minimal' icon={FileTxt}>
|
<Button color='ut-black' size='small' variant='minimal' icon={FileTxt}>
|
||||||
Export Unique IDs
|
Export Unique IDs
|
||||||
|
|||||||
@@ -26,15 +26,16 @@ export function CalendarSchedules() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='min-w-full w-0 flex flex-col items-center gap-y-spacing-3'>
|
<div className='min-w-full w-0 flex flex-col items-center gap-y-spacing-2'>
|
||||||
<div className='m0 w-full flex justify-between'>
|
<div className='m0 w-full flex items-center justify-between'>
|
||||||
<Text variant='h3' className='text-nowrap text-theme-black'>
|
<Text variant='h3' className='text-nowrap text-theme-black'>
|
||||||
MY SCHEDULES
|
MY SCHEDULES
|
||||||
</Text>
|
</Text>
|
||||||
<Button
|
<Button
|
||||||
variant='minimal'
|
variant='minimal'
|
||||||
|
size='small'
|
||||||
color='theme-black'
|
color='theme-black'
|
||||||
className='h-fit w-fit !p-0 btn'
|
className='!p-0 btn'
|
||||||
onClick={handleAddSchedule}
|
onClick={handleAddSchedule}
|
||||||
icon={Plus}
|
icon={Plus}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { AppStoreLogo, ForkKnife, X as CloseIcon } from '@phosphor-icons/react';
|
import { AppStoreLogo, ForkKnife, X as CloseIcon } from '@phosphor-icons/react';
|
||||||
import { UT_DINING_APP_STORE_URL, UT_DINING_GOOGLE_PLAY_URL } from '@shared/util/appUrls';
|
import { UT_DINING_APP_STORE_URL } from '@shared/util/appUrls';
|
||||||
import { Button } from '@views/components/common/Button';
|
import { Button } from '@views/components/common/Button';
|
||||||
import Text from '@views/components/common/Text/Text';
|
import Text from '@views/components/common/Text/Text';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|||||||
@@ -14,30 +14,30 @@ interface LinkItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const links: LinkItem[] = [
|
const links: LinkItem[] = [
|
||||||
{
|
|
||||||
text: "Fall '25 Course Schedule",
|
|
||||||
url: 'https://utdirect.utexas.edu/apps/registrar/course_schedule/20259/',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "Summer '25 Course Schedule",
|
|
||||||
url: 'https://utdirect.utexas.edu/apps/registrar/course_schedule/20256/',
|
|
||||||
},
|
|
||||||
// {
|
// {
|
||||||
// text: "Spring '25 Course Schedule",
|
// text: "Fall '25 Course Schedule",
|
||||||
// url: 'https://utdirect.utexas.edu/apps/registrar/course_schedule/20252/',
|
// url: 'https://utdirect.utexas.edu/apps/registrar/course_schedule/20259/',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// text: 'Course Schedule Archives',
|
||||||
|
// url: 'https://registrar.utexas.edu/schedules/archive',
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
text: 'Course Schedule Archives',
|
text: "Spring '26 Course Schedule",
|
||||||
url: 'https://registrar.utexas.edu/schedules/archive',
|
url: 'https://utdirect.utexas.edu/apps/registrar/course_schedule/20262/',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Other Course Schedules',
|
||||||
|
url: 'https://registrar.utexas.edu/schedules',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'My Degree Audit (IDA)',
|
text: 'My Degree Audit (IDA)',
|
||||||
url: 'https://utdirect.utexas.edu/apps/degree/audits/',
|
url: 'https://utdirect.utexas.edu/apps/degree/audits/',
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// text: "'24-'25 Academic Calendar",
|
text: "'25-'26 Academic Calendar",
|
||||||
// url: 'https://registrar.utexas.edu/calendars/24-25',
|
url: 'https://registrar.utexas.edu/calendars/25-26',
|
||||||
// },
|
},
|
||||||
{
|
{
|
||||||
text: 'Registration Info Sheet (RIS)',
|
text: 'Registration Info Sheet (RIS)',
|
||||||
url: 'https://utdirect.utexas.edu/registrar/ris.WBX',
|
url: 'https://utdirect.utexas.edu/registrar/ris.WBX',
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { tz, TZDate } from '@date-fns/tz';
|
import { tz, TZDate } from '@date-fns/tz';
|
||||||
|
import exportSchedule from '@pages/background/lib/exportSchedule';
|
||||||
import { UserScheduleStore } from '@shared/storage/UserScheduleStore';
|
import { UserScheduleStore } from '@shared/storage/UserScheduleStore';
|
||||||
import type { Course } from '@shared/types/Course';
|
import type { Course } from '@shared/types/Course';
|
||||||
import type { CourseMeeting } from '@shared/types/CourseMeeting';
|
import type { CourseMeeting } from '@shared/types/CourseMeeting';
|
||||||
@@ -261,6 +262,22 @@ export const saveAsCal = async () => {
|
|||||||
downloadBlob(icsString, 'CALENDAR', 'schedule.ics');
|
downloadBlob(icsString, 'CALENDAR', 'schedule.ics');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Saves current schedule to JSON that can be imported on other devices.
|
||||||
|
* @param id - Provided schedule ID to download
|
||||||
|
*/
|
||||||
|
export const handleExportJson = async (id: string) => {
|
||||||
|
const jsonString = await exportSchedule(id);
|
||||||
|
if (jsonString) {
|
||||||
|
const schedules = await UserScheduleStore.get('schedules');
|
||||||
|
const schedule = schedules.find(s => s.id === id);
|
||||||
|
const fileName = `${schedule?.name ?? `schedule_${id}`}_${new Date().toISOString().replace(/[:.]/g, '-')}.json`;
|
||||||
|
await downloadBlob(jsonString, 'JSON', fileName);
|
||||||
|
} else {
|
||||||
|
console.error('Error exporting schedule: jsonString is undefined');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the calendar as a PNG image.
|
* Saves the calendar as a PNG image.
|
||||||
*
|
*
|
||||||
@@ -427,7 +444,8 @@ export const calculateCourseCellColumns = (dayCells: CalendarGridCourse[]) => {
|
|||||||
typeof cell.calendarGridPoint.startIndex === 'number' &&
|
typeof cell.calendarGridPoint.startIndex === 'number' &&
|
||||||
cell.calendarGridPoint.startIndex >= 0
|
cell.calendarGridPoint.startIndex >= 0
|
||||||
)
|
)
|
||||||
.toSorted((a, b) => a.calendarGridPoint.startIndex - b.calendarGridPoint.startIndex);
|
.slice()
|
||||||
|
.sort((a, b) => a.calendarGridPoint.startIndex - b.calendarGridPoint.startIndex);
|
||||||
|
|
||||||
// Initialize metadata
|
// Initialize metadata
|
||||||
for (const cell of cells) {
|
for (const cell of cells) {
|
||||||
|
|||||||
@@ -15,6 +15,11 @@
|
|||||||
@apply font-sans;
|
@apply font-sans;
|
||||||
color: #303030;
|
color: #303030;
|
||||||
|
|
||||||
|
// fix font-family on injected pages
|
||||||
|
* {
|
||||||
|
@apply font-sans;
|
||||||
|
}
|
||||||
|
|
||||||
[data-rfd-drag-handle-context-id=':r1:'] {
|
[data-rfd-drag-handle-context-id=':r1:'] {
|
||||||
cursor: move;
|
cursor: move;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type { ThemeColor } from '@shared/types/ThemeColors';
|
|||||||
import { getThemeColorHexByName, getThemeColorRgbByName } from '@shared/util/themeColors';
|
import { getThemeColorHexByName, getThemeColorRgbByName } from '@shared/util/themeColors';
|
||||||
import Text from '@views/components/common/Text/Text';
|
import Text from '@views/components/common/Text/Text';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import React from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
className?: string;
|
className?: string;
|
||||||
@@ -21,9 +21,8 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A reusable input button component that follows the Button.tsx consistency
|
* A reusable input button component that follows Button.tsx consistency.
|
||||||
*
|
* Now supports drag-and-drop file uploads (issue #446).
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
export default function FileUpload({
|
export default function FileUpload({
|
||||||
className,
|
className,
|
||||||
@@ -43,22 +42,74 @@ export default function FileUpload({
|
|||||||
const isIconOnly = !children && !!icon;
|
const isIconOnly = !children && !!icon;
|
||||||
const colorHex = getThemeColorHexByName(color);
|
const colorHex = getThemeColorHexByName(color);
|
||||||
const colorRgb = getThemeColorRgbByName(color)?.join(' ');
|
const colorRgb = getThemeColorRgbByName(color)?.join(' ');
|
||||||
|
const inputRef = useRef<HTMLInputElement>(null);
|
||||||
|
const [isDragging, setIsDragging] = useState(false);
|
||||||
|
|
||||||
// Convert accept to a comma-separated string if it's an array
|
// Convert accept array to comma-separated list
|
||||||
const acceptValue = Array.isArray(accept) ? accept.join(',') : accept;
|
const acceptValue = Array.isArray(accept) ? accept.join(',') : accept;
|
||||||
|
|
||||||
|
// --- Prevent Chrome from opening the file on drop anywhere else ---
|
||||||
|
useEffect(() => {
|
||||||
|
const preventDefault = (e: DragEvent) => {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('dragover', preventDefault);
|
||||||
|
window.addEventListener('drop', preventDefault);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener('dragover', preventDefault);
|
||||||
|
window.removeEventListener('drop', preventDefault);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
|
// --- Local drag and drop handlers for this button only -------------
|
||||||
|
const handleDrop = (event: React.DragEvent<HTMLLabelElement>) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
setIsDragging(false);
|
||||||
|
if (disabled) return;
|
||||||
|
|
||||||
|
const file = event.dataTransfer.files?.[0];
|
||||||
|
if (file && inputRef.current && onChange) {
|
||||||
|
const dataTransfer = new DataTransfer();
|
||||||
|
dataTransfer.items.add(file);
|
||||||
|
inputRef.current.files = dataTransfer.files;
|
||||||
|
|
||||||
|
// Trigger change event manually
|
||||||
|
onChange({ target: inputRef.current } as React.ChangeEvent<HTMLInputElement>);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDragOver = (event: React.DragEvent<HTMLLabelElement>) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
if (!disabled) setIsDragging(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDragLeave = (event: React.DragEvent<HTMLLabelElement>) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
setIsDragging(false);
|
||||||
|
};
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<label
|
<label
|
||||||
style={
|
onDrop={handleDrop}
|
||||||
{
|
onDragOver={handleDragOver}
|
||||||
...style,
|
onDragLeave={handleDragLeave}
|
||||||
color: disabled ? 'ut-gray' : colorHex,
|
style={{
|
||||||
backgroundColor: `rgb(${colorRgb} / var(--un-bg-opacity)`,
|
...style,
|
||||||
} satisfies React.CSSProperties
|
color: disabled ? 'ut-gray' : colorHex,
|
||||||
}
|
backgroundColor: `rgb(${colorRgb} / var(--un-bg-opacity))`,
|
||||||
|
}}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'btn',
|
'btn transition-colors select-none',
|
||||||
{
|
{
|
||||||
|
'ring-2 ring-offset-2 ring-blue-400': isDragging && !disabled,
|
||||||
'text-white! bg-opacity-100 hover:enabled:shadow-md active:enabled:shadow-sm shadow-black/20':
|
'text-white! bg-opacity-100 hover:enabled:shadow-md active:enabled:shadow-sm shadow-black/20':
|
||||||
variant === 'filled',
|
variant === 'filled',
|
||||||
'bg-opacity-0 border-current hover:enabled:bg-opacity-8 border stroke-width-[1px]':
|
'bg-opacity-0 border-current hover:enabled:bg-opacity-8 border stroke-width-[1px]':
|
||||||
@@ -70,6 +121,7 @@ export default function FileUpload({
|
|||||||
'h-[35px] w-[35px] p-spacing-2': size === 'small' && isIconOnly,
|
'h-[35px] w-[35px] p-spacing-2': size === 'small' && isIconOnly,
|
||||||
'h-6 p-spacing-2': size === 'mini' && !isIconOnly,
|
'h-6 p-spacing-2': size === 'mini' && !isIconOnly,
|
||||||
'h-6 w-6 p-0': size === 'mini' && isIconOnly,
|
'h-6 w-6 p-0': size === 'mini' && isIconOnly,
|
||||||
|
'opacity-60 cursor-not-allowed': disabled,
|
||||||
},
|
},
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
@@ -85,6 +137,7 @@ export default function FileUpload({
|
|||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
<input
|
<input
|
||||||
|
ref={inputRef}
|
||||||
type='file'
|
type='file'
|
||||||
{...(accept ? { accept: acceptValue } : {})}
|
{...(accept ? { accept: acceptValue } : {})}
|
||||||
className='hidden'
|
className='hidden'
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export default function Link(props: PropsWithChildren<Props>): JSX.Element {
|
|||||||
tabIndex={isDisabled ? -1 : 0}
|
tabIndex={isDisabled ? -1 : 0}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
{
|
{
|
||||||
'underline cursor-pointer': !isDisabled,
|
'underline cursor-pointer p-2': !isDisabled,
|
||||||
'cursor-not-allowed color-ut-gray': isDisabled,
|
'cursor-not-allowed color-ut-gray': isDisabled,
|
||||||
},
|
},
|
||||||
className
|
className
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import React, { useEffect, useState } from 'react';
|
|||||||
*/
|
*/
|
||||||
const WHATSNEW_POPUP_VERSION = 2;
|
const WHATSNEW_POPUP_VERSION = 2;
|
||||||
|
|
||||||
const WHATSNEW_VIDEO_URL = 'https://cdn.longhorns.dev/whats-new-v2.1.2.mp4';
|
// const WHATSNEW_VIDEO_URL = 'https://cdn.longhorns.dev/whats-new-v2.1.2.mp4';
|
||||||
|
|
||||||
type Feature = {
|
type Feature = {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -60,7 +60,7 @@ const NEW_FEATURES = [
|
|||||||
* @returns A JSX of WhatsNewPopupContent component.
|
* @returns A JSX of WhatsNewPopupContent component.
|
||||||
*/
|
*/
|
||||||
export default function WhatsNewPopupContent(): JSX.Element {
|
export default function WhatsNewPopupContent(): JSX.Element {
|
||||||
const [videoError, setVideoError] = useState(false);
|
const [videoError, _setVideoError] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='w-full flex flex-row justify-between'>
|
<div className='w-full flex flex-row justify-between'>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { addCourseByURL } from '@pages/background/lib/addCourseByURL';
|
import { addCourseByURL } from '@pages/background/lib/addCourseByURL';
|
||||||
import { background } from '@shared/messages';
|
import { background } from '@shared/messages';
|
||||||
import { validateLoginStatus } from '@shared/util/checkLoginStatus';
|
|
||||||
import { Button } from '@views/components/common/Button';
|
import { Button } from '@views/components/common/Button';
|
||||||
import ExtensionRoot from '@views/components/common/ExtensionRoot/ExtensionRoot';
|
import ExtensionRoot from '@views/components/common/ExtensionRoot/ExtensionRoot';
|
||||||
import useSchedules from '@views/hooks/useSchedules';
|
import useSchedules from '@views/hooks/useSchedules';
|
||||||
@@ -43,6 +42,8 @@ export default function InjectedButton(): JSX.Element | null {
|
|||||||
await addCourseByURL(activeSchedule, a);
|
await addCourseByURL(activeSchedule, a);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// We'll allow the alert for this WIP feature
|
||||||
|
// eslint-disable-next-line no-alert
|
||||||
window.alert('Logged into UT Registrar.');
|
window.alert('Logged into UT Registrar.');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
|
||||||
import ReactDOM from 'react-dom';
|
|
||||||
|
|
||||||
function getCourseSections() {
|
|
||||||
const table = document.querySelector('table');
|
|
||||||
if (!table) return [];
|
|
||||||
|
|
||||||
const rows = Array.from(table.querySelectorAll('tr'));
|
|
||||||
const sections: { header: HTMLTableRowElement; children: HTMLTableRowElement[] }[] = [];
|
|
||||||
let currentSection: { header: HTMLTableRowElement; children: HTMLTableRowElement[] } | null = null;
|
|
||||||
|
|
||||||
for (const row of rows) {
|
|
||||||
const headerCell = row.querySelector('td.course_header');
|
|
||||||
if (headerCell) {
|
|
||||||
if (currentSection) sections.push(currentSection);
|
|
||||||
currentSection = { header: row, children: [] };
|
|
||||||
} else if (currentSection) {
|
|
||||||
currentSection.children.push(row);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (currentSection) sections.push(currentSection);
|
|
||||||
return sections;
|
|
||||||
}
|
|
||||||
|
|
||||||
const CollapsibleSection: React.FC<{
|
|
||||||
header: HTMLTableRowElement;
|
|
||||||
childrenRows: HTMLTableRowElement[];
|
|
||||||
}> = ({ header, childrenRows }) => {
|
|
||||||
const [open, setOpen] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
// Hide children rows initially
|
|
||||||
childrenRows.forEach(row => (row.style.display = open ? '' : 'none'));
|
|
||||||
// Clean up on unmount
|
|
||||||
return () => {
|
|
||||||
childrenRows.forEach(row => (row.style.display = ''));
|
|
||||||
};
|
|
||||||
}, [open, childrenRows]);
|
|
||||||
|
|
||||||
// Inject a button into the header cell
|
|
||||||
useEffect(() => {
|
|
||||||
const cell = header.querySelector('td.course_header');
|
|
||||||
if (!cell) return;
|
|
||||||
let button = cell.querySelector('.utrp-collapse-btn') as HTMLButtonElement | null;
|
|
||||||
if (!button) {
|
|
||||||
button = document.createElement('button');
|
|
||||||
button.className = 'utrp-collapse-btn';
|
|
||||||
button.style.marginRight = '8px';
|
|
||||||
cell.prepend(button);
|
|
||||||
}
|
|
||||||
button.textContent = open ? '▼' : '►';
|
|
||||||
button.onclick = () => setOpen(o => !o);
|
|
||||||
// Clean up
|
|
||||||
return () => {
|
|
||||||
button?.remove();
|
|
||||||
};
|
|
||||||
}, [header, open]);
|
|
||||||
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default
|
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import createSchedule from '@pages/background/lib/createSchedule';
|
||||||
|
import switchSchedule from '@pages/background/lib/switchSchedule';
|
||||||
import {
|
import {
|
||||||
ArrowUpRight,
|
ArrowUpRight,
|
||||||
CalendarDots,
|
CalendarDots,
|
||||||
@@ -14,8 +16,10 @@ import { background } from '@shared/messages';
|
|||||||
import type { Course } from '@shared/types/Course';
|
import type { Course } from '@shared/types/Course';
|
||||||
import type Instructor from '@shared/types/Instructor';
|
import type Instructor from '@shared/types/Instructor';
|
||||||
import type { UserSchedule } from '@shared/types/UserSchedule';
|
import type { UserSchedule } from '@shared/types/UserSchedule';
|
||||||
|
import { englishStringifyList } from '@shared/util/string';
|
||||||
import { Button } from '@views/components/common/Button';
|
import { Button } from '@views/components/common/Button';
|
||||||
import { Chip, coreMap, flagMap } from '@views/components/common/Chip';
|
import { Chip, coreMap, flagMap } from '@views/components/common/Chip';
|
||||||
|
import { usePrompt } from '@views/components/common/DialogProvider/DialogProvider';
|
||||||
import Divider from '@views/components/common/Divider';
|
import Divider from '@views/components/common/Divider';
|
||||||
import Link from '@views/components/common/Link';
|
import Link from '@views/components/common/Link';
|
||||||
import Text from '@views/components/common/Text/Text';
|
import Text from '@views/components/common/Text/Text';
|
||||||
@@ -60,7 +64,7 @@ export default function HeadingAndActions({ course, activeSchedule, onClose }: H
|
|||||||
|
|
||||||
const [isCopied, setIsCopied] = useState<boolean>(false);
|
const [isCopied, setIsCopied] = useState<boolean>(false);
|
||||||
const lastCopyTime = useRef<number>(0);
|
const lastCopyTime = useRef<number>(0);
|
||||||
|
const showDialog = usePrompt();
|
||||||
const getInstructorFullName = (instructor: Instructor) => instructor.toString({ format: 'first_last' });
|
const getInstructorFullName = (instructor: Instructor) => instructor.toString({ format: 'first_last' });
|
||||||
|
|
||||||
const handleCopy = async (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
|
const handleCopy = async (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
|
||||||
@@ -112,10 +116,78 @@ export default function HeadingAndActions({ course, activeSchedule, onClose }: H
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleAddToNewSchedule = async (close: () => void) => {
|
||||||
|
const newScheduleId = await createSchedule(`${course.semester.season} ${course.semester.year}`);
|
||||||
|
switchSchedule(newScheduleId);
|
||||||
|
addCourse({ course, scheduleId: newScheduleId });
|
||||||
|
close();
|
||||||
|
};
|
||||||
|
|
||||||
const handleAddOrRemoveCourse = async () => {
|
const handleAddOrRemoveCourse = async () => {
|
||||||
|
const uniqueSemesterCodes = [
|
||||||
|
...new Set(
|
||||||
|
activeSchedule.courses
|
||||||
|
.map(course => course.semester.code)
|
||||||
|
.filter((code): code is string => code !== undefined)
|
||||||
|
),
|
||||||
|
];
|
||||||
|
uniqueSemesterCodes.sort();
|
||||||
|
const codeToReadableMap: Record<string, string> = {};
|
||||||
|
activeSchedule.courses.forEach(course => {
|
||||||
|
const { code } = course.semester;
|
||||||
|
if (code) {
|
||||||
|
const readable = `${course.semester.season} ${course.semester.year}`;
|
||||||
|
codeToReadableMap[code] = readable;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const sortedSemesters = uniqueSemesterCodes
|
||||||
|
.map(code => codeToReadableMap[code])
|
||||||
|
.filter((value): value is string => value !== undefined);
|
||||||
|
const activeSemesters = englishStringifyList(sortedSemesters);
|
||||||
|
|
||||||
if (!activeSchedule) return;
|
if (!activeSchedule) return;
|
||||||
if (!courseAdded) {
|
if (!courseAdded) {
|
||||||
addCourse({ course, scheduleId: activeSchedule.id });
|
const currentSemesterCode = course.semester.code;
|
||||||
|
// Show warning if this course is for a different semester than the selected schedule
|
||||||
|
if (
|
||||||
|
activeSchedule.courses.length > 0 &&
|
||||||
|
activeSchedule.courses.every(otherCourse => otherCourse.semester.code !== currentSemesterCode)
|
||||||
|
) {
|
||||||
|
const dialogButtons = (close: () => void) => (
|
||||||
|
<>
|
||||||
|
<Button variant='minimal' color='ut-black' onClick={close}>
|
||||||
|
Cancel
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant='filled'
|
||||||
|
color='ut-burntorange'
|
||||||
|
onClick={() => {
|
||||||
|
handleAddToNewSchedule(close);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Start a new schedule
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
|
showDialog({
|
||||||
|
title: 'This course section is from a different semester!',
|
||||||
|
description: (
|
||||||
|
<>
|
||||||
|
The section you're adding is for{' '}
|
||||||
|
<span className='whitespace-nowrap text-ut-burntorange'>
|
||||||
|
{course.semester.season} {course.semester.year}
|
||||||
|
</span>
|
||||||
|
, but your current schedule contains sections in{' '}
|
||||||
|
<span className='whitespace-nowrap text-ut-burntorange'>{activeSemesters}</span>. Mixing
|
||||||
|
semesters in one schedule may cause confusion.
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
buttons: dialogButtons,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addCourse({ course, scheduleId: activeSchedule.id });
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
removeCourse({ course, scheduleId: activeSchedule.id });
|
removeCourse({ course, scheduleId: activeSchedule.id });
|
||||||
}
|
}
|
||||||
|
|||||||
39
src/views/components/injected/SearchResultShader.tsx
Normal file
39
src/views/components/injected/SearchResultShader.tsx
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import { useEffect } from 'react';
|
||||||
|
// @TODO Get a better name for this class
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The existing search results (kws), only with alternate shading for easier readability
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export default function ShadedResults(): null {
|
||||||
|
useEffect(() => {
|
||||||
|
const table = document.getElementById('kw_results_table');
|
||||||
|
if (!table) {
|
||||||
|
console.error('Results table not found');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const tbody = table.querySelector('tbody');
|
||||||
|
if (!tbody) {
|
||||||
|
console.error('Table tbody not found');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const style = document.createElement('style');
|
||||||
|
style.textContent = `
|
||||||
|
#kw_results_table tbody tr:nth-child(even) {
|
||||||
|
background-color: #f0f0f0 !important;
|
||||||
|
}
|
||||||
|
#kw_results_table tbody tr:nth-child(even) td {
|
||||||
|
background-color: #f0f0f0 !important;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
document.head.appendChild(style);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
style.remove();
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
197
src/views/components/settings/AdvancedSettings.tsx
Normal file
197
src/views/components/settings/AdvancedSettings.tsx
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
import { Trash } from '@phosphor-icons/react';
|
||||||
|
import { OptionsStore } from '@shared/storage/OptionsStore';
|
||||||
|
import MIMEType from '@shared/types/MIMEType';
|
||||||
|
import type { UserSchedule } from '@shared/types/UserSchedule';
|
||||||
|
import { handleExportJson } from '@views/components/calendar/utils';
|
||||||
|
import { Button } from '@views/components/common/Button';
|
||||||
|
import Divider from '@views/components/common/Divider';
|
||||||
|
import SwitchButton from '@views/components/common/SwitchButton';
|
||||||
|
import Text from '@views/components/common/Text/Text';
|
||||||
|
import clsx from 'clsx';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import FileUpload from '../common/FileUpload';
|
||||||
|
import { DISPLAY_PREVIEWS, PREVIEW_SECTION_DIV_CLASSNAME } from './constants';
|
||||||
|
import Preview from './Preview';
|
||||||
|
|
||||||
|
interface AdvancedSettingsProps {
|
||||||
|
highlightConflicts: boolean;
|
||||||
|
setHighlightConflicts: (value: boolean) => void;
|
||||||
|
loadAllCourses: boolean;
|
||||||
|
setLoadAllCourses: (value: boolean) => void;
|
||||||
|
increaseScheduleLimit: boolean;
|
||||||
|
setIncreaseScheduleLimit: (value: boolean) => void;
|
||||||
|
calendarNewTab: boolean;
|
||||||
|
setCalendarNewTab: (value: boolean) => void;
|
||||||
|
activeSchedule: UserSchedule;
|
||||||
|
handleEraseAll: () => void;
|
||||||
|
handleImportClick: (event: React.ChangeEvent<HTMLInputElement>) => Promise<void>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Settings section component for advanced settings
|
||||||
|
*/
|
||||||
|
export const AdvancedSettings: React.FC<AdvancedSettingsProps> = ({
|
||||||
|
highlightConflicts,
|
||||||
|
setHighlightConflicts,
|
||||||
|
loadAllCourses,
|
||||||
|
setLoadAllCourses,
|
||||||
|
increaseScheduleLimit,
|
||||||
|
setIncreaseScheduleLimit,
|
||||||
|
calendarNewTab,
|
||||||
|
setCalendarNewTab,
|
||||||
|
activeSchedule,
|
||||||
|
handleEraseAll,
|
||||||
|
handleImportClick,
|
||||||
|
}) => (
|
||||||
|
<section className='mb-8'>
|
||||||
|
<h2 className='mb-4 text-xl text-ut-black font-semibold'>ADVANCED SETTINGS</h2>
|
||||||
|
<div className='flex space-x-4'>
|
||||||
|
<div className={PREVIEW_SECTION_DIV_CLASSNAME}>
|
||||||
|
<div className='flex items-center justify-between'>
|
||||||
|
<div className='max-w-xs'>
|
||||||
|
<Text variant='h4' className='text-ut-burntorange font-semibold'>
|
||||||
|
Export Current Schedule
|
||||||
|
</Text>
|
||||||
|
<p className='text-sm text-gray-600'>Backup your active schedule to a portable file</p>
|
||||||
|
</div>
|
||||||
|
<Button
|
||||||
|
variant='outline'
|
||||||
|
color='ut-burntorange'
|
||||||
|
onClick={() => handleExportJson(activeSchedule.id)}
|
||||||
|
>
|
||||||
|
Export
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Divider size='auto' orientation='horizontal' />
|
||||||
|
|
||||||
|
<div className='flex items-center justify-between'>
|
||||||
|
<div className='max-w-xs'>
|
||||||
|
<Text variant='h4' className='text-ut-burntorange font-semibold'>
|
||||||
|
Import Schedule
|
||||||
|
</Text>
|
||||||
|
<p className='text-sm text-gray-600'>Import from a schedule file</p>
|
||||||
|
</div>
|
||||||
|
<FileUpload
|
||||||
|
variant='filled'
|
||||||
|
color='ut-burntorange'
|
||||||
|
onChange={handleImportClick}
|
||||||
|
accept={MIMEType.JSON}
|
||||||
|
>
|
||||||
|
Import Schedule
|
||||||
|
</FileUpload>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Divider size='auto' orientation='horizontal' />
|
||||||
|
|
||||||
|
<div className='flex items-center justify-between'>
|
||||||
|
<div className='max-w-xs'>
|
||||||
|
<Text variant='h4' className='text-ut-burntorange font-semibold'>
|
||||||
|
Course Conflict Highlight
|
||||||
|
</Text>
|
||||||
|
<p className='text-sm text-gray-600'>
|
||||||
|
Adds a red strikethrough to courses that have conflicting times.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<SwitchButton
|
||||||
|
isChecked={highlightConflicts}
|
||||||
|
onChange={() => {
|
||||||
|
setHighlightConflicts(!highlightConflicts);
|
||||||
|
OptionsStore.set('enableHighlightConflicts', !highlightConflicts);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Divider size='auto' orientation='horizontal' />
|
||||||
|
|
||||||
|
<div className='flex items-center justify-between'>
|
||||||
|
<div className='max-w-xs'>
|
||||||
|
<Text variant='h4' className='text-ut-burntorange font-semibold'>
|
||||||
|
Load All Courses in Course Schedule
|
||||||
|
</Text>
|
||||||
|
<p className='text-sm text-gray-600'>
|
||||||
|
Loads all courses in the Course Schedule site by scrolling, instead of using next/prev page
|
||||||
|
buttons.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<SwitchButton
|
||||||
|
isChecked={loadAllCourses}
|
||||||
|
onChange={() => {
|
||||||
|
setLoadAllCourses(!loadAllCourses);
|
||||||
|
OptionsStore.set('enableScrollToLoad', !loadAllCourses);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Divider size='auto' orientation='horizontal' />
|
||||||
|
|
||||||
|
<div className='flex items-center justify-between'>
|
||||||
|
<div className='max-w-xs'>
|
||||||
|
<Text variant='h4' className='text-ut-burntorange font-semibold'>
|
||||||
|
Allow more than 10 schedules
|
||||||
|
</Text>
|
||||||
|
<p className='text-sm text-gray-600'>
|
||||||
|
Allow bypassing the 10-schedule limit. Intended for advisors or staff who need to create
|
||||||
|
many schedules on behalf of students.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<SwitchButton
|
||||||
|
isChecked={increaseScheduleLimit}
|
||||||
|
onChange={() => {
|
||||||
|
setIncreaseScheduleLimit(!increaseScheduleLimit);
|
||||||
|
OptionsStore.set('allowMoreSchedules', !increaseScheduleLimit);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Divider size='auto' orientation='horizontal' />
|
||||||
|
|
||||||
|
<div className='flex items-center justify-between'>
|
||||||
|
<div className='max-w-xs'>
|
||||||
|
<Text variant='h4' className='text-ut-burntorange font-semibold'>
|
||||||
|
Always Open Calendar in New Tab
|
||||||
|
</Text>
|
||||||
|
<p className='text-sm text-gray-600'>
|
||||||
|
Always opens the calendar view in a new tab when navigating to the calendar page. May
|
||||||
|
prevent issues where the calendar refuses to open.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<SwitchButton
|
||||||
|
isChecked={calendarNewTab}
|
||||||
|
onChange={() => {
|
||||||
|
setCalendarNewTab(!calendarNewTab);
|
||||||
|
OptionsStore.set('alwaysOpenCalendarInNewTab', !calendarNewTab);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Divider size='auto' orientation='horizontal' />
|
||||||
|
|
||||||
|
<div className='flex items-center justify-between'>
|
||||||
|
<div className='max-w-xs'>
|
||||||
|
<Text variant='h4' className='text-ut-burntorange font-semibold'>
|
||||||
|
Reset All Data
|
||||||
|
</Text>
|
||||||
|
<p className='text-sm text-gray-600'>Erases all schedules and courses you have.</p>
|
||||||
|
</div>
|
||||||
|
<Button variant='outline' color='theme-red' icon={Trash} onClick={handleEraseAll}>
|
||||||
|
Erase All
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{DISPLAY_PREVIEWS && (
|
||||||
|
<Preview>
|
||||||
|
<Text
|
||||||
|
variant='h2-course'
|
||||||
|
className={clsx('text-center text-theme-red font-normal', {
|
||||||
|
'line-through': highlightConflicts,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
01234 MWF 10:00 AM - 11:00 AM UTC 1.234
|
||||||
|
</Text>
|
||||||
|
</Preview>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
54
src/views/components/settings/ContributorCard.tsx
Normal file
54
src/views/components/settings/ContributorCard.tsx
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import Text from '@views/components/common/Text/Text';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
interface ContributorCardProps {
|
||||||
|
name: string;
|
||||||
|
githubUsername: string;
|
||||||
|
roles: string[];
|
||||||
|
stats?: {
|
||||||
|
commits: number;
|
||||||
|
linesAdded: number;
|
||||||
|
linesDeleted: number;
|
||||||
|
mergedPRs?: number;
|
||||||
|
};
|
||||||
|
showStats: boolean;
|
||||||
|
includeMergedPRs: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GitHub contributor card component
|
||||||
|
*/
|
||||||
|
export const ContributorCard: React.FC<ContributorCardProps> = ({
|
||||||
|
name,
|
||||||
|
githubUsername,
|
||||||
|
roles,
|
||||||
|
stats,
|
||||||
|
showStats,
|
||||||
|
includeMergedPRs,
|
||||||
|
}) => (
|
||||||
|
<div className='border border-gray-300 rounded bg-ut-gray/10 p-4'>
|
||||||
|
<Text
|
||||||
|
variant='p'
|
||||||
|
className='text-ut-burntorange font-semibold hover:cursor-pointer'
|
||||||
|
onClick={() => window.open(`https://github.com/${githubUsername}`, '_blank')}
|
||||||
|
>
|
||||||
|
{name}
|
||||||
|
</Text>
|
||||||
|
{roles.map(role => (
|
||||||
|
<p key={`${githubUsername}-${role}`} className='text-sm text-gray-600'>
|
||||||
|
{role}
|
||||||
|
</p>
|
||||||
|
))}
|
||||||
|
{showStats && stats && (
|
||||||
|
<div className='mt-2'>
|
||||||
|
<p className='text-xs text-gray-500'>GitHub Stats (UTRP repo):</p>
|
||||||
|
{includeMergedPRs && stats.mergedPRs !== undefined && (
|
||||||
|
<p className='text-xs'>Merged PRs: {stats.mergedPRs}</p>
|
||||||
|
)}
|
||||||
|
<p className='text-xs'>Commits: {stats.commits}</p>
|
||||||
|
<p className='text-xs text-ut-green'>{stats.linesAdded}++</p>
|
||||||
|
<p className='text-xs text-theme-red'>{stats.linesDeleted}--</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
@@ -1,116 +1,68 @@
|
|||||||
// import addCourse from '@pages/background/lib/addCourse';
|
// Pages
|
||||||
import { addCourseByURL } from '@pages/background/lib/addCourseByURL';
|
import { addCourseByURL } from '@pages/background/lib/addCourseByURL';
|
||||||
import { deleteAllSchedules } from '@pages/background/lib/deleteSchedule';
|
import { deleteAllSchedules } from '@pages/background/lib/deleteSchedule';
|
||||||
import exportSchedule from '@pages/background/lib/exportSchedule';
|
|
||||||
import importSchedule from '@pages/background/lib/importSchedule';
|
import importSchedule from '@pages/background/lib/importSchedule';
|
||||||
import { CalendarDots, Trash } from '@phosphor-icons/react';
|
import { CalendarDots } from '@phosphor-icons/react';
|
||||||
|
// Shared
|
||||||
import { background } from '@shared/messages';
|
import { background } from '@shared/messages';
|
||||||
import { DevStore } from '@shared/storage/DevStore';
|
import { DevStore } from '@shared/storage/DevStore';
|
||||||
import { initSettings, OptionsStore } from '@shared/storage/OptionsStore';
|
import { initSettings, OptionsStore } from '@shared/storage/OptionsStore';
|
||||||
import { UserScheduleStore } from '@shared/storage/UserScheduleStore';
|
|
||||||
import { CRX_PAGES } from '@shared/types/CRXPages';
|
import { CRX_PAGES } from '@shared/types/CRXPages';
|
||||||
import MIMEType from '@shared/types/MIMEType';
|
import Particles from '@tsparticles/react';
|
||||||
import { downloadBlob } from '@shared/util/downloadBlob';
|
|
||||||
// import { addCourseByUrl } from '@shared/util/courseUtils';
|
|
||||||
// import { getCourseColors } from '@shared/util/colors';
|
|
||||||
// import CalendarCourseCell from '@views/components/calendar/CalendarCourseCell';
|
|
||||||
import { Button } from '@views/components/common/Button';
|
import { Button } from '@views/components/common/Button';
|
||||||
import { usePrompt } from '@views/components/common/DialogProvider/DialogProvider';
|
import { usePrompt } from '@views/components/common/DialogProvider/DialogProvider';
|
||||||
|
// Views
|
||||||
import Divider from '@views/components/common/Divider';
|
import Divider from '@views/components/common/Divider';
|
||||||
import { LargeLogo } from '@views/components/common/LogoIcon';
|
import { LargeLogo } from '@views/components/common/LogoIcon';
|
||||||
// import PopupCourseBlock from '@views/components/common/PopupCourseBlock';
|
|
||||||
import SwitchButton from '@views/components/common/SwitchButton';
|
|
||||||
import Text from '@views/components/common/Text/Text';
|
import Text from '@views/components/common/Text/Text';
|
||||||
|
// Hooks
|
||||||
import useChangelog from '@views/hooks/useChangelog';
|
import useChangelog from '@views/hooks/useChangelog';
|
||||||
import useSchedules from '@views/hooks/useSchedules';
|
import useSchedules from '@views/hooks/useSchedules';
|
||||||
// import { CourseCatalogScraper } from '@views/lib/CourseCatalogScraper';
|
|
||||||
// import getCourseTableRows from '@views/lib/getCourseTableRows';
|
|
||||||
import { GitHubStatsService, LONGHORN_DEVELOPERS_ADMINS, LONGHORN_DEVELOPERS_SWE } from '@views/lib/getGitHubStats';
|
import { GitHubStatsService, LONGHORN_DEVELOPERS_ADMINS, LONGHORN_DEVELOPERS_SWE } from '@views/lib/getGitHubStats';
|
||||||
// import { SiteSupport } from '@views/lib/getSiteSupport';
|
// Misc
|
||||||
import clsx from 'clsx';
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
|
||||||
|
|
||||||
|
// Icons
|
||||||
import IconoirGitFork from '~icons/iconoir/git-fork';
|
import IconoirGitFork from '~icons/iconoir/git-fork';
|
||||||
|
|
||||||
// import { ExampleCourse } from 'src/stories/components/ConflictsWithWarning.stories';;
|
|
||||||
import FileUpload from '../common/FileUpload';
|
|
||||||
import { useMigrationDialog } from '../common/MigrationDialog';
|
import { useMigrationDialog } from '../common/MigrationDialog';
|
||||||
// import RefreshIcon from '~icons/material-symbols/refresh';
|
import { AdvancedSettings } from './AdvancedSettings';
|
||||||
|
import { DEV_MODE_CLICK_TARGET, INCLUDE_MERGED_PRS, STATS_TOGGLE_KEY } from './constants';
|
||||||
|
import { ContributorCard } from './ContributorCard';
|
||||||
import DevMode from './DevMode';
|
import DevMode from './DevMode';
|
||||||
import Preview from './Preview';
|
import { useBirthdayCelebration } from './useBirthdayCelebration';
|
||||||
|
import { useDevMode } from './useDevMode';
|
||||||
|
|
||||||
const manifest = chrome.runtime.getManifest();
|
const manifest = chrome.runtime.getManifest();
|
||||||
|
|
||||||
const gitHubStatsService = new GitHubStatsService();
|
|
||||||
const includeMergedPRs = false;
|
|
||||||
|
|
||||||
const DISPLAY_PREVIEWS = false;
|
|
||||||
const PREVIEW_SECTION_DIV_CLASSNAME = DISPLAY_PREVIEWS ? 'w-1/2 space-y-4' : 'flex-grow space-y-4';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom hook for enabling developer mode.
|
* Main Settings Component for managing user settings and preferences.
|
||||||
*
|
|
||||||
* @param targetCount - The target count to activate developer mode.
|
|
||||||
* @returns A tuple containing a boolean indicating if developer mode is active and a function to increment the count.
|
|
||||||
*/
|
|
||||||
const useDevMode = (targetCount: number): [boolean, () => void] => {
|
|
||||||
const [count, setCount] = useState(0);
|
|
||||||
const [active, setActive] = useState(false);
|
|
||||||
const [lastClick, setLastClick] = useState(0);
|
|
||||||
|
|
||||||
const incrementCount = useCallback(() => {
|
|
||||||
const now = Date.now();
|
|
||||||
if (now - lastClick < 500) {
|
|
||||||
setCount(prevCount => {
|
|
||||||
const newCount = prevCount + 1;
|
|
||||||
if (newCount === targetCount) {
|
|
||||||
setActive(true);
|
|
||||||
}
|
|
||||||
return newCount;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
setCount(1);
|
|
||||||
}
|
|
||||||
setLastClick(now);
|
|
||||||
}, [lastClick, targetCount]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const timer = setTimeout(() => setCount(0), 3000);
|
|
||||||
return () => clearTimeout(timer);
|
|
||||||
}, [count]);
|
|
||||||
|
|
||||||
return [active, incrementCount];
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Component for managing user settings and preferences.
|
|
||||||
*
|
*
|
||||||
* @returns The Settings component.
|
* @returns The Settings component.
|
||||||
*/
|
*/
|
||||||
export default function Settings(): JSX.Element {
|
export default function Settings(): JSX.Element {
|
||||||
const [_enableCourseStatusChips, setEnableCourseStatusChips] = useState<boolean>(false);
|
const gitHubStatsService = useMemo(() => new GitHubStatsService(), []);
|
||||||
// const [_showTimeLocation, setShowTimeLocation] = useState<boolean>(false);
|
|
||||||
const [highlightConflicts, setHighlightConflicts] = useState<boolean>(false);
|
|
||||||
const [loadAllCourses, setLoadAllCourses] = useState<boolean>(false);
|
|
||||||
const [_enableDataRefreshing, setEnableDataRefreshing] = useState<boolean>(false);
|
|
||||||
const [calendarNewTab, setCalendarNewTab] = useState<boolean>(false);
|
|
||||||
|
|
||||||
const showMigrationDialog = useMigrationDialog();
|
// State
|
||||||
|
const [highlightConflicts, setHighlightConflicts] = useState(false);
|
||||||
// Toggle GitHub stats when the user presses the 'S' key
|
const [loadAllCourses, setLoadAllCourses] = useState(false);
|
||||||
const [showGitHubStats, setShowGitHubStats] = useState<boolean>(false);
|
const [calendarNewTab, setCalendarNewTab] = useState(false);
|
||||||
|
const [increaseScheduleLimit, setIncreaseScheduleLimit] = useState(false);
|
||||||
|
const [showGitHubStats, setShowGitHubStats] = useState(false);
|
||||||
const [githubStats, setGitHubStats] = useState<Awaited<
|
const [githubStats, setGitHubStats] = useState<Awaited<
|
||||||
ReturnType<typeof gitHubStatsService.fetchGitHubStats>
|
ReturnType<typeof gitHubStatsService.fetchGitHubStats>
|
||||||
> | null>(null);
|
> | null>(null);
|
||||||
|
const [isDeveloper, setIsDeveloper] = useState(false);
|
||||||
|
|
||||||
const [activeSchedule] = useSchedules();
|
const [activeSchedule] = useSchedules();
|
||||||
// const [isRefreshing, setIsRefreshing] = useState<boolean>(false);
|
|
||||||
|
|
||||||
const [isDeveloper, setIsDeveloper] = useState<boolean>(false);
|
|
||||||
|
|
||||||
const showDialog = usePrompt();
|
const showDialog = usePrompt();
|
||||||
const handleChangelogOnClick = useChangelog();
|
const handleChangelogOnClick = useChangelog();
|
||||||
|
const showMigrationDialog = useMigrationDialog();
|
||||||
|
|
||||||
|
const [devMode, toggleDevMode] = useDevMode(DEV_MODE_CLICK_TARGET);
|
||||||
|
const { showParticles, particlesInit, particlesOptions, triggerCelebration, isBirthday } = useBirthdayCelebration();
|
||||||
|
|
||||||
|
// Initialize settings and listeners
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchGitHubStats = async () => {
|
const fetchGitHubStats = async () => {
|
||||||
try {
|
try {
|
||||||
@@ -122,19 +74,12 @@ export default function Settings(): JSX.Element {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const initAndSetSettings = async () => {
|
const initAndSetSettings = async () => {
|
||||||
const {
|
const { enableHighlightConflicts, enableScrollToLoad, alwaysOpenCalendarInNewTab, allowMoreSchedules } =
|
||||||
enableCourseStatusChips,
|
await initSettings();
|
||||||
enableHighlightConflicts,
|
|
||||||
enableScrollToLoad,
|
|
||||||
enableDataRefreshing,
|
|
||||||
alwaysOpenCalendarInNewTab,
|
|
||||||
} = await initSettings();
|
|
||||||
setEnableCourseStatusChips(enableCourseStatusChips);
|
|
||||||
// setShowTimeLocation(enableTimeAndLocationInPopup);
|
|
||||||
setHighlightConflicts(enableHighlightConflicts);
|
setHighlightConflicts(enableHighlightConflicts);
|
||||||
setLoadAllCourses(enableScrollToLoad);
|
setLoadAllCourses(enableScrollToLoad);
|
||||||
setEnableDataRefreshing(enableDataRefreshing);
|
|
||||||
setCalendarNewTab(alwaysOpenCalendarInNewTab);
|
setCalendarNewTab(alwaysOpenCalendarInNewTab);
|
||||||
|
setIncreaseScheduleLimit(allowMoreSchedules);
|
||||||
};
|
};
|
||||||
|
|
||||||
const initDS = async () => {
|
const initDS = async () => {
|
||||||
@@ -142,68 +87,50 @@ export default function Settings(): JSX.Element {
|
|||||||
setIsDeveloper(isDev);
|
setIsDeveloper(isDev);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleKeyPress = (event: KeyboardEvent) => {
|
||||||
|
if (event.key === STATS_TOGGLE_KEY || event.key === STATS_TOGGLE_KEY.toUpperCase()) {
|
||||||
|
setShowGitHubStats(prev => !prev);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Listeners
|
||||||
const ds_l1 = DevStore.listen('isDeveloper', async ({ newValue }) => {
|
const ds_l1 = DevStore.listen('isDeveloper', async ({ newValue }) => {
|
||||||
setIsDeveloper(newValue);
|
setIsDeveloper(newValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const l1 = OptionsStore.listen('enableHighlightConflicts', async ({ newValue }) => {
|
||||||
|
setHighlightConflicts(newValue);
|
||||||
|
});
|
||||||
|
|
||||||
|
const l2 = OptionsStore.listen('enableScrollToLoad', async ({ newValue }) => {
|
||||||
|
setLoadAllCourses(newValue);
|
||||||
|
});
|
||||||
|
|
||||||
|
const l3 = OptionsStore.listen('alwaysOpenCalendarInNewTab', async ({ newValue }) => {
|
||||||
|
setCalendarNewTab(newValue);
|
||||||
|
});
|
||||||
|
|
||||||
|
const l4 = OptionsStore.listen('allowMoreSchedules', async ({ newValue }) => {
|
||||||
|
setIncreaseScheduleLimit(newValue);
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener('keydown', handleKeyPress);
|
||||||
|
|
||||||
initDS();
|
initDS();
|
||||||
fetchGitHubStats();
|
fetchGitHubStats();
|
||||||
initAndSetSettings();
|
initAndSetSettings();
|
||||||
|
|
||||||
const handleKeyPress = (event: KeyboardEvent) => {
|
|
||||||
if (event.key === 'S' || event.key === 's') {
|
|
||||||
setShowGitHubStats(prev => !prev);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
window.addEventListener('keydown', handleKeyPress);
|
|
||||||
|
|
||||||
// Listen for changes in the settings
|
|
||||||
const l1 = OptionsStore.listen('enableCourseStatusChips', async ({ newValue }) => {
|
|
||||||
setEnableCourseStatusChips(newValue);
|
|
||||||
// console.log('enableCourseStatusChips', newValue);
|
|
||||||
});
|
|
||||||
|
|
||||||
// const l2 = OptionsStore.listen('enableTimeAndLocationInPopup', async ({ newValue }) => {
|
|
||||||
// setShowTimeLocation(newValue);
|
|
||||||
// // console.log('enableTimeAndLocationInPopup', newValue);
|
|
||||||
// });
|
|
||||||
|
|
||||||
const l2 = OptionsStore.listen('enableHighlightConflicts', async ({ newValue }) => {
|
|
||||||
setHighlightConflicts(newValue);
|
|
||||||
// console.log('enableHighlightConflicts', newValue);
|
|
||||||
});
|
|
||||||
|
|
||||||
const l3 = OptionsStore.listen('enableScrollToLoad', async ({ newValue }) => {
|
|
||||||
setLoadAllCourses(newValue);
|
|
||||||
// console.log('enableScrollToLoad', newValue);
|
|
||||||
});
|
|
||||||
|
|
||||||
const l4 = OptionsStore.listen('enableDataRefreshing', async ({ newValue }) => {
|
|
||||||
setEnableDataRefreshing(newValue);
|
|
||||||
// console.log('enableDataRefreshing', newValue);
|
|
||||||
});
|
|
||||||
|
|
||||||
const l5 = OptionsStore.listen('alwaysOpenCalendarInNewTab', async ({ newValue }) => {
|
|
||||||
setCalendarNewTab(newValue);
|
|
||||||
// console.log('alwaysOpenCalendarInNewTab', newValue);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Remove listeners when the component is unmounted
|
|
||||||
return () => {
|
return () => {
|
||||||
OptionsStore.removeListener(l1);
|
OptionsStore.removeListener(l1);
|
||||||
OptionsStore.removeListener(l2);
|
OptionsStore.removeListener(l2);
|
||||||
OptionsStore.removeListener(l3);
|
OptionsStore.removeListener(l3);
|
||||||
OptionsStore.removeListener(l4);
|
OptionsStore.removeListener(l4);
|
||||||
OptionsStore.removeListener(l5);
|
|
||||||
|
|
||||||
DevStore.removeListener(ds_l1);
|
DevStore.removeListener(ds_l1);
|
||||||
|
|
||||||
window.removeEventListener('keydown', handleKeyPress);
|
window.removeEventListener('keydown', handleKeyPress);
|
||||||
};
|
};
|
||||||
}, []);
|
}, [gitHubStatsService]);
|
||||||
|
|
||||||
const handleEraseAll = () => {
|
const handleEraseAll = useCallback(() => {
|
||||||
showDialog({
|
showDialog({
|
||||||
title: 'Erase All Course/Schedule Data',
|
title: 'Erase All Course/Schedule Data',
|
||||||
description: (
|
description: (
|
||||||
@@ -230,46 +157,45 @@ export default function Settings(): JSX.Element {
|
|||||||
</Button>
|
</Button>
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
};
|
}, [showDialog]);
|
||||||
|
|
||||||
const handleExportClick = async (id: string) => {
|
const handleImportClick = useCallback(async (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const jsonString = await exportSchedule(id);
|
|
||||||
if (jsonString) {
|
|
||||||
const schedules = await UserScheduleStore.get('schedules');
|
|
||||||
const schedule = schedules.find(s => s.id === id);
|
|
||||||
const fileName = `${schedule?.name ?? `schedule_${id}`}_${new Date().toISOString().replace(/[:.]/g, '-')}.json`;
|
|
||||||
await downloadBlob(jsonString, 'JSON', fileName);
|
|
||||||
} else {
|
|
||||||
console.error('Error exporting schedule: jsonString is undefined');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleImportClick = async (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
||||||
const file = event.target.files?.[0];
|
const file = event.target.files?.[0];
|
||||||
if (file) {
|
if (!file) return;
|
||||||
const reader = new FileReader();
|
|
||||||
reader.onload = async e => {
|
try {
|
||||||
try {
|
const text = await file.text();
|
||||||
const result = e.target?.result as string;
|
const data = JSON.parse(text);
|
||||||
const jsonObject = JSON.parse(result);
|
await importSchedule(data);
|
||||||
await importSchedule(jsonObject);
|
alert('Schedule imported successfully.');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Invalid import file!');
|
console.error('Error importing schedule:', error);
|
||||||
}
|
alert('Failed to import schedule. Make sure the file is a valid .json format.');
|
||||||
};
|
|
||||||
reader.readAsText(file);
|
|
||||||
}
|
}
|
||||||
};
|
}, []);
|
||||||
|
|
||||||
// const handleAddCourseByLink = async () => {
|
const sortedContributors = useMemo(() => {
|
||||||
// // todo: Use a proper modal instead of a prompt
|
if (!githubStats) return LONGHORN_DEVELOPERS_SWE;
|
||||||
// const link: string | null = prompt('Enter course link');
|
return [...LONGHORN_DEVELOPERS_SWE].sort(
|
||||||
// // Exit if the user cancels the prompt
|
(a, b) =>
|
||||||
// if (link === null) return;
|
(githubStats.userGitHubStats[b.githubUsername]?.commits ?? 0) -
|
||||||
// await addCourseByUrl(link, activeSchedule);
|
(githubStats.userGitHubStats[a.githubUsername]?.commits ?? 0)
|
||||||
// };
|
);
|
||||||
|
}, [githubStats]);
|
||||||
|
|
||||||
const [devMode, toggleDevMode] = useDevMode(10);
|
const additionalContributors = useMemo(() => {
|
||||||
|
if (!githubStats) return [];
|
||||||
|
return Object.keys(githubStats.userGitHubStats)
|
||||||
|
.filter(
|
||||||
|
username =>
|
||||||
|
!LONGHORN_DEVELOPERS_ADMINS.some(admin => admin.githubUsername === username) &&
|
||||||
|
!LONGHORN_DEVELOPERS_SWE.some(swe => swe.githubUsername === username)
|
||||||
|
)
|
||||||
|
.sort(
|
||||||
|
(a, b) =>
|
||||||
|
(githubStats.userGitHubStats[b]?.commits ?? 0) - (githubStats.userGitHubStats[a]?.commits ?? 0)
|
||||||
|
);
|
||||||
|
}, [githubStats]);
|
||||||
|
|
||||||
if (devMode) {
|
if (devMode) {
|
||||||
DevStore.set('isDeveloper', true);
|
DevStore.set('isDeveloper', true);
|
||||||
@@ -277,13 +203,32 @@ export default function Settings(): JSX.Element {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className='relative'>
|
||||||
|
{particlesInit && showParticles && (
|
||||||
|
<Particles
|
||||||
|
id='birthday-particles'
|
||||||
|
options={particlesOptions}
|
||||||
|
className='pointer-events-none absolute inset-0 z-50'
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<header className='flex items-center gap-5 overflow-x-auto overflow-y-hidden border-b border-ut-offwhite px-7 py-4 md:overflow-x-hidden'>
|
<header className='flex items-center gap-5 overflow-x-auto overflow-y-hidden border-b border-ut-offwhite px-7 py-4 md:overflow-x-hidden'>
|
||||||
<LargeLogo />
|
<LargeLogo />
|
||||||
<Divider className='mx-2 self-center md:mx-4' size='2.5rem' orientation='vertical' />
|
<Divider className='mx-2 self-center md:mx-4' size='2.5rem' orientation='vertical' />
|
||||||
<Text variant='h1' className='flex-1 text-ut-burntorange normal-case!'>
|
<div className='flex flex-1 items-center gap-2'>
|
||||||
Settings and Credits
|
<Text variant='h1' className='text-ut-burntorange normal-case'>
|
||||||
</Text>
|
Settings and Credits
|
||||||
|
</Text>
|
||||||
|
{isBirthday && (
|
||||||
|
<span
|
||||||
|
onClick={triggerCelebration}
|
||||||
|
className='cursor-pointer px-4 text-sm text-ut-burntorange transition-transform hover:scale-110'
|
||||||
|
title='Click to celebrate!'
|
||||||
|
>
|
||||||
|
🎉 Happy Birthday LHD! 🎉
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<div className='hidden flex-row items-center justify-end gap-6 screenshot:hidden lg:flex'>
|
<div className='hidden flex-row items-center justify-end gap-6 screenshot:hidden lg:flex'>
|
||||||
<Button variant='minimal' color='theme-black' onClick={handleChangelogOnClick}>
|
<Button variant='minimal' color='theme-black' onClick={handleChangelogOnClick}>
|
||||||
<IconoirGitFork className='h-6 w-6 text-ut-gray' />
|
<IconoirGitFork className='h-6 w-6 text-ut-gray' />
|
||||||
@@ -304,219 +249,19 @@ export default function Settings(): JSX.Element {
|
|||||||
|
|
||||||
<div className='p-6 lg:flex'>
|
<div className='p-6 lg:flex'>
|
||||||
<div className='mr-4 lg:w-1/2 xl:w-xl'>
|
<div className='mr-4 lg:w-1/2 xl:w-xl'>
|
||||||
{/* <section className='mb-8'>
|
<AdvancedSettings
|
||||||
<h2 className='mb-4 text-xl text-ut-black font-semibold'>CUSTOMIZATION OPTIONS</h2>
|
highlightConflicts={highlightConflicts}
|
||||||
<div className='flex space-x-4'>
|
setHighlightConflicts={setHighlightConflicts}
|
||||||
<div className='w-1/2 space-y-4'>
|
loadAllCourses={loadAllCourses}
|
||||||
<div className='flex items-center justify-between'>
|
setLoadAllCourses={setLoadAllCourses}
|
||||||
<div className='max-w-xs'>
|
increaseScheduleLimit={increaseScheduleLimit}
|
||||||
<h3 className='text-ut-burntorange font-semibold'>Show Course Status</h3>
|
setIncreaseScheduleLimit={setIncreaseScheduleLimit}
|
||||||
<p className='text-sm text-gray-600'>
|
calendarNewTab={calendarNewTab}
|
||||||
Shows an indicator for waitlisted, cancelled, and closed courses.
|
setCalendarNewTab={setCalendarNewTab}
|
||||||
</p>
|
activeSchedule={activeSchedule}
|
||||||
</div>
|
handleEraseAll={handleEraseAll}
|
||||||
<SwitchButton
|
handleImportClick={handleImportClick}
|
||||||
isChecked={enableCourseStatusChips}
|
/>
|
||||||
onChange={() => {
|
|
||||||
setEnableCourseStatusChips(!enableCourseStatusChips);
|
|
||||||
OptionsStore.set('enableCourseStatusChips', !enableCourseStatusChips);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Divider size='auto' orientation='horizontal' />
|
|
||||||
|
|
||||||
<div className='flex items-center justify-between'>
|
|
||||||
<div className='max-w-xs'>
|
|
||||||
<h3 className='text-ut-burntorange font-semibold'>
|
|
||||||
Show Time & Location in Popup
|
|
||||||
</h3>
|
|
||||||
<p className='text-sm text-gray-600'>
|
|
||||||
Shows the course's time and location in the extension's popup.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<SwitchButton
|
|
||||||
isChecked={showTimeLocation}
|
|
||||||
onChange={() => {
|
|
||||||
setShowTimeLocation(!showTimeLocation);
|
|
||||||
OptionsStore.set('enableTimeAndLocationInPopup', !showTimeLocation);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{DISPLAY_PREVIEWS && (
|
|
||||||
<Preview>
|
|
||||||
<CalendarCourseCell
|
|
||||||
colors={getCourseColors('orange')}
|
|
||||||
courseDeptAndInstr={ExampleCourse.department}
|
|
||||||
className={ExampleCourse.number}
|
|
||||||
status={ExampleCourse.status}
|
|
||||||
timeAndLocation={ExampleCourse.schedule.meetings[0]!.getTimeString({
|
|
||||||
separator: '-',
|
|
||||||
})}
|
|
||||||
/>
|
|
||||||
<PopupCourseBlock colors={getCourseColors('orange')} course={ExampleCourse} />
|
|
||||||
</Preview>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<Divider size='auto' orientation='horizontal' /> */}
|
|
||||||
|
|
||||||
<section className='mb-8'>
|
|
||||||
<h2 className='mb-4 text-xl text-ut-black font-semibold'>ADVANCED SETTINGS</h2>
|
|
||||||
<div className='flex space-x-4'>
|
|
||||||
<div className={PREVIEW_SECTION_DIV_CLASSNAME}>
|
|
||||||
{/* <div className='flex items-center justify-between'>
|
|
||||||
<div className='max-w-xs'>
|
|
||||||
<h3 className='text-ut-burntorange font-semibold'>Refresh Data</h3>
|
|
||||||
<p className='text-sm text-gray-600'>
|
|
||||||
Refreshes waitlist, course status, and other info with the latest data from
|
|
||||||
UT's site.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<Button
|
|
||||||
variant='outline'
|
|
||||||
color='ut-black'
|
|
||||||
icon={RefreshIcon}
|
|
||||||
onClick={() => console.log('Refresh clicked')}
|
|
||||||
disabled={!enableDataRefreshing}
|
|
||||||
>
|
|
||||||
Refresh
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Divider size='auto' orientation='horizontal' /> */}
|
|
||||||
|
|
||||||
<div className='flex items-center justify-between'>
|
|
||||||
<div className='max-w-xs'>
|
|
||||||
<Text variant='h4' className='text-ut-burntorange font-semibold'>
|
|
||||||
Export Current Schedule
|
|
||||||
</Text>
|
|
||||||
<p className='text-sm text-gray-600'>
|
|
||||||
Backup your active schedule to a portable file
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<Button
|
|
||||||
variant='outline'
|
|
||||||
color='ut-burntorange'
|
|
||||||
onClick={() => handleExportClick(activeSchedule.id)}
|
|
||||||
>
|
|
||||||
Export
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Divider size='auto' orientation='horizontal' />
|
|
||||||
|
|
||||||
<div className='flex items-center justify-between'>
|
|
||||||
<div className='max-w-xs'>
|
|
||||||
<Text variant='h4' className='text-ut-burntorange font-semibold'>
|
|
||||||
Import Schedule
|
|
||||||
</Text>
|
|
||||||
<p className='text-sm text-gray-600'>Import from a schedule file</p>
|
|
||||||
</div>
|
|
||||||
<FileUpload
|
|
||||||
variant='filled'
|
|
||||||
color='ut-burntorange'
|
|
||||||
onChange={handleImportClick}
|
|
||||||
accept={MIMEType.JSON}
|
|
||||||
>
|
|
||||||
Import Schedule
|
|
||||||
</FileUpload>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Divider size='auto' orientation='horizontal' />
|
|
||||||
|
|
||||||
<div className='flex items-center justify-between'>
|
|
||||||
<div className='max-w-xs'>
|
|
||||||
<Text variant='h4' className='text-ut-burntorange font-semibold'>
|
|
||||||
Course Conflict Highlight
|
|
||||||
</Text>
|
|
||||||
<p className='text-sm text-gray-600'>
|
|
||||||
Adds a red strikethrough to courses that have conflicting times.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<SwitchButton
|
|
||||||
isChecked={highlightConflicts}
|
|
||||||
onChange={() => {
|
|
||||||
setHighlightConflicts(!highlightConflicts);
|
|
||||||
OptionsStore.set('enableHighlightConflicts', !highlightConflicts);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Divider size='auto' orientation='horizontal' />
|
|
||||||
|
|
||||||
<div className='flex items-center justify-between'>
|
|
||||||
<div className='max-w-xs'>
|
|
||||||
<Text variant='h4' className='text-ut-burntorange font-semibold'>
|
|
||||||
Load All Courses in Course Schedule
|
|
||||||
</Text>
|
|
||||||
<p className='text-sm text-gray-600'>
|
|
||||||
Loads all courses in the Course Schedule site by scrolling, instead of using
|
|
||||||
next/prev page buttons.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<SwitchButton
|
|
||||||
isChecked={loadAllCourses}
|
|
||||||
onChange={() => {
|
|
||||||
setLoadAllCourses(!loadAllCourses);
|
|
||||||
OptionsStore.set('enableScrollToLoad', !loadAllCourses);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Divider size='auto' orientation='horizontal' />
|
|
||||||
|
|
||||||
<div className='flex items-center justify-between'>
|
|
||||||
<div className='max-w-xs'>
|
|
||||||
<Text variant='h4' className='text-ut-burntorange font-semibold'>
|
|
||||||
Always Open Calendar in New Tab
|
|
||||||
</Text>
|
|
||||||
<p className='text-sm text-gray-600'>
|
|
||||||
Always opens the calendar view in a new tab when navigating to the calendar
|
|
||||||
page. May prevent issues where the calendar refuses to open.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<SwitchButton
|
|
||||||
isChecked={calendarNewTab}
|
|
||||||
onChange={() => {
|
|
||||||
setCalendarNewTab(!calendarNewTab);
|
|
||||||
OptionsStore.set('alwaysOpenCalendarInNewTab', !calendarNewTab);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Divider size='auto' orientation='horizontal' />
|
|
||||||
|
|
||||||
<div className='flex items-center justify-between'>
|
|
||||||
<div className='max-w-xs'>
|
|
||||||
<Text variant='h4' className='text-ut-burntorange font-semibold'>
|
|
||||||
Reset All Data
|
|
||||||
</Text>
|
|
||||||
<p className='text-sm text-gray-600'>
|
|
||||||
Erases all schedules and courses you have.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<Button variant='outline' color='theme-red' icon={Trash} onClick={handleEraseAll}>
|
|
||||||
Erase All
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{DISPLAY_PREVIEWS && (
|
|
||||||
<Preview>
|
|
||||||
<Text
|
|
||||||
variant='h2-course'
|
|
||||||
className={clsx('text-center text-theme-red !font-normal', {
|
|
||||||
'line-through': highlightConflicts,
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
01234 MWF 10:00 AM - 11:00 AM UTC 1.234
|
|
||||||
</Text>
|
|
||||||
</Preview>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<Divider size='auto' orientation='horizontal' />
|
<Divider size='auto' orientation='horizontal' />
|
||||||
|
|
||||||
@@ -577,17 +322,21 @@ export default function Settings(): JSX.Element {
|
|||||||
Open Debug Page
|
Open Debug Page
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<Divider size='auto' orientation='horizontal' />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
variant='filled'
|
||||||
|
color='ut-black'
|
||||||
|
onClick={() => addCourseByURL(activeSchedule)}
|
||||||
|
>
|
||||||
|
Add course by link
|
||||||
|
</Button>
|
||||||
|
<Button variant='filled' color='ut-burntorange' onClick={showMigrationDialog}>
|
||||||
|
Show Migration Dialog
|
||||||
|
</Button>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Divider size='auto' orientation='horizontal' />
|
|
||||||
|
|
||||||
<Button variant='filled' color='ut-black' onClick={() => addCourseByURL(activeSchedule)}>
|
|
||||||
Add course by link
|
|
||||||
</Button>
|
|
||||||
<Button variant='filled' color='ut-burntorange' onClick={showMigrationDialog}>
|
|
||||||
Show Migration Dialog
|
|
||||||
</Button>
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -600,144 +349,44 @@ export default function Settings(): JSX.Element {
|
|||||||
</h2>
|
</h2>
|
||||||
<div className='grid grid-cols-2 gap-4 2xl:grid-cols-4 md:grid-cols-3'>
|
<div className='grid grid-cols-2 gap-4 2xl:grid-cols-4 md:grid-cols-3'>
|
||||||
{LONGHORN_DEVELOPERS_ADMINS.map(admin => (
|
{LONGHORN_DEVELOPERS_ADMINS.map(admin => (
|
||||||
<div
|
<ContributorCard
|
||||||
key={admin.githubUsername}
|
key={admin.githubUsername}
|
||||||
className='border border-gray-300 rounded bg-ut-gray/10 p-4'
|
name={admin.name}
|
||||||
>
|
githubUsername={admin.githubUsername}
|
||||||
<Text
|
roles={admin.role}
|
||||||
variant='p'
|
stats={githubStats?.adminGitHubStats[admin.githubUsername]}
|
||||||
className='text-ut-burntorange font-semibold hover:cursor-pointer'
|
showStats={showGitHubStats}
|
||||||
onClick={() =>
|
includeMergedPRs={INCLUDE_MERGED_PRS}
|
||||||
window.open(`https://github.com/${admin.githubUsername}`, '_blank')
|
/>
|
||||||
}
|
|
||||||
>
|
|
||||||
{admin.name}
|
|
||||||
</Text>
|
|
||||||
{admin.role.map(role => (
|
|
||||||
<p key={admin.githubUsername} className='text-sm text-gray-600'>
|
|
||||||
{role}
|
|
||||||
</p>
|
|
||||||
))}
|
|
||||||
{showGitHubStats && githubStats && (
|
|
||||||
<div className='mt-2'>
|
|
||||||
<p className='text-xs text-gray-500'>GitHub Stats (UTRP repo):</p>
|
|
||||||
{includeMergedPRs && (
|
|
||||||
<p className='text-xs'>
|
|
||||||
Merged PRS:{' '}
|
|
||||||
{githubStats.adminGitHubStats[admin.githubUsername]?.mergedPRs}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
<p className='text-xs'>
|
|
||||||
Commits: {githubStats.adminGitHubStats[admin.githubUsername]?.commits}
|
|
||||||
</p>
|
|
||||||
<p className='text-xs text-ut-green'>
|
|
||||||
{githubStats.adminGitHubStats[admin.githubUsername]?.linesAdded} ++
|
|
||||||
</p>
|
|
||||||
<p className='text-xs text-theme-red'>
|
|
||||||
{githubStats.adminGitHubStats[admin.githubUsername]?.linesDeleted} --
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section className='my-8'>
|
<section className='my-8'>
|
||||||
<h2 className='mb-4 text-xl text-ut-black font-semibold'>UTRP CONTRIBUTORS</h2>
|
<h2 className='mb-4 text-xl text-ut-black font-semibold'>UTRP CONTRIBUTORS</h2>
|
||||||
<div className='grid grid-cols-2 gap-4 2xl:grid-cols-4 md:grid-cols-3 xl:grid-cols-3'>
|
<div className='grid grid-cols-2 gap-4 2xl:grid-cols-4 md:grid-cols-3 xl:grid-cols-3'>
|
||||||
{LONGHORN_DEVELOPERS_SWE.sort(
|
{sortedContributors.map(swe => (
|
||||||
(a, b) =>
|
<ContributorCard
|
||||||
(githubStats?.userGitHubStats[b.githubUsername]?.commits ?? 0) -
|
|
||||||
(githubStats?.userGitHubStats[a.githubUsername]?.commits ?? 0)
|
|
||||||
).map(swe => (
|
|
||||||
<div
|
|
||||||
key={swe.githubUsername}
|
key={swe.githubUsername}
|
||||||
className='border border-gray-300 rounded bg-ut-gray/10 p-4'
|
name={swe.name}
|
||||||
>
|
githubUsername={swe.githubUsername}
|
||||||
<Text
|
roles={swe.role}
|
||||||
variant='p'
|
stats={githubStats?.userGitHubStats[swe.githubUsername]}
|
||||||
className='text-ut-burntorange font-semibold hover:cursor-pointer'
|
showStats={showGitHubStats}
|
||||||
onClick={() =>
|
includeMergedPRs={INCLUDE_MERGED_PRS}
|
||||||
window.open(`https://github.com/${swe.githubUsername}`, '_blank')
|
/>
|
||||||
}
|
))}
|
||||||
>
|
{additionalContributors.map(username => (
|
||||||
{swe.name}
|
<ContributorCard
|
||||||
</Text>
|
key={username}
|
||||||
{swe.role.map(role => (
|
name={githubStats!.names[username] || username}
|
||||||
<p key={swe.githubUsername} className='text-sm text-gray-600'>
|
githubUsername={username}
|
||||||
{role}
|
roles={['Contributor']}
|
||||||
</p>
|
stats={githubStats!.userGitHubStats[username]}
|
||||||
))}
|
showStats={showGitHubStats}
|
||||||
{showGitHubStats && githubStats && (
|
includeMergedPRs={INCLUDE_MERGED_PRS}
|
||||||
<div className='mt-2'>
|
/>
|
||||||
<p className='text-xs text-gray-500'>GitHub Stats (UTRP repo):</p>
|
|
||||||
{includeMergedPRs && (
|
|
||||||
<p className='text-xs'>
|
|
||||||
Merged PRS:{' '}
|
|
||||||
{githubStats.userGitHubStats[swe.githubUsername]?.mergedPRs}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
<p className='text-xs'>
|
|
||||||
Commits: {githubStats.userGitHubStats[swe.githubUsername]?.commits}
|
|
||||||
</p>
|
|
||||||
<p className='text-xs text-ut-green'>
|
|
||||||
{githubStats.userGitHubStats[swe.githubUsername]?.linesAdded} ++
|
|
||||||
</p>
|
|
||||||
<p className='text-xs text-theme-red'>
|
|
||||||
{githubStats.userGitHubStats[swe.githubUsername]?.linesDeleted} --
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
))}
|
))}
|
||||||
{githubStats &&
|
|
||||||
Object.keys(githubStats.userGitHubStats)
|
|
||||||
.filter(
|
|
||||||
username =>
|
|
||||||
!LONGHORN_DEVELOPERS_ADMINS.some(
|
|
||||||
admin => admin.githubUsername === username
|
|
||||||
) && !LONGHORN_DEVELOPERS_SWE.some(swe => swe.githubUsername === username)
|
|
||||||
)
|
|
||||||
.sort(
|
|
||||||
(a, b) =>
|
|
||||||
(githubStats.userGitHubStats[b]?.commits ?? 0) -
|
|
||||||
(githubStats.userGitHubStats[a]?.commits ?? 0)
|
|
||||||
)
|
|
||||||
.map(username => (
|
|
||||||
<div
|
|
||||||
key={username}
|
|
||||||
className='overflow-clip border border-gray-300 rounded bg-ut-gray/10 p-4'
|
|
||||||
>
|
|
||||||
<Text
|
|
||||||
variant='p'
|
|
||||||
className='text-ut-burntorange font-semibold hover:cursor-pointer'
|
|
||||||
onClick={() => window.open(`https://github.com/${username}`, '_blank')}
|
|
||||||
>
|
|
||||||
{githubStats.names[username]}
|
|
||||||
</Text>
|
|
||||||
<p className='text-sm text-gray-600'>Contributor</p>
|
|
||||||
{showGitHubStats && (
|
|
||||||
<div className='mt-2'>
|
|
||||||
<p className='text-xs text-gray-500'>GitHub Stats (UTRP repo):</p>
|
|
||||||
{includeMergedPRs && (
|
|
||||||
<p className='text-xs'>
|
|
||||||
Merged PRs:{' '}
|
|
||||||
{githubStats.userGitHubStats[username]?.mergedPRs}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
<p className='text-xs'>
|
|
||||||
Commits: {githubStats.userGitHubStats[username]?.commits}
|
|
||||||
</p>
|
|
||||||
<p className='text-xs text-ut-green'>
|
|
||||||
{githubStats.userGitHubStats[username]?.linesAdded} ++
|
|
||||||
</p>
|
|
||||||
<p className='text-xs text-theme-red'>
|
|
||||||
{githubStats.userGitHubStats[username]?.linesDeleted} --
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
13
src/views/components/settings/constants.ts
Normal file
13
src/views/components/settings/constants.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
export const DISPLAY_PREVIEWS = false;
|
||||||
|
export const PREVIEW_SECTION_DIV_CLASSNAME = DISPLAY_PREVIEWS ? 'w-1/2 space-y-4' : 'flex-grow space-y-4';
|
||||||
|
|
||||||
|
export const STATS_TOGGLE_KEY = 's';
|
||||||
|
export const INCLUDE_MERGED_PRS = false;
|
||||||
|
export const DEV_MODE_CLICK_TARGET = 5;
|
||||||
|
export const DEV_MODE_CLICK_TIMEOUT = 5000;
|
||||||
|
export const DEV_MODE_CLICK_INTERVAL = 500;
|
||||||
|
|
||||||
|
// LHD Birthday: January 9th, 2025
|
||||||
|
export const LHD_BIRTHDAY = { month: 0, day: 9 };
|
||||||
|
export const BIRTHDAY_CELEBRATION_DURATION = 5000;
|
||||||
|
export const BIRTHDAY_CELEBRATION_DEBOUNCE = 2000;
|
||||||
140
src/views/components/settings/useBirthdayCelebration.ts
Normal file
140
src/views/components/settings/useBirthdayCelebration.ts
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
import type { Engine, ISourceOptions } from '@tsparticles/engine';
|
||||||
|
import { initParticlesEngine } from '@tsparticles/react';
|
||||||
|
import { loadSlim } from '@tsparticles/slim';
|
||||||
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
|
|
||||||
|
import { BIRTHDAY_CELEBRATION_DEBOUNCE, BIRTHDAY_CELEBRATION_DURATION, LHD_BIRTHDAY } from './constants';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom hook for birthday celebration particles
|
||||||
|
*/
|
||||||
|
export const useBirthdayCelebration = () => {
|
||||||
|
const [showParticles, setShowParticles] = useState(false);
|
||||||
|
const [particlesInit, setParticlesInit] = useState(false);
|
||||||
|
const [lastCelebration, setLastCelebration] = useState(0);
|
||||||
|
|
||||||
|
const isBirthday = useMemo(() => {
|
||||||
|
const today = new Date();
|
||||||
|
return today.getMonth() === LHD_BIRTHDAY.month && today.getDate() === LHD_BIRTHDAY.day;
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
initParticlesEngine(async (engine: Engine) => {
|
||||||
|
await loadSlim(engine);
|
||||||
|
}).then(() => {
|
||||||
|
setParticlesInit(true);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const triggerCelebration = useCallback(() => {
|
||||||
|
if (!isBirthday) return;
|
||||||
|
|
||||||
|
const now = Date.now();
|
||||||
|
// Debounce: prevent triggering again within BIRTHDAY_CELEBRATION_DEBOUNCE ms
|
||||||
|
if (now - lastCelebration < BIRTHDAY_CELEBRATION_DEBOUNCE) return;
|
||||||
|
|
||||||
|
setLastCelebration(now);
|
||||||
|
setShowParticles(true);
|
||||||
|
setTimeout(() => setShowParticles(false), BIRTHDAY_CELEBRATION_DURATION);
|
||||||
|
}, [isBirthday, lastCelebration]);
|
||||||
|
|
||||||
|
const particlesOptions: ISourceOptions = useMemo(
|
||||||
|
() => ({
|
||||||
|
fullScreen: { enable: true, zIndex: 1 },
|
||||||
|
particles: {
|
||||||
|
color: { value: ['#BF5700', '#333F48', '#FFFFFF'] }, // UT colors
|
||||||
|
move: {
|
||||||
|
direction: 'bottom',
|
||||||
|
enable: true,
|
||||||
|
outModes: {
|
||||||
|
default: 'out',
|
||||||
|
},
|
||||||
|
size: true,
|
||||||
|
speed: {
|
||||||
|
min: 1,
|
||||||
|
max: 3,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
number: {
|
||||||
|
value: 500,
|
||||||
|
density: {
|
||||||
|
enable: true,
|
||||||
|
area: 800,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opacity: {
|
||||||
|
value: 1,
|
||||||
|
animation: {
|
||||||
|
enable: false,
|
||||||
|
startValue: 'max',
|
||||||
|
destroy: 'min',
|
||||||
|
speed: 0.3,
|
||||||
|
sync: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rotate: {
|
||||||
|
value: {
|
||||||
|
min: 0,
|
||||||
|
max: 360,
|
||||||
|
},
|
||||||
|
direction: 'random',
|
||||||
|
move: true,
|
||||||
|
animation: {
|
||||||
|
enable: true,
|
||||||
|
speed: 60,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
tilt: {
|
||||||
|
direction: 'random',
|
||||||
|
enable: true,
|
||||||
|
move: true,
|
||||||
|
value: {
|
||||||
|
min: 0,
|
||||||
|
max: 360,
|
||||||
|
},
|
||||||
|
animation: {
|
||||||
|
enable: true,
|
||||||
|
speed: 60,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
shape: {
|
||||||
|
type: ['circle', 'square'],
|
||||||
|
options: {},
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
value: {
|
||||||
|
min: 2,
|
||||||
|
max: 4,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
roll: {
|
||||||
|
darken: {
|
||||||
|
enable: true,
|
||||||
|
value: 30,
|
||||||
|
},
|
||||||
|
enlighten: {
|
||||||
|
enable: true,
|
||||||
|
value: 30,
|
||||||
|
},
|
||||||
|
enable: true,
|
||||||
|
speed: {
|
||||||
|
min: 15,
|
||||||
|
max: 25,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
wobble: {
|
||||||
|
distance: 30,
|
||||||
|
enable: true,
|
||||||
|
move: true,
|
||||||
|
speed: {
|
||||||
|
min: -15,
|
||||||
|
max: 15,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
|
return { showParticles, particlesInit, particlesOptions, triggerCelebration, isBirthday };
|
||||||
|
};
|
||||||
35
src/views/components/settings/useDevMode.ts
Normal file
35
src/views/components/settings/useDevMode.ts
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
import { DEV_MODE_CLICK_INTERVAL, DEV_MODE_CLICK_TIMEOUT } from './constants';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom hook for enabling developer mode via rapid clicking
|
||||||
|
*/
|
||||||
|
export const useDevMode = (targetCount: number): [boolean, () => void] => {
|
||||||
|
const [count, setCount] = useState(0);
|
||||||
|
const [active, setActive] = useState(false);
|
||||||
|
const [lastClick, setLastClick] = useState(0);
|
||||||
|
|
||||||
|
const incrementCount = useCallback(() => {
|
||||||
|
const now = Date.now();
|
||||||
|
if (now - lastClick < DEV_MODE_CLICK_INTERVAL) {
|
||||||
|
setCount(prevCount => {
|
||||||
|
const newCount = prevCount + 1;
|
||||||
|
if (newCount === targetCount) {
|
||||||
|
setActive(true);
|
||||||
|
}
|
||||||
|
return newCount;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setCount(1);
|
||||||
|
}
|
||||||
|
setLastClick(now);
|
||||||
|
}, [lastClick, targetCount]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const timer = setTimeout(() => setCount(0), DEV_MODE_CLICK_TIMEOUT);
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
}, [count]);
|
||||||
|
|
||||||
|
return [active, incrementCount];
|
||||||
|
};
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
|
import { background } from '@shared/messages';
|
||||||
|
import { OptionsStore } from '@shared/storage/OptionsStore';
|
||||||
|
import { CRX_PAGES } from '@shared/types/CRXPages';
|
||||||
import useSchedules from '@views/hooks/useSchedules';
|
import useSchedules from '@views/hooks/useSchedules';
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { Button } from '../components/common/Button';
|
import { Button } from '../components/common/Button';
|
||||||
import { usePrompt } from '../components/common/DialogProvider/DialogProvider';
|
import { usePrompt } from '../components/common/DialogProvider/DialogProvider';
|
||||||
@@ -17,8 +20,33 @@ const SCHEDULE_LIMIT = 10;
|
|||||||
export function useEnforceScheduleLimit(): () => boolean {
|
export function useEnforceScheduleLimit(): () => boolean {
|
||||||
const [, schedules] = useSchedules();
|
const [, schedules] = useSchedules();
|
||||||
const showDialog = usePrompt();
|
const showDialog = usePrompt();
|
||||||
|
const [allowMoreSchedules, setAllowMoreSchedules] = useState<boolean>(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let mounted = true;
|
||||||
|
(async () => {
|
||||||
|
try {
|
||||||
|
const val = await OptionsStore.get('allowMoreSchedules');
|
||||||
|
if (mounted) setAllowMoreSchedules(val ?? false);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to read allowMoreSchedules from OptionsStore:', err);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
const listener = OptionsStore.listen('allowMoreSchedules', async ({ newValue }) => {
|
||||||
|
setAllowMoreSchedules(newValue);
|
||||||
|
});
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
mounted = false;
|
||||||
|
OptionsStore.removeListener(listener);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
return useCallback(() => {
|
return useCallback(() => {
|
||||||
|
// If user has enabled bypass, allow creating more schedules
|
||||||
|
if (allowMoreSchedules) return true;
|
||||||
|
|
||||||
if (schedules.length >= SCHEDULE_LIMIT) {
|
if (schedules.length >= SCHEDULE_LIMIT) {
|
||||||
showDialog({
|
showDialog({
|
||||||
title: `You have too many schedules!`,
|
title: `You have too many schedules!`,
|
||||||
@@ -27,19 +55,33 @@ export function useEnforceScheduleLimit(): () => boolean {
|
|||||||
<>
|
<>
|
||||||
To encourage organization,{' '}
|
To encourage organization,{' '}
|
||||||
<span className='text-ut-burntorange'>please consider deleting any unused schedules</span> you
|
<span className='text-ut-burntorange'>please consider deleting any unused schedules</span> you
|
||||||
may have.
|
may have. You can increase the limit in the settings if it’s really necessary.
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
|
|
||||||
buttons: close => (
|
buttons: close => (
|
||||||
<Button variant='filled' color='ut-burntorange' onClick={close}>
|
<>
|
||||||
I understand
|
<Button
|
||||||
</Button>
|
variant='outline'
|
||||||
|
color='ut-black'
|
||||||
|
onClick={() => {
|
||||||
|
close();
|
||||||
|
// open options/settings page so user can enable bypass if they are advising staff
|
||||||
|
const url = chrome.runtime.getURL(CRX_PAGES.OPTIONS);
|
||||||
|
background.openNewTab({ url });
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Open Settings
|
||||||
|
</Button>
|
||||||
|
<Button variant='filled' color='ut-burntorange' onClick={close}>
|
||||||
|
I understand
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}, [schedules, showDialog]);
|
}, [schedules, showDialog, allowMoreSchedules]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ import WhatsNewPopupContent from '@views/components/common/WhatsNewPopup';
|
|||||||
import { useDialog } from '@views/contexts/DialogContext';
|
import { useDialog } from '@views/contexts/DialogContext';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { LogoIcon } from '../components/common/LogoIcon';
|
// import useChangelog from './useChangelog';
|
||||||
import useChangelog from './useChangelog';
|
|
||||||
|
|
||||||
const LDIconURL = new URL('/src/assets/LD-icon-new.png', import.meta.url).href;
|
const LDIconURL = new URL('/src/assets/LD-icon-new.png', import.meta.url).href;
|
||||||
|
|
||||||
@@ -17,8 +16,8 @@ const LDIconURL = new URL('/src/assets/LD-icon-new.png', import.meta.url).href;
|
|||||||
*/
|
*/
|
||||||
export default function useWhatsNewPopUp(): () => void {
|
export default function useWhatsNewPopUp(): () => void {
|
||||||
const showDialog = useDialog();
|
const showDialog = useDialog();
|
||||||
const showChangeLog = useChangelog();
|
// const showChangeLog = useChangelog();
|
||||||
const { version } = chrome.runtime.getManifest();
|
// const { version } = chrome.runtime.getManifest();
|
||||||
|
|
||||||
const showPopUp = () => {
|
const showPopUp = () => {
|
||||||
showDialog(close => ({
|
showDialog(close => ({
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export const SiteSupport = {
|
|||||||
MY_UT: 'MY_UT',
|
MY_UT: 'MY_UT',
|
||||||
COURSE_CATALOG_SEARCH: 'COURSE_CATALOG_SEARCH',
|
COURSE_CATALOG_SEARCH: 'COURSE_CATALOG_SEARCH',
|
||||||
CLASSLIST: 'CLASSLIST',
|
CLASSLIST: 'CLASSLIST',
|
||||||
|
COURSE_CATALOG_KWS: 'COURSE_CATALOG_KWS',
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -40,6 +41,9 @@ export default function getSiteSupport(url: string): SiteSupportType | null {
|
|||||||
return SiteSupport.UT_PLANNER;
|
return SiteSupport.UT_PLANNER;
|
||||||
}
|
}
|
||||||
if (url.includes('utdirect.utexas.edu/apps/registrar/course_schedule')) {
|
if (url.includes('utdirect.utexas.edu/apps/registrar/course_schedule')) {
|
||||||
|
if (url.includes('kws_results')) {
|
||||||
|
return SiteSupport.COURSE_CATALOG_KWS;
|
||||||
|
}
|
||||||
if (url.includes('results')) {
|
if (url.includes('results')) {
|
||||||
return SiteSupport.COURSE_CATALOG_LIST;
|
return SiteSupport.COURSE_CATALOG_LIST;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,31 @@ const fixManifestOptionsPage = (): Plugin => ({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function getGitInfo() {
|
||||||
|
// Try environment variables first (for Nix builds)
|
||||||
|
if (process.env.VITE_GIT_BRANCH && process.env.VITE_GIT_COMMIT) {
|
||||||
|
return {
|
||||||
|
gitBranch: process.env.VITE_GIT_BRANCH,
|
||||||
|
gitCommit: process.env.VITE_GIT_COMMIT,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fall back to git commands (for local development)
|
||||||
|
try {
|
||||||
|
return {
|
||||||
|
gitBranch: execSync('git rev-parse --abbrev-ref HEAD').toString().trim(),
|
||||||
|
gitCommit: execSync('git rev-parse --short HEAD').toString().trim(),
|
||||||
|
};
|
||||||
|
} catch {
|
||||||
|
return {
|
||||||
|
gitBranch: 'unknown',
|
||||||
|
gitCommit: 'unknown',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const gitInfo = getGitInfo();
|
||||||
|
|
||||||
let config: ResolvedConfig;
|
let config: ResolvedConfig;
|
||||||
let server: ViteDevServer;
|
let server: ViteDevServer;
|
||||||
|
|
||||||
@@ -180,12 +205,14 @@ export default defineConfig({
|
|||||||
'PROD',
|
'PROD',
|
||||||
'VITE_SENTRY_ENVIRONMENT',
|
'VITE_SENTRY_ENVIRONMENT',
|
||||||
'VITE_BETA_BUILD',
|
'VITE_BETA_BUILD',
|
||||||
|
'VITE_GIT_BRANCH',
|
||||||
|
'VITE_GIT_COMMIT',
|
||||||
],
|
],
|
||||||
includeTimestamp: true,
|
includeTimestamp: true,
|
||||||
includeBuildTime: true,
|
includeBuildTime: true,
|
||||||
customMetadata: {
|
customMetadata: {
|
||||||
gitBranch: () => execSync('git rev-parse --abbrev-ref HEAD').toString().trim(),
|
gitBranch: () => gitInfo.gitBranch,
|
||||||
gitCommit: () => execSync('git rev-parse --short HEAD').toString().trim(),
|
gitCommit: () => gitInfo.gitCommit,
|
||||||
nodeVersion: () => process.version,
|
nodeVersion: () => process.version,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user