This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const verifyToken = async ({ authorization, schoolid }) => { | |
| if (authorization) { | |
| const newToken = authorization.replace('Bearer ', ''); | |
| const header = await admin | |
| .auth() | |
| .verifyIdToken(newToken) | |
| .then(decodedToken => { | |
| if (decodedToken.firebase.tenant !== schoolid) { | |
| throw new AuthenticationError("User doesn't have access to school"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const routes: Routes = [ | |
| { | |
| path: `:${selectedSectionIdRouteParam}`, | |
| canActivate: [AuthGuard], | |
| resolve: [CourseResolver], | |
| component: CourseComponent, | |
| children: [ | |
| { | |
| path: `action-items`, | |
| component: ActionItemsComponent, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ActivatedRouteSnapshot } from '@angular/router'; | |
| import * as fromRouter from '@ngrx/router-store'; | |
| import { createFeatureSelector, createSelector } from '@ngrx/store'; | |
| export interface State { | |
| router: fromRouter.RouterReducerState; | |
| } | |
| export const selectRouter = createFeatureSelector< | |
| State, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public todoListChanged(affectedIds: string[]) { | |
| this.store.dispatch( | |
| TodoListActions.todoListChanged({ | |
| affectedIds, | |
| }), | |
| ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public todoListChanged(affectedIds: string[]) { | |
| this.store.dispatch( | |
| TodoListActions.todoListChanged({ | |
| affectedIds: [] | |
| }), | |
| ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TodoListActions.todoFormSubmited({ | |
| todoItem: { | |
| ...todoItem, | |
| }, | |
| }), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public loadTodoList() { | |
| this.store.dispatch(TodoListActions.getTodoListRequest()); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <app-crud-item | |
| *ngFor="let todo of todos" | |
| [todoItem]="todo" | |
| data-test="todo-item" | |
| (todoDelete)="deleteTodo($event)" | |
| (todoEdit)="selectTodoForEdit($event)" | |
| (todoCompleteToggled)="todoCompleteToggled($event)" | |
| ></app-crud-item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static checkForTodos() { | |
| cy.get('[data-test=todo-item]').should('have.length', 5); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { TodoPage } from '../support/todo.po'; | |
| describe('TodoList', () => { | |
| beforeEach(() => { | |
| cy.setupAppGlobalRoutes(); | |
| TodoPage.goToPage(); | |
| }); | |
| it('should should show todo items', () => { | |
| TodoPage.checkForTodos(); |