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

Feature : Added events search (+Added Fix) (#14) #98

Merged
merged 16 commits into from
Mar 26, 2024

Conversation

gautamjuyal
Copy link
Contributor

Fixes #14

This PR adds events search feature to the calendar

Changes/Updates

  1. Added SearchHeader component to the project.
  2. Removed directly passing events.json to FullCalendar component. events.json is now manually imported to App.jsx.
  3. Due to manual import, devs are now required to move events.json from root directory to src directory in development. Same has been updated in the Readme.md file.

Features

  1. The search works once the user clicks the search button after passing a search string in the input.
  2. Search feature checks for availability of search string in all the event's title and description.
  3. When search is in use, only the events matching the search string are displayed throughout the calendar.
  4. If the search string doesn't match any any string, no events are displayed in the calendar.
  5. Once the search box is cleared, the calendar resets and loads all available events.

Screenshots

  1. Calendar
    Screenshot (374)

  2. Calendar (when searched for an event)
    Screenshot (377)

  3. Dark Mode
    Screenshot (375)

  4. Mobile view
    Screenshot (378)

Suggestions and improvements

Since this is the first iteration of search in the project it might not be perfect, thus any improvements and suggestions are very much appreciated

Caveats

Even though import statement is changed (which was causing error), it is still unsure whether the change fixes the issue. Will need to be tested on deployment.

@TheJuanAndOnly99
Copy link
Member

Hi @gautamjuyal sorry for the delay. Could you resolve the conflicts? I'll review after and hopefully we can merge this time!

@gautamjuyal
Copy link
Contributor Author

Sure. I'll start resolving the conflicts. There's one thing I wanted to ask, do we have any way to deploy a branch, so that we test the changes in the branch first?

@TheJuanAndOnly99
Copy link
Member

Sure. I'll start resolving the conflicts. There's one thing I wanted to ask, do we have any way to deploy a branch, so that we test the changes in the branch first?

We need to look into this but I think it's related to this issue #95. I'll discuss this with @maoo.

@gautamjuyal
Copy link
Contributor Author

@TheJuanAndOnly99 just checked the build steps, I think I've figured why it breaks on deployment. We run "Get events from google API" after we run the build command.

@TheJuanAndOnly99
Copy link
Member

@gautamjuyal I cannot send a PR to your branch. Can you either grant me permission or change the action to be like this:

name: Build

on:
  pull_request:
  workflow_dispatch:
  push:
    branches:
      - main
  schedule:
    - cron: "0 */3 * * *"

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

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v4
        with:
          node-version: "${{ matrix.node-version }}"

      - name: Install
        run:  npm ci

      - 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: Build
        run: npm run build

      - 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
        if: github.event_name != 'pull_request'

Thanks!

@gautamjuyal
Copy link
Contributor Author

gautamjuyal commented Feb 7, 2024

There is an error with GPG this time

gpg: gcry_kdf_derive failed: Invalid data
gpg: decryption failed: No secret key
Error: Process completed with exit code 2.

@gautamjuyal
Copy link
Contributor Author

I think this issue persists because of PASSPHRASE secret getting restricted to selected branches. I tried using my local passphrase but it doesn't work, since the PR has the original calendar-service-account.json.gpg file.

@TheJuanAndOnly99
Copy link
Member

Hey @gautamjuyal yes you are correct the secret is not shared across branches. I will test this locally and merge if all looks good.

@TheJuanAndOnly99 TheJuanAndOnly99 merged commit 3ec365f into finos:main Mar 26, 2024
1 of 2 checks passed
@TheJuanAndOnly99 TheJuanAndOnly99 deleted the events-search branch March 26, 2024 10:14
@TheJuanAndOnly99
Copy link
Member

Thanks again @gautamjuyal! Sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add search feature
2 participants