Skip to content

Commit

Permalink
Merge branch 'main' into chore-update-scripts-to-a8dd48e7a89fff743d40…
Browse files Browse the repository at this point in the history
…102e414dadc7c2d8152d
  • Loading branch information
tsaxking authored Sep 26, 2024
2 parents c7ab362 + 83377ff commit 2fcccf7
Show file tree
Hide file tree
Showing 345 changed files with 51,980 additions and 688 deletions.
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Issue Template
about: Template for creating well-documented issues
---

## Description

[Provide a clear and concise description of the issue.]

## Steps to Reproduce

[Outline the steps to reproduce the issue, if applicable.]

## Expected Behavior

[Describe what you expected to happen.]

## Actual Behavior

[Describe what actually happened.]

## Screenshots

[If applicable, add screenshots to help explain the issue.]

## Additional Information

[Add any other relevant information about the issue here.]

## Possible Solution

[Suggest a possible solution to the issue, if you have one.]

## Related Issues

[List any related issues or pull requests here.]

## Checklist

- [ ] I have read the project's contributing guidelines.
- [ ] I have searched for similar issues and confirmed that this is not a duplicate.
- [ ] I have provided all the necessary information for the issue.
- [ ] I have assigned the appropriate labels and milestone to the issue.
35 changes: 35 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Description

Please provide a brief description of the changes made in this pull request.

## Motivation

Explain the motivation behind these changes. Why are they necessary or beneficial?

## Changes Made

List the specific changes made in this pull request. Be as detailed as possible.

## Screenshots (if applicable)

If your changes include visual updates, please provide screenshots to showcase the before and after.

## Testing

Describe the testing process you have followed to ensure that your changes are working as expected.

## Checklist

- [ ] I have reviewed the code changes thoroughly.
- [ ] I have tested the changes locally.
- [ ] I have updated the documentation if necessary.
- [ ] I have added appropriate comments to the code.
- [ ] I have followed the project's coding conventions and guidelines.

## Related Issues

List any related issues or pull requests that are addressed or referenced by this pull request.

## Additional Notes

Add any additional notes or context that may be helpful for reviewers.
30 changes: 30 additions & 0 deletions .github/workflows/deploy-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy to Development Environment
on:
push:
branches:
- deploy
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Retrieve git dependencies
uses: actions/checkout@v3
with:
submodules: 'true'
token: ${{ secrets.GH_TOKEN }}

- name: pull latest from deploy branch
uses: appleboy/[email protected]
env:
PROJECT: /root/tators-dashboard
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
envs: PROJECT
script: |
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
sh gh-actions/tatorscout/nightly.sh
31 changes: 31 additions & 0 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy to Development Environment
on:
release:
types:
- published
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Retrieve git dependencies
uses: actions/checkout@v3
with:
submodules: 'true'
token: ${{ secrets.GH_TOKEN }}

- name: pull latest from deploy branch
uses: appleboy/[email protected]
env:
PROJECT: /root/tators-dashboard

with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
envs: PROJECT
script: |
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
sh gh-actions/tatorscout/release.sh
60 changes: 0 additions & 60 deletions .github/workflows/docs.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ branch-transfer/
deno.lock
credentials.json
token.json
*.assignment.json

