Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #248 from rashley-iqt/235-index
Browse files Browse the repository at this point in the history
fix(Search): corrected bad check on configuration when flattening
fixes #235 
fixes #247
  • Loading branch information
rashley-iqt authored Feb 20, 2019
2 parents 562006a + 061c771 commit 87a090b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 18 deletions.
44 changes: 31 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"react-dom": "^16.8.1",
"react-modal": "^3.5.1",
"react-portal-tooltip": "^2.4.0",
"react-redux": "^6.0.0",
"react-redux": "^6.0.1",
"react-scripts": "^2.1.3",
"redux": "^4.0.0",
"redux-actions": "^2.2.1",
Expand Down
6 changes: 4 additions & 2 deletions src/epics/index-dataset-epic.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ofType } from 'redux-observable';
import { isNil } from "ramda";
import { isNil, isEmpty } from "ramda";
import { of } from "rxjs";
import { mergeMap, map } from 'rxjs/operators';

Expand Down Expand Up @@ -84,7 +84,9 @@ const flattenDataset = (ds, cfg) => {
const generateIndex = (payload) => {
const owner = payload.owner;
const dataset = payload.dataset;
const configuration = payload.configuration || configurationFor(dataset);
const configuration = !isNil(payload.configuration) && !isEmpty(payload.configuration)
? payload.configuration : configurationFor(dataset);
console.log("configuration to flatten with: %o", configuration);
var flat = flattenDataset(dataset, configuration);
const idx = lunr(function () {
this.ref('id');
Expand Down
2 changes: 1 addition & 1 deletion src/epics/index-dataset-epic.test.js.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe("indexDatasetEpic", () => {
const action$ = buildIndex({ 'owner': owner, 'dataset': dataset, 'configuration': emptyConf });
store.dispatch(action$);

const expectedFields = []//['uid', 'role.role', 'role.confidence'];
const expectedFields = ['uid', 'role.role', 'role.confidence'];
const idx = getSearchIndex(store.getState(), owner)

expect(idx.fields).to.deep.equal(expectedFields);
Expand Down
2 changes: 1 addition & 1 deletion src/features/dataset-controls/DatasetControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if (host.indexOf(':') > -1) {

var POSEIDON_DATASET = {
name: "Poseidon Network",
url: "http://"+hostname+":"+port+"/v1/network"
url: "http://"+hostname+":5000/v1/network"
};

Modal.setAppElement('#root');
Expand Down

0 comments on commit 87a090b

Please sign in to comment.