Skip to content

Commit

Permalink
feat(appointment-details): display basic viewings info
Browse files Browse the repository at this point in the history
  • Loading branch information
draylegend committed Sep 26, 2022
1 parent 1f92fa0 commit 06b8de3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions libs/appointment/domain/src/lib/appointment.facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export class AppointmentFacade {
visibleDays$ = this.store.select(selectors.selectVisibleDays);
viewings$ = this.store.select(selectors.selectViewings);
weekSpan$ = this.store.select(selectors.selectWeekSpan);
selectedViewings$ = this.store.select(selectors.selectSelectedViewings);
history: string[] = [];

constructor(private store: Store<State>) {}
Expand Down
4 changes: 4 additions & 0 deletions libs/appointment/domain/src/lib/appointment.selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ export const selectViewings = createSelector(selectFeature, s => {
export const selectWeekSpan = createSelector(selectFeature, s =>
getWeekSpan(s.selectedYear, s.selectedWeek),
);

export const selectSelectedViewings = createSelector(selectFeature, s =>
s.selectedViewings.map(id => s.entities[id]),
);
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<section></section>
<section>
<pre>{{ facade.selectedViewings$ | ngrxPush | json }}</pre>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ section {
border-radius: 4px;
height: 75vh;
width: 75vw;
overflow: auto;
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import { Location } from '@angular/common';
import { JsonPipe, Location } from '@angular/common';
import {
ChangeDetectionStrategy,
Component,
HostListener,
} from '@angular/core';
import { AppointmentFacade } from '@immomio/appointment/domain';
import { PushModule } from '@ngrx/component';

@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
styleUrls: ['./details-feature.component.scss'],
templateUrl: './details-feature.component.html',
imports: [PushModule, JsonPipe],
})
export class DetailsFeatureComponent {
constructor(private facade: AppointmentFacade, private location: Location) {}
constructor(public facade: AppointmentFacade, private location: Location) {}

@HostListener('click', ['$event.target']) hostClick(e: HTMLElement) {
if (e.closest('section')) {
Expand Down

0 comments on commit 06b8de3

Please sign in to comment.