From 8c604df1d2e4a3e49e6e2949621eae65cfa8db01 Mon Sep 17 00:00:00 2001
From: Sara Vieira
Date: Wed, 6 Dec 2017 15:35:22 +0000
Subject: [PATCH] feat(my-joy-beta): instance tags
fixes #905
---
.gitignore | 3 -
joyent.code-workspace | 3 +
packages/my-joy-beta/package.json | 10 +-
.../components/instances/__tests__/tags.js | 19 ++
.../src/components/instances/home.js | 126 +++++-----
.../src/components/instances/key-value.js | 77 +++---
.../src/components/instances/tags.js | 178 +++++++++++++
.../src/containers/instances/tags.js | 235 ++++++++----------
packages/ui-toolkit/src/index.js | 2 +
packages/ui-toolkit/src/tags/container.js | 7 +
packages/ui-toolkit/src/tags/index.js | 3 +
packages/ui-toolkit/src/tags/item.js | 13 +
packages/ui-toolkit/src/tags/list.js | 9 +
yarn.lock | 23 +-
14 files changed, 469 insertions(+), 239 deletions(-)
create mode 100644 packages/my-joy-beta/src/components/instances/__tests__/tags.js
create mode 100644 packages/my-joy-beta/src/components/instances/tags.js
create mode 100644 packages/ui-toolkit/src/tags/container.js
create mode 100644 packages/ui-toolkit/src/tags/index.js
create mode 100644 packages/ui-toolkit/src/tags/item.js
create mode 100644 packages/ui-toolkit/src/tags/list.js
diff --git a/.gitignore b/.gitignore
index b0ad877c..4614796c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -118,9 +118,6 @@ Session.vim
# temporary
.netrwhist
*~
-# auto-generated tag files
-tags
-
### Windows ###
# Windows image file caches
diff --git a/joyent.code-workspace b/joyent.code-workspace
index 678ac1e2..8410215f 100644
--- a/joyent.code-workspace
+++ b/joyent.code-workspace
@@ -8,6 +8,9 @@
},
{
"path": "packages/my-joy-beta"
+ },
+ {
+ "path": "."
}
],
"settings": {}
diff --git a/packages/my-joy-beta/package.json b/packages/my-joy-beta/package.json
index 853906b1..baf8945e 100644
--- a/packages/my-joy-beta/package.json
+++ b/packages/my-joy-beta/package.json
@@ -6,11 +6,14 @@
"repository": "github:yldio/joyent-portal",
"main": "build/",
"scripts": {
- "dev": "REACT_APP_GQL_PORT=4000 PORT=3069 REACT_APP_GQL_PROTOCOL=http joyent-react-scripts start",
+ "dev":
+ "REACT_APP_GQL_PORT=4000 PORT=3069 REACT_APP_GQL_PROTOCOL=http joyent-react-scripts start",
"start": "PORT=3069 joyent-react-scripts start",
"build": "NODE_ENV=production joyent-react-scripts build",
- "lint-ci": "eslint . --ext .js --ext .md && echo 0 `# stylelint './src/**/*.js'`",
- "lint": "eslint . --fix --ext .js --ext .md && echo 0 `# stylelint './src/**/*.js'`",
+ "lint-ci":
+ "eslint . --ext .js --ext .md && echo 0 `# stylelint './src/**/*.js'`",
+ "lint":
+ "eslint . --fix --ext .js --ext .md && echo 0 `# stylelint './src/**/*.js'`",
"test": "NODE_ENV=test joyent-react-scripts test --env=jsdom",
"test-ci": "redrun test",
"prepublish": "echo 0"
@@ -43,6 +46,7 @@
"redux-form": "^7.1.2",
"remcalc": "^1.0.9",
"styled-components": "^2.2.3",
+ "styled-flex-component": "^1.1.0",
"title-case": "^2.1.1"
},
"devDependencies": {
diff --git a/packages/my-joy-beta/src/components/instances/__tests__/tags.js b/packages/my-joy-beta/src/components/instances/__tests__/tags.js
new file mode 100644
index 00000000..c60691bc
--- /dev/null
+++ b/packages/my-joy-beta/src/components/instances/__tests__/tags.js
@@ -0,0 +1,19 @@
+import React from 'react';
+import renderer from 'react-test-renderer';
+import Store from '@mocks/store';
+import 'jest-styled-components';
+
+import Tags from '../tags';
+
+
+it('renders without throwing', () => {
+ const tree = renderer
+ .create(
+
+
+
+ )
+ .toJSON();
+
+ expect(tree).toMatchSnapshot();
+});
\ No newline at end of file
diff --git a/packages/my-joy-beta/src/components/instances/home.js b/packages/my-joy-beta/src/components/instances/home.js
index 61537929..de713508 100644
--- a/packages/my-joy-beta/src/components/instances/home.js
+++ b/packages/my-joy-beta/src/components/instances/home.js
@@ -206,75 +206,65 @@ export default withTheme(
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
- {instance.image && (
-
- )}
+
+
+
+
+
+
+
+
+
+
+ {instance.image && (
+
+ )}
+
+ {instance.ips.map((ip, i) => (
{create ? `Create ${label}` : `Edit ${label}`}
+ {create ? `Create ${label}` : `Edit ${label}`}
) : (
+
) : (
);
@@ -102,6 +108,7 @@ const KeyValue = ({