summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-05-29 13:09:19 +0100
committerPhil Hughes <me@iamphill.com>2018-05-29 13:09:19 +0100
commit66bf2de830c421c06bef571a87f8d3d48edcad76 (patch)
tree50235dec4a3595e76c5bebe43a64aecdfc20f93c /app/assets/javascripts
parentdd17a4840659467628d9390139e4430a05349175 (diff)
downloadgitlab-ce-66bf2de830c421c06bef571a87f8d3d48edcad76.tar.gz
added component specs
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/ide/stores/index.js23
-rw-r--r--app/assets/javascripts/ide/stores/modules/pipelines/getters.js4
-rw-r--r--app/assets/javascripts/ide/stores/modules/pipelines/mutations.js38
-rw-r--r--app/assets/javascripts/ide/stores/state.js1
4 files changed, 37 insertions, 29 deletions
diff --git a/app/assets/javascripts/ide/stores/index.js b/app/assets/javascripts/ide/stores/index.js
index 699710055e3..5d26cb8d626 100644
--- a/app/assets/javascripts/ide/stores/index.js
+++ b/app/assets/javascripts/ide/stores/index.js
@@ -9,13 +9,16 @@ import pipelines from './modules/pipelines';
Vue.use(Vuex);
-export default new Vuex.Store({
- state: state(),
- actions,
- mutations,
- getters,
- modules: {
- commit: commitModule,
- pipelines,
- },
-});
+export const createStore = () =>
+ new Vuex.Store({
+ state: state(),
+ actions,
+ mutations,
+ getters,
+ modules: {
+ commit: commitModule,
+ pipelines,
+ },
+ });
+
+export default createStore();
diff --git a/app/assets/javascripts/ide/stores/modules/pipelines/getters.js b/app/assets/javascripts/ide/stores/modules/pipelines/getters.js
index fea77b661b5..d6f10e0d71e 100644
--- a/app/assets/javascripts/ide/stores/modules/pipelines/getters.js
+++ b/app/assets/javascripts/ide/stores/modules/pipelines/getters.js
@@ -4,9 +4,9 @@ export const pipelineFailed = state =>
state.latestPipeline && state.latestPipeline.details.status.text === 'failed';
export const failedStages = state =>
- state.stages.filter(stage => stage.status.text === 'failed').map(stage => ({
+ state.stages.filter(stage => stage.status.text.toLowerCase() === 'failed').map(stage => ({
...stage,
- jobs: stage.jobs.filter(job => job.status.text === 'failed'),
+ jobs: stage.jobs.filter(job => job.status.text.toLowerCase() === 'failed'),
}));
export const failedJobsCount = state =>
diff --git a/app/assets/javascripts/ide/stores/modules/pipelines/mutations.js b/app/assets/javascripts/ide/stores/modules/pipelines/mutations.js
index 419be989901..39552c548ea 100644
--- a/app/assets/javascripts/ide/stores/modules/pipelines/mutations.js
+++ b/app/assets/javascripts/ide/stores/modules/pipelines/mutations.js
@@ -38,16 +38,18 @@ export default {
}
},
[types.REQUEST_JOBS](state, id) {
- state.stages = state.stages.map(stage => ({
- ...stage,
- isLoading: id === stage.id ? true : stage.isLoading,
- }));
+ state.stages = state.stages.map(stage =>
+ Object.assign(stage, {
+ isLoading: id === stage.id ? true : stage.isLoading,
+ }),
+ );
},
[types.RECEIVE_JOBS_ERROR](state, id) {
- state.stages = state.stages.map(stage => ({
- ...stage,
- isLoading: id === stage.id ? true : stage.isLoading,
- }));
+ state.stages = state.stages.map(stage =>
+ Object.assign(stage, {
+ isLoading: id === stage.id ? true : stage.isLoading,
+ }),
+ );
},
[types.RECEIVE_JOBS_SUCCESS](state, { id, data }) {
const normalizeData = job => ({
@@ -57,16 +59,18 @@ export default {
path: job.build_path,
});
- state.stages = state.stages.map(stage => ({
- ...stage,
- isLoading: id === stage.id ? false : stage.isLoading,
- jobs: id === stage.id ? data.latest_statuses.map(normalizeData) : stage.jobs,
- }));
+ state.stages = state.stages.map(stage =>
+ Object.assign(stage, {
+ isLoading: id === stage.id ? false : stage.isLoading,
+ jobs: id === stage.id ? data.latest_statuses.map(normalizeData) : stage.jobs,
+ }),
+ );
},
[types.TOGGLE_STAGE_COLLAPSE](state, id) {
- state.stages = state.stages.map(stage => ({
- ...stage,
- isCollapsed: stage.id === id ? !stage.isCollapsed : stage.isCollapsed,
- }));
+ state.stages = state.stages.map(stage =>
+ Object.assign(stage, {
+ isCollapsed: stage.id === id ? !stage.isCollapsed : stage.isCollapsed,
+ }),
+ );
},
};
diff --git a/app/assets/javascripts/ide/stores/state.js b/app/assets/javascripts/ide/stores/state.js
index ef8d678dd43..4aac4696075 100644
--- a/app/assets/javascripts/ide/stores/state.js
+++ b/app/assets/javascripts/ide/stores/state.js
@@ -24,4 +24,5 @@ export default () => ({
unusedSeal: true,
fileFindVisible: false,
rightPane: null,
+ links: {},
});