diff --git a/index.html b/index.html index 4ed43b8..7fa37cc 100644 --- a/index.html +++ b/index.html @@ -70,7 +70,7 @@ diff --git a/package.json b/package.json index e673f88..7e94fa6 100644 --- a/package.json +++ b/package.json @@ -27,13 +27,18 @@ "url": "git+https://github.com/NERDDISCO/luminave.git" }, "dependencies": { - "@polymer/app-layout": "3.0.0-pre.25", - "@polymer/iron-icons": "3.0.0-pre.25", - "@polymer/iron-pages": "3.0.0-pre.25", + "@material/layout-grid": "^0.39.0", + "@material/mwc-button": "^0.2.1", + "@material/mwc-icon": "^0.2.1", + "@polymer/app-layout": "3.0.1", + "@polymer/iron-icons": "3.0.1", + "@polymer/iron-pages": "3.0.1", "@polymer/lit-element": "0.6.0", - "@polymer/paper-button": "3.0.0-pre.25", - "@polymer/paper-tabs": "3.0.0-pre.25", - "@polymer/paper-tooltip": "3.0.0-pre.25", + "@polymer/paper-button": "3.0.1", + "@polymer/paper-card": "^3.0.1", + "@polymer/paper-dialog": "^3.0.1", + "@polymer/paper-tabs": "3.0.1", + "@polymer/paper-tooltip": "3.0.1", "@webcomponents/webcomponentsjs": "2.1.1", "concurrently": "^3.5.1", "fivetwelve": "^1.0.0-alpha.1", diff --git a/src/actions/app.js b/src/actions/app.js index b5a2ab1..1687aed 100644 --- a/src/actions/app.js +++ b/src/actions/app.js @@ -4,27 +4,34 @@ export const UPDATE_DRAWER_STATE = 'UPDATE_DRAWER_STATE' export const OPEN_SNACKBAR = 'OPEN_SNACKBAR' export const CLOSE_SNACKBAR = 'CLOSE_SNACKBAR' -export const navigate = (path) => (dispatch) => { - // Extract the page name from path. - const page = path === '/' ? 'universe' : path.slice(1) +export const navigate = (location) => (dispatch) => { + const pathname = location.pathname + const parts = pathname.slice(1).split('/') + const page = parts[0] || 'universe' + const entityId = parts[1] || undefined // Any other info you might want to extract from the path (like page type), // you can do here - dispatch(loadPage(page)) + dispatch(loadPage(page, entityId)) // Close the drawer - in case the *path* change came from a link in the drawer. dispatch(updateDrawerState(false)) } -const loadPage = (page) => (dispatch) => { +const loadPage = (page, entityId) => (dispatch) => { switch(page) { case 'animation': import('../views/animation-view.js') break - case 'fixture': - import('../views/fixture-view.js') + case 'fixture': { + if (entityId !== undefined) { + import('../views/fixture-detail-view.js') + } else { + import('../views/fixture-view.js') + } break + } case 'universe': import('../views/universe-view.js').then((module) => { @@ -53,14 +60,15 @@ const loadPage = (page) => (dispatch) => { page = 'view404' import('../views/my-view404.js') } - - dispatch(updatePage(page)) + + dispatch(updatePage(page, entityId)) } -const updatePage = (page) => { +const updatePage = (page, entityId) => { return { type: UPDATE_PAGE, - page + page, + entityId } } diff --git a/src/components/dmx-fixture/index.js b/src/components/dmx-fixture/index.js index 19918ba..1f3e6fa 100644 --- a/src/components/dmx-fixture/index.js +++ b/src/components/dmx-fixture/index.js @@ -9,7 +9,6 @@ import { batch } from '../../utils/index.js' import '/node_modules/@polymer/iron-icons/iron-icons.js' import '/node_modules/@polymer/iron-icons/maps-icons.js' -import '/node_modules/@polymer/paper-tooltip/paper-tooltip.js' /* * A single DMX fixture with all properties @@ -87,17 +86,19 @@ class DmxFixture extends LitElement {