Skip to content

Commit

Permalink
feat: use first target property path (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
stoffeastrom committed Jan 14, 2020
1 parent 94f2eca commit 8604ddb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apis/nucleus/src/components/Cell.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ const handleModal = ({ sn, layout, model }) => {
if (selections.id === model.id) {
selections.setLayout(layout);
if (layout && layout.qSelectionInfo && layout.qSelectionInfo.qInSelections && !selections.isModal()) {
selections.goModal('/qHyperCubeDef'); // TODO - use path from data targets
const { targets } = sn.generator.qae.data;
const firstPropertyPath = targets[0].propertyPath;
selections.goModal(firstPropertyPath);
}
if (!layout.qSelectionInfo || !layout.qSelectionInfo.qInSelections) {
if (selections.isModal()) {
Expand Down
2 changes: 2 additions & 0 deletions apis/nucleus/src/components/__tests__/cell.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ describe('<Cell />', () => {
data: {
targets: [
{
propertyPath: '/qFoo',
layoutPath: '/foo',
resolveLayout: () => layout.foo,
dimensions: {
Expand Down Expand Up @@ -293,6 +294,7 @@ describe('<Cell />', () => {
};
await render({ model, nebbie });
expect(goModal.callCount).to.equal(1);
expect(goModal).to.have.been.calledWithExactly('/qFoo');
});

it('should no modal (selections)', async () => {
Expand Down

0 comments on commit 8604ddb

Please sign in to comment.