Fix notification bug on the supporter side panel

This commit is contained in:
Eric Schultz 2018-10-19 13:21:17 -05:00 committed by Eric Schultz
parent 27d41eb3cc
commit 8393bfe2db
8 changed files with 14 additions and 14 deletions

View file

@ -20,7 +20,6 @@
<script> <script>
appl.def('open_donation_modal', function(payment_details) { appl.def('open_donation_modal', function(payment_details) {
$('.modal').removeClass('inView')
function SetupLoadReactEditPaymentPane(modalActive){ function SetupLoadReactEditPaymentPane(modalActive){
LoadReactEditPaymentPane(document.getElementById('EditPaymentPaneElement'), LoadReactEditPaymentPane(document.getElementById('EditPaymentPaneElement'),

View file

@ -96,6 +96,7 @@ appl.def('start_loading', function(){
appl.def('update_donation__success', function() { appl.def('update_donation__success', function() {
appl.ajax_payment_details.fetch(appl.payment_details.data.id) appl.ajax_payment_details.fetch(appl.payment_details.data.id)
appl.def('loading', false) appl.def('loading', false)
// appl.close_modal()
appl.notify('Donation successfully updated!') appl.notify('Donation successfully updated!')
}) })

View file

@ -16,7 +16,7 @@ function init(parentState) {
var state = { var state = {
submit$: flyd.stream() submit$: flyd.stream()
, supporter$: parentState.supporter$ , supporter$: parentState.supporter$
, saved$: flyd.stream(Math.random()) , saved$: flyd.stream()
} }

View file

@ -10,7 +10,7 @@ export interface ModalProps
titleText?: string titleText?: string
focusDialog?:boolean focusDialog?:boolean
dialogStyle?:any dialogStyle?:any
childGenerator:() => JSX.Element childGenerator:() => any
} }
class Modal extends React.Component<ModalProps, {}> { class Modal extends React.Component<ModalProps, {}> {

View file

@ -23,15 +23,10 @@ class ReactSelect extends React.Component<InputTypes, {}> {
super(props) super(props)
} }
@observable
field:Field
@action.bound @action.bound
componentWillMount(){ componentWillMount(){
this.field = this.props.field
this.updateProps() this.updateProps()
} }
@ -46,8 +41,8 @@ class ReactSelect extends React.Component<InputTypes, {}> {
@action.bound @action.bound
updateProps() { updateProps() {
this.field.set('label', castToNullIfUndef(this.props.label)) this.props.field.set('label', castToNullIfUndef(this.props.label))
this.field.set('placeholder', castToNullIfUndef(this.props.placeholder)) this.props.field.set('placeholder', castToNullIfUndef(this.props.placeholder))
} }
@ -64,7 +59,7 @@ class ReactSelect extends React.Component<InputTypes, {}> {
render() { render() {
return <select {...this.winnowProps()} {...this.field.bind()}> return <select {...this.winnowProps()} {...this.props.field.bind()}>
{ this.props.options ? this.props.options.map(option => { this.props.options ? this.props.options.map(option =>
<option key={option.id} value={option.id}>{option.name}</option> <option key={option.id} value={option.id}>{option.name}</option>
) : this.props.children ) : this.props.children

View file

@ -180,6 +180,7 @@ class CreateNewOffsitePaymentPane extends React.Component<CreateOffsitePaymentPa
} }
render() { render() {
this.form.values()
const modal = const modal =
<Modal modalActive={this.props.modalActive} titleText={'Edit Donation'} focusDialog={true} <Modal modalActive={this.props.modalActive} titleText={'Edit Donation'} focusDialog={true}
onClose={this.props.onClose} dialogStyle={{minWidth:'768px'}} childGenerator={() => { onClose={this.props.onClose} dialogStyle={{minWidth:'768px'}} childGenerator={() => {

View file

@ -275,12 +275,12 @@ class EditPaymentPane extends React.Component<EditPaymentPaneProps & InjectedInt
{readableKind(this.props.data.kind)} {readableKind(this.props.data.kind)}
{ {
this.props.data.offsite_payment && this.props.data.offsite_payment ? this.props.data.offsite_payment && this.props.data.offsite_payment && this.props.data.offsite_payment.kind ?
<span> <span>
&nbsp; ({this.props.data.offsite_payment.kind}) &nbsp; ({this.props.data.offsite_payment.kind})
</span> : false </span> : undefined
} }
</td> </td>
@ -481,7 +481,8 @@ class EditPaymentPane extends React.Component<EditPaymentPaneProps & InjectedInt
render() { render() {
//force it to check the form values so this updates
this.form.values()
const modal = const modal =
<Modal modalActive={this.props.modalActive} titleText={'Edit Donation'} focusDialog={true} <Modal modalActive={this.props.modalActive} titleText={'Edit Donation'} focusDialog={true}

View file

@ -1,3 +1,5 @@
import { values } from "mobx";
// License: LGPL-3.0-or-later // License: LGPL-3.0-or-later
interface ValidationInput { interface ValidationInput {
@ -315,6 +317,7 @@ export class Form implements Base {
readonly isValid :boolean; readonly isValid :boolean;
readonly size:number readonly size:number
values(): {[fields:string] : ValuesResponse|string}
} }