Example #1
0
  componentDidMount: function() {
    if (!this.props.interactive.hasRunInitialize()) {
      var params = this.props.isInitialTab ? InteractiveData.getParamsFromWindowUrl() : null;
      params = params || {};
      if (!params['branch']) {
        params['branch'] = this.props.project.getReturnedData()
          .repository.defaultBranch;
      }

      this.props.interactive.initialize(params || {});
    }

    // if we're revisiting this tab, let's restore the window url to the
    // current state
    if (api.isLoaded(this.props.interactive.getDataToShow())) {
      this.props.interactive.updateWindowUrl();
    }

    // TODO: maybe store this in parent state
    var repo_id = this.props.project.getReturnedData().repository.id;
    api.fetch(
      this,
      { 'branches': `/api/0/repositories/${repo_id}/branches` }
    );
  },
Example #2
0
  componentDidMount: function() {
    var sourceID = this.props.sourceID;

    api.fetch(this, {
      source: `/api/0/sources/${sourceID}`
    })
  },
Example #3
0
 componentDidMount: function() {
   api.fetch(this, {
     projects: '/api/0/projects/?fetch_extra=1',
     jenkins_master_blacklist: '/api/0/jenkins_master_blacklist/',
     auth: '/api/0/auth/'
   });
 },
Example #4
0
  componentDidMount: function() {
    var objectID = this.props.objectID;

    api.fetch(this, {
      objectTasks: `/api/0/tasks/?object_id=${objectID}`,
    })
  },
Example #5
0
 componentDidMount: function() {
   let repositoryID = this.props.repositoryID;
   api.fetch(this, {
     repository: `/api/0/repositories/${repositoryID}`,
     projects: `/api/0/repositories/${repositoryID}/projects`,
   });
 },
Example #6
0
  componentDidMount: function() {
    var snapshotID = this.props.snapshotID;

    api.fetch(this, {
      snapshotDetails: `/api/0/snapshots/${snapshotID}/`,
      snapshotJobs: `/api/0/snapshots/${snapshotID}/jobs/`
    })
  },
Example #7
0
  componentDidMount: function() {
    var author = this.props.author || 'me';

    api.fetch(this, {
      diffs: `/api/0/authors/${author}/diffs/`,
      commits: `/api/0/authors/${author}/commits/?per_page=20`,
      projects: '/api/0/projects/' // no fetch_extra
    });
  },
Example #8
0
  componentDidMount: function() {
    var slug = this.props.projectSlug;

    // grab the initial project data needed to render anything. We also eagerly
    // grab some data for our tabs so that they load faster
    api.fetch(this, {
      project: `/api/0/projects/${slug}`,
    });
  },
Example #9
0
  componentDidMount: function() {
    var projectID = this.props.projectUUID;
    var testHash = this.props.testHash;

    var info_endpoint = `/api/0/projects/${projectID}/tests/${testHash}/`;
    api.fetch(this, {
      info: info_endpoint,
    });

    this.state.history.initialize(InteractiveData.getParamsFromWindowUrl());
  },
Example #10
0
  componentDidMount: function() {
    var nodeID = this.props.nodeID;

    var detailsEndpoint = `/api/0/nodes/${nodeID}/`;
    var jobsEndpoint = `/api/0/nodes/${nodeID}/jobs/`;
    api.fetch(this, {
      nodeDetails: detailsEndpoint,
      nodeStatus: `/api/0/nodes/${nodeID}/status/`,
      nodeJobs: jobsEndpoint,
    })
  },
Example #11
0
  componentDidMount: function() {
    _.each([['testList', TEST_LIST], ['targetList', TARGET_LIST]], tabs => {
      var [stateKey, tabName] = tabs;
      var params = {};
      if (this.initialTab === tabName) {
        var params = InteractiveData.getParamsFromWindowUrl();
      }
      this.state[stateKey].initialize(params);
    });

    api.fetch(this, {
      buildInfo: `/api/0/builds/${this.props.buildID}`,
      failedTests: `/api/0/builds/${this.props.buildID}/tests/failures`
    });
  },
Example #12
0
  componentDidMount: function() {
    // get richer information about the build
    api.fetch(this, {
      buildDetails: `/api/0/builds/${this.props.build.id}`,
      buildCoverage: `/api/0/builds/${this.props.build.id}/stats/coverage?diff=1`,
      buildMessages: `/api/0/builds/${this.props.build.id}/messages/?per_page=10`,
    });

    // get info about the phases of each job
    var job_ids = _.map(this.props.build.jobs, j => j.id);

    var endpoint_map = {};
    _.each(job_ids, id => {
      endpoint_map[id] = `/api/0/jobs/${id}/phases?test_counts=1`;
    });

    // TODO: don't refetch every time (cache on parent)
    api.fetchMap(this, 'jobPhases', endpoint_map);
  },
Example #13
0
 componentDidMount: function() {
   api.fetch(this, {
     infraFailJobs: `/api/0/admin_dash/infra_fail_jobs/`
   })
 },
Example #14
0
 componentDidMount: function() {
   api.fetch(this, {
     taskTree: `/api/0/tasks/${this.props.taskID}/`,
   })
 },
Example #15
0
import * as utils from 'es6!utils/utils';

/**
 * Page with information on current active jobsteps.
 */
var JobstepSummaryPage = React.createClass({

  getInitialState() {
    return {
      jobstepAggregate: null,
    }
  },

  componentDidMount() {
    api.fetch(this, {
      jobstepAggregate: `/api/0/jobsteps/aggregate_by_status/`
    })
  },

  render() {
    if (!api.allLoaded([this.state.jobstepAggregate])) {
      return <APINotLoadedPage
        calls={[this.state.jobstepAggregate]}
      />;
    }

    utils.setPageTitle(`Active Jobsteps`);

    let data = this.state.jobstepAggregate.getReturnedData().jobsteps;
    return <ChangesPage>
      <SectionHeader>Active Jobsteps</SectionHeader>
Example #16
0
 componentDidMount: function() {
   api.fetch(this, {
     details: `/api/0/jobsteps/${this.props.jobstepID}/artifacts/`
   });
 },
Example #17
0
  getInitialTitle() {
    return 'Dashboard';
  },

  getInitialState() {
    var endpoints = this.getEndpoints();

    var state = {};
    _.each(_.keys(endpoints), key => {
      state[key] = null;
    });
    return state;
  },

  componentDidMount() {
    api.fetch(this, this.getEndpoints());

    this.updateInProgress = false;
    this.refreshTimer = window.setInterval(__ => {
      if (!this.isMounted()) {
        return;
      }
      this.liveUpdate();
    }, POLL_INTERVAL);
  },

  render() {
    if (this.updateInProgress) {
      if (api.allLoaded(_.values(this.state.liveUpdate))) {
        this.updateInProgress = false;
        utils.async(__ => {
Example #18
0
 componentDidMount: function() {
   api.fetch(this, {
     test: `/api/0/tests/${this.props.testID}/`
   });
 },
Example #19
0
 componentDidMount: function() {
   var slug = this.props.project.getReturnedData().slug;
   api.fetch(this.props.pageElem, {
     details: `/api/0/projects/${slug}/plans/`
   });
 },
Example #20
0
 componentDidMount: function() {
   api.fetch(this, {
     buildInfo: `/api/0/builds/${this.props.buildID}/`,
     test: `/api/0/tests/${this.props.testID}/`
   });
 },