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 support for multiple locations on job listings #674

Merged
merged 3 commits into from
Sep 23, 2024

Conversation

Krakels
Copy link
Member

@Krakels Krakels commented Sep 18, 2024

Short Description

Add support for multiple locations on job listings.


Visual Overview (Image/Video)

This is how it looks now:
Skjermbilde 2024-09-19 kl  11 29 00

This is how it looked before:
Skjermbilde 2024-09-19 kl  11 29 40


Checklist

Please ensure that you’ve completed the following checkpoints before submitting your pull request:

  • Documentation: Relevant documentation has been added or updated (if applicable).
  • Testing: Have you tested your changes thoroughly?
    • Please list the types of tests you've run (unit, integration, manual, etc.):

Additional Notes

Other comments relevant to this pull request.

Copy link

vercel bot commented Sep 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
variant-no ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 23, 2024 7:20am
variant-se-2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 23, 2024 7:20am

src/jobs/utils/getListings.ts Outdated Show resolved Hide resolved
Comment on lines 28 to 30
{`${item.locations.map((location) => {
return ' ' + location.city;
})}`}
Copy link
Member

@itzjacki itzjacki Sep 19, 2024

Choose a reason for hiding this comment

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

Suggested change
{`${item.locations.map((location) => {
return ' ' + location.city;
})}`}
{item.locations.map((location) => {
return ' ' + location.city;
}).toString()}

Kunne man bare tatt bort disse? Evt med en toString() dersom jsx ikke gjør det for oss

Copy link
Member Author

Choose a reason for hiding this comment

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

Av en eller annen uforklarlig grunn (for meg) sørger ${}for å automatisk legge på komma mellom elementene. Det finnes sikkert en god grunn til hvorfor, men jeg tenkte at det var bedre å beholde de automagiske kommaene, enn å lage noe som ordna komma selv 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Det blir om til en array som gjøres toString når det template literals inn og da blir det automatisk komma. Om du vil gjøre det "korrekt" så kan det være slik:

          {item.locations.map((location) => {
            return location.city;
          }).join(', ')}

Copy link
Member Author

Choose a reason for hiding this comment

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

Nå snakker vi, takk!

Copy link
Member

@itzjacki itzjacki Sep 23, 2024

Choose a reason for hiding this comment

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

Har oppdatert forslaget mitt med en toString() som ser ut til å gjøre så man får med seg kommaene. Kommer om forskjeller på hvordan jsx og toString()-funksjonen konkatinerer arrays når den skal stringifisere de. ${``} er i praksis det samme som toString(), bare litt mindre eksplisitt.

Er ikke egentlig så viktig dette altså, men når jeg først kommenterte på det kan jeg like godt følge det opp 😅

Edit: Hadde jeg refresha sida hadde jeg sett at Mikael allerede hadde forklart og kommet med et bedre forslag. Ups.

Copy link
Member

Choose a reason for hiding this comment

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

Meeeen Mikael sitt forslag er mer eksplisitt, så støtter det i stedet 🥇

Co-authored-by: Jakob Endrestad Kielland <31799931+itzjacki@users.noreply.github.com>
@Krakels Krakels merged commit 44bc7d0 into main Sep 23, 2024
7 checks passed
@Krakels Krakels deleted the multiple-location-job-listing branch September 23, 2024 10:56
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.

3 participants