cached-ids.json
blocked-ips.json
database.json
Expand All @@ -30,7 +32,7 @@ uploads/
static/build/
*/scss/*.css
ignore-list.txt
*/logs/*.csv
*.csv
*.db
*.db-journal
storage/db/backups/*
Expand Down
11 changes: 11 additions & 0 deletions client/entries/dashboard/2023.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import '../../utilities/imports';

import Dashboard from '../../views/dashboards/2024.svelte';
import { FIRSTYear } from '../../models/FIRST/year';
import '../../models/FIRST/model-builder';

new Dashboard({
target: document.body
});

FIRSTYear.select(2023);
11 changes: 11 additions & 0 deletions client/entries/dashboard/2024.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import '../../utilities/imports';

import Dashboard from '../../views/dashboards/2024.svelte';
import { FIRSTYear } from '../../models/FIRST/year';
import '../../models/FIRST/model-builder';

new Dashboard({
target: document.body
});

FIRSTYear.select(2024);
7 changes: 7 additions & 0 deletions client/entries/dashboard/account.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import '../../utilities/imports';
import App from '../../views/pages/account.svelte';
import '../../models/FIRST/model-builder';
import { FIRSTYear } from '../../models/FIRST/year';
FIRSTYear.select(new Date().getFullYear());

const myApp = new App({ target: document.body });

Check warning on line 7 in client/entries/dashboard/account.ts

View workflow job for this annotation

GitHub Actions / format_and_lint

'myApp' is assigned a value but never used. Allowed unused vars must match /^_/u
3 changes: 3 additions & 0 deletions client/entries/dashboard/admin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import '../../utilities/imports';

import Dashboard from '../../views/dashboards/Admin.svelte';
import '../../models/FIRST/model-builder';
import { FIRSTYear } from '../../models/FIRST/year';
FIRSTYear.select(new Date().getFullYear());

new Dashboard({
target: document.body
Expand Down
3 changes: 3 additions & 0 deletions client/entries/dashboard/developer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import '../../utilities/imports';
import '../../utilities/imports';

Check warning on line 3 in client/entries/dashboard/developer.ts

View workflow job for this annotation

GitHub Actions / format_and_lint

'../../utilities/imports' import is duplicated

import Dashboard from '../../views/dashboards/Developer.svelte';
import '../../models/FIRST/model-builder';
import { FIRSTYear } from '../../models/FIRST/year';
FIRSTYear.select(new Date().getFullYear());

new Dashboard({
target: document.body
Expand Down
7 changes: 7 additions & 0 deletions client/entries/dashboard/mentor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import '../../utilities/imports';
import App from '../../views/dashboards/Mentor.svelte';
import '../../models/FIRST/model-builder';
import { FIRSTYear } from '../../models/FIRST/year';

const myApp = new App({ target: document.body });

Check warning on line 6 in client/entries/dashboard/mentor.ts

View workflow job for this annotation

GitHub Actions / format_and_lint

'myApp' is assigned a value but never used. Allowed unused vars must match /^_/u
FIRSTYear.select(new Date().getFullYear());
11 changes: 11 additions & 0 deletions client/entries/dashboard/pit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import '../../utilities/imports';

import PitDisplay from '../../views/dashboards/Pit.svelte';
import { FIRSTYear } from '../../models/FIRST/year';
import '../../models/FIRST/model-builder';

new PitDisplay({
target: document.body
});

FIRSTYear.select(2024);
4 changes: 4 additions & 0 deletions client/entries/home.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import '../utilities/imports';
import App from '../views/pages/Home.svelte';

const myApp = new App({ target: document.body });

Check warning on line 4 in client/entries/home.ts

View workflow job for this annotation

GitHub Actions / format_and_lint

'myApp' is assigned a value but never used. Allowed unused vars must match /^_/u
4 changes: 4 additions & 0 deletions client/entries/test/svelteChart.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import '../../utilities/imports';
import App from '../../views/components/Chart.svelte';

const myApp = new App({ target: document.body });

Check warning on line 4 in client/entries/test/svelteChart.ts

View workflow job for this annotation

GitHub Actions / format_and_lint

'myApp' is assigned a value but never used. Allowed unused vars must match /^_/u
4 changes: 4 additions & 0 deletions client/entries/test/upload.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import '../../utilities/imports';
import App from '../../views/components/robot-display/UploadTeamPicture.svelte';

const myApp = new App({ target: document.body });
4 changes: 4 additions & 0 deletions client/entries/test/velocity-histogram.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import '../../utilities/imports';
import App from '../../views/components/robot-display/VelocityHistogram.svelte';

const myApp = new App({ target: document.body });
22 changes: 22 additions & 0 deletions client/entries/test/whiteboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { FIRSTWhiteboard } from '../../models/FIRST/whiteboard';
import { globalize } from '../../utilities/global';
import '../../utilities/imports';
import App from '../../views/components/whiteboard/Whiteboard.svelte';

const wb = new FIRSTWhiteboard({
id: '1',
name: 'Test',
strategyId: '1',
archived: false,
board: '[]'
});

new App({
target: document.body,
props: {
whiteboard: wb,
year: 2024
}
});

globalize(wb, 'wb');
30 changes: 30 additions & 0 deletions client/models/FIRST/alliance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Cache } from '../cache';
import { EventEmitter } from '../../../shared/event-emitter';
import { FIRSTTeam } from './team';

type FIRSTAllianceEventData = {
'': '';
};

type Updates = {
select: FIRSTAlliance;
};

export type Alliance = [FIRSTTeam, FIRSTTeam, FIRSTTeam, FIRSTTeam | null];

export class FIRSTAlliance extends Cache<FIRSTAllianceEventData> {
private static readonly emitter = new EventEmitter<Updates>();

public static on = FIRSTAlliance.emitter.on.bind(FIRSTAlliance.emitter);
public static off = FIRSTAlliance.emitter.off.bind(FIRSTAlliance.emitter);
public static emit = FIRSTAlliance.emitter.emit.bind(FIRSTAlliance.emitter);
public static once = FIRSTAlliance.emitter.once.bind(FIRSTAlliance.emitter);

constructor(public readonly teams: Alliance) {
super();
}

hasTeam(team: number) {
return this.teams.some(t => t?.number === team);
}
}
Loading

0 comments on commit 2fcccf7

Please sign in to comment.