Skip to content

Instantly share code, notes, and snippets.

var ThriftApi = require('../ThriftApi');
var model = require('./model');
exports.entityMap = ThriftApi.createEntityMapGetter(model);
exports.byId = ThriftApi.createByIdGetter(model);
exports.jobList = [
exports.entityMap,
['thriftApiCache', 'jobTemplate'],
module.exports = function(model) {
const entity = model.entity;
let apiActions = {};
// This method can be used in situations where a model's data is fetched via
// a separate request, and we just want to process the resulting data
apiActions.receiveAll = function(result) {
Flux.dispatch(actionTypes.API_FETCH_SUCCESS, {
model: model,
result: result,
/**
* @param {Object?} params
* @return {Promise}
*/
exports.fetchAll = function(params) {
if (params && params.teamId) {
return Thrift.enhanced.Job.indexForTeam(params).then(jobs => {
processForeignKeys(jobs);
return jobs;
});
/**
* @param {Object?} params
* @return {Promise}
*/
exports.fetchAll = function(params) {
return Thrift.enhanced.JobRole.index(params);
};
import classnames from 'classnames';
import React from 'react';
import {Link} from 'react-router';
import Flux from 'modules/flux';
import Job from 'modules/Job';
import WebEx from 'WebEx/modules/WebEx';
import './WebExJobList.scss';
/** Base Job object */
struct Job {
1: string id,
/** Name of the job */
2: string title,
/** Top level step group */
3: step.BaseStep stepGroup,
4: team.Team team,
/** Template from which this Job was created */
5: string jobTemplateId,
import _ from 'lodash';
import AltContainer from 'alt/AltContainer';
import classnames from 'classnames';
import React from 'react';
import {Link} from 'react-router';
import BaseComponent from 'components/BaseComponent';
import alt from 'modules/Thrift/alt-inst';
import './WebExJobList.scss';
function reconnect() {
const webSocketProvider = new WebSocketProvider();
const status = flux.evaluate(['signaling']);
if (status.get('readyState') === READY_STATE_OPEN) {
webSocketProvider.stopTimer(RECONNECT_TIMER_NAME);
checkConnection();
} else {
webSocketProvider.startTimer(RECONNECT_TIMER_NAME, ONE_MINUTE, reconnect);
// If all goes well:
// 1. The connect action triggers an onopen event (immediately)
// 2. The onOpenHandler sends an identification message (immediately)
// 3. The server returns a ping (immediately)
//
// If the connect action returns an immediate error, CONNECT_ERROR fires.
//
// In some cases, however, no open or close event is ever received from the
// server, so we need to fire a checkConnection event shortly after
// connecting.
import MessageActions from './MessageActions';
import { Map } from 'immutable';
let providerInstance = null;
let timers = Map({});
// hardReset is a boolean
export default class WebSocketProvider {
constructor(host, token, hardReset) {
if(!providerInstance || hardReset) {