Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mutations.js « store « jobs « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2a451ef0cd1d46bc0ab26fa8fdc557f6899b7606 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/* eslint-disable no-param-reassign */

import * as types from './mutation_types';

export default {
  [types.REQUEST_STATUS_FAVICON](state) {
    state.fetchingStatusFavicon = true;
  },
  [types.RECEIVE_STATUS_FAVICON_SUCCESS](state) {
    state.fetchingStatusFavicon = false;
  },
  [types.RECEIVE_STATUS_FAVICON_ERROR](state) {
    state.fetchingStatusFavicon = false;
  },

  [types.RECEIVE_TRACE_SUCCESS](state, log) {
    if (log.state) {
      state.traceState = log.state;
    }

    if (log.append) {
      state.trace += log.html;
      state.traceSize += log.size;
    } else {
      state.trace = log.html;
      state.traceSize = log.size;
    }

    if (state.traceSize < log.total) {
      state.isTraceSizeVisible = true;
    } else {
      state.isTraceSizeVisible = false;
    }

    state.isTraceComplete = log.complete;
    state.hasTraceError = false;
  },
  [types.STOP_POLLING_TRACE](state) {
    state.isTraceComplete = true;
  },
  // todo_fl: check this.
  [types.RECEIVE_TRACE_ERROR](state) {
    state.isLoadingTrace = false;
    state.isTraceComplete = true;
    state.hasTraceError = true;
  },

  [types.REQUEST_JOB](state) {
    state.isLoading = true;
  },
  [types.RECEIVE_JOB_SUCCESS](state, job) {
    state.isLoading = false;
    state.hasError = false;
    state.job = job;
  },
  [types.RECEIVE_JOB_ERROR](state) {
    state.isLoading = false;
    state.hasError = true;
    state.job = {};
  },

  [types.SCROLL_TO_TOP](state) {
    state.isTraceScrolledToBottom = false;
    state.hasBeenScrolled = true;
  },
  [types.SCROLL_TO_BOTTOM](state) {
    state.isTraceScrolledToBottom = true;
    state.hasBeenScrolled = true;
  },

  [types.REQUEST_STAGES](state) {
    state.isLoadingStages = true;
  },
  [types.RECEIVE_STAGES_SUCCESS](state, stages) {
    state.isLoadingStages = false;
    state.stages = stages;
  },
  [types.RECEIVE_STAGES_ERROR](state) {
    state.isLoadingStages = false;
    state.stages = [];
  },

  [types.REQUEST_JOBS_FOR_STAGE](state) {
    state.isLoadingJobs = true;
  },
  [types.RECEIVE_JOBS_FOR_STAGE_SUCCESS](state, jobs) {
    state.isLoadingJobs = false;
    state.jobs = jobs;
  },
  [types.RECEIVE_JOBS_FOR_STAGE_ERROR](state) {
    state.isLoadingJobs = false;
    state.jobs = [];
  },
};