Skip to content

Commit

Permalink
Merge pull request FIRSTTeam102#199 from FIRSTTeam102/master
Browse files Browse the repository at this point in the history
Merge master into new-voyager
  • Loading branch information
JL102 authored Mar 10, 2024
2 parents 0104277 + 2cfd0e4 commit 9179c03
Show file tree
Hide file tree
Showing 21 changed files with 354 additions and 36 deletions.
Binary file modified .devcontainer/db_export.zip
Binary file not shown.
43 changes: 43 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Credits / Attribution

We would like to thank the following free and open-source software that makes Scoutradioz possible, in no particular order:

- ExpressJS
- PugJS
- BcryptJS
- Log4js
- Passport
- MongoDB
- Svelte / SvelteKit
- TypeScript
- NodeJS
- Svelte Material UI
- SST
- Koder
- ESLint
- Jimp
- Git
- W3.CSS
- JQuery
- ChartJS

We would like to thank the following free services that make Scoutradioz possible:

- The Blue Alliance
- Weblate
- GitHub

We would like to recognize the following services that form the Scoutradioz infrastructure (This is not a paid endorsement):

- Amazon Web Services
- MongoDB Atlas

We would like to credit the following for art assets used within Scoutradioz:

- FIRST, for the headers and background images between 2018 and 2024
- Julia Petretta, for designing Keania One, the font on which the Scoutradioz logo is based
- Marz Gallery, for the Voyager probe sprite
- FIRST, for their logo
- The Blue Alliance, for their logo
- Discord, for their own logo
- GitHub, for their own logo
Binary file modified Photoshop Project Files/sprites.psd
Binary file not shown.
23 changes: 19 additions & 4 deletions primary/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"management": "Event management tools such as auditing match assignments, swapping scouters in and out, and managing a list of members",
"free": "And of course, it's completely free!"
},
"github": "See our code & documentation on GitHub",
"github": "Check out our code on GitHub",
"wiki": "See our wiki for detailed documentation",
"discord": "Join our Discord",
"partner": "Apply to be an Early-Access partner",
"signup": "Sign up for your team to use Scoutradioz",
Expand Down Expand Up @@ -56,7 +57,8 @@
"footer": {
"copyright": "Copyright {date} FIRST Team 102 and Robotics Fund Inc.\nOpen-source & licensed with AGPLv3.",
"tba": "Powered by The Blue Alliance.",
"frc": "We are proud to be participants of FIRST Robotics Competition."
"frc": "We are proud to be participants of FIRST Robotics Competition.",
"github": "Check out our source code on GitHub"
},
"nav": {
"home": "Home",
Expand Down Expand Up @@ -90,6 +92,7 @@
"present": "Set who is present at current event"
}
},
"voyager": "Switch to Voyager offline module",
"admin": "Admin",
"user": {
"main": "User: [[{user}]]",
Expand All @@ -98,7 +101,8 @@
"logout": "Log out",
"switchorg": "Change organization"
},
"help": "Need help? Check our wiki!"
"help": "Need help? Check our wiki!",
"thanks": "Special thanks"
}
},
"home": {
Expand All @@ -112,7 +116,18 @@
"scoutingDashboard": "Scouting dashboard",
"management": "Management",
"admin": "Admin",
"specifyTeam": "You must specify a team."
"specifyTeam": "You must specify a team.",
"formDemos": "Preview the forms",
"matchFormDemo": "Match form",
"pitFormDemo": "Pit form"
},
"thankyou": {
"title": "Thank you!",
"thanks": "Thanks to our Early-Access Partners!",
"threestarters": "The Three Starters",
"2020to2022": "{year2020} to {year2022}",
"2023inseason": "2023 In Season",
"2023offseason": "2023 Off Season"
},
"share": {
"changeOrg": "You are viewing {org}.\nTo change the organization you wish to view, click *Org: {org}* in the menu and select *Change Organization*."
Expand Down
9 changes: 6 additions & 3 deletions primary/locales/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"choice": "Чи ви хочете:",
"viewer": {
"choice": "Бачити дані",
"intro": "Scoutradioz дозволяє командам/організаціям збирати власну інформацію на змаганнях."
"intro": "Scoutradioz дозволяє командам/організаціям збирати власну інформацію на змаганнях.",
"action": "Вибрати організацію щоб бачити дані, які вони зібрали!"
},
"scouter": {
"choice": "Заходити щоб розвідати"
Expand All @@ -13,9 +14,11 @@
"choice": "Вчити про Scoutradioz і як може ваша команда використовувати",
"features": {
"free": "І звичайно, Scoutradioz - абсолютно безкоштовно!"
}
},
"intro": "Scoutradioz - додаток рекогностування FRC розлоблені The Gearheads, який дозволяє команди і організації можуть **зібрати свої власні індивідувльні дані на конкуренції**."
},
"login": "Вхід"
"login": "Вхід",
"fulltitle": "Scoutradioz: Рекогностування FRC як служба"
},
"hello": {
"name": "Привіт, {name}!",
Expand Down
2 changes: 1 addition & 1 deletion primary/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"scripts": {
"start": "npx nodemon --ext ts ./src/www.ts",
"update": "yarn upgrade --pattern 'scoutradioz*'",
"update": "yarn && yarn upgrade --pattern 'scoutradioz*'",
"build": "tsc && yarn run compile-static",
"win-build": "yarn run build",
"---readme---": "Use the win-X scripts if you're using Windows. Always upload to test or QA first, then extensively test before promoting to prod.",
Expand Down
2 changes: 2 additions & 0 deletions primary/public-src/less/sprites.less
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,6 @@
&.sp-discord{--position: -20;}
&.sp-github{--position: -21;}
&.sp-paper{--position: -22;}
&.sp-heart{--position: -23;}
&.sp-voyager{--position: -24;}
}
8 changes: 5 additions & 3 deletions primary/public-src/ts-bundled/scoutradioz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ declare function onResize(cb: () => void): void;
$(debugLogger).css({
'background-color': 'white',
'color': 'black',
'z-index': '99',
'position': 'absolute',
'z-index': '9999',
'position': 'fixed',
'line-height': '1',
'top': '0',
'right': '0',
'width': '25%',
'padding': '8px 16px',
});
Expand Down Expand Up @@ -95,7 +97,7 @@ declare function onResize(cb: () => void): void;
}

