-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: staging
Are you sure you want to change the base?
Added room adverts #804
Conversation
There was a problem hiding this 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.
These are the main UX points I found. I will leave a code review later, this Friday evening probably |
Apparently I never pushed the fixes I mentioned, oops |
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 :) |
yes it was my fault: I did |
Would it be practical to have a subdomain like |
There was a problem hiding this 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.
<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> |
There was a problem hiding this comment.
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:
but then. Clicking again on the opened advert results in a darker backdrop:
resulting in a pretty comical effect after some more clicks:
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.
There was a problem hiding this comment.
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?
<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> |
There was a problem hiding this comment.
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.
@onSubmit={{action this.submit}} | ||
@onCancel={{this.cancel}} | ||
@onCoverPhotoLoaded={{action this.coverPhotoLoaded}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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'}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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
<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> |
There was a problem hiding this comment.
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?
sounds good lets discuss the advantages Monday |
staging has been updated in the meantime so we need to merge it again |
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