Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile fix #59

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
38347da
using custom events.json in fullcalendar
maoo Nov 30, 2023
1602730
use google api (#52)
TheJuanAndOnly99 Nov 30, 2023
f697f61
use google api
TheJuanAndOnly99 Nov 30, 2023
03549a2
clean up
TheJuanAndOnly99 Nov 30, 2023
4f5c360
added google service account with encryption
maoo Nov 30, 2023
f9fd08d
fix typo in build action
maoo Nov 30, 2023
4bbaf98
remove verbose logs in event fetching
maoo Nov 30, 2023
3304c20
added ICS generation and download
maoo Nov 30, 2023
a59ddf6
removed console.log
maoo Nov 30, 2023
09c06db
minor changes
maoo Nov 30, 2023
3ebb454
Update README.md
maoo Nov 30, 2023
4e90464
cleanup package.json
maoo Nov 30, 2023
8622ad7
Merge branch 'fc-experiments' of github.com:finos/calendar into fc-ex…
maoo Nov 30, 2023
c26f290
use matrix for node version in build.yml
maoo Dec 1, 2023
9ef5628
print dates with localdatestring
maoo Dec 1, 2023
cabd843
improve event time formatting
maoo Dec 1, 2023
6952f24
improved docs and package.json scripts
maoo Dec 1, 2023
86852e6
fixed ICS recurrence
maoo Dec 1, 2023
3d1439a
fixed calendar api signature call
maoo Dec 3, 2023
018c458
adding log statements to report number of events fetched/processed
maoo Dec 3, 2023
31a5282
playing with google API requests, got better results
maoo Dec 3, 2023
480bdf3
convert HTML to text for ICS description
maoo Dec 3, 2023
3bb1952
googleapi2events.js - refactoring and docs
maoo Dec 3, 2023
12362c4
skip events that are declined by FINOS Calendar
maoo Dec 3, 2023
3e2ae00
Update README.md
TheJuanAndOnly99 Dec 4, 2023
5403f88
Merge pull request #57 from finos/TheJuanAndOnly99-patch-1
maoo Dec 4, 2023
5e98bc5
fix mobile view
TheJuanAndOnly99 Dec 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ name: Build
on:
workflow_dispatch:
push:
branches:
- main
# TODO - uncomment when merging to main branch (!!)
# branches:
# - main
schedule:
- cron: "0 */3 * * *"

jobs:
build:
strategy:
matrix:
node-version: [20.10.0]

runs-on: ubuntu-latest

steps:
Expand All @@ -18,21 +23,28 @@ jobs:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: "${{ matrix.node-version }}"

- name: Build
run: |
npm install
npm run build

- name: Download ICS file
run: curl -o dist/basic.ics https://calendar.google.com/calendar/ical/finos.org_fac8mo1rfc6ehscg0d80fi8jig%40group.calendar.google.com/public/basic.ics
- name: Setup environment
run: gpg --quiet --batch --yes --decrypt --passphrase="$PASSPHRASE" --output calendar-service-account.json calendar-service-account.json.gpg
env:
PASSPHRASE: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_PASSPHRASE }}

- name: Get events from Google API
run: npm run getEvents

- name: Add CNAME in dist folder
run: cp CNAME dist

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
publish_dir: dist # Replace 'dist' with the folder containing your built static files
# Disable to avoid risking to influence the live environement (even though it should not)
# TODO - re-enable when merging to main branch (!!)
# - name: Deploy to GitHub Pages
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.ACCESS_TOKEN }}
# publish_dir: dist
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# secrets
calendar-service-account.json

30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# FINOS Calendar

This code builds the page hosted on https://calendar.finos.org , which is also embedded on https://www.finos.org/calendar .
This code builds the page hosted on https://calendar.finos.org , which is also embedded on https://www.finos.org/calendar , in order to provide a fully hosted solution that shows all events in the [FINOS Community (Google) Calendar](https://calendar.google.com/calendar/embed?src=symphony.foundation_6g70j7s80813djmj9q7gmgdjuc%40group.calendar.google.com&ctz=Europe%2FMadrid) that can be correctly visualised also behind a corporate firewall.

A Github action runs periodically to fetch events using Google APIs (see [src/googleapi2events.js](src/googleapi2events.js)) and renders out a JSON file in `dist/events.json`.

The calendar is visualized in HTML using React and [FullCalendar](https://fullcalendar.io/).

## Prerequisites

- Node.js and npm installed on your machine.

## Getting Started (work in progress, see https://github.com/finos/calendar/issues/9 )
## Getting Started

1. Clone the repository:

Expand All @@ -15,16 +19,36 @@ git clone https://github.com/finos/calendar.git
cd calendar
```

2. Download `calendar-service-account.json` into the project's root folder.

In order to use the Google Calendar API you will need to follow [these 5 steps](https://developers.google.com/workspace/guides/get-started) to generate the necessary credentials. Once you have the credentials store them in the root folder of the project in a file named `calendar-service-account.json`.

### Encrypting Google Service Account key

```
gpg --symmetric --cipher-algo AES256 calendar-service-account.json
```

### Install the dependencies:

```bash
npm install
```

### Import events from Google API

```bash
npm run getEvents
```

### Run development server

```bash
npm run dev
npm start
```

Open browser to `http://localhost:5173/`.

### Live environment

https://calendar.finos.org is served by Github Pages and deployed by the [build.yml](.github/workflows/build.yml) Github Action.
Binary file added calendar-service-account.json.gpg
Binary file not shown.
Loading