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
const groupSchema = { | |
type: "object", | |
properties: { | |
groups: { | |
type: "array", | |
minItems: 0, | |
maxItems: 5, | |
uniqueItems: true, | |
items: { | |
type: "object", |
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 { green, red } from "chalk"; | |
import * as fs from "fs"; | |
import * as jsf from "json-schema-faker"; | |
import groupSchema from "./groupSchema"; | |
import IGroup from "../src/models/IGroup"; | |
import ISite from "../src/models/ISite"; | |
import siteSchema from "./siteSchema"; | |
const compiledGroupSchema = jsf(groupSchema); |
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 * as React from "react"; | |
import { connect } from "react-redux"; | |
import { RouteComponentProps, withRouter } from "react-router-dom"; | |
import { bindActionCreators, Dispatch } from "redux"; | |
import { signOut as signOutAction } from "../actions/authentication/authenticationActions"; | |
import { homePath } from "../routes/paths"; | |
import Routes from "../routes/Routes"; | |
import { isBusy } from "../selectors"; | |
import IStoreState from "../store/IStoreState"; | |
import Header from "./header/Header"; |
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 * as React from "react"; | |
export default class HomePage extends React.Component { | |
public render() { | |
return ( | |
<div className="jumbotron"> | |
<h1 className="display-3 text-center">{"React app"}</h1> | |
<p className="lead text-center"> | |
{ | |
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel augue turpis. Suspendisse malesuada lacus nec metus pharetra sodales. Nunc tellus quam, mollis a dictum et, luctus maximus libero." |
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 default interface IStoreState { | |
readonly pendingActions: number; | |
readonly isAuthenticated: 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 ActionTypeKeys, { ActionTypeStates } from "../actions/ActionTypeKeys"; | |
import ActionTypes from "../actions/ActionTypes"; | |
import initialState from "./initialState"; | |
export default function pendingActionsReducer( | |
state = initialState.pendingActions, | |
action: ActionTypes | |
) { | |
if (actionTypeEndsInInProgress(action.type)) { | |
return onInProgressAction(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
export enum ActionTypeStates { | |
INPROGRESS = "_INPROGRESS", | |
SUCCESS = "_SUCCESS", | |
FAIL = "_FAIL" | |
} | |
enum ActionTypeKeys { | |
SIGNIN_INPROGRESS = "SIGNIN_INPROGRESS", | |
SIGNIN_SUCCESS = "SIGNIN_SUCCESS", | |
SIGNIN_FAIL = "SIGNIN_FAIL", |
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 { Dispatch } from "redux"; | |
import { | |
signIn as signInToApi, | |
signOut as signOutFromApi | |
} from "../../api/authenticationApi"; | |
import IStoreState from "../../store/IStoreState"; | |
import keys from "../ActionTypeKeys"; | |
import { | |
ISignInFailAction, | |
ISignInInProgressAction, |
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 { IsEmail, IsNotEmpty, IsUrl, MaxLength } from "class-validator"; | |
interface ISite { | |
readonly name: string; | |
readonly url: string; | |
readonly emailAddress: string; | |
readonly password: string; | |
} | |
export default class Site implements ISite { |
OlderNewer