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
# Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
# use this file except in compliance with the License. You may obtain a copy of | |
# the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
# License for the specific language governing permissions and limitations under |
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
=erl_crash_dump:0.3 | |
Sat Aug 12 17:18:09 2017 | |
Slogan: Kernel pid terminated (application_controller) ({application_start_failure,couch,{{shutdown,{failed_to_start_child,couch_secondary_services,{shutdown,{failed_to_start_child,couch_peruser,{badarg,[{e | |
System version: Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:3:3] [async-threads:16] [kernel-poll:true] | |
Compiled: Mon Apr 24 06:20:48 2017 | |
Taints: snappy,khash,crypto | |
Atoms: 13216 | |
=memory | |
total: 103938648 | |
processes: 3682736 |
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
=erl_crash_dump:0.3 | |
Sat Aug 12 17:18:09 2017 | |
Slogan: Kernel pid terminated (application_controller) ({application_start_failure,couch,{{shutdown,{failed_to_start_child,couch_secondary_services,{shutdown,{failed_to_start_child,couch_peruser,{badarg,[{e | |
System version: Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:3:3] [async-threads:16] [kernel-poll:true] | |
Compiled: Mon Apr 24 06:20:48 2017 | |
Taints: snappy,khash,crypto | |
Atoms: 13216 | |
=memory | |
total: 103938648 | |
processes: 3682736 |
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
/** | |
* Redux-form Field with custom property `nutrient` passed in directly and not via props | |
* Type safe and no typescript erros | |
*/ | |
import { Field, WrappedFieldProps } from 'redux-form'; | |
type ExtrasProps = { nutrient: Nutrient }; | |
const ValueField = Field as new () => Field<ExtraProps>; |
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 { Loading } from '@common/components/Loading/Loading'; | |
import { ErrorMessage } from '@common/components/ErrorMessage/ErrorMessage'; | |
import { IconSizeProp } from 'semantic-ui-react/src/elements/Icon/Icon'; | |
type Options<T = any> = { | |
loaderSize?: IconSizeProp, | |
errorExtraCheck?: (props: T) => string | null | undefined, | |
loadingExtraCheck?: (props: T) => 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 { graphql, QueryProps } from 'react-apollo'; | |
/** | |
* QUERY | |
*/ | |
const PAYMENT_QUERY = gql` | |
query payment($id: ID!) { | |
payment(id: $id) { | |
id |
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
{ | |
"compilerOptions": { | |
"target": "es2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ | |
"lib": ["dom", "es2017", "esnext"], | |
"module": "commonjs", /* Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ | |
// "noEmit": true, /* Do not emit outputs. */ | |
"strict": true, | |
"strictFunctionTypes": false, | |
"noImplicitAny": false, | |
"experimentalDecorators": true, |
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
// @ts-ignore | |
nutrientSchema.post('init', async function(this: NutrientInstance) { | |
// noinspection JSDeprecatedSymbols | |
if (!this.displayUnitCode && this.displayUnitId) { | |
const unit = await NutrientUnitModel.findById(this.displayUnitId); | |
if (unit) { | |
this.displayUnitCode = unit.code; | |
await this.save(); | |
} | |
} |
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 { Document, Model, Schema } from 'mongoose'; | |
import { ObjectID } from 'bson'; | |
/** | |
* Find or create mongoose static function creator | |
*/ | |
export type WithFindOrCreate<T extends Document> = { | |
findOrCreate: (id?: string | ObjectID | null) => T; | |
}; |
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 { Document, model, Model, Schema } from 'mongoose'; | |
import { withFindOrCreate, WithFindOrCreate } from '../utils/findOrCreate'; | |
import { NutrientUnitInstance, NutrientUnitModel } from '../NutrientUnit/NutrientUnit'; | |
import { ObjectID } from 'bson'; | |
/** | |
* Nutrient (e.g. calcium) | |
*/ | |
export interface Nutrient { |
OlderNewer