summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-05-03 17:08:54 +0100
committerFilipa Lacerda <filipa@gitlab.com>2017-05-03 17:08:54 +0100
commita5989900c9c001eaee971969b89a708f132c6d7c (patch)
tree87e8da4e43981678b4c58f72ad5c8a1a668db4ea
parent2d6f1e9600ce43ab98d7bfc767e778f746e34914 (diff)
downloadgitlab-ce-a5989900c9c001eaee971969b89a708f132c6d7c.tar.gz
Remove service being provided as a prop on environments table
-rw-r--r--app/assets/javascripts/environments/components/environment.vue13
-rw-r--r--app/assets/javascripts/environments/folder/environments_folder_view.vue4
2 files changed, 6 insertions, 11 deletions
diff --git a/app/assets/javascripts/environments/components/environment.vue b/app/assets/javascripts/environments/components/environment.vue
index b11b02042df..556eb78d736 100644
--- a/app/assets/javascripts/environments/components/environment.vue
+++ b/app/assets/javascripts/environments/components/environment.vue
@@ -1,6 +1,4 @@
<script>
-
-/* eslint-disable no-new */
/* global Flash */
import EnvironmentsService from '../services/environments_service';
import EnvironmentTable from './environments_table.vue';
@@ -123,6 +121,7 @@ export default {
})
.catch(() => {
this.isLoading = false;
+ // eslint-disable-next-line no-new
new Flash('An error occurred while fetching the environments.');
});
},
@@ -138,19 +137,15 @@ export default {
})
.catch(() => {
this.isLoadingFolderContent = false;
+ // eslint-disable-next-line no-new
new Flash('An error occurred while fetching the environments.');
});
},
postAction(endpoint) {
this.service.postAction(endpoint)
- .then(() => {
- this.fetchEnvironments();
- })
- .catch(() => {
- // eslint-disable-next-line no-new
- new Flash('An error occured while making the request.');
- });
+ .then(() => this.fetchEnvironments())
+ .catch(() => new Flash('An error occured while making the request.'));
},
},
};
diff --git a/app/assets/javascripts/environments/folder/environments_folder_view.vue b/app/assets/javascripts/environments/folder/environments_folder_view.vue
index d27b2acfcdf..f4a0c390c91 100644
--- a/app/assets/javascripts/environments/folder/environments_folder_view.vue
+++ b/app/assets/javascripts/environments/folder/environments_folder_view.vue
@@ -1,5 +1,4 @@
<script>
-/* eslint-disable no-new */
/* global Flash */
import EnvironmentsService from '../services/environments_service';
import EnvironmentTable from '../components/environments_table.vue';
@@ -99,6 +98,7 @@ export default {
})
.catch(() => {
this.isLoading = false;
+ // eslint-disable-next-line no-new
new Flash('An error occurred while fetching the environments.', 'alert');
});
},
@@ -169,7 +169,7 @@ export default {
:environments="state.environments"
:can-create-deployment="canCreateDeploymentParsed"
:can-read-environment="canReadEnvironmentParsed"
- :service="service"/>
+ />
<table-pagination
v-if="state.paginationInformation && state.paginationInformation.totalPages > 1"