summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDhiraj Bodicherla <dhiraj@gitlab.com>2019-06-14 07:59:42 +0000
committerFilipa Lacerda <filipa@gitlab.com>2019-06-14 07:59:42 +0000
commit3179564f74b04c269577427e7521bf7d373cb342 (patch)
treeeb94cf41488dc30f285ce01ff5dbc6902c6e38d9
parent9f923ff4137c46e53638d625155a2bd5429a444c (diff)
downloadgitlab-ce-3179564f74b04c269577427e7521bf7d373cb342.tar.gz
Fix missing deployment rockets in monitor dashboard
Fixed inconsistencies in variable names for deployment endpoints for monitoring dashboard which causes deployment rocket icons to disappear
-rw-r--r--app/assets/javascripts/monitoring/components/dashboard.vue14
-rw-r--r--app/assets/javascripts/monitoring/stores/actions.js4
-rw-r--r--app/helpers/environments_helper.rb2
-rw-r--r--changelogs/unreleased/dhiraj-fix-missing-deployment-rockets-in-monitoring-dashboard.yml5
-rw-r--r--spec/helpers/environments_helper_spec.rb2
-rw-r--r--spec/javascripts/monitoring/dashboard_spec.js2
-rw-r--r--spec/javascripts/monitoring/store/actions_spec.js8
7 files changed, 19 insertions, 18 deletions
diff --git a/app/assets/javascripts/monitoring/components/dashboard.vue b/app/assets/javascripts/monitoring/components/dashboard.vue
index d716fc211ca..0a652329dfe 100644
--- a/app/assets/javascripts/monitoring/components/dashboard.vue
+++ b/app/assets/javascripts/monitoring/components/dashboard.vue
@@ -70,7 +70,7 @@ export default {
type: String,
required: true,
},
- deploymentEndpoint: {
+ deploymentsEndpoint: {
type: String,
required: false,
default: null,
@@ -148,7 +148,7 @@ export default {
this.setEndpoints({
metricsEndpoint: this.metricsEndpoint,
environmentsEndpoint: this.environmentsEndpoint,
- deploymentsEndpoint: this.deploymentEndpoint,
+ deploymentsEndpoint: this.deploymentsEndpoint,
dashboardEndpoint: this.dashboardEndpoint,
});
@@ -280,9 +280,8 @@ export default {
<gl-button
v-gl-modal-directive="$options.addMetric.modalId"
class="js-add-metric-button text-success border-success"
+ >{{ $options.addMetric.title }}</gl-button
>
- {{ $options.addMetric.title }}
- </gl-button>
<gl-modal
ref="addMetricModal"
:modal-id="$options.addMetric.modalId"
@@ -296,16 +295,13 @@ export default {
/>
</form>
<div slot="modal-footer">
- <gl-button @click="hideAddMetricModal">
- {{ __('Cancel') }}
- </gl-button>
+ <gl-button @click="hideAddMetricModal">{{ __('Cancel') }}</gl-button>
<gl-button
:disabled="!formIsValid"
variant="success"
@click="submitCustomMetricsForm"
+ >{{ __('Save changes') }}</gl-button
>
- {{ __('Save changes') }}
- </gl-button>
</div>
</gl-modal>
</div>
diff --git a/app/assets/javascripts/monitoring/stores/actions.js b/app/assets/javascripts/monitoring/stores/actions.js
index 49ce722b838..f41e215cb5d 100644
--- a/app/assets/javascripts/monitoring/stores/actions.js
+++ b/app/assets/javascripts/monitoring/stores/actions.js
@@ -164,10 +164,10 @@ export const fetchPrometheusMetrics = ({ state, commit, dispatch }, params) => {
};
export const fetchDeploymentsData = ({ state, dispatch }) => {
- if (!state.deploymentEndpoint) {
+ if (!state.deploymentsEndpoint) {
return Promise.resolve([]);
}
- return backOffRequest(() => axios.get(state.deploymentEndpoint))
+ return backOffRequest(() => axios.get(state.deploymentsEndpoint))
.then(resp => resp.data)
.then(response => {
if (!response || !response.deployments) {
diff --git a/app/helpers/environments_helper.rb b/app/helpers/environments_helper.rb
index 855b243cc8a..0f118c235d8 100644
--- a/app/helpers/environments_helper.rb
+++ b/app/helpers/environments_helper.rb
@@ -27,7 +27,7 @@ module EnvironmentsHelper
"empty-unable-to-connect-svg-path" => image_path('illustrations/monitoring/unable_to_connect.svg'),
"metrics-endpoint" => additional_metrics_project_environment_path(project, environment, format: :json),
"dashboard-endpoint" => metrics_dashboard_project_environment_path(project, environment, format: :json),
- "deployment-endpoint" => project_environment_deployments_path(project, environment, format: :json),
+ "deployments-endpoint" => project_environment_deployments_path(project, environment, format: :json),
"environments-endpoint": project_environments_path(project, format: :json),
"project-path" => project_path(project),
"tags-path" => project_tags_path(project),
diff --git a/changelogs/unreleased/dhiraj-fix-missing-deployment-rockets-in-monitoring-dashboard.yml b/changelogs/unreleased/dhiraj-fix-missing-deployment-rockets-in-monitoring-dashboard.yml
new file mode 100644
index 00000000000..12a21e818b4
--- /dev/null
+++ b/changelogs/unreleased/dhiraj-fix-missing-deployment-rockets-in-monitoring-dashboard.yml
@@ -0,0 +1,5 @@
+---
+title: Fix missing deployment rockets in monitor dashboard
+merge_request: 29574
+author:
+type: fixed
diff --git a/spec/helpers/environments_helper_spec.rb b/spec/helpers/environments_helper_spec.rb
index 0c8a8d2f032..2b8bf9319fc 100644
--- a/spec/helpers/environments_helper_spec.rb
+++ b/spec/helpers/environments_helper_spec.rb
@@ -27,7 +27,7 @@ describe EnvironmentsHelper do
'empty-no-data-svg-path' => match_asset_path('/assets/illustrations/monitoring/no_data.svg'),
'empty-unable-to-connect-svg-path' => match_asset_path('/assets/illustrations/monitoring/unable_to_connect.svg'),
'metrics-endpoint' => additional_metrics_project_environment_path(project, environment, format: :json),
- 'deployment-endpoint' => project_environment_deployments_path(project, environment, format: :json),
+ 'deployments-endpoint' => project_environment_deployments_path(project, environment, format: :json),
'environments-endpoint': project_environments_path(project, format: :json),
'project-path' => project_path(project),
'tags-path' => project_tags_path(project),
diff --git a/spec/javascripts/monitoring/dashboard_spec.js b/spec/javascripts/monitoring/dashboard_spec.js
index f1d578648b8..f4166987aed 100644
--- a/spec/javascripts/monitoring/dashboard_spec.js
+++ b/spec/javascripts/monitoring/dashboard_spec.js
@@ -20,7 +20,7 @@ const propsData = {
tagsPath: '/path/to/tags',
projectPath: '/path/to/project',
metricsEndpoint: mockApiEndpoint,
- deploymentEndpoint: null,
+ deploymentsEndpoint: null,
emptyGettingStartedSvgPath: '/path/to/getting-started.svg',
emptyLoadingSvgPath: '/path/to/loading.svg',
emptyNoDataSvgPath: '/path/to/no-data.svg',
diff --git a/spec/javascripts/monitoring/store/actions_spec.js b/spec/javascripts/monitoring/store/actions_spec.js
index 8c02e21eda2..083a01c4d74 100644
--- a/spec/javascripts/monitoring/store/actions_spec.js
+++ b/spec/javascripts/monitoring/store/actions_spec.js
@@ -51,9 +51,9 @@ describe('Monitoring store actions', () => {
it('commits RECEIVE_DEPLOYMENTS_DATA_SUCCESS on error', done => {
const dispatch = jasmine.createSpy();
const { state } = store;
- state.deploymentEndpoint = '/success';
+ state.deploymentsEndpoint = '/success';
- mock.onGet(state.deploymentEndpoint).reply(200, {
+ mock.onGet(state.deploymentsEndpoint).reply(200, {
deployments: deploymentData,
});
@@ -68,9 +68,9 @@ describe('Monitoring store actions', () => {
it('commits RECEIVE_DEPLOYMENTS_DATA_FAILURE on error', done => {
const dispatch = jasmine.createSpy();
const { state } = store;
- state.deploymentEndpoint = '/error';
+ state.deploymentsEndpoint = '/error';
- mock.onGet(state.deploymentEndpoint).reply(500);
+ mock.onGet(state.deploymentsEndpoint).reply(500);
fetchDeploymentsData({ state, dispatch })
.then(() => {