Skip to content

Conversation

@jacekkalbarczyk
Copy link
Contributor

For now, accessible only via '/me-working-path' endpoint.

mote-tracking branch 'upstream/master'

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
ote-tracking branch 'upstream/master'

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
e remote-tracking branch 'upstream/master'

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
e remote-tracking branch 'upstream/master'

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
aborts
# the commit.
<h3 class="card-header">Aktywność</h3>
<div class="card-body">
<p class="card-text">Zgłoś się w jednej z dostępnych ofert wolontariatu i zapełnij to miejsce.</p>
<!-- <p class="card-text">Zgłoś się w jednej z dostępnych ofert wolontariatu i zapełnij to miejsce.</p> -->
Copy link
Member

Choose a reason for hiding this comment

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

Don't leave commented code behind.


import { AuthService } from '../auth.service';
import { Organization } from '../organization/organization.model';
import { OffersBoxComponent } from '../offers/offers-box/offers-box.component';
Copy link
Member

Choose a reason for hiding this comment

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

unused import


ngOnInit() {
this.offersService.getUserOffers()
.subscribe(offers => this.offers = offers);
Copy link
Member

Choose a reason for hiding this comment

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

instead of subsribe here use async pipe in tempalate

@Component({
selector: 'volontulo-offers-box',
templateUrl: './offers-box.component.html',
styleUrls: ['./offers-box.component.scss'],
Copy link
Member

Choose a reason for hiding this comment

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

We do not store empty scss files.

Copy link
Member

@magul magul left a comment

Choose a reason for hiding this comment

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

One minor problem with multiple subscription to observable to be resolved.

@@ -0,0 +1,11 @@
<div *ngIf="(offers$ | async)?.length==0; else offersExist">
Copy link
Member

Choose a reason for hiding this comment

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

This approach has a few flaws, the first and most obvious is being potentially exposed to multiple, unwanted, subscriptions (previously mentioned up top) that initiate requests.

See how to handle that here: https://toddmotto.com/angular-ngif-async-pipe

Copy link
Member

Choose a reason for hiding this comment

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

You can even change order here and render list from ngIf and in else block show info, that no offers were yet joined.

})
export class OffersBoxComponent implements OnInit {
public offers$: Observable<Offer[]>;
constructor(private offersService: OffersService) {
Copy link
Member

Choose a reason for hiding this comment

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

I would add one blank line between class attributes and constructror

Also prefer (if method body is empty) to format it like that:

constructor(private offersService: OffersService) { }

@magul
Copy link
Member

magul commented Oct 13, 2018

You also have Travis build failing: https://travis-ci.org/CodeForPoznan/volontulo/builds/437120822#L1085

@codecov
Copy link

codecov bot commented Oct 29, 2018

Codecov Report

Merging #1077 into master will increase coverage by 0.01%.
The diff coverage is 70%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1077      +/-   ##
=========================================
+ Coverage   91.49%   91.5%   +0.01%     
=========================================
  Files         119     121       +2     
  Lines        2904    2921      +17     
  Branches       32      32              
=========================================
+ Hits         2657    2673      +16     
- Misses        243     244       +1     
  Partials        4       4
Impacted Files Coverage Δ
frontend/src/app/services/offers.service.ts 62.5% <33.33%> (+5.35%) ⬆️
...mponents/offers/offers-box/offers-box.component.ts 85.71% <85.71%> (ø)
...ponents/homepage-offer/homepage-offer.component.ts 100% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7781682...e50b3e8. Read the comment docs.

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