Releases: tams-cso/tams-club-cal
HOTFIX: Added computer lab back
Summary
Just adding computer lab back to prod
What's Changed
- Added computer lab back by @MichaelZhao21 in #577
Full Changelog: v-6.4.1...v-6.4.2
HOTFIX: Bug that crashed server on invalid event ID
Description
Fixed bug that crashed the server if the user entered an invalid event ID path /events/<id>
What's Changed
- [HOTFIX] Fixed issue where backend would crash if user entered an invalid eventId by @MichaelZhao21 in #574
Full Changelog: v-6.4...v-6.4.1
Summer 2023 Updates
Summary
- Removed computer lab as a reservable room
- Show private events by default + added toggle switch to show both
- Added event creator name + email to the event card display
- Fixed a bug where deleting a single repeating event would not delete correctly
What's Changed
- Bump express from 4.17.2 to 4.17.3 by @dependabot in #562
- Bump minimatch from 3.0.4 to 3.1.2 by @dependabot in #563
- Bump http-cache-semantics from 4.1.0 to 4.1.1 by @dependabot in #564
- Fixed typo - data.json by @jinitsuga in #566
- Removed computer lab by @MichaelZhao21 in #569
- Show private events by default by @MichaelZhao21 in #570
- Added event creator email/name to event card by @MichaelZhao21 in #571
- Fixed bug with repeating events not deleting correctly by @MichaelZhao21 in #573
New Contributors
- @jinitsuga made their first contribution in #566
Full Changelog: v-6.3.2...v-6.4
HOTFIX: Removed 11pm on Reservation Calendar
Summary
Due to admin request, the 11pm slot has been removed on the reservation calendar.
What's Changed
- HOTFIX: Removed the 11pm time slot on the reservation calendar by @MichaelZhao21 in #559
Full Changelog: v-6.3.1...v-6.3.2
Migration to new server
Summary
- Migrated repo to tams-cso/tams-club-cal
- Migrated server to new, isolated droplet
What's Changed
- Fixed positioning of reservations on mobile by @MichaelZhao21 in #550
- Create CODEOWNERS by @MichaelZhao21 in #551
- Update dockerhub image to new user by @MichaelZhao21 in #552
Full Changelog: v-6.3...v-6.3.1
QOL & LTS Updates
Summary
- Removed support for Google Calendar due to code complexity
- Optimized creation of the repeating events system by replacing loops with maps
- Fixed issue where empty history entries were being added
- Updated backend logging with a CLEAN format
- Replaced residual 'activity' labels with 'event'
- Renamed the "private" checkbox on edit events to "Show on Calendar"
- Clarified resolutions of the error about private events with no reservations
- Changed color to secondary on repeating calendar of events that are not public
- Added ability to see user-created events on the user's profile
- Completed the "How to Use" section
- Renamed save button on admin edit links
- Removed random console.logs
- Replaced "Invalid token" with "Stale token" text on login page for invalid token
- Sort feedback by descending time
What's Changed
- Remove support for gcal and optimized backend code by @MichaelZhao21 in #547
- Events frontend optimizations by @MichaelZhao21 in #548
- Complete "How to Use" Section and Frontend Cleanup by @MichaelZhao21 in #549
Full Changelog: v-6.2.1...v-6.3
Bug Fixes for Repeating Events
Summary
Hotfix of all issues found in v-6.2's production release. Mainly fixes issues with checking for overlaps and updating dates for repeating events.
What's Changed
- Fixed repeating events by @MichaelZhao21 in #541
- Fixed some bugs with repeating events by @MichaelZhao21 in #542
Full Changelog: v-6.2...v-6.2.1
Better Repeating Events and Expanded Club Access Levels
Summary
Added a simpler repeating event system that allows for editing repetitions but not changing the length of the repeating instances. Also allows the user to detach instances and edit them individually.
What's Changed
- aboutText changed in data.json by @rohit-maheshwari in #529
- Add Repeating Events by @MichaelZhao21 in #530
- Fix formatting of event list club/type/description line by @MichaelZhao21 in #531
- Allow club level full access to clubs and clarify add button by @MichaelZhao21 in #533
- Remove Board Room from reservation list by @DylanLi272 in #534
- Updated changelog for v-6.2 by @MichaelZhao21 in #535
- Added ability to delete repeating events by @MichaelZhao21 in #536
New Contributors
- @rohit-maheshwari made their first contribution in #529
Full Changelog: v-6.1...v-6.2
Reservation Calendar, Login Cookies, and Bug Fixes
Summary
- Completely rewrote the reservation calendar UI to be easier to use
- Removed external links for the admin-editable system
- Added new colors for light theme
- Added staging text to title for the staging and dev sites
- Added event type back (except with a dropdown and a filter event by type feature)
- Added loading screen to the home page
- Fixed wonky admin data grids
- Clicking on an edit now opens to those specific edits
- Refactor of types file so that you no longer need to import them
- Fixed broken login cookie saving system
What's Changed
- Reservation calendar by @MichaelZhao21 in #506
- Removed external links by @PrajwalBorkar in #508
- Addded new colors for light theme by @MichaelZhao21 in #513
- Added staging text to title by @MichaelZhao21 in #510
- Added Event Type back, with filters by @MichaelZhao21 in #517
- Added loading screen to hopefully fix the loading weirdness by @MichaelZhao21 in #521
- Fixed admin data grids by defaulting sorting to name ascending by @MichaelZhao21 in #519
- Clicking on an edit now opens up the popup for that specific edit by @MichaelZhao21 in #520
- Refactor of util functions and types by @MichaelZhao21 in #523
- Refactored cookie management into util functions and fixed cookies not saving by @MichaelZhao21 in #524
- Fix reservation calendar width and "private event" wording by @MichaelZhao21 in #525
New Contributors
- @PrajwalBorkar made their first contribution in #508
Full Changelog: v-6.0...v-6.1
User Permissions and Resource Management Overhaul
Summary
- Added info in CONTRIBUTING about imports
- External links now load 100% from the database
- Added ability to edit external links from the admin dashboard
- Fixed spelling mistake on the add button
- Added access levels system for users
- Added ability for admins to change access levels of users
- Fixed login button using new google-login library
- Changed link on profile icon button to
/profile/dashboard
- Updated
sharp
- Added scripts for typechecking
- Added workflow to run type checking scripts on pull
- Added delete buttons on resource edit pages
- Added dialog explaining access levels on
/edit
homepage - Added ability to view feedback on admin dashboard
- Removed repeating events
- Added the ability to create duplicates of existing events
- Location names now display nicely on the edit history
DB Update Log
TODO
Update production database's TextData
collection where { type: 'external-links' }
to:
{
"_id": { "$oid": "61e4bab50b43cc7cdcde087c" },
"data": [
{
"name": "Exam Calendar",
"url": "https://docs.google.com/presentation/d/1FYK_1kiuwi-DXkO8jpfcd_NLNIx3Er5pjq8dbGj1cS4/edit#slide=id.p",
"icon": "event"
},
{
"name": "Academics Guide",
"url": "https://docs.google.com/document/d/1gi7-K81MN4KLEBPCF9bv-nVxg2HMnH8ub5IXKeFM7fc/edit?usp=sharing",
"icon": "edit"
},
{
"name": "Club Leader Resources",
"url": "https://tams.unt.edu/studentlife/clubs#clubresources",
"icon": "emoji_people"
},
{ "name": "TAMS Wiki", "url": "https://tamswiki.org/wiki/Main_Page", "icon": "public" },
{
"name": "Add to Google Calendar!",
"url": "https://calendar.google.com/calendar/u/0?cid=ODlicWE0c3FpOTRxMG9ocmtoOW5raWtvN2dAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ",
"icon": "event_available"
}
],
"type": "external-links"
}
An external script will need to be run with the mongodb
node.js client library. This will update all events with an 'editorId', denoting the first user who edited an event.
// =========== Define CONNECTION_URI here
const { MongoClient } = require('mongodb');
const client = new MongoClient(CONNECTION_URI);
async function getFirstEdit(editId) {
return client
.db('data')
.collection('history')
.find({ editId })
.sort({ time: 1 })
.limit(1)
.toArray();
}
// This will loop through the events database and find all documents with a logged in editor
// It will update all documents that have a valid user with an `editorId` field
(async function () {
await client.connect();
const data = client.db('data').collection('events').find({});
const size = await client.db('data').collection('events').estimatedDocumentCount();
console.log('Processing %d documents:', size);
let done = 0;
data.forEach(async (it) => {
try {
if (it.repeatOriginId) {
console.log(`Done ${++done}/${size} | Repeating Instance`);
return;
}
const hist = await getFirstEdit(it.id);
const editor = hist[0].editor ? hist[0].editor.id : null;
if (editor) {
await client
.db('data')
.collection('events')
.updateOne({ id: it.id }, { $set: { editorId: editor } });
}
console.log(`Done ${++done}/${size} | ID: ${hist[0].id} | Editor: ${editor}`);
} catch (err) {
console.log(`${err} | id: ${it.id} | name: ${it.name}`);
}
});
})();
// Using the client definition above, we perform these operations as well. This will replace the editor object in the history DB (originally { id: string, ip: string }) to a string.
// This will update all history entries, where all "editor" fields
// will be converted to a string if editor.id is not null, otherwise it'll be null
(async function () {
await client.connect();
const data = client.db('data').collection('history').find({});
const size = await client.db('data').collection('history').estimatedDocumentCount();
console.log('Processing %d documents', size);
let done = 0;
data.forEach(async (it) => {
try {
const editorId = it.editor ? (it.editor.id ? it.editor.id : null) : null;
console.log(`Done ${++done}/${size} | ID: ${it.id} | Editor: ${editorId}`);
await client
.db('data')
.collection('history')
.updateOne({ id: it.id }, { $set: { editorId } });
} catch (err) {
console.log(`${err} | id: ${it.id} | name: ${it.name}`);
}
});
})();
Additionally, apply the following changes to the database through mongosh:
db.users.updateMany({}, { $unset: { admin: 1 }});
db.users.updateMany({}, { $set: { level: 0 }});
db.users.updateMany({}, { $rename: { "sub": "googleId" }});
db.history.updateMany({}, { $unset: { editor: 1 }});
db.history.updateMany({}, { $rename: { "editId": "resourceId" }});
db.events.updateMany({}, { $unset: { repeats: 1, repeatsUntil: 1, repeatOriginId: 1, allDay: 1 }});
db.history.createIndex({ id: 1 }, { unique: 1 });
db.history.createIndex({ resource: 1, resourceId: 1 });
db.history.createIndex({ editorId: 1 });
db.events.createIndex({ id: 1 }, { unique: 1 });
db.events.createIndex({ editorId: 1 });
db.clubs.createIndex({ id: 1 }, { unique: 1 });
db.volunteering.createIndex({ id: 1 }, { unique: 1 });
db.users.createIndex({ id: 1 }, { unique: 1 });
db['text-data'].createIndex({ type: 1 }, { unique: 1 });
What's Changed
- External links by @MichaelZhao21 in #471
- Updated user permissions system by @MichaelZhao21 in #473
- Changed link for profile icon to /profile/dashboard by @MichaelZhao21 in #474
- Bump sharp from 0.29.3 to 0.30.5 by @dependabot in #475
- User Access Level Permissions System by @MichaelZhao21 in #476
- Added button for deletion and access checking for clubs/volunteering by @MichaelZhao21 in #479
- Added access level info dialog by @MichaelZhao21 in #478
- Added ability to view feedback on admin dashboard by @MichaelZhao21 in #481
- Removed edit history items from frontend by @MichaelZhao21 in #482
- Removed repeating events and replaced it with duplicating events by @MichaelZhao21 in #483
Full Changelog: v-5.4...v-6.0