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

Add banners to events calendar #658

Merged
merged 9 commits into from
Nov 3, 2023
Merged

Add banners to events calendar #658

merged 9 commits into from
Nov 3, 2023

Conversation

Amyh11325
Copy link
Contributor

@Amyh11325 Amyh11325 commented Oct 21, 2023

Changes

  • Previously website's event calendar only showed the default banner on every event
  • Now the website reads the banner link provided in the newsletter and displays the image at the link
    • If image link is invalid or unavailable, defaults to the default banner
Screen Shot 2023-11-02 at 5 16 33 PM

Note: the banner link should link directly to a .png/.jpg image. If it links to google drive, the image must have the right permissions

Code

  • Google drive share links must be transformed to directly export the image
  • Only difficulty was that the CodeQL/Analyze scan is very strict and disallowed searching for "drive.google.com" within the link directly
    • Had to encode the URL and extract the host, then compare the host with "drive.google.com" to satisfy the code scanner

Testing

Used a test newsletter sheet (link), then copied various links into the newsletter banner column.

Case 1

Non Google Drive Link: https://i.ibb.co/99MH6Yz/277701596-1203931976807914-5430242111216078873-n.jpg
Screen Shot 2023-11-02 at 5 36 27 PM

Case 2

Google Drive Link: https://drive.google.com/file/d/1HWHCg2dUIPKF-2g_l209SWbMKutlQsfB/view?usp=sharing
Screen Shot 2023-11-02 at 5 35 48 PM

Case 3

Google Drive Link With Wrong Permissions: https://drive.google.com/file/d/1SmiQzf6MTBBNp6KNKD3zcvuNFUEPH71q/view?usp=sharing
Screen Shot 2023-11-02 at 5 39 58 PM

Case 4

Invalid Link: i-am-an-invalid-link
Screen Shot 2023-11-02 at 5 37 26 PM
Terminal warning:
Screen Shot 2023-11-02 at 5 37 38 PM

Case 5

No Link
Screen Shot 2023-11-02 at 5 38 40 PM

scripts/lib.mjs Fixed Show fixed Hide fixed
scripts/lib.mjs Fixed Show fixed Hide fixed
Copy link
Contributor

@ArshMalik02 ArshMalik02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@ArshMalik02 ArshMalik02 merged commit 1e90f7e into main Nov 3, 2023
8 checks passed
@ArshMalik02 ArshMalik02 deleted the event-banners branch November 3, 2023 17:35
@ArshMalik02 ArshMalik02 mentioned this pull request Nov 3, 2023
@ArshMalik02 ArshMalik02 mentioned this pull request Jan 24, 2024
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.

2 participants