Skip to content

Commit

Permalink
Merge pull request #225 from joie:terms&conditions
Browse files Browse the repository at this point in the history
terms&conditions page
  • Loading branch information
yinonov authored Nov 10, 2020
2 parents 1a38163 + f0d7614 commit f3644b9
Show file tree
Hide file tree
Showing 12 changed files with 1,954 additions and 18 deletions.
15 changes: 8 additions & 7 deletions apps/joie/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,12 @@ const routes: Routes = [
{
path: 'teacher',
loadChildren: () =>
import('./onboarding/onboarding-teacher/onboarding-teacher.module').then(
(m) => m.OnboardingTeacherModule
),
import('./onboarding/onboarding-teacher/onboarding-teacher.module').then((m) => m.OnboardingTeacherModule),
},
{
path: 'student',
loadChildren: () =>
import('./onboarding/onboarding-student/onboarding-student.module').then(
(m) => m.OnboardingStudentModule
),
import('./onboarding/onboarding-student/onboarding-student.module').then((m) => m.OnboardingStudentModule),
},
],
},
Expand All @@ -80,13 +76,18 @@ const routes: Routes = [
path: 'mission',
loadChildren: () => import('./mission/mission.module').then((m) => m.MissionModule),
},
{
path: 'terms-and-conditions',
loadChildren: () =>
import('./terms-and-conditions/terms-and-conditions.module').then((m) => m.TermsAndConditionsModule),
},
{ path: '**', component: PageNotFoundComponent },
];

@NgModule({
imports: [
RouterModule.forRoot(routes, {
// preloadingStrategy: QuicklinkStrategy,
preloadingStrategy: QuicklinkStrategy,
paramsInheritanceStrategy: 'always',
}),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export class NavigationComponent {
{ name: 'onboarding/student', path: ['/', 'onboarding', 'student'] },
{ name: 'mission', path: ['/', 'mission'] },
{ name: 'how it works', path: ['/', 'how-it-works'] },
{ name: 'terms & conditions', path: ['/', 'terms-and-conditions'] },

// { name: 'teacher', path: ['/', 'teacher'] },
];
activeLink = this.links[0];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<ngx-auth-firebaseui-avatar
[canViewAccount]="false"
layout="simple"
[canDeleteAccount]="false"
*ngIf="afAuth.authState | async; else showLogin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<app-icon class="size-sm" name="more-horizontal" [inline]="true"></app-icon>
</button>
<mat-menu #menu="matMenu" xPosition="before" yPosition="below">
<button mat-menu-item (click)="publishSession()" *ngIf="(isPublic$ | async) === (false | null | undefined)">
<button mat-menu-item (click)="publishSession()" *ngIf="(isPublic$ | async) === false">
<app-icon [inline]="true" class="size-sm" name="flag"></app-icon>
Make public
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@ export class SessionOwnerLinksComponent {
if (type === 'success') {
this.router.navigate(['/account', 'sessions']);
}
this.snackBar.open(message, null, {
this.snackBar.open(message, undefined, {
duration: 8000,
horizontalPosition: 'end',
verticalPosition: 'bottom',
});
}

@Confirmable(`Are you sure session is fully composed? this cannot be undone`, 'warn', 'Publish')
async publishSession() {
@Confirmable(
`Are you sure session is fully composed and ready to be published? this cannot be undone`,
'warn',
'Publish',
)
async publishSession(): Promise<void> {
const sessionId = await this.sessionId;
this.sessionsService.setSession(sessionId, { status: Status.Public });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ActivatedRoute } from '@angular/router';
// import { UntilDestroy } from '@ngneat/until-destroy';
import { SessionsService } from '../../../services/sessions/sessions.service';
import { Observable } from 'rxjs';
import { map, pluck, shareReplay, switchMap, take } from 'rxjs/operators';
import { map, pluck, shareReplay, switchMap } from 'rxjs/operators';
import { AuthFacade } from '../../../auth/services/auth.facade';
import { Pillar, PillarsIconsMap } from '../../../enums/pillar.enum';

Expand All @@ -16,19 +16,19 @@ export class SessionDetailsComponent {
#sessionId$: Observable<string> = this.activatedRoute.params.pipe(pluck('sessionId'));
session$ = this.#sessionId$.pipe(
switchMap((sessionId) => this.sessionsFacade.getSession(sessionId)),
shareReplay(1)
shareReplay(1),
);
eventId$: Observable<number> = this.session$.pipe(pluck('eventId'));
eventId$: Observable<number | undefined> = this.session$.pipe(pluck('eventId'));
owner$ = this.session$.pipe(pluck('owner'), shareReplay());
sessionOwnerId$ = this.owner$.pipe(pluck('uid'), shareReplay());

isOwner$: Observable<boolean> = this.sessionOwnerId$.pipe(
switchMap((sessionOwnerId) =>
this.authFacade.uid$.pipe(
map((uid) => sessionOwnerId === uid)
map((uid) => sessionOwnerId === uid),
// take(1)
)
)
),
),
);

// showDelete$: Observable<boolean> = combineLatest([this.authFacade, this.owner$]).pipe(
Expand Down Expand Up @@ -63,7 +63,7 @@ export class SessionDetailsComponent {
constructor(
private activatedRoute: ActivatedRoute,
private sessionsFacade: SessionsService,
private authFacade: AuthFacade
private authFacade: AuthFacade,
) {}

// get kalturaSessionDetails$(): Observable<SessionStartActionArgs> {
Expand Down
Loading

0 comments on commit f3644b9

Please sign in to comment.