export default (function (_ref) {
  var formatMessage = _ref.formatMessage,
      intlPrefix = _ref.intlPrefix,
      projectId = _ref.projectId,
      pipelineRecordId = _ref.pipelineRecordId,
      store = _ref.store,
      refresh = _ref.refresh;
  return {
    autoCreate: false,
    autoQuery: true,
    selection: false,
    paging: false,
    dataKey: null,
    transport: {
      read: {
        url: "/devops/v1/projects/".concat(projectId, "/cicd_pipelines_record/details?record_rel_id=").concat(pipelineRecordId),
        method: 'get'
      }
    },
    fields: [{
      name: 'pipelineName',
      type: 'string',
      label: formatMessage({
        id: "".concat(intlPrefix, ".name")
      })
    }, {
      name: 'appServiceName',
      type: 'string',
      label: formatMessage({
        id: "".concat(intlPrefix, ".appService")
      })
    }, {
      name: 'status',
      type: 'string',
      label: formatMessage({
        id: "".concat(intlPrefix, ".result")
      })
    }, {
      name: 'userDTO',
      type: 'object',
      label: formatMessage({
        id: "".concat(intlPrefix, ".trigger.user")
      })
    }, {
      name: 'createdDate',
      type: 'string',
      label: formatMessage({
        id: "".concat(intlPrefix, ".execute.date")
      })
    }, {
      name: 'durationSeconds',
      type: 'number',
      label: formatMessage({
        id: "".concat(intlPrefix, ".time")
      })
    }, {
      name: 'commit',
      type: 'object',
      label: formatMessage({
        id: 'commit'
      })
    }],
    events: {
      load: function load(_ref2) {
        var dataSet = _ref2.dataSet;
        var _store$getSelectedMen = store.getSelectedMenu,
            status = _store$getSelectedMen.status,
            devopsPipelineRecordRelId = _store$getSelectedMen.devopsPipelineRecordRelId;

        if (dataSet.current.get('gitlabPipelineId') === devopsPipelineRecordRelId && dataSet.current.get('status') !== status) {
          refresh();
        }
      }
    }
  };
});