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

Added room adverts #804

Open
wants to merge 20 commits into
base: staging
Choose a base branch
from
Open

Added room adverts #804

wants to merge 20 commits into from

Conversation

Ellen-Wittingen
Copy link
Contributor

@Ellen-Wittingen Ellen-Wittingen commented Sep 9, 2023

Added room adverts. They are accessible via http://localhost:4200/room-adverts and via the menu-item in the left sidebar.

There is also a view for unauthorized users on the public part of the website, it is accessible via http://localhost:4200/public/room-forum and via the menu-item "Kamerforum" in the "Over ons" dropdown.

Please also check if the English translations are proper English, as nobody except from me has looked at them so far.

Note: it requires the following amber-api branch to function properly: csvalpha/amber-api#393 NOTE BY MATTEO: this backend branch has already been incorporated into staging

Copy link
Contributor

@DrumsnChocolate DrumsnChocolate left a comment

Choose a reason for hiding this comment

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

The implementation works as expected, but I see you haven't quite used ember octane. I know that lots of the entire app is still written in the old style, but please try to follow the checklist (most important): https://guides.emberjs.com/release/upgrading/current-edition/glimmer-components/
and if relevant the rest of the octane upgrade guide mentioned there.
For example, named arguments means we should be using @roomAdvert.location in our templates, not roomAdvert.location
And we should not be using import Component from '@ember/component'; in any of our new components. Always use native classes for everything, and for components only ever extend glimmer components.

translations/en.yaml Outdated Show resolved Hide resolved
translations/en.yaml Outdated Show resolved Hide resolved
app/components/header-nav.js Outdated Show resolved Hide resolved
@DrumsnChocolate
Copy link
Contributor

The text can become rather long, and the text is not vertically bounded in display:
afbeelding

@DrumsnChocolate
Copy link
Contributor

afbeelding
When logged in, I don't see any shorttext preview of the written content of the advert. Is this something we should add?

@DrumsnChocolate
Copy link
Contributor

These are the main UX points I found. I will leave a code review later, this Friday evening probably

@Ellen-Wittingen
Copy link
Contributor Author

Fixed the long scrolling content. Now there is a "lees meer" button that opens a modal with a scrollable bigger view of the advert when clicked upon. That modal is also opened when clicking anywhere on the advert.

image

image

@Ellen-Wittingen
Copy link
Contributor Author

Fixed not showing a short description on room advert index page:

image

@Ellen-Wittingen
Copy link
Contributor Author

Apparently I never pushed the fixes I mentioned, oops

@DrumsnChocolate
Copy link
Contributor

We're reviewing this once more, @lodewiges and @Notheen01 will you two also remember to leave a review before we meet on Monday?

@Ellen-Wittingen we will finally be merging this thing :)

@DrumsnChocolate
Copy link
Contributor

afbeelding
icon doesn't load for some reason. Unsure if that's my fault

@DrumsnChocolate
Copy link
Contributor

yes it was my fault: I did yarn install in the staging branch. yarn install in the feature/rooms resolved the icon issue 🤦

@DrumsnChocolate
Copy link
Contributor

Would it be practical to have a subdomain like kamers.csvalpha.nl point to csvalpha.nl/public/room-forum ? That would allow for more external traffic, because it is easier to share and remember.

Copy link
Contributor

@DrumsnChocolate DrumsnChocolate left a comment

Choose a reason for hiding this comment

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

Overall, nice work! Very happy that you adhere well to octane (as far as I can see). One remark about future maintainability: I see a similar pattern emerge between this feature and that of static pages: both can be viewed from the public side and from behind the login. Currently, this results in some duplication in terms of templates, but abstracting that will take more time and mental contortions than is probably necessary right now.

Thanks Ellen! My comments in this review may not be exhaustive, so let's wait for @lodewiges and @Notheen01 reviews. The three of us will discuss them on Monday, and I'll let you know when we think this PR is ready for merging.

Comment on lines +29 to +42
<div class="modal modal-xl fade room-advert-modal" id="room-advert-modal" tabindex="-1" aria-hidden="true" {{on "hide.bs.modal" this.removeBackdrops}}>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body p-0">
{{#if this.openedAdvert}}
<Cards::PublicRoomAdvertCard @roomAdvert={{this.openedAdvert}} @collapsed={{false}} @open={{this.openAdvert}} />
{{/if}}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary fw-bold" data-bs-dismiss="modal">Sluiten</button>
</div>
</div>
</div>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a funny bug here:
making this div visible by clicking the advert works perfectly:
afbeelding

but then. Clicking again on the opened advert results in a darker backdrop:
afbeelding
resulting in a pretty comical effect after some more clicks:
afbeelding

We can do something about this by not passing @open and handling that case in the underlying component. Or some other approach if better exists.

Copy link
Contributor

Choose a reason for hiding this comment

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

could you explain the source of this bug Monday?

Comment on lines +93 to +99
<div class="flex-grow-1" />
<LinkTo
@route='articles.article'
@model={{article.id}}
@route='vacancies.vacancy'
@model={{vacancy.id}}
itemprop='url'
>
{{t 'tag.button.readMore'}}
<i>{{t 'tag.button.readMore'}}</i>
Copy link
Contributor

Choose a reason for hiding this comment

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

good catch! But wait. how is this currently not linking to articles on production... ? wtf
When I hover over this read more text (in prod), it shows https://csvalpha.nl/vacancies# as the destination.

Comment on lines +8 to +10
@onSubmit={{action this.submit}}
@onCancel={{this.cancel}}
@onCoverPhotoLoaded={{action this.coverPhotoLoaded}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@onSubmit={{action this.submit}}
@onCancel={{this.cancel}}
@onCoverPhotoLoaded={{action this.coverPhotoLoaded}}
@onSubmit={{this.submit}}
@onCancel={{this.cancel}}
@onCoverPhotoLoaded={{this.coverPhotoLoaded}}

the action helper is outdated. see https://guides.emberjs.com/release/upgrading/current-edition/action-on-and-fn/
if someAction has been annotated with @action in the controller, passing this.someAction in template properties works just fine.

<h5>{{if @model.isNew 'Kamer advertentie aanmaken' 'Kamer advertentie wijzigen'}}</h5>
</div>
<div class='card-body'>
<form {{action @onSubmit on='submit'}}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<form {{action @onSubmit on='submit'}}>
<form {{on 'submit' @onSubmit}}>

the action helper is outdated. see https://guides.emberjs.com/release/upgrading/current-edition/action-on-and-fn/

I think this should work

Copy link
Contributor

Choose a reason for hiding this comment

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

there are a lot of occurrences of the action helper in this PR, I won't comment on them all but it is important to get rid of them before this PR is merged

Copy link
Contributor

@lodewiges lodewiges Oct 12, 2024

Choose a reason for hiding this comment

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

small question: what is the advantage of adding 'this.' for a lot of items

Copy link
Contributor

@lodewiges lodewiges left a comment

Choose a reason for hiding this comment

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

Read through it and the code looks mostly good had one comment but in the end I saw lint made the same comment


@action
setStaticPages() {
if (!this.session.isAuthenticated && !this.media.isMobile) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this checking for?

@@ -0,0 +1,9 @@
import Component from '@ember/component';
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this ember component and not glitter component

Comment on lines +29 to +42
<div class="modal modal-xl fade room-advert-modal" id="room-advert-modal" tabindex="-1" aria-hidden="true" {{on "hide.bs.modal" this.removeBackdrops}}>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body p-0">
{{#if this.openedAdvert}}
<Cards::PublicRoomAdvertCard @roomAdvert={{this.openedAdvert}} @collapsed={{false}} @open={{this.openAdvert}} />
{{/if}}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary fw-bold" data-bs-dismiss="modal">Sluiten</button>
</div>
</div>
</div>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

could you explain the source of this bug Monday?

@lodewiges
Copy link
Contributor

Would it be practical to have a subdomain like kamers.csvalpha.nl point to csvalpha.nl/public/room-forum ? That would allow for more external traffic, because it is easier to share and remember.

sounds good lets discuss the advantages Monday

@lodewiges
Copy link
Contributor

staging has been updated in the meantime so we need to merge it again

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.

4 participants