This commit is contained in:
Bastien Abadie 2019-08-13 13:59:12 +02:00
Родитель 6b3837d1f0
Коммит c83a711b8d
4 изменённых файлов: 13 добавлений и 25 удалений

Просмотреть файл

@ -11,11 +11,6 @@ const styles = {
};
class Reportees extends React.PureComponent {
getTaskclusterDemo() {
const { taskclusterDemo } = this.props;
return taskclusterDemo;
}
getMergedProps() {
const { metrics, partialOrg, ldapEmail } = this.props;
@ -100,7 +95,6 @@ class Reportees extends React.PureComponent {
return (
<div className={classes.root}>
<pre>{this.getTaskclusterDemo()}</pre>
<MuiThemeProvider theme={this.getMuiTheme()}>
<MUIDataTable
title="Reportees"
@ -117,7 +111,6 @@ class Reportees extends React.PureComponent {
Reportees.propTypes = {
classes: PropTypes.shape({}).isRequired,
ldapEmail: PropTypes.string,
taskclusterDemo: PropTypes.string,
partialOrg: PropTypes.shape({}).isRequired,
metrics: PropTypes.shape({}),
};
@ -125,7 +118,6 @@ Reportees.propTypes = {
Reportees.defaultProps = {
metrics: {},
ldapEmail: '',
taskclusterDemo: 'loading',
};
export default withStyles(styles)(Reportees);

Просмотреть файл

@ -1,3 +1,15 @@
/* Load a private artifact from Taskcluster, using a signed url and a direct download
You can use it with a signed it Taskcluster user session:
import loadArtifact from '../../utils/artifacts';
const data = await loadArtifact(
userSession,
'project.relman.production.bugzilla-dashboard.latest',
'project/relman/bugzilla-dashboard/XXXX.json'
);
*/
async function loadArtifact(userSession, route, artifactName) {
const index = userSession.getTaskClusterIndexClient();

Просмотреть файл

@ -11,7 +11,6 @@ import Header from '../../components/Header';
import getAllReportees from '../../utils/getAllReportees';
import getBugzillaOwners from '../../utils/getBugzillaOwners';
import getBugsCountAndLink from '../../utils/bugzilla/getBugsCountAndLink';
import loadArtifact from '../../utils/artifacts';
import CONFIG, { TEAMS_CONFIG, BZ_QUERIES } from '../../config';
const BugzillaComponents = React.lazy(() => import('../../components/BugzillaComponents'));
@ -94,7 +93,7 @@ class MainContainer extends Component {
});
};
async fetchData() {
fetchData() {
const { context } = this;
const userSession = context && context.getUserSession();
if (userSession) {
@ -104,10 +103,6 @@ class MainContainer extends Component {
const ldapEmail = new URLSearchParams(location.search).get('ldapEmail') || (userSession && userSession.email);
this.setState({ ldapEmail });
this.retrieveData(userSession, ldapEmail);
// Demo artifact loading
const taskclusterDemo = await loadArtifact(userSession, 'project.relman.production.bugzilla-dashboard.latest', 'project/relman/bugzilla-dashboard/product_component_data.json');
this.setState({ taskclusterDemo });
} else {
this.setState(DEFAULT_STATE);
}
@ -242,7 +237,6 @@ class MainContainer extends Component {
componentDetails,
bugzillaComponents,
ldapEmail,
taskclusterDemo,
partialOrg,
teamComponents,
selectedTabIndex,
@ -275,7 +269,6 @@ class MainContainer extends Component {
path="/reportees"
component={Reportees}
ldapEmail={ldapEmail}
taskclusterDemo={taskclusterDemo}
partialOrg={partialOrg}
metrics={reporteesMetrics}
/>

Просмотреть файл

@ -4,9 +4,6 @@ exports[`renders Manager who has reportees & metrics 1`] = `
<div
className="Reportees-root-1"
>
<pre>
loading
</pre>
<div
className="MuiPaper-root-438 MuiPaper-elevation4-444 MuiPaper-rounded-439 MUIDataTable-paper-433 reportees-table"
>
@ -726,9 +723,6 @@ exports[`renders Manager who has reportees 1`] = `
<div
className="Reportees-root-1"
>
<pre>
loading
</pre>
<div
className="MuiPaper-root-223 MuiPaper-elevation4-229 MuiPaper-rounded-224 MUIDataTable-paper-218 reportees-table"
>
@ -1448,9 +1442,6 @@ exports[`renders Someone with no reportees 1`] = `
<div
className="Reportees-root-1"
>
<pre>
loading
</pre>
<div
className="MuiPaper-root-8 MuiPaper-elevation4-14 MuiPaper-rounded-9 MUIDataTable-paper-3 reportees-table"
>