Skip to content

Releases: tams-cso/tams-club-cal

HOTFIX: Added computer lab back

30 Aug 20:02
de1b618
Compare
Choose a tag to compare

Summary

Just adding computer lab back to prod

What's Changed

Full Changelog: v-6.4.1...v-6.4.2

HOTFIX: Bug that crashed server on invalid event ID

27 May 17:22
b681e3c
Compare
Choose a tag to compare

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

23 May 21:11
4f0f376
Compare
Choose a tag to compare

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

New Contributors

Full Changelog: v-6.3.2...v-6.4

HOTFIX: Removed 11pm on Reservation Calendar

26 Nov 22:52
d26daeb
Compare
Choose a tag to compare

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

17 Aug 18:27
8f5eabc
Compare
Choose a tag to compare

Summary

  • Migrated repo to tams-cso/tams-club-cal
  • Migrated server to new, isolated droplet

What's Changed

Full Changelog: v-6.3...v-6.3.1

QOL & LTS Updates

16 Aug 07:11
Compare
Choose a tag to compare

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

Full Changelog: v-6.2.1...v-6.3

Bug Fixes for Repeating Events

11 Aug 22:39
1ee7bc2
Compare
Choose a tag to compare

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

Full Changelog: v-6.2...v-6.2.1

Better Repeating Events and Expanded Club Access Levels

09 Aug 18:07
ffe8c1c
Compare
Choose a tag to compare

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

New Contributors

Full Changelog: v-6.1...v-6.2

Reservation Calendar, Login Cookies, and Bug Fixes

12 Jul 21:06
Compare
Choose a tag to compare

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

New Contributors

Full Changelog: v-6.0...v-6.1

User Permissions and Resource Management Overhaul

13 Jun 19:46
Compare
Choose a tag to compare

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

https://pastebin.com/s2DVAmY8

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

Full Changelog: v-5.4...v-6.0