Merge pull request #12 from houdiniproject/master

Update with Houdini master branch latest changes
This commit is contained in:
Luis Castro 2019-07-27 14:11:31 +02:00 committed by GitHub
commit eb59c221f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 64 additions and 213 deletions

2
Gemfile.lock Executable file → Normal file
View file

@ -255,7 +255,7 @@ GEM
memcachier (0.0.2) memcachier (0.0.2)
method_source (0.9.0) method_source (0.9.0)
mime-types (1.25.1) mime-types (1.25.1)
mini_magick (4.2.1) mini_magick (4.9.5)
mini_portile2 (2.1.0) mini_portile2 (2.1.0)
money (6.10.0) money (6.10.0)
i18n (>= 0.6.4, < 1.0) i18n (>= 0.6.4, < 1.0)

View file

@ -15,4 +15,7 @@ class Ticket < ActiveRecord::Base
has_one :nonprofit, through: :event has_one :nonprofit, through: :event
has_many :activities, as: :attachment, dependent: :destroy has_many :activities, as: :attachment, dependent: :destroy
def related_tickets
payment.tickets.where('id != ?', self.id)
end
end end

81
package-lock.json generated
View file

@ -6808,9 +6808,9 @@
} }
}, },
"bootstrap": { "bootstrap": {
"version": "3.3.7", "version": "3.4.1",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-3.3.7.tgz", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-3.4.1.tgz",
"integrity": "sha1-WjiTlFSfIzMIdaOxUGVldPip63E=", "integrity": "sha512-yN5oZVmRCwe5aKwzRj6736nSmKDX7pLYwsXiCj/EYmo16hODaBiT4En5btW/jhBF/seV+XMx3aYwukYC3A49DA==",
"dev": true "dev": true
}, },
"bootstrap-loader": { "bootstrap-loader": {
@ -9251,11 +9251,6 @@
"@babel/runtime": "^7.1.2" "@babel/runtime": "^7.1.2"
} }
}, },
"dom-scroll-into-view": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/dom-scroll-into-view/-/dom-scroll-into-view-1.0.1.tgz",
"integrity": "sha1-Mqu5Lw2P7KYhUWKu9D5LRJq42Zw="
},
"dom-serializer": { "dom-serializer": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz",
@ -9899,9 +9894,9 @@
"dev": true "dev": true
}, },
"extend": { "extend": {
"version": "3.0.1", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
}, },
"extend-shallow": { "extend-shallow": {
"version": "3.0.2", "version": "3.0.2",
@ -14496,9 +14491,9 @@
} }
}, },
"lodash": { "lodash": {
"version": "4.17.11", "version": "4.17.14",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz",
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw=="
}, },
"lodash._baseassign": { "lodash._baseassign": {
"version": "3.2.0", "version": "3.2.0",
@ -14794,9 +14789,9 @@
} }
}, },
"marked": { "marked": {
"version": "0.6.2", "version": "0.7.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.6.2.tgz", "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz",
"integrity": "sha512-LqxwVH3P/rqKX4EKGz7+c2G9r98WeM/SW34ybhgNGhUQNKtf1GmmSkJ6cDGJ/t6tiyae49qRkpyTw2B9HOrgUA==" "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg=="
}, },
"math-expression-evaluator": { "math-expression-evaluator": {
"version": "1.2.17", "version": "1.2.17",
@ -14961,9 +14956,9 @@
} }
}, },
"mixin-deep": { "mixin-deep": {
"version": "1.3.1", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
"integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
"dev": true, "dev": true,
"requires": { "requires": {
"for-in": "^1.0.2", "for-in": "^1.0.2",
@ -19935,15 +19930,6 @@
"react-displace": "^2.3.0" "react-displace": "^2.3.0"
} }
}, },
"react-autocomplete": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/react-autocomplete/-/react-autocomplete-1.8.1.tgz",
"integrity": "sha1-67vEAABqqRrVOLLRRye55+XQYxA=",
"requires": {
"dom-scroll-into-view": "1.0.1",
"prop-types": "^15.5.10"
}
},
"react-displace": { "react-displace": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/react-displace/-/react-displace-2.3.0.tgz", "resolved": "https://registry.npmjs.org/react-displace/-/react-displace-2.3.0.tgz",
@ -20696,9 +20682,9 @@
"dev": true "dev": true
}, },
"set-value": { "set-value": {
"version": "2.0.0", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
"integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
"dev": true, "dev": true,
"requires": { "requires": {
"extend-shallow": "^2.0.1", "extend-shallow": "^2.0.1",
@ -22672,38 +22658,15 @@
"dev": true "dev": true
}, },
"union-value": { "union-value": {
"version": "1.0.0", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
"integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
"dev": true, "dev": true,
"requires": { "requires": {
"arr-union": "^3.1.0", "arr-union": "^3.1.0",
"get-value": "^2.0.6", "get-value": "^2.0.6",
"is-extendable": "^0.1.1", "is-extendable": "^0.1.1",
"set-value": "^0.4.3" "set-value": "^2.0.1"
},
"dependencies": {
"extend-shallow": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"dev": true,
"requires": {
"is-extendable": "^0.1.0"
}
},
"set-value": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz",
"integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=",
"dev": true,
"requires": {
"extend-shallow": "^2.0.1",
"is-extendable": "^0.1.1",
"is-plain-object": "^2.0.1",
"to-object-path": "^0.3.0"
}
}
} }
}, },
"uniq": { "uniq": {

View file

@ -42,7 +42,7 @@
"babel-loader": "^7.1.4", "babel-loader": "^7.1.4",
"babel-preset-env": "^1.6.1", "babel-preset-env": "^1.6.1",
"babel-preset-es2015": "^6.24.1", "babel-preset-es2015": "^6.24.1",
"bootstrap": "^3.3.7", "bootstrap": "^3.4.1",
"bootstrap-loader": "github:houdiniproject/bootstrap-loader#compiled_namespaced", "bootstrap-loader": "github:houdiniproject/bootstrap-loader#compiled_namespaced",
"bootstrap-sass": "^3.3.7", "bootstrap-sass": "^3.3.7",
"browserify": "13.0.1", "browserify": "13.0.1",
@ -65,7 +65,7 @@
"jsdom": "^11.10.0", "jsdom": "^11.10.0",
"less": "^3.0.4", "less": "^3.0.4",
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"lodash": "^4.17.11", "lodash": "^4.17.14",
"node-sass": "^4.12.0", "node-sass": "^4.12.0",
"phantomjs-prebuilt": "^2.1.16", "phantomjs-prebuilt": "^2.1.16",
"postcss-cssnext": "^2.9.0", "postcss-cssnext": "^2.9.0",
@ -118,7 +118,7 @@
"immutable": "3.7.5", "immutable": "3.7.5",
"jquery": "1.11.1", "jquery": "1.11.1",
"jquery.cookie": "1.4.1", "jquery.cookie": "1.4.1",
"marked": "^0.6.2", "marked": "^0.7.0",
"mobx": "^4.3.1", "mobx": "^4.3.1",
"mobx-react": "^5.4.3", "mobx-react": "^5.4.3",
"mobx-react-devtools": "^5.0.1", "mobx-react-devtools": "^5.0.1",
@ -138,7 +138,6 @@
"ramda": "^0.21.0", "ramda": "^0.21.0",
"react": "^16.2.0", "react": "^16.2.0",
"react-aria-modal": "^3.0.1", "react-aria-modal": "^3.0.1",
"react-autocomplete": "^1.8.1",
"react-dom": "^16.3.1", "react-dom": "^16.3.1",
"react-intl": "^2.4.0", "react-intl": "^2.4.0",
"react-text-mask": "^5.3.0", "react-text-mask": "^5.3.0",

View file

@ -0,0 +1,35 @@
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
require 'rails_helper'
RSpec.describe Ticket, type: :model do
let(:payment1) { force_create(:payment)}
let(:payment2) { force_create(:payment)}
let(:ticket1) { force_create(:ticket, payment: payment1)}
let(:ticket2) { force_create(:ticket, payment: payment1)}
let(:ticket3) { force_create(:ticket, payment: payment1)}
let(:ticket4) { force_create(:ticket, payment: payment2)}
before(:each) do
ticket1
ticket2
ticket3
ticket4
end
it 'has ticket1 getting ticket2 and ticket3 for related_tickets' do
expect(ticket1.related_tickets).to contain_exactly(ticket2, ticket3)
end
it 'has ticket2 getting ticket1 and ticket3 for related_tickets' do
expect(ticket2.related_tickets).to contain_exactly(ticket1, ticket3)
end
it 'has ticket3 getting ticket1 and ticket2 for related_tickets' do
expect(ticket3.related_tickets).to contain_exactly(ticket1, ticket2)
end
it 'has ticket4 getting no related tickets' do
expect(ticket4.related_tickets).to be_empty
end
end

View file

@ -1,13 +0,0 @@
// License: LGPL-3.0-or-later
import {Component} from 'react'
import {AutocompleteProps} from "./types";
class Autocomplete extends Component<AutocompleteProps, {}>
{
}
export = Autocomplete

View file

@ -1,136 +0,0 @@
export interface AutocompletePropsGeneric<T> {
/**
* The items to display in the dropdown menu
*/
items: Array<T>,
/**
* The value to display in the input field
*/
value?: any,
/**
* Arguments: `event: Event, value: String`
*
* Invoked every time the user changes the input's value.
*/
onChange?: (event:Event, value:string) => void,
/**
* Arguments: `value: String, item: Any`
*
* Invoked when the user selects an item from the dropdown menu.
*/
onSelect?: (value:String, item:T) => void
/**
* Arguments: `item: Any, value: String`
*
* Invoked for each entry in `items` and its return value is used to
* determine whether or not it should be displayed in the dropdown menu.
* By default all items are always rendered.
*/
shouldItemRender?: (item:T, value:string) => boolean
/**
* Arguments: `item: Any`
*
* Invoked when attempting to select an item. The return value is used to
* determine whether the item should be selectable or not.
* By default all items are selectable.
*/
isItemSelectable?: (item:T) => boolean,
/**
* Arguments: `itemA: Any, itemB: Any, value: String`
*
* The function which is used to sort `items` before display.
*/
sortItems?: (itemA:T, itemB:T, value:string) => number
/**
* Arguments: `item: Any`
*
* Used to read the display value from each entry in `items`.
*/
getItemValue: (item:T) => string
/**
* Arguments: `item: Any, isHighlighted: Boolean, styles: Object`
*
* Invoked for each entry in `items` that also passes `shouldItemRender` to
* generate the render tree for each item in the dropdown menu. `styles` is
* an optional set of styles that can be applied to improve the look/feel
* of the items in the dropdown menu.
*/
renderItem: (item: T, isHighlighted:boolean, styles?:any) => ReactNode
/**
* Arguments: `items: Array<Any>, value: String, styles: Object`
*
* Invoked to generate the render tree for the dropdown menu. Ensure the
* returned tree includes every entry in `items` or else the highlight order
* and keyboard navigation logic will break. `styles` will contain
* { top, left, minWidth } which are the coordinates of the top-left corner
* and the width of the dropdown menu.
*/
renderMenu?: (items: Array<T>, value:String, style:{top:string, left:string, minWidth:string}) => ReactNode
/**
* Styles that are applied to the dropdown menu in the default `renderMenu`
* implementation. If you override `renderMenu` and you want to use
* `menuStyle` you must manually apply them (`this.props.menuStyle`).
*/
menuStyle?: any,
/**
* Arguments: `props: Object`
*
* Invoked to generate the input element. The `props` argument is the result
* of merging `props.inputProps` with a selection of props that are required
* both for functionality and accessibility. At the very least you need to
* apply `props.ref` and all `props.on<event>` event handlers. Failing to do
* this will cause `Autocomplete` to behave unexpectedly.
*/
renderInput?: (props:any) => ReactNode,
/**
* Props passed to `props.renderInput`. By default these props will be
* applied to the `<input />` element rendered by `Autocomplete`, unless you
* have specified a custom value for `props.renderInput`. Any properties
* supported by `HTMLInputElement` can be specified, apart from the
* following which are set by `Autocomplete`: value, autoComplete, role,
* aria-autocomplete. `inputProps` is commonly used for (but not limited to)
* placeholder, event handlers (onFocus, onBlur, etc.), autoFocus, etc..
*/
inputProps?: any,
/**
* Props that are applied to the element which wraps the `<input />` and
* dropdown menu elements rendered by `Autocomplete`.
*/
wrapperProps?: any
/**
* This is a shorthand for `wrapperProps={{ style: <your styles> }}`.
* Note that `wrapperStyle` is applied before `wrapperProps`, so the latter
* will win if it contains a `style` entry.
*/
wrapperStyle?: any
/**
* Whether or not to automatically highlight the top match in the dropdown
* menu.
*/
autoHighlight?: boolean,
/**
* Whether or not to automatically select the highlighted item when the
* `<input>` loses focus.
*/
selectOnBlur?: boolean,
/**
* Arguments: `isOpen: Boolean`
*
* Invoked every time the dropdown menu's visibility changes (i.e. every
* time it is displayed/hidden).
*/
onMenuVisibilityChange?: (isOpen:boolean) => void
/**
* Used to override the internal logic which displays/hides the dropdown
* menu. This is useful if you want to force a certain state based on your
* UX/business logic. Use it together with `onMenuVisibilityChange` for
* fine-grained control over the dropdown menu dynamics.
*/
open?: boolean,
debug?: boolean
[prop:string]: any
}
export interface AutocompleteProps extends AutocompletePropsGeneric<any> {
}