Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Unnest search param #81

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

root = true


[*]
end_of_line = lf
charset = utf-8
Expand Down
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
'use strict';

module.exports = {
globals: {
server: true,
},
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module'
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
},
plugins: [
'ember'
Expand All @@ -18,6 +24,7 @@ module.exports = {
browser: true
},
rules: {
'ember/no-jquery': 'error'
},
overrides: [
// node files
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/.env*
/.eslintignore
/.eslintrc.js
/.git/
/.gitignore
/.template-lintrc.js
/.travis.yml
Expand Down
2 changes: 1 addition & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

module.exports = {
extends: 'recommended',
extends: 'octane',
rules: {
'no-inline-styles': false,
'attribute-indentation': false
Expand Down
28 changes: 13 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "8"
- "10"

sudo: false
dist: trusty

addons:
Expand All @@ -26,42 +25,41 @@ branches:
- /^v\d+\.\d+\.\d+/

jobs:
fail_fast: true
fast_finish: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

include:
# runs linting and tests with current locked deps

- stage: "Tests"
name: "Tests"
install:
- yarn install --non-interactive
script:
- yarn lint:hbs
- yarn lint:js
- yarn test
- yarn lint
- yarn test:ember

- name: "Floating Dependencies"
- stage: "Additional Tests"
name: "Floating Dependencies"
install:
- yarn install --no-lockfile --non-interactive
script:
- yarn test
- yarn test:ember

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- stage: "Additional Tests"
env: EMBER_TRY_SCENARIO=ember-lts-3.4
- env: EMBER_TRY_SCENARIO=ember-lts-3.8
- env: EMBER_TRY_SCENARIO=ember-3.13
- env: EMBER_TRY_SCENARIO=ember-lts-3.16
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
- env: EMBER_TRY_SCENARIO=ember-classic

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH

install:
- yarn install --no-lockfile --non-interactive
- yarn install --non-interactive

script:
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Documentation
Compatibility
------------------------------------------------------------------------------

* Ember.js v3.4 or above
* Ember.js v3.13 or above
* Ember CLI v2.13 or above
* Node.js v8 or above
* Node.js v10 or above


Installation
Expand Down
29 changes: 13 additions & 16 deletions addon/components/model-select-multiple.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
import { action } from '@ember/object';
import PowerSelectMultipleComponent from 'ember-power-select/components/power-select-multiple';
import layout from '../templates/components/model-select-multiple';
import fallbackIfUndefined from '../utils/computed-fallback-if-undefined';

/**
* {{model-select-multiple}} component. This is a wrapper around the normal model-select component. The same arguments apply.
* This is a wrapper around the normal model-select component. The same arguments apply.
*
* @yield {object} model
*
* @class ModelSelectMultipleComponent
*/
export default PowerSelectMultipleComponent.extend({
layout,

triggerClass: fallbackIfUndefined('ember-model-select-multiple-trigger'),
export default class ModelSelectMultipleComponent extends PowerSelectMultipleComponent {

actions: {
change(option, select){
const suggestion = option.find(item => item.__isSuggestion__);
@action
change(option, select) {
const suggestion = option.find(item => item.__isSuggestion__);

if(suggestion){
this.get('oncreate')(suggestion.__value__, select);
} else {
this.get('onchange')(option, select);
}
if(suggestion){
this.args.onCreate(suggestion.__value__, select);
} else {
this.args.onChange(option, select);
}
}
});
}
Loading