Giter VIP home page Giter VIP logo

tams-cso / tams-club-cal Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 8.0 3.24 MB

Website that lists all TAMS club events in a simple calendar and concatenates all club information!

Home Page: https://tams.club

License: MIT License

JavaScript 0.31% Dockerfile 0.41% TypeScript 99.24% Shell 0.04%
calendar expressjs google-calendar google-calendar-api hacktoberfest js mern-stack mongodb reactjs

tams-club-cal's People

Contributors

dependabot[bot] avatar dylanli272 avatar jeongwoo55 avatar jinitsuga avatar jwright707 avatar michaelzhao21 avatar prajwalborkar avatar rohit-maheshwari avatar royantar0311 avatar shubhamr2511 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tams-club-cal's Issues

Add Esc key to exit from popup

Right now the only way to exit is to click on the grey area. I want to have it so the user can also press the Esc key to exit the popup.

Change "Event" text to darker orange color

The orange "event" text in client/src/pages/Home.scss for the popup and the text in client/src/pages/Add.scss should be #FF9A3D. Make a variable in client/src/custom.scss and use that to assign those colors.

Create custom datetime input component

Is your feature request related to a problem? Please describe.

Current date & time inputs and form control are too messy and dependent on browser. The native HTML5 datetime inputs are easy to code but horrible for user experience.

Describe the solution you'd like

Create a custom component where the user can enter a date/time. This would include its own stylesheet and dropdown menu for picking dates. Additionally, you can add a "duration" field so the user would not need to choose the end time manually.

Describe alternatives you've considered

We could also find a library to use (might be more time-efficient), or simple just encapsulate the date/time input fields in a component and find a way to get the info.

Additional Context

This can use the standard css property or a custom tooltip

Edited to fit new format

Move the name of the event slightly to the right on the schedule view

Problem

Currently, on an average desktop view, the schedule view's club name can only fit at most 15 characters (on average). This should be increased so clubs with long names won't seem cramped.

Proposed Solution

Increase the right margin on the club name or the left margin on the event name.

Alternative Solution

Limit the number of characters someone can enter in the club name field for events or truncate the name of the club with ellipsis when too long.

Add tooltips to the schedule view

When hovering over the colored squares on the left (orange/purple), show a tooltip to distinguish whether or not it's an "event" or a "signup".

Format imports

Problem

A lot of the imports in client/src/pages are extremely messy and need to be sorted. It is sometimes difficult to find an import.

Proposed Solution

I would like for them to be put in the following order (example from client/src/pages/Resources.js):

import React from 'react';
import { connect } from 'react-redux';

import LinkBox from '../components/LinkBox';
import Popup from '../components/Popup';
import VolunteeringCard from '../components/VolunteeringCard';
import VolunteeringPopup from '../components/VolunteeringPopup';

import { getVolunteering } from '../functions/api';
import { getSavedVolunteeringList } from '../redux/selectors';
import { setVolunteeringList } from '../redux/actions';

import './Resources.scss';
  1. Libraries
  2. React Components
  3. Functions/Redux
  4. Scss and other files (like icons)

Alternate solutions

None

Club card grid is not centered

The display: grid formatting is currently (in client/src/pages/Clubs.scss):

.club-card-list {
    padding: 1.25rem 7rem 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, 9rem);
    row-gap: 1rem;
    justify-content: start;
}

This allows for overflow and mobile compatibility, but it doesn't center itself :((

Use Redux

Problem

The state management, especially the popups, is getting extremely messy and hard to manage. I now have components calling their sibling component's functions through refs (See close() function in client/src/components/VolunteeringPopup.js being called by client/src/components/Popup.js)

Proposed Solution

Use Redux. It manages state from a store, cleaning up both the code and the messy states of the components.

Alternative Solutions

We could also stick with the current system, but the system would become a pile of spaghetti pretty soon. Another idea would be to use the url to manage the state, but that is quite jank and hard to listen for in a component.

Fix popup so it's all in one component

I added the "bug" label because the popup right now is messy and requires code outside of the component. If there's a good way to fully componentize it, I want.

Scroll not restored on Route change

Describe the bug

Whenever a user navigates using the nav menu, the page is not scrolled back to the top automatically. I would like to use the provided sample from React-Router, but I also change the url for the popups, and I do not want the page to scroll to the top when popups are opened.

To Reproduce

Steps to reproduce the behavior:

  1. Open the home page (located at /)
  2. Scroll down to the bottom
  3. Click on the Add Event tab in the naviagation menu
  4. The user cannot see the top of the page now

Expected behavior

When the user clicks on a link on the menu, the page should scroll back up.

Screenshots or Links

N/A

Environment

  • OS: Arch Linux (5.9.14-arch1-1 )
  • Browser: Firefox
  • Browser Version: 84.0.1

Additional context

(See comment below)

This issue has been edited to fit the new format!

Pass id to Popup callback function

Instead of doing const id = this.popup.current.state.id; in client/src/pages/Home.js, we can simply pass the id to the activateCallback function in the client/src/components/Popup.js file.

Log information about a client when they open the site

On the old site right now, I am logging the public IP addresses to a file whenever people load the website with the following code:

Frontend

const req = new XMLHttpRequest();
req.open('POST', 'https://api.michaelzhao.xyz/log');
req.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
req.setRequestHeader('Access-Control-Allow-Origin', '*');
req.send(JSON.stringify({ dir: 'tams.club' }));
req.onload = () => {
    console.log(req.response);
};

Backend

// router on route /log
router.post('/', function (req, res, next) {
    res.header('Access-Control-Allow-Origin','*');
    if (!req.body.dir) {
        res.status(400);
        res.send({
            status: 400,
            error: "Missing 'dir' in request body",
        });
    }
    // Need to add to nginx config:
    // proxy_set_header X-Real-IP $remote_addr;
    var ip = req.header('X-Real-IP') || req.connection.remoteAddress;
    fs.appendFile(path.join(__dirname, 'files', 'logging', req.body.dir), `[${now()}] ${ip}\n`, () => {});
    res.sendStatus(200);
});

Output Log File:

[2020-12-22T22:15:30.808Z] 143.176.249.75
[2020-12-23T08:58:05.465Z] 3.236.243.184
[2020-12-23T21:50:59.926Z] 3.83.17.15
[2020-12-26T21:55:59.112Z] 47.187.197.209
[2020-12-28T12:27:24.617Z] 65.154.226.165
[2020-12-30T01:09:30.780Z] 162.249.229.121
[2020-12-31T07:18:27.931Z] 47.187.197.209
[2021-01-01T20:18:45.280Z] 73.55.210.193
[2021-01-04T02:36:34.453Z] 47.185.43.108
[2021-01-04T03:41:57.790Z] 75.38.18.76
[2021-01-04T04:10:13.699Z] 47.187.197.209
...

I want to create a logging file of some sort as well, except it will log as a csv file. This is only for when a user goes onto the site. It is seperate from the backend log files in issue #66.

Calculate date from the add events form

The date should be stored as milliseconds since Jan 1, 1970. Currently, the backend simply stores this value as 0. Day.js with the timezone plugin can be used for timezones in the future, but for now simply assume we are in UTC-6 (CST). The relevant commit is #67 . This code should go with the TODO on line 36 of server/src/database.js.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.