let newTextElem = document.createElement('pre');
$(newTextElem).text(text);
$(newTextElem).text(text).css({'margin': '0.5em 0px'});

$(debugLogger).append(newTextElem);
};
Expand Down
20 changes: 10 additions & 10 deletions primary/public-src/ts/script-matchschedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,24 +201,24 @@ function updateTime(timeString: string, dayNumber: number, timeInput: HTMLInputE
}

//parseTime function from somewhere on stackoverflow
function parseDateTime(dayNumber: number, t: string, callback: (error: string | null, date: luxon.DateTime|null) => void ) {
function parseDateTime(dayNumber: number, timeString: string, callback: (error: string | null, date: luxon.DateTime|null) => void ) {

if(eventDate){
//Create new date obj, from eventDate
let d = new Date(eventDate.valueOf());

let time = t.match( /(\d+)(?::(\d\d))?\s*(p?)/ );

let time = luxon.DateTime.fromFormat(timeString, 'h:mm a');
if (!time.isValid) {
time = luxon.DateTime.fromFormat(timeString, 'h:mm');
}

if(time){
d.setHours( parseInt( time[1]) + (time[3] ? 12 : 0) );
d.setMinutes( parseInt( time[2]) || 0 );
if(time.isValid){

// TODO: timezone
let date = luxon.DateTime.fromObject({
year: eventDate.year,
month: eventDate.month,
day: eventDate.day,
hour: parseInt( time[1]) + (time[3] ? 12 : 0),
minute: parseInt( time[2]) || 0
hour: time.hour,
minute: time.minute,
})
.plus({days: dayNumber - 1}); // add the day number

Expand Down
Binary file modified primary/public/images/sprites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions primary/public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2348,6 +2348,12 @@ hr {
.sprite.sp-paper {
--position: -22;
}
.sprite.sp-heart {
--position: -23;
}
.sprite.sp-voyager {
--position: -24;
}
.scouting-counter {
font-weight: bold;
box-sizing: content-box;
Expand Down
4 changes: 4 additions & 0 deletions primary/scripts/dbExportStarterData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ function doExportAndArchive() {

// aaand last, add a global admin user
const user: User = {
_id: 9999999999,
org_key: 'frc102',
name: '00 Dev Account',
role_key: 'global_admin',
Expand All @@ -367,8 +368,11 @@ function doExportAndArchive() {
present: true,
assigned: false,
},
oauth: {},
visible: true,
removed: false,
};
// @ts-ignore - doesn't like numerical id
await dbExport.collection('users').insertOne(user);

await doExportAndArchive();
Expand Down
27 changes: 26 additions & 1 deletion primary/src/helpers/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,19 @@ class NavHelpers {
{
label: '!allianceselection.title',
href: '/dashboard/allianceselection',
},
{
label: '!home.formDemos',
submenu: [
{
label: '!home.matchFormDemo',
href: '/scouting/match?key=2024srdemo_qm99_frc999999&alliance=Blue'
},
{
label: '!home.pitFormDemo',
href: '/scouting/pit?team_key=frc999999'
},
]
}
]
},
Expand Down Expand Up @@ -319,6 +332,11 @@ class NavHelpers {
visible: (req, res) => !!req.user && req._user.name === 'default_user',
href: '/user/login'
},
{
label: '!layout.nav.voyager',
sprite: 'voyager',
href: 'https://voyager.scoutradioz.com'
},
// Change org
{
label: '!layout.nav.user.switchorg',
Expand All @@ -345,7 +363,14 @@ class NavHelpers {
{
label: '!layout.nav.help',
sprite: 'help',
href: 'https://github.com/FIRSTTeam102/scoutradioz/wiki'
// 2024-02-19, M.O'C: Changing to the team MediaWiki
//href: 'https://github.com/FIRSTTeam102/scoutradioz/wiki' -> moved GitHub link to bottom of menu [layout.pug]
href: 'https://wiki.team102.org/scoutradioz/start'
},
{
label: '!layout.nav.thanks',
href: '/thankyou',
sprite: 'heart'
}
];

Expand Down
14 changes: 14 additions & 0 deletions primary/src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,20 @@ router.get('/home', wrap(async (req, res) => {
}
}));

/**
* Thank-you page
* @url /thankyou
* @view /thankyou
*/
router.get('/thankyou', wrap(async (req, res) => {
logger.addContext('funcName', 'thankyou[get]');
logger.debug('ENTER');

res.render('./thankyou', {
title: res.msg('thankyou.title'),
});
}));

router.get('/throwanerror', wrap(async (req, res) => {
logger.addContext('funcName', 'throwanerror[get]');

Expand Down
Loading

0 comments on commit 9179c03

Please sign in to comment.