Commit 3179564f authored by Dhiraj Bodicherla's avatar Dhiraj Bodicherla Committed by Filipa Lacerda

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
parent 9f923ff4
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
deploymentEndpoint: { deploymentsEndpoint: {
type: String, type: String,
required: false, required: false,
default: null, default: null,
...@@ -148,7 +148,7 @@ export default { ...@@ -148,7 +148,7 @@ export default {
this.setEndpoints({ this.setEndpoints({
metricsEndpoint: this.metricsEndpoint, metricsEndpoint: this.metricsEndpoint,
environmentsEndpoint: this.environmentsEndpoint, environmentsEndpoint: this.environmentsEndpoint,
deploymentsEndpoint: this.deploymentEndpoint, deploymentsEndpoint: this.deploymentsEndpoint,
dashboardEndpoint: this.dashboardEndpoint, dashboardEndpoint: this.dashboardEndpoint,
}); });
...@@ -280,9 +280,8 @@ export default { ...@@ -280,9 +280,8 @@ export default {
<gl-button <gl-button
v-gl-modal-directive="$options.addMetric.modalId" v-gl-modal-directive="$options.addMetric.modalId"
class="js-add-metric-button text-success border-success" class="js-add-metric-button text-success border-success"
>{{ $options.addMetric.title }}</gl-button
> >
{{ $options.addMetric.title }}
</gl-button>
<gl-modal <gl-modal
ref="addMetricModal" ref="addMetricModal"
:modal-id="$options.addMetric.modalId" :modal-id="$options.addMetric.modalId"
...@@ -296,16 +295,13 @@ export default { ...@@ -296,16 +295,13 @@ export default {
/> />
</form> </form>
<div slot="modal-footer"> <div slot="modal-footer">
<gl-button @click="hideAddMetricModal"> <gl-button @click="hideAddMetricModal">{{ __('Cancel') }}</gl-button>
{{ __('Cancel') }}
</gl-button>
<gl-button <gl-button
:disabled="!formIsValid" :disabled="!formIsValid"
variant="success" variant="success"
@click="submitCustomMetricsForm" @click="submitCustomMetricsForm"
>{{ __('Save changes') }}</gl-button
> >
{{ __('Save changes') }}
</gl-button>
</div> </div>
</gl-modal> </gl-modal>
</div> </div>
......
...@@ -164,10 +164,10 @@ export const fetchPrometheusMetrics = ({ state, commit, dispatch }, params) => { ...@@ -164,10 +164,10 @@ export const fetchPrometheusMetrics = ({ state, commit, dispatch }, params) => {
}; };
export const fetchDeploymentsData = ({ state, dispatch }) => { export const fetchDeploymentsData = ({ state, dispatch }) => {
if (!state.deploymentEndpoint) { if (!state.deploymentsEndpoint) {
return Promise.resolve([]); return Promise.resolve([]);
} }
return backOffRequest(() => axios.get(state.deploymentEndpoint)) return backOffRequest(() => axios.get(state.deploymentsEndpoint))
.then(resp => resp.data) .then(resp => resp.data)
.then(response => { .then(response => {
if (!response || !response.deployments) { if (!response || !response.deployments) {
......
...@@ -27,7 +27,7 @@ module EnvironmentsHelper ...@@ -27,7 +27,7 @@ module EnvironmentsHelper
"empty-unable-to-connect-svg-path" => image_path('illustrations/monitoring/unable_to_connect.svg'), "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), "metrics-endpoint" => additional_metrics_project_environment_path(project, environment, format: :json),
"dashboard-endpoint" => metrics_dashboard_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), "environments-endpoint": project_environments_path(project, format: :json),
"project-path" => project_path(project), "project-path" => project_path(project),
"tags-path" => project_tags_path(project), "tags-path" => project_tags_path(project),
......
---
title: Fix missing deployment rockets in monitor dashboard
merge_request: 29574
author:
type: fixed
...@@ -27,7 +27,7 @@ describe EnvironmentsHelper do ...@@ -27,7 +27,7 @@ describe EnvironmentsHelper do
'empty-no-data-svg-path' => match_asset_path('/assets/illustrations/monitoring/no_data.svg'), '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'), '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), '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), 'environments-endpoint': project_environments_path(project, format: :json),
'project-path' => project_path(project), 'project-path' => project_path(project),
'tags-path' => project_tags_path(project), 'tags-path' => project_tags_path(project),
......
...@@ -20,7 +20,7 @@ const propsData = { ...@@ -20,7 +20,7 @@ const propsData = {
tagsPath: '/path/to/tags', tagsPath: '/path/to/tags',
projectPath: '/path/to/project', projectPath: '/path/to/project',
metricsEndpoint: mockApiEndpoint, metricsEndpoint: mockApiEndpoint,
deploymentEndpoint: null, deploymentsEndpoint: null,
emptyGettingStartedSvgPath: '/path/to/getting-started.svg', emptyGettingStartedSvgPath: '/path/to/getting-started.svg',
emptyLoadingSvgPath: '/path/to/loading.svg', emptyLoadingSvgPath: '/path/to/loading.svg',
emptyNoDataSvgPath: '/path/to/no-data.svg', emptyNoDataSvgPath: '/path/to/no-data.svg',
......
...@@ -51,9 +51,9 @@ describe('Monitoring store actions', () => { ...@@ -51,9 +51,9 @@ describe('Monitoring store actions', () => {
it('commits RECEIVE_DEPLOYMENTS_DATA_SUCCESS on error', done => { it('commits RECEIVE_DEPLOYMENTS_DATA_SUCCESS on error', done => {
const dispatch = jasmine.createSpy(); const dispatch = jasmine.createSpy();
const { state } = store; const { state } = store;
state.deploymentEndpoint = '/success'; state.deploymentsEndpoint = '/success';
mock.onGet(state.deploymentEndpoint).reply(200, { mock.onGet(state.deploymentsEndpoint).reply(200, {
deployments: deploymentData, deployments: deploymentData,
}); });
...@@ -68,9 +68,9 @@ describe('Monitoring store actions', () => { ...@@ -68,9 +68,9 @@ describe('Monitoring store actions', () => {
it('commits RECEIVE_DEPLOYMENTS_DATA_FAILURE on error', done => { it('commits RECEIVE_DEPLOYMENTS_DATA_FAILURE on error', done => {
const dispatch = jasmine.createSpy(); const dispatch = jasmine.createSpy();
const { state } = store; const { state } = store;
state.deploymentEndpoint = '/error'; state.deploymentsEndpoint = '/error';
mock.onGet(state.deploymentEndpoint).reply(500); mock.onGet(state.deploymentsEndpoint).reply(500);
fetchDeploymentsData({ state, dispatch }) fetchDeploymentsData({ state, dispatch })
.then(() => { .then(() => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment