This file contains 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
<a id="simple-menu" href="#sidr">Toggle menu</a> | |
<div id="sidr"> | |
<!-- Your content --> | |
<ul> | |
<li><a href="#">List 1</a></li> | |
<li class="active"><a href="#">List 2</a></li> | |
<li><a href="#">List 3</a></li> | |
</ul> | |
</div> |
This file contains 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
describe('Temperature, with no alarms', () => { | |
it('takes temperature with manual input', () => { | |
loginPage.visit(); | |
const menuPage = loginPage.doLogin(TEST_USER, CORRECT_PASSWORD); | |
const measurementsPage = menuPage.chooseMeasurements(); | |
const temperaturePage = measurementsPage.chooseTemperature(); | |
temperaturePage.enterMeasurement(36); | |
temperaturePage.expect().toSayPerfect(); | |
}); |
This file contains 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 React, { Component, KeyboardEvent, ChangeEvent } from 'react'; | |
import { ITodoView, Injector, TodoMixin, TodoPresenter, Todo } from '../core'; | |
interface ITodoItemProps { | |
todo: Todo; | |
}; | |
interface ITodoItemState { | |
isEditing: boolean; |
This file contains 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 { Todo } from '../model'; | |
export interface ITodoUserActions { | |
onDoubleClicked(): void; | |
onToggleCheckboxClicked(): void; | |
onRemoveButtonClicked(): void; | |
onInputBlur(inputContent: string): void; | |
} | |
export interface ITodoView extends ITodoUserActions { |
This file contains 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
export abstract class BasePresenter<V> { | |
protected _view!: V; | |
protected get view(): V { | |
return this._view; | |
} | |
protected abstract init(): void; | |
public attach(view: V): void { |
This file contains 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 { Service, BasePresenter, Mediator } from '../framework'; | |
import { ITodoView } from '../views'; | |
import { AppState, ToggleTodoCommand, RemoveTodoCommand, EditTodoCommand } from '../model'; | |
@Service() | |
export class TodoPresenter extends BasePresenter<ITodoView> { | |
constructor( | |
private readonly state: AppState, | |
private readonly mediator: Mediator | |
) { |
This file contains 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 { Type, Injector } from '../framework'; | |
import { ITodoUserActions } from './todo.view'; | |
import { TodoPresenter } from '../presenters'; | |
// tslint:disable-next-line:typedef | |
export function TodoMixin<TBase extends Type>(base: TBase) { | |
return class extends base implements ITodoUserActions { | |
public presenter: TodoPresenter = Injector.resolve(TodoPresenter); | |
public onDoubleClicked(): void { |
This file contains 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 { CommandHandler, Service } from '../../../../framework'; | |
import { EditTodoCommand, IEditTodoPayload } from '../edit-todo.command'; | |
import { TodosState } from '../../../state'; | |
@Service() | |
export class EditTodoCommandHandler extends CommandHandler<IEditTodoPayload> { | |
constructor( | |
private readonly todosState: TodosState | |
) { | |
super(EditTodoCommand); |
This file contains 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
export class GetVisibleTodosQueryHandler extends SimpleQueryHandler<Todo[]> { | |
constructor( | |
private readonly filterState: FilterState, | |
private readonly todosState: TodosState | |
) { | |
super(GetVisibleTodosQuery); | |
} | |
public handle(): Todo[] { | |
switch (this.filterState.state) { |
This file contains 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 { Todo } from '../../model'; | |
import { Service, StateContainer } from '../../framework'; | |
@Service() | |
export class TodosState extends StateContainer<Todo[]> { | |
constructor() { | |
super([]); | |
} | |
public initialize(todos: Todo[]): void { |
OlderNewer