diff --git a/package.json b/package.json index 5a0558771..c4e61d110 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,10 @@ "engines": { "node": ">=6.2.0 <10.0.0" }, - "browserslist": ["> 1% in FR", "not ie < 11"], + "browserslist": [ + "> 1% in FR", + "not ie < 11" + ], "dependencies": { "@babel/polyfill": "^7.0.0-beta.34", "classnames": "^2.2.5", @@ -99,21 +102,13 @@ }, "scripts": { "start": "node source/server.js", - "compile": - "NODE_ENV='production' webpack --config source/webpack.config.js", - "surge": - "npm run compile && surge --domain scientific-wish.surge.sh -p ./ && rm -rf dist/", - "test": - "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js \"test/**/*.test.js\"", - "test-watch": - "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js \"test/**/*.test.js\" --watch", - "test-meca": - "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js test/mecanisms.test.js --watch", - "test-rules": - "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js test/real-rules.test.js --watch", - "heroku-postbuild": - "npm install --dev && webpack --config source/webpack.config.js --progress", - "test-inversions": - "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js \"test/inversion.test.js\" --watch" + "compile": "NODE_ENV='production' webpack --config source/webpack.config.js", + "surge": "npm run compile && surge --domain scientific-wish.surge.sh -p ./ && rm -rf dist/", + "test": "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js \"test/**/*.test.js\"", + "test-watch": "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js \"test/**/*.test.js\" --watch", + "test-meca": "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js test/mecanisms.test.js --watch", + "test-rules": "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js test/real-rules.test.js --watch", + "heroku-postbuild": "npm install --dev && webpack --config source/webpack.config.js --progress", + "test-inversions": "mocha-webpack --webpack-config source/webpack.test.config.js --require source-map-support/register --require test/helpers/browser.js \"test/inversion.test.js\" --watch" } } diff --git a/source/components/pages/RulesList.js b/source/components/pages/RulesList.js index 8dcbf7e54..d8696630e 100644 --- a/source/components/pages/RulesList.js +++ b/source/components/pages/RulesList.js @@ -44,7 +44,9 @@ export class SearchBar extends React.Component { ] } this.fuse = new Fuse( - rules.map(pick(['title', 'espace', 'description', 'name', 'dottedName'])), + rules.map( + pick(['title', 'espace', 'description', 'name', 'dottedName', 'ns']) + ), options ) } @@ -55,11 +57,16 @@ export class SearchBar extends React.Component { handleChange = selectedOption => { this.setState({ selectedOption }) } - renderOption = option => ( - + renderOption = ({ title, ns }) => ( + + + + {ns} + + ) filterOptions = (options, filter) => this.fuse.search(filter) render() {