Remove demo loading
This commit is contained in:
Родитель
6b3837d1f0
Коммит
c83a711b8d
|
@ -11,11 +11,6 @@ const styles = {
|
||||||
};
|
};
|
||||||
|
|
||||||
class Reportees extends React.PureComponent {
|
class Reportees extends React.PureComponent {
|
||||||
getTaskclusterDemo() {
|
|
||||||
const { taskclusterDemo } = this.props;
|
|
||||||
return taskclusterDemo;
|
|
||||||
}
|
|
||||||
|
|
||||||
getMergedProps() {
|
getMergedProps() {
|
||||||
const { metrics, partialOrg, ldapEmail } = this.props;
|
const { metrics, partialOrg, ldapEmail } = this.props;
|
||||||
|
|
||||||
|
@ -100,7 +95,6 @@ class Reportees extends React.PureComponent {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
<pre>{this.getTaskclusterDemo()}</pre>
|
|
||||||
<MuiThemeProvider theme={this.getMuiTheme()}>
|
<MuiThemeProvider theme={this.getMuiTheme()}>
|
||||||
<MUIDataTable
|
<MUIDataTable
|
||||||
title="Reportees"
|
title="Reportees"
|
||||||
|
@ -117,7 +111,6 @@ class Reportees extends React.PureComponent {
|
||||||
Reportees.propTypes = {
|
Reportees.propTypes = {
|
||||||
classes: PropTypes.shape({}).isRequired,
|
classes: PropTypes.shape({}).isRequired,
|
||||||
ldapEmail: PropTypes.string,
|
ldapEmail: PropTypes.string,
|
||||||
taskclusterDemo: PropTypes.string,
|
|
||||||
partialOrg: PropTypes.shape({}).isRequired,
|
partialOrg: PropTypes.shape({}).isRequired,
|
||||||
metrics: PropTypes.shape({}),
|
metrics: PropTypes.shape({}),
|
||||||
};
|
};
|
||||||
|
@ -125,7 +118,6 @@ Reportees.propTypes = {
|
||||||
Reportees.defaultProps = {
|
Reportees.defaultProps = {
|
||||||
metrics: {},
|
metrics: {},
|
||||||
ldapEmail: '',
|
ldapEmail: '',
|
||||||
taskclusterDemo: 'loading',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withStyles(styles)(Reportees);
|
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) {
|
async function loadArtifact(userSession, route, artifactName) {
|
||||||
const index = userSession.getTaskClusterIndexClient();
|
const index = userSession.getTaskClusterIndexClient();
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ import Header from '../../components/Header';
|
||||||
import getAllReportees from '../../utils/getAllReportees';
|
import getAllReportees from '../../utils/getAllReportees';
|
||||||
import getBugzillaOwners from '../../utils/getBugzillaOwners';
|
import getBugzillaOwners from '../../utils/getBugzillaOwners';
|
||||||
import getBugsCountAndLink from '../../utils/bugzilla/getBugsCountAndLink';
|
import getBugsCountAndLink from '../../utils/bugzilla/getBugsCountAndLink';
|
||||||
import loadArtifact from '../../utils/artifacts';
|
|
||||||
import CONFIG, { TEAMS_CONFIG, BZ_QUERIES } from '../../config';
|
import CONFIG, { TEAMS_CONFIG, BZ_QUERIES } from '../../config';
|
||||||
|
|
||||||
const BugzillaComponents = React.lazy(() => import('../../components/BugzillaComponents'));
|
const BugzillaComponents = React.lazy(() => import('../../components/BugzillaComponents'));
|
||||||
|
@ -94,7 +93,7 @@ class MainContainer extends Component {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
async fetchData() {
|
fetchData() {
|
||||||
const { context } = this;
|
const { context } = this;
|
||||||
const userSession = context && context.getUserSession();
|
const userSession = context && context.getUserSession();
|
||||||
if (userSession) {
|
if (userSession) {
|
||||||
|
@ -104,10 +103,6 @@ class MainContainer extends Component {
|
||||||
const ldapEmail = new URLSearchParams(location.search).get('ldapEmail') || (userSession && userSession.email);
|
const ldapEmail = new URLSearchParams(location.search).get('ldapEmail') || (userSession && userSession.email);
|
||||||
this.setState({ ldapEmail });
|
this.setState({ ldapEmail });
|
||||||
this.retrieveData(userSession, 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 {
|
} else {
|
||||||
this.setState(DEFAULT_STATE);
|
this.setState(DEFAULT_STATE);
|
||||||
}
|
}
|
||||||
|
@ -242,7 +237,6 @@ class MainContainer extends Component {
|
||||||
componentDetails,
|
componentDetails,
|
||||||
bugzillaComponents,
|
bugzillaComponents,
|
||||||
ldapEmail,
|
ldapEmail,
|
||||||
taskclusterDemo,
|
|
||||||
partialOrg,
|
partialOrg,
|
||||||
teamComponents,
|
teamComponents,
|
||||||
selectedTabIndex,
|
selectedTabIndex,
|
||||||
|
@ -275,7 +269,6 @@ class MainContainer extends Component {
|
||||||
path="/reportees"
|
path="/reportees"
|
||||||
component={Reportees}
|
component={Reportees}
|
||||||
ldapEmail={ldapEmail}
|
ldapEmail={ldapEmail}
|
||||||
taskclusterDemo={taskclusterDemo}
|
|
||||||
partialOrg={partialOrg}
|
partialOrg={partialOrg}
|
||||||
metrics={reporteesMetrics}
|
metrics={reporteesMetrics}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -4,9 +4,6 @@ exports[`renders Manager who has reportees & metrics 1`] = `
|
||||||
<div
|
<div
|
||||||
className="Reportees-root-1"
|
className="Reportees-root-1"
|
||||||
>
|
>
|
||||||
<pre>
|
|
||||||
loading
|
|
||||||
</pre>
|
|
||||||
<div
|
<div
|
||||||
className="MuiPaper-root-438 MuiPaper-elevation4-444 MuiPaper-rounded-439 MUIDataTable-paper-433 reportees-table"
|
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
|
<div
|
||||||
className="Reportees-root-1"
|
className="Reportees-root-1"
|
||||||
>
|
>
|
||||||
<pre>
|
|
||||||
loading
|
|
||||||
</pre>
|
|
||||||
<div
|
<div
|
||||||
className="MuiPaper-root-223 MuiPaper-elevation4-229 MuiPaper-rounded-224 MUIDataTable-paper-218 reportees-table"
|
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
|
<div
|
||||||
className="Reportees-root-1"
|
className="Reportees-root-1"
|
||||||
>
|
>
|
||||||
<pre>
|
|
||||||
loading
|
|
||||||
</pre>
|
|
||||||
<div
|
<div
|
||||||
className="MuiPaper-root-8 MuiPaper-elevation4-14 MuiPaper-rounded-9 MUIDataTable-paper-3 reportees-table"
|
className="MuiPaper-root-8 MuiPaper-elevation4-14 MuiPaper-rounded-9 MUIDataTable-paper-3 reportees-table"
|
||||||
>
|
>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче