Update ara-web patternfly modules to use the released version

Patternfly is released, we can now use component from react-core modules.
Update patternfly modules.

Replace html components with react equivalents

Change-Id: I93941fe86ae2dda905af78779b414cbc8cc4fcc1
This commit is contained in:
Guillaume Vincent 2019-05-21 11:04:12 +02:00
parent 8f72f77129
commit 46f8897604
10 changed files with 333 additions and 306 deletions

237
package-lock.json generated
View File

@ -1131,6 +1131,19 @@
"resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.8.2.tgz", "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.8.2.tgz",
"integrity": "sha512-rLu3wcBWH4P5q1CGoSSH/i9hrXs7SlbRLkoq9IGuoPYNGQvDJ3pt/wmOM+XgYjIDRMVIdkUWt0RsfzF50JfnCw==" "integrity": "sha512-rLu3wcBWH4P5q1CGoSSH/i9hrXs7SlbRLkoq9IGuoPYNGQvDJ3pt/wmOM+XgYjIDRMVIdkUWt0RsfzF50JfnCw=="
}, },
"@fortawesome/fontawesome-common-types": {
"version": "0.2.18",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.18.tgz",
"integrity": "sha512-834DrzO2Ne3upCW+mJJPC/E6BsFcj+2Z1HmPIhbpbj8UaKmXWum4NClqLpUiMetugRlHuG4jbIHNdv2/lc3c1Q=="
},
"@fortawesome/free-brands-svg-icons": {
"version": "5.8.2",
"resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-5.8.2.tgz",
"integrity": "sha512-nhEWctDOP6f+Ka10LXAFoF+6mtWidC2iQgTBGRGgydmhBtcIEwyxWVx5wQHa86A1zAMi5TnipDAYQs2qn7DD6A==",
"requires": {
"@fortawesome/fontawesome-common-types": "^0.2.18"
}
},
"@hapi/address": { "@hapi/address": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@hapi/address/-/address-2.0.0.tgz", "resolved": "https://registry.npmjs.org/@hapi/address/-/address-2.0.0.tgz",
@ -1400,45 +1413,36 @@
"integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw=="
}, },
"@patternfly/patternfly": { "@patternfly/patternfly": {
"version": "2.1.1", "version": "2.6.14",
"resolved": "https://registry.npmjs.org/@patternfly/patternfly/-/patternfly-2.1.1.tgz", "resolved": "https://registry.npmjs.org/@patternfly/patternfly/-/patternfly-2.6.14.tgz",
"integrity": "sha512-V3gUgO+hmFcXp7gDi8x3zgwR6Xy4sOmODtgGPFAVAB031IkLD651UuOgz7GB2s2R65HyhTUaV5NH95d6wNlJgg==" "integrity": "sha512-ikSkb4p6iMBM3lXfeTjAWRoJ6LSDf6f814r7DaKbR/jOPQZvW90GmqFPUt2vyzqBbkUhlhwqwjr8ILFofA25Tw=="
}, },
"@patternfly/react-core": { "@patternfly/react-core": {
"version": "3.1.3", "version": "3.16.10",
"resolved": "https://registry.npmjs.org/@patternfly/react-core/-/react-core-3.1.3.tgz", "resolved": "https://registry.npmjs.org/@patternfly/react-core/-/react-core-3.16.10.tgz",
"integrity": "sha512-hRuCr6Mmm5ZXN7eUmQrq6mRuPIlKQnUJA3YCEowWaVSH2X10Y70luACz00lO1nD+rUd4vOL2lG1dLyCjwX9/Fw==", "integrity": "sha512-ASoNNuC+S2UjUeT2aR7LsAuDJpvXzMHYCjRc9WmXD9S52nvqA5p4SS9cXV60RCTvRpUbXJ7/55gnxi4Dt9u6/A==",
"requires": { "requires": {
"@patternfly/react-icons": "^3.7.3", "@patternfly/react-icons": "^3.8.1",
"@patternfly/react-styles": "^3.0.2", "@patternfly/react-styles": "^3.2.0",
"@patternfly/react-tokens": "^2.3.2", "@patternfly/react-tokens": "^2.5.1",
"@tippy.js/react": "^1.1.1", "@tippy.js/react": "^1.1.1",
"emotion": "^9.2.9", "emotion": "^9.2.9",
"exenv": "^1.2.2", "exenv": "^1.2.2",
"focus-trap-react": "^4.0.1" "focus-trap-react": "^4.0.1"
},
"dependencies": {
"@patternfly/react-icons": {
"version": "3.7.4",
"resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-3.7.4.tgz",
"integrity": "sha512-YgKQt7qloOvGJEt3kRJLlRe6eJMwU0YbfuC2bsTzcmCReI5cSNv0ZyuV9rOIOpB5rRaNPmCm9RjKBCixFjcaYg=="
},
"@patternfly/react-tokens": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/@patternfly/react-tokens/-/react-tokens-2.3.2.tgz",
"integrity": "sha512-17rGae23JIwDD1in2Y0AUqgkrb7g3gEvUitkWOIGeYgqk/L8oo+0CGV2CHWYwWHM0PaBk3GvDrHDGKuJIxmr5A=="
}
} }
}, },
"@patternfly/react-icons": { "@patternfly/react-icons": {
"version": "3.7.1", "version": "3.9.2",
"resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-3.7.1.tgz", "resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-3.9.2.tgz",
"integrity": "sha512-Q7MDYKy+/4SjMR4UVK35Dg1srE2i4zwFiMA8UpuKqfqPaE5DsfpJALLeedxIiuMjhVC2XwoEwiQQkNczB2ejQQ==" "integrity": "sha512-EwPB+Nodd7zwiFh7R3Qq6Dif+xUR3WOwaJ+SRbP5NsxEAJf3CyYyrd7rbN8yFrFLTMKzknT2ez9XrP/5Lgr5LQ==",
"requires": {
"@fortawesome/free-brands-svg-icons": "^5.8.1"
}
}, },
"@patternfly/react-styles": { "@patternfly/react-styles": {
"version": "3.0.2", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/@patternfly/react-styles/-/react-styles-3.0.2.tgz", "resolved": "https://registry.npmjs.org/@patternfly/react-styles/-/react-styles-3.2.0.tgz",
"integrity": "sha512-JiGxDkC4JArQJ13RQOjSUE4jPmwrAq8f5E+qg0tVws1A9BQ2l3uGCRFMVbfa57qqjqk0jXNmIVdFSeCG18qwJQ==", "integrity": "sha512-8M7bo4kPvypHlbzuynV53xjk5176EktfEgZ283sfHmvUlU3Yvq2+m8hS9ERHE9gd91Ip4HiyucAVVACd2gtHNQ==",
"requires": { "requires": {
"@babel/helper-plugin-utils": "^7.0.0-beta.48", "@babel/helper-plugin-utils": "^7.0.0-beta.48",
"camel-case": "^3.0.0", "camel-case": "^3.0.0",
@ -1480,9 +1484,9 @@
} }
}, },
"@patternfly/react-tokens": { "@patternfly/react-tokens": {
"version": "2.2.2", "version": "2.5.1",
"resolved": "https://registry.npmjs.org/@patternfly/react-tokens/-/react-tokens-2.2.2.tgz", "resolved": "https://registry.npmjs.org/@patternfly/react-tokens/-/react-tokens-2.5.1.tgz",
"integrity": "sha512-5yszwICn0/ZPz9YWQcilYmHdP7dIGwTNba0GPyqQfXOpuSJ2X3uLwZfuMGdqhOOsJTZmH9ksv2LQpc9HXhWa1Q==" "integrity": "sha512-ZykUfWT4yCELXhGGwQxcNqnXwe3sqfSuoL6IlQRV6wtUKk+/et7NkVvrRwvci926+Usemr4IQVc8V9gbHqRN/A=="
}, },
"@svgr/babel-plugin-add-jsx-attribute": { "@svgr/babel-plugin-add-jsx-attribute": {
"version": "4.2.0", "version": "4.2.0",
@ -2383,6 +2387,47 @@
} }
} }
}, },
"babel-core": {
"version": "6.26.3",
"resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz",
"integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==",
"requires": {
"babel-code-frame": "^6.26.0",
"babel-generator": "^6.26.0",
"babel-helpers": "^6.24.1",
"babel-messages": "^6.23.0",
"babel-register": "^6.26.0",
"babel-runtime": "^6.26.0",
"babel-template": "^6.26.0",
"babel-traverse": "^6.26.0",
"babel-types": "^6.26.0",
"babylon": "^6.18.0",
"convert-source-map": "^1.5.1",
"debug": "^2.6.9",
"json5": "^0.5.1",
"lodash": "^4.17.4",
"minimatch": "^3.0.4",
"path-is-absolute": "^1.0.1",
"private": "^0.1.8",
"slash": "^1.0.0",
"source-map": "^0.5.7"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"json5": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
"integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE="
}
}
},
"babel-eslint": { "babel-eslint": {
"version": "10.0.1", "version": "10.0.1",
"resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.0.1.tgz", "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.0.1.tgz",
@ -3123,47 +3168,6 @@
"lodash": "^4.17.4", "lodash": "^4.17.4",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"source-map-support": "^0.4.15" "source-map-support": "^0.4.15"
},
"dependencies": {
"babel-core": {
"version": "6.26.3",
"resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz",
"integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==",
"requires": {
"babel-code-frame": "^6.26.0",
"babel-generator": "^6.26.0",
"babel-helpers": "^6.24.1",
"babel-messages": "^6.23.0",
"babel-register": "^6.26.0",
"babel-runtime": "^6.26.0",
"babel-template": "^6.26.0",
"babel-traverse": "^6.26.0",
"babel-types": "^6.26.0",
"babylon": "^6.18.0",
"convert-source-map": "^1.5.1",
"debug": "^2.6.9",
"json5": "^0.5.1",
"lodash": "^4.17.4",
"minimatch": "^3.0.4",
"path-is-absolute": "^1.0.1",
"private": "^0.1.8",
"slash": "^1.0.0",
"source-map": "^0.5.7"
}
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"json5": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
"integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE="
}
} }
}, },
"babel-runtime": { "babel-runtime": {
@ -3787,7 +3791,8 @@
}, },
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true "bundled": true,
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -3805,11 +3810,13 @@
}, },
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true "bundled": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -3822,15 +3829,18 @@
}, },
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true "bundled": true,
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true "bundled": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true "bundled": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -3933,7 +3943,8 @@
}, },
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true "bundled": true,
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -3943,6 +3954,7 @@
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -3955,17 +3967,20 @@
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
}, },
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true "bundled": true,
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -3982,6 +3997,7 @@
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -4054,7 +4070,8 @@
}, },
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true "bundled": true,
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -4064,6 +4081,7 @@
"once": { "once": {
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -4139,7 +4157,8 @@
}, },
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true "bundled": true,
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -4169,6 +4188,7 @@
"string-width": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -4186,6 +4206,7 @@
"strip-ansi": { "strip-ansi": {
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -4224,11 +4245,13 @@
}, },
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true "bundled": true,
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true "bundled": true,
"optional": true
} }
} }
}, },
@ -6359,45 +6382,6 @@
"requires": { "requires": {
"ansi-wrap": "^0.1.0" "ansi-wrap": "^0.1.0"
} }
},
"babel-core": {
"version": "6.26.3",
"resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz",
"integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==",
"requires": {
"babel-code-frame": "^6.26.0",
"babel-generator": "^6.26.0",
"babel-helpers": "^6.24.1",
"babel-messages": "^6.23.0",
"babel-register": "^6.26.0",
"babel-runtime": "^6.26.0",
"babel-template": "^6.26.0",
"babel-traverse": "^6.26.0",
"babel-types": "^6.26.0",
"babylon": "^6.18.0",
"convert-source-map": "^1.5.1",
"debug": "^2.6.9",
"json5": "^0.5.1",
"lodash": "^4.17.4",
"minimatch": "^3.0.4",
"path-is-absolute": "^1.0.1",
"private": "^0.1.8",
"slash": "^1.0.0",
"source-map": "^0.5.7"
}
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"json5": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
"integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE="
} }
} }
}, },
@ -8049,11 +8033,13 @@
}, },
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true "bundled": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -8070,7 +8056,8 @@
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true "bundled": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
@ -8199,13 +8186,15 @@
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
}, },
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true "bundled": true,
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",

