diff --git a/.eslintignore b/.eslintignore index 1268706e..a73bde13 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,5 +5,5 @@ coverage dist styleguide build -lib/app +consoles/*/lib/app node_modules \ No newline at end of file diff --git a/bundle/package.json b/bundle/package.json index 35767072..76aa7745 100644 --- a/bundle/package.json +++ b/bundle/package.json @@ -18,12 +18,14 @@ "execa": "^0.10.0", "graphi": "^5.7.0", "h2o2": "^8.1.2", - "hapi": "^17.4.0", + "hapi": "^17.5.0", "hapi-triton-auth": "^3.0.0", "hapi-webconsole-nav": "^2.1.0", "my-joy-images": "*", "my-joy-instances": "*", "my-joy-navigation": "*", + "my-joy-service-groups": "*", + "my-joy-templates": "*", "tsg-graphql": "^1.0.0" } } diff --git a/bundle/src/service-groups.js b/bundle/src/service-groups.js index f9819cbb..88eb77b2 100644 --- a/bundle/src/service-groups.js +++ b/bundle/src/service-groups.js @@ -7,6 +7,7 @@ const Graphi = require('graphi'); const Url = require('url'); const Server = require('./server'); +const Ui = require('my-joy-service-groups'); const { PORT = 4004, @@ -67,6 +68,9 @@ Main(async () => { routes: { prefix: `/${PREFIX}` } + }, + { + plugin: Ui } ]); diff --git a/bundle/src/templates.js b/bundle/src/templates.js index 2bd6a8a3..51694f2e 100644 --- a/bundle/src/templates.js +++ b/bundle/src/templates.js @@ -7,6 +7,7 @@ const Graphi = require('graphi'); const Url = require('url'); const Server = require('./server'); +const Ui = require('my-joy-templates'); const { PORT = 4005, @@ -67,6 +68,9 @@ Main(async () => { routes: { prefix: `/${PREFIX}` } + }, + { + plugin: Ui } ]); diff --git a/consoles/my-joy-images/package.json b/consoles/my-joy-images/package.json index 6e085671..15cb73b3 100644 --- a/consoles/my-joy-images/package.json +++ b/consoles/my-joy-images/package.json @@ -6,7 +6,7 @@ "repository": "github:yldio/joyent-portal", "main": "lib/index.js", "scripts": { - "dev": "NAMESPACE=images NODE_ENV=development REACT_APP_GQL_PORT=4000 PORT=3070 joyent-react-scripts start", + "dev": "REACT_APP_DEV=1 NAMESPACE=images NODE_ENV=development REACT_APP_GQL_PORT=4000 PORT=3070 joyent-react-scripts start", "build:test": "echo 0", "build:lib": "echo 0", "build:bundle": "NAMESPACE=images NODE_ENV=production redrun -p build:frontend build:ssr", @@ -19,23 +19,23 @@ "dependencies": { "@manaflair/redux-batch": "^0.1.0", "apollo": "^0.2.2", - "apollo-cache-inmemory": "^1.1.12", - "apollo-client": "^2.2.8", - "apollo-link-http": "^1.5.3", + "apollo-cache-inmemory": "^1.2.2", + "apollo-client": "^2.3.2", + "apollo-link-http": "^1.5.4", "apr-intercept": "^3.0.3", "apr-reduce": "^3.0.3", "boom": "^7.2.0", - "cross-fetch": "^2.1.0", + "cross-fetch": "^2.2.0", "date-fns": "^1.29.0", "declarative-redux-form": "^2.0.8", "exenv": "^1.2.2", "force-array": "^3.1.0", "fuse.js": "^3.2.0", "hapi-render-react": "^2.5.2", - "hapi-render-react-joyent-document": "^7.1.0", + "hapi-render-react-joyent-document": "^7.2.0", "inert": "^5.1.0", "joyent-logo-assets": "^1.1.0", - "joyent-react-styled-flexboxgrid": "^2.2.3", + "joyent-react-styled-flexboxgrid": "^3.1.0", "joyent-ui-resource-widgets": "^1.0.0", "joyent-ui-toolkit": "^6.0.0", "lodash.assign": "^4.2.0", @@ -46,37 +46,37 @@ "lodash.keys": "^4.2.0", "lodash.omit": "^4.5.0", "lodash.uniqby": "^4.7.0", - "lunr": "^2.1.6", + "lunr": "^2.2.1", "mz": "^2.7.0", "param-case": "^2.1.1", - "react": "^16.3.1", - "react-apollo": "^2.1.2", - "react-dom": "^16.3.1", - "react-helmet-async": "0.0.5", + "react": "^16.4.0", + "react-apollo": "^2.1.4", + "react-dom": "^16.4.0", + "react-helmet-async": "0.1.0", "react-redux": "^5.0.7", "react-redux-values": "^1.1.2", "react-router": "^4.2.0", "react-router-dom": "^4.2.2", - "redux": "^3.7.2", + "redux": "^4.0.0", "redux-form": "^7.3.0", "remcalc": "^1.0.10", - "styled-components": "^3.2.5", - "styled-components-spacing": "^2.1.3", + "styled-components": "^3.3.0", + "styled-components-spacing": "^3.0.0", "styled-flex-component": "^2.2.2", - "styled-is": "^1.1.2", + "styled-is": "^1.1.3", "title-case": "^2.1.1", - "yup": "^0.24.1" + "yup": "^0.25.1" }, "devDependencies": { "babel-cli": "^6.26.0", "babel-preset-joyent-portal": "^7.0.1", "eslint": "^4.19.1", "eslint-config-joyent-portal": "^3.3.1", - "jest-image-snapshot": "^2.4.0", + "jest-image-snapshot": "^2.4.2", "jest-styled-components": "^5.0.1", - "joyent-react-scripts": "^8.2.0", + "joyent-react-scripts": "^8.2.1", "react-screenshot-renderer": "^1.1.2", - "react-test-renderer": "^16.3.1", - "redrun": "^6.0.2" + "react-test-renderer": "^16.4.0", + "redrun": "^6.0.4" } } diff --git a/consoles/my-joy-images/src/components/create-image/details.js b/consoles/my-joy-images/src/components/create-image/details.js index e7d1870c..df688746 100644 --- a/consoles/my-joy-images/src/components/create-image/details.js +++ b/consoles/my-joy-images/src/components/create-image/details.js @@ -2,7 +2,6 @@ import React from 'react'; import { Field } from 'redux-form'; import { Margin } from 'styled-components-spacing'; import Flex, { FlexItem } from 'styled-flex-component'; -import remcalc from 'remcalc'; import { Row, Col } from 'joyent-react-styled-flexboxgrid'; import { @@ -31,7 +30,6 @@ export default ({ placeholderName, randomizing, onRandomize }) => ( - + diff --git a/consoles/my-joy-images/src/containers/list.js b/consoles/my-joy-images/src/containers/list.js index 8d98e2ec..376ef974 100644 --- a/consoles/my-joy-images/src/containers/list.js +++ b/consoles/my-joy-images/src/containers/list.js @@ -78,7 +78,7 @@ export const List = ({ {images.map(image => ( - + handleCreateInstance(image)} diff --git a/consoles/my-joy-images/src/routes.js b/consoles/my-joy-images/src/routes.js index c7e4acc1..6c4cce45 100644 --- a/consoles/my-joy-images/src/routes.js +++ b/consoles/my-joy-images/src/routes.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { Fragment } from 'react'; import { Route, Switch, Redirect } from 'react-router-dom'; import get from 'lodash.get'; @@ -19,6 +19,8 @@ import Create from '@containers/create'; import Tags from '@containers/tags'; import { Route as ServerError } from '@root/server-error'; +const { REACT_APP_DEV = false } = process.env; + export default () => ( {/* Breadcrumb */} @@ -70,6 +72,41 @@ export default () => ( } /> + {REACT_APP_DEV ? ( + + + window.location.replace( + `${window.location.protocol}//${window.location.hostname}:3069${ + location.pathname + }${location.search}` + ) + } + /> + + window.location.replace( + `${window.location.protocol}//${window.location.hostname}:3071${ + location.pathname + }${location.search}` + ) + } + /> + + window.location.replace( + `${window.location.protocol}//${window.location.hostname}:3072${ + location.pathname + }${location.search}` + ) + } + /> + + ) : null} +