Skip to content

Commit

Permalink
Use url for build stats, from inital data bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneseymour committed Feb 4, 2020
1 parent d53f25b commit 4dede04
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
7 changes: 4 additions & 3 deletions src/dev/code_coverage/cc_app/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ import TestRunnerItemList from './test_runner_item_list';
import HistoricalList from './historical_list';
import Footer from './footer';

export default function App({ items }) {
export default function App({ items, buildStats }) {
const { url } = buildStats;
return (
<div>
<Header />
<Header url={url} />
<div>
<BuildStats />
<TestRunnerItemList items={items} />
<HistoricalList />
</div>
<Footer/>
<Footer />
</div>
);
}
10 changes: 3 additions & 7 deletions src/dev/code_coverage/cc_app/src/header.jsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import React from "react";

export default function Header() {
export default function Header({ url }) {
return (
<header className="App-header">
{/*<img src={logo} className="App-logo" alt="logo"/>*/}
<a
className="App-link"
href={buildStatsLink()}
href={url}
target="_blank"
rel="noopener noreferrer"
>
Some build stats link or something :)
Build Stats Dashboard
</a>
</header>
);
}

function buildStatsLink() {
return 'https://build-stats.elastic.co/app/kibana#/dashboard/02b9d310-9513-11e8-a9c0-db5f285c257f?_g=(refreshInterval%3A(pause%3A!f%2Cvalue%3A10000)%2Ctime%3A(from%3Anow%2Fd%2Cmode%3Aquick%2Cto%3Anow%2Fd))'
}
10 changes: 7 additions & 3 deletions src/dev/code_coverage/cc_app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ import App from './app';
import * as serviceWorker from './service_worker';

const initialData = window.initialData;
const { items } = initialData;
const { items, buildStats } = initialData;

console.log(`\n### initial data: \n\n${JSON.stringify(window.initialData, null, 2)}`);
initialPrint();

ReactDOM.render(<App items={items} />, document.getElementById('root'));
ReactDOM.render(<App items={items} buildStats={buildStats} />, document.getElementById('root'));

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();

function initialPrint() {
console.log(`\n### initial data: \n\n${JSON.stringify(window.initialData, null, 2)}`);
}

0 comments on commit 4dede04

Please sign in to comment.