devedmonton / DES-Website

The Dev Edmonton Society website! We empower Edmonton Developers!
https://devedmonton.com
MIT License
22 stars 52 forks source link

Implements randomization of cards shown in meetups summary, resources summary and events summary #301

Closed deejayjay closed 7 months ago

deejayjay commented 7 months ago

Completes Issue#299: Randomize getLimitedMeetups.

deejayjay commented 7 months ago

This is so fun to refresh and see them all change hahaha though I am noticing two things

  1. In the start up edmonton description it says "check the next card" (to see the edmonton unlimited info) so that might have to be re-written to "check the edmonton unlimited card"
  2. I am seeing the first 5 become randomized but I never see any after the first 5 be randomized. Like I never see yegwit show up... Do you? I refreshed quite a few times

@MandyMeindersma: I think I know what the issue is. I'll have to move the logic that limits the events/resources/meet ups to the Summary components for each rather than doing it in the store. I'll resolve the comments either tomorrow or Tuesday evening.

deejayjay commented 7 months ago

@MandyMeindersma : Regarding the first comment, do we need to keep the Start up Edmonton card if all it says is to check the Edmonton Unlimited card?

MandyMeindersma commented 7 months ago

We still get a couple questions about what happened to start up edmonton so I like to leave it up there but I feel like I am also a digital hoarder so you can do whatever you feel :)

deejayjay commented 7 months ago

We still get a couple questions about what happened to start up edmonton so I like to leave it up there but I feel like I am also a digital hoarder so you can do whatever you feel :)

@MandyMeindersma : I'll leave it for now then. We can remove it later on a separate PR when it's time πŸ™‚.

leslietech commented 7 months ago

I'm glad to see that @deejayjay is making headway. I cannot wait to see the final commit.

  1. In the start up edmonton description it says "check the next card" (to see the edmonton unlimited info) so that might have to be re-written to "check the edmonton unlimited card"

My take on this is that removing "See the next card" from "FYI Startup Edmonton has become Edmonton Unlimited and has a new space! See the next card." would be a good way to go since it would not matter which of the two cards (Startup Edmonton + Edmonton Unlimited) comes first in the list since both cards are linked to the same url.

  1. I am seeing the first 5 become randomized but I never see any after the first 5 be randomized. Like I never see yegwit show up... Do you? I refreshed quite a few times

Is it possible to retain the card limit while still allowing all 5+ cards to be randomized into those 5 slots? How are we randomizing them? For meetups, for example, are we randomizing them on the homepage or we are randomizing them at https://devedmonton.com/meetups? I am not yet at that point in my JS journey where I can understand the JS logic in the code πŸ˜‚ (getting there thoughπŸ§‘β€πŸ’»).

deejayjay commented 7 months ago

I'm glad to see that @deejayjay is making headway. I cannot wait to see the final commit.

  1. In the start up edmonton description it says "check the next card" (to see the edmonton unlimited info) so that might have to be re-written to "check the edmonton unlimited card"

My take on this is that removing "See the next card" from "FYI Startup Edmonton has become Edmonton Unlimited and has a new space! See the next card." would be a good way to go since it would not matter which of the two cards (Startup Edmonton + Edmonton Unlimited) comes first in the list since both cards are linked to the same url.

  1. I am seeing the first 5 become randomized but I never see any after the first 5 be randomized. Like I never see yegwit show up... Do you? I refreshed quite a few times

Is it possible to retain the card limit while still allowing all 5+ cards to be randomized into those 5 slots? How are we randomizing them? For meetups, for example, are we randomizing them on the homepage or we are randomizing them at https://devedmonton.com/meetups? I am not yet at that point in my JS journey where I can understand the JS logic in the code πŸ˜‚ (getting there thoughπŸ§‘β€πŸ’»).

@leslietech: The answer your question Is it possible to retain the card limit while still allowing all 5+ cards to be randomized into those 5 slots? is yes. I am quoting my current team lead here when I say there is always a solution to these problems πŸ˜€.

Currently, the logic to limit the number of cards reside in the Pinia store (we use Pinia for state management in Vue/Nuxt applications). I decided to shuffle the cards outside the Pinia store, just in the summary component (this was due to some other technical issue I encountered when I tried to add it in Pinia store). I think I have found a way to get around that technical issue, and can move the shuffling logic to Pinia store as well.

For shuffling, I just used fisher-yates algorithm and used array restructuring in JavaScript to help me with the swapping of array elements.

deejayjay commented 7 months ago
1. In the start up edmonton description it says "check the next card" (to see the edmonton unlimited info) so that might have to be re-written to "check the edmonton unlimited card"

@MandyMeindersma: I modified the text to this so that users will still know where to go if Edmonton Unlimited card does not show up in the home page when we shuffle the cards: image

MandyMeindersma commented 7 months ago

Ah this is so fun to refresh!! I absolutely love it