View File

@ -4,10 +4,10 @@
"private": true, "private": true,
"homepage": "http://localhost:3000/", "homepage": "http://localhost:3000/",
"dependencies": { "dependencies": {
"@patternfly/patternfly": "^2.0.0", "@patternfly/patternfly": "^2.6.14",
"@patternfly/react-core": "^3.1.3", "@patternfly/react-core": "^3.16.10",
"@patternfly/react-icons": "^3.7.1", "@patternfly/react-icons": "^3.9.2",
"@patternfly/react-tokens": "^2.2.2", "@patternfly/react-tokens": "^2.5.1",
"axios": "^0.18.0", "axios": "^0.18.0",
"braces": "^3.0.1", "braces": "^3.0.1",
"react": "^16.8.6", "react": "^16.8.6",

View File

@ -8,6 +8,7 @@ import store from "./store";
import { getConfig } from "./config/configActions"; import { getConfig } from "./config/configActions";
import * as Containers from "./containers"; import * as Containers from "./containers";
import Header from "./layout/navigation/Header"; import Header from "./layout/navigation/Header";
import Page from "./layout/Page";
class App extends Component { class App extends Component {
state = { state = {
@ -24,29 +25,21 @@ class App extends Component {
return ( return (
<Provider store={store}> <Provider store={store}>
<BrowserRouter basename={process.env.PUBLIC_URL}> <BrowserRouter basename={process.env.PUBLIC_URL}>
<div> <Page header={<Header />}>
<div className="pf-c-background-image" /> <Switch>
<div className="pf-c-page" id="page-layout-horizontal-nav"> <Redirect from="/" exact to="/playbooks" />
<Header /> <Route
<main role="main" className="pf-c-page__main"> path="/playbooks"
<section className="pf-c-page__main-section"> exact
<Switch> component={Containers.PlaybooksContainer}
<Redirect from="/" exact to="/playbooks" /> />
<Route <Route
path="/playbooks" path="/playbooks/:id"
exact component={Containers.PlaybookContainer}
component={Containers.PlaybooksContainer} />
/> <Route component={Containers.Container404} />
<Route </Switch>
path="/playbooks/:id" </Page>
component={Containers.PlaybookContainer}
/>
<Route component={Containers.Container404} />
</Switch>
</section>
</main>
</div>
</div>
</BrowserRouter> </BrowserRouter>
</Provider> </Provider>
); );

View File

@ -1,17 +1,25 @@
import React, { Component } from "react"; import React, { Component } from "react";
import {
Bullseye,
Button,
PageSection,
PageSectionVariants
} from "@patternfly/react-core";
export default class Container404 extends Component { export default class Container404 extends Component {
render() { render() {
return ( return (
<div className="pf-l-bullseye"> <PageSection variant={PageSectionVariants.light}>
<div className="pf-l-bullseye__item"> <Bullseye>
<div className="pf-c-card"> <p className="pf-u-text-align-center">
<div className="pf-c-card__body"> We are looking for your page...but we can't find it
<p>We are looking for your page...but we can't find it</p> <br />
</div> <Button variant="secondary" component="a" href="/" className="pf-u-mt-xl">
</div> Go to index
</div> </Button>
</div> </p>
</Bullseye>
</PageSection>
); );
} }
} }

View File

@ -1,15 +1,45 @@
import React, { Component } from "react"; import React, { Component } from "react";
import {
Bullseye,
Card,
CardBody,
PageSection,
PageSectionVariants
} from "@patternfly/react-core";
export default class LoadingContainer extends Component { export default class LoadingContainer extends Component {
state = {
seconds: 0
};
tick() {
this.setState(state => ({
seconds: state.seconds + 1
}));
}
componentDidMount() {
this.interval = setInterval(() => this.tick(), 1000);
}
componentWillUnmount() {
clearInterval(this.interval);
}
render() { render() {
const { seconds } = this.state;
const nbDots = 3;
const nbDotsToDisplay = (seconds % nbDots) + 1;
const dots = ".".repeat(nbDotsToDisplay);
const spaces = " ".repeat(nbDots - nbDotsToDisplay).replace(/ /g, "\u00a0");
return ( return (
<div className="pf-l-bullseye"> <PageSection variant={PageSectionVariants.default}>
<div className="pf-l-bullseye__item"> <Bullseye>
<div className="pf-c-card"> <Card>
<div className="pf-c-card__body">loading</div> <CardBody>{`loading${dots}${spaces}`}</CardBody>
</div> </Card>
</div> </Bullseye>
</div> </PageSection>
); );
} }
} }

8
src/layout/Page.js Normal file
View File

@ -0,0 +1,8 @@
import styled from "styled-components";
import { Page } from "@patternfly/react-core";
const AraPage = styled(Page)`
min-height: 100vh;
`;
export default AraPage;

View File

@ -1,70 +1,50 @@
import React, { Component } from "react"; import React, { Component } from "react";
import styled from "styled-components"; import styled from "styled-components";
import { Link } from "react-router-dom";
import { withRouter } from "react-router"; import { withRouter } from "react-router";
import {
Brand,
Nav,
NavItem,
NavList,
NavVariants,
PageHeader
} from "@patternfly/react-core";
import logo from "./logo.svg"; import logo from "./logo.svg";
const AraImg = styled.img` const Logo = styled(Brand)`
height: 45px; height: 45px;
`; `;
export class NavLink extends Component { class Header extends Component {
render() { render() {
const { to, className, location, children, ...rest } = this.props; const { location, history } = this.props;
return ( const TopNav = (
<Link <Nav onSelect={this.onNavSelect} aria-label="Nav">
to={to} <NavList variant={NavVariants.horizontal}>
className={`${className} ${ <NavItem
location.pathname.indexOf(to) === -1 ? "" : "pf-m-current" to="/playbooks"
}`} onClick={() => history.push("/playbooks")}
{...rest} isActive={location.pathname.indexOf("playbooks") !== -1}
> preventDefault
{children}
</Link>
);
}
}
export class Header extends Component {
render() {
const { location } = this.props;
return (
<header role="banner" className="pf-c-page__header">
<div className="pf-c-page__header-brand">
<Link to="/playbooks" className="pf-c-page__header-brand-link">
<AraImg className="pf-c-brand" src={logo} alt="Ara Logo" />
</Link>
</div>
<div className="pf-c-page__header-nav">
<nav
className="pf-c-nav"
id="page-layout-horizontal-nav-horizontal-nav"
aria-label="Horizontal Nav Example"
> >
<ul className="pf-c-nav__horizontal-list"> Playbooks
<li className="pf-c-nav__item"> </NavItem>
<NavLink <NavItem
to="/playbooks" to="https://ara.readthedocs.io/en/latest/"
className="pf-c-nav__link" target="_blank"
location={location} rel="noopener noreferrer"
> >
Playbooks Documentation
</NavLink> </NavItem>
</li> </NavList>
<li className="pf-c-nav__item"> </Nav>
<a );
href="https://ara.readthedocs.io/en/latest/" return (
target="_blank" <PageHeader
rel="noopener noreferrer" logo={<Logo src={logo} alt="Ara Logo" />}
className="pf-c-nav__link" logoProps={{ href: "/" }}
> topNav={TopNav}
Documentation />
</a>
</li>
</ul>
</nav>
</div>
</header>
); );
} }
} }

View File

@ -1,11 +1,18 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { List, ListItem } from '@patternfly/react-core'; import {
Card,
CardHeader,
CardBody,
List,
ListItem,
PageSection,
PageSectionVariants
} from "@patternfly/react-core";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { isEmpty } from "lodash"; import { isEmpty } from "lodash";
import { LoadingContainer, Container404 } from "../containers"; import { LoadingContainer, Container404 } from "../containers";
import { getPlaybook } from "./playbooksActions"; import { getPlaybook } from "./playbooksActions";
export class PlaybookContainer extends Component { export class PlaybookContainer extends Component {
state = { state = {
isLoading: true, isLoading: true,
@ -29,77 +36,74 @@ export class PlaybookContainer extends Component {
return <Container404 />; return <Container404 />;
} }
return ( return (
<div> <PageSection variant={PageSectionVariants.light}>
<div className="pf-c-card"> <Card>
<div class="pf-c-card__header"> <CardHeader>Hosts</CardHeader>
<h1 className="pf-c-title pf-m-lg">Hosts</h1> <CardBody>
</div>
<div className="pf-c-card__body">
<table class="pf-c-table pf-m-compact pf-m-grid-md" role="grid"> <table class="pf-c-table pf-m-compact pf-m-grid-md" role="grid">
<thead> <thead>
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>OK</th> <th>OK</th>
<th>CHANGED</th> <th>CHANGED</th>
<th>FAILED</th> <th>FAILED</th>
<th>SKIPPED</th> <th>SKIPPED</th>
<th>UNREACHABLE</th> <th>UNREACHABLE</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{playbook.hosts.map(host => ( {playbook.hosts.map(host => (
<tr key={host.id}> <tr key={host.id}>
<td data-label="Name">{host.name}</td> <td data-label="Name">{host.name}</td>
<td data-label="OK">{host.ok}</td> <td data-label="OK">{host.ok}</td>
<td data-label="CHANGED">{host.changed}</td> <td data-label="CHANGED">{host.changed}</td>
<td data-label="FAILED">{host.failed}</td> <td data-label="FAILED">{host.failed}</td>
<td data-label="SKIPPED">{host.skipped}</td> <td data-label="SKIPPED">{host.skipped}</td>
<td data-label="UNREACHABLE">{host.unreachable}</td> <td data-label="UNREACHABLE">{host.unreachable}</td>
</tr> </tr>
))} ))}
</tbody> </tbody>
</table> </table>
</div> </CardBody>
</div> </Card>
<div className="pf-c-card"> <Card>
<div class="pf-c-card__header"> <CardHeader>Plays</CardHeader>
<h1 className="pf-c-title pf-m-lg">Plays</h1>
</div>
{playbook.plays.map(play => ( {playbook.plays.map(play => (
<div className="pf-c-card__body"> <CardBody>
<h2>{play.name}</h2> <h2>{play.name}</h2>
<List> <List>
<ListItem>Started: {play.started}</ListItem> <ListItem>Started: {play.started}</ListItem>
<ListItem>Ended: {play.ended}</ListItem> <ListItem>Ended: {play.ended}</ListItem>
<ListItem>Duration: {play.duration}</ListItem> <ListItem>Duration: {play.duration}</ListItem>
</List> </List>
<table class="pf-c-table pf-m-compact pf-m-grid-md" role="grid"> <table class="pf-c-table pf-m-compact pf-m-grid-md" role="grid">
<thead> <thead>
<tr> <tr>
<th>Task</th> <th>Task</th>
<th>Host</th> <th>Host</th>
<th>Action</th> <th>Action</th>
<th>Duration</th> <th>Duration</th>
<th>Status</th> <th>Status</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{play.tasks.map(task => {play.tasks.map(task =>
task.results.map(result => task.results.map(result => (
<tr key={result.id}> <tr key={result.id}>
<th data-label="Task">{task.name}</th> <th data-label="Task">{task.name}</th>
<th data-label="Host">{result.host.name}</th> <th data-label="Host">{result.host.name}</th>
<th data-label="Action">{task.action}</th> <th data-label="Action">{task.action}</th>
<th data-label="Duration">{result.duration}</th> <th data-label="Duration">{result.duration}</th>
<th data-label="Status">{result.status}</th> <th data-label="Status">{result.status}</th>
</tr> </tr>
))} ))
)}
</tbody> </tbody>
</table> </table>
</div> </CardBody>
))} ))}
</div> </Card>
</div> </PageSection>
); );
} }
} }

View File

@ -1,5 +1,6 @@
import React, { Component } from "react"; import React, { Component } from "react";
import styled from "styled-components"; import styled from "styled-components";
import { Card, CardBody } from "@patternfly/react-core";
import { import {
CheckCircleIcon, CheckCircleIcon,
ExclamationCircleIcon, ExclamationCircleIcon,
@ -138,8 +139,8 @@ export default class Playbook extends Component {
className="pf-u-mb-xs" className="pf-u-mb-xs"
onClick={() => history.push(`/playbooks/${playbook.id}`)} onClick={() => history.push(`/playbooks/${playbook.id}`)}
> >
<div className="pf-c-card"> <Card>
<div className="pf-c-card__body"> <CardBody>
<PlaybookContent> <PlaybookContent>
<StatusAndName> <StatusAndName>
<StatusIcon status={playbook.status} /> <StatusIcon status={playbook.status} />
@ -174,8 +175,8 @@ export default class Playbook extends Component {
</span> </span>
</Duration> </Duration>
</PlaybookContent> </PlaybookContent>
</div> </CardBody>
</div> </Card>
</PlaybookWrapper> </PlaybookWrapper>
); );
} }

View File

@ -1,7 +1,20 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { isEmpty } from "lodash"; import { isEmpty } from "lodash";
import {
Bullseye,
Button,
Card,
CardBody,
EmptyState,
EmptyStateVariant,
EmptyStateIcon,
EmptyStateBody,
PageSection,
PageSectionVariants,
Title
} from "@patternfly/react-core";
import { CubesIcon } from "@patternfly/react-icons";
import { LoadingContainer } from "../containers"; import { LoadingContainer } from "../containers";
import { getPlaybooks } from "./playbooksActions"; import { getPlaybooks } from "./playbooksActions";
import PlaybookSummary from "./PlaybookSummary"; import PlaybookSummary from "./PlaybookSummary";
@ -27,40 +40,41 @@ export class PlaybooksContainer extends Component {
} }
return ( return (
<div> <PageSection variant={PageSectionVariants.default}>
{!isLoading && isEmpty(playbooks) && ( {!isLoading && isEmpty(playbooks) && (
<div className="pf-l-bullseye"> <Bullseye>
<div className="pf-l-bullseye__item"> <Card>
<div className="pf-c-card"> <CardBody>
<div className="pf-c-card__body"> <EmptyState variant={EmptyStateVariant.large}>
<div className="pf-c-empty-state"> <EmptyStateIcon icon={CubesIcon} />
<i <Title headingLevel="h5" size="lg">
className="fas fa-cubes pf-c-empty-state__icon" No playbooks
aria-hidden="true" </Title>
/> <EmptyStateBody>
<h1 className="pf-c-title pf-m-lg">No playbooks</h1> There is no playbook available on this instance of Ara
<p className="pf-c-empty-state__body"> </EmptyStateBody>
There is no playbook available on this instance of Ara <Button
</p> variant="primary"
<div className="pf-c-empty-state__action"> component="a"
<a href="https://ara.readthedocs.io/en/latest/"
href="https://ara.readthedocs.io/en/latest/" target="_blank"
target="_blank" rel="noopener noreferrer"
rel="noopener noreferrer" >
> See documentation
See documentation </Button>
</a> </EmptyState>
</div> </CardBody>
</div> </Card>
</div> </Bullseye>
</div>
</div>
</div>
)} )}
{playbooks.map(playbook => ( {playbooks.map(playbook => (
<PlaybookSummary key={playbook.id} playbook={playbook} history={history} /> <PlaybookSummary
key={playbook.id}
playbook={playbook}
history={history}
/>
))} ))}
</div> </PageSection>
); );
} }
} }