Commit 328780bd authored by kushalpandya's avatar kushalpandya

Fix conflicts for CE to EE merge

parent bb10d783
/* global Flash */
<<<<<<< HEAD
import { statusClassToSvgMap } from '../../vue_shared/pipeline_svg_icons';
export default {
props: {
stage: {
type: Object,
required: true,
},
},
=======
import { borderlessStatusIconEntityMap } from '../../vue_shared/ci_status_icons';
export default {
>>>>>>> upstream/master
data() {
return {
builds: '',
......@@ -22,8 +9,6 @@ export default {
};
},
<<<<<<< HEAD
=======
props: {
stage: {
type: Object,
......@@ -31,7 +16,6 @@ export default {
},
},
>>>>>>> upstream/master
updated() {
if (this.builds) {
this.stopDropdownClickPropagation();
......@@ -47,17 +31,7 @@ export default {
return this.$http.get(this.stage.dropdown_path)
.then((response) => {
this.builds = JSON.parse(response.body).html;
<<<<<<< HEAD
})
.catch(() => {
// If dropdown is opened we'll close it.
if (this.$el.classList.contains('open')) {
$(this.$refs.dropdown).dropdown('toggle');
}
=======
}, () => {
>>>>>>> upstream/master
const flash = new Flash('Something went wrong on our end.');
return flash;
});
......@@ -72,16 +46,9 @@ export default {
* target the click event of this component.
*/
stopDropdownClickPropagation() {
<<<<<<< HEAD
$(this.$el.querySelectorAll('.js-builds-dropdown-list a.mini-pipeline-graph-dropdown-item'))
.on('click', (e) => {
e.stopPropagation();
});
=======
$(this.$el.querySelectorAll('.js-builds-dropdown-list a.mini-pipeline-graph-dropdown-item')).on('click', (e) => {
e.stopPropagation();
});
>>>>>>> upstream/master
},
},
computed: {
......@@ -102,11 +69,7 @@ export default {
return `mini-pipeline-graph-dropdown-toggle has-tooltip js-builds-dropdown-button ci-status-icon-${this.stage.status.group}`;
},
svgHTML() {
<<<<<<< HEAD
return statusClassToSvgMap[this.stage.status.icon];
=======
return borderlessStatusIconEntityMap[this.stage.status.icon];
>>>>>>> upstream/master
},
},
watch: {
......@@ -123,24 +86,6 @@ export default {
data-placement="top"
data-toggle="dropdown"
type="button"
<<<<<<< HEAD
:aria-label="stage.title"
ref="dropdown">
<span
v-html="svgHTML"
aria-hidden="true">
</span>
<i
class="fa fa-caret-down"
aria-hidden="true" />
</button>
<ul
ref="dropdown-content"
class="dropdown-menu mini-pipeline-graph-dropdown-menu js-builds-dropdown-container">
<div
class="arrow-up"
aria-hidden="true"></div>
=======
ref="button"
:aria-label="stage.title">
<span v-html="svgHTML" aria-hidden="true"></span>
......@@ -148,7 +93,6 @@ export default {
</button>
<ul class="dropdown-menu mini-pipeline-graph-dropdown-menu js-builds-dropdown-container">
<div class="arrow-up" aria-hidden="true"></div>
>>>>>>> upstream/master
<div
:class="dropdownClass"
class="js-builds-dropdown-list scrollable-menu"
......
......@@ -14,11 +14,7 @@
*/
/* global Flash */
<<<<<<< HEAD
import { statusClassToSvgMap } from '../../vue_shared/pipeline_svg_icons';
=======
import { borderlessStatusIconEntityMap } from '../../vue_shared/ci_status_icons';
>>>>>>> upstream/master
export default {
props: {
......@@ -117,11 +113,7 @@ export default {
},
svgIcon() {
<<<<<<< HEAD
return statusClassToSvgMap[this.stage.status.icon];
=======
return borderlessStatusIconEntityMap[this.stage.status.icon];
>>>>>>> upstream/master
},
},
};
......
......@@ -108,11 +108,6 @@ export default {
</div>
<mr-widget-memory-usage
v-if="deployment.metrics_url"
<<<<<<< HEAD
:mr="mr"
:service="service"
=======
>>>>>>> upstream/master
:metricsUrl="deployment.metrics_url"
/>
</div>
......
......@@ -5,11 +5,6 @@ import MRWidgetService from '../services/mr_widget_service';
export default {
name: 'MemoryUsage',
props: {
<<<<<<< HEAD
mr: { type: Object, required: true },
service: { type: Object, required: true },
=======
>>>>>>> upstream/master
metricsUrl: { type: String, required: true },
},
data() {
......@@ -17,10 +12,7 @@ export default {
// memoryFrom: 0,
// memoryTo: 0,
memoryMetrics: [],
<<<<<<< HEAD
=======
deploymentTime: 0,
>>>>>>> upstream/master
hasMetrics: false,
loadFailed: false,
loadingMetrics: true,
......@@ -30,10 +22,6 @@ export default {
components: {
'mr-memory-graph': MemoryGraph,
},
<<<<<<< HEAD
methods: {
computeGraphData(metrics) {
=======
computed: {
shouldShowLoading() {
return this.loadingMetrics && !this.hasMetrics && !this.loadFailed;
......@@ -50,7 +38,6 @@ export default {
},
methods: {
computeGraphData(metrics, deploymentTime) {
>>>>>>> upstream/master
this.loadingMetrics = false;
const { memory_values } = metrics;
// if (memory_previous.length > 0) {
......@@ -64,50 +51,6 @@ export default {
if (memory_values.length > 0) {
this.hasMetrics = true;
this.memoryMetrics = memory_values[0].values;
<<<<<<< HEAD
}
},
},
mounted() {
this.$props.loadingMetrics = true;
gl.utils.backOff((next, stop) => {
MRWidgetService.fetchMetrics(this.$props.metricsUrl)
.then((res) => {
if (res.status === statusCodes.NO_CONTENT) {
this.backOffRequestCounter = this.backOffRequestCounter += 1;
if (this.backOffRequestCounter < 3) {
next();
} else {
stop(res);
}
} else {
stop(res);
}
})
.catch(stop);
})
.then((res) => {
if (res.status === statusCodes.NO_CONTENT) {
return res;
}
return res.json();
})
.then((res) => {
this.computeGraphData(res.metrics);
return res;
})
.catch(() => {
this.$props.loadFailed = true;
});
},
template: `
<div class="mr-info-list mr-memory-usage">
<div class="legend"></div>
<p
v-if="loadingMetrics"
class="usage-info usage-info-loading">
=======
this.deploymentTime = deploymentTime;
}
},
......@@ -152,31 +95,11 @@ export default {
<p
v-if="shouldShowLoading"
class="usage-info js-usage-info usage-info-loading">
>>>>>>> upstream/master
<i
class="fa fa-spinner fa-spin usage-info-load-spinner"
aria-hidden="true" />Loading deployment statistics.
</p>
<p
<<<<<<< HEAD
v-if="!hasMetrics && !loadingMetrics"
class="usage-info usage-info-loading">
Deployment statistics are not available currently.
</p>
<p
v-if="hasMetrics"
class="usage-info">
Deployment memory usage:
</p>
<p
v-if="loadFailed"
class="usage-info">
Failed to load deployment statistics.
</p>
<mr-memory-graph
v-if="hasMetrics"
:metrics="memoryMetrics"
=======
v-if="shouldShowMemoryGraph"
class="usage-info js-usage-info">
Deployment memory usage:
......@@ -195,7 +118,6 @@ export default {
v-if="shouldShowMemoryGraph"
:metrics="memoryMetrics"
:deploymentTime="deploymentTime"
>>>>>>> upstream/master
height="25"
width="100" />
</div>
......
......@@ -2,10 +2,7 @@ export default {
name: 'MemoryGraph',
props: {
metrics: { type: Array, required: true },
<<<<<<< HEAD
=======
deploymentTime: { type: Number, required: true },
>>>>>>> upstream/master
width: { type: String, required: true },
height: { type: String, required: true },
},
......@@ -13,29 +10,6 @@ export default {
return {
pathD: '',
pathViewBox: '',
<<<<<<< HEAD
// dotX: '',
// dotY: '',
};
},
mounted() {
const renderData = this.$props.metrics.map(v => v[1]);
const maxMemory = Math.max.apply(null, renderData);
const minMemory = Math.min.apply(null, renderData);
const diff = maxMemory - minMemory;
// const cx = 0;
// const cy = 0;
const lineWidth = renderData.length;
const linePath = renderData.map((y, x) => `${x} ${maxMemory - y}`);
this.pathD = `M ${linePath}`;
this.pathViewBox = `0 0 ${lineWidth} ${diff}`;
},
template: `
<div class="memory-graph-container">
<svg :width="width" :height="height" xmlns="http://www.w3.org/2000/svg">
<path :d="pathD" :viewBox="pathViewBox" />
<!--<circle r="0.8" :cx="dotX" :cy="dotY" tranform="translate(0 -1)" /> -->
=======
dotX: '',
dotY: '',
};
......@@ -135,7 +109,6 @@ export default {
<svg class="has-tooltip" :title="getFormattedMedian" :width="width" :height="height" xmlns="http://www.w3.org/2000/svg">
<path :d="pathD" :viewBox="pathViewBox" />
<circle r="1.5" :cx="dotX" :cy="dotY" tranform="translate(0 -1)" />
>>>>>>> upstream/master
</svg>
</div>
`,
......
.memory-graph-container {
svg {
background: $white-light;
<<<<<<< HEAD
=======
cursor: pointer;
&:hover {
box-shadow: 0 0 4px $gray-darkest inset;
}
>>>>>>> upstream/master
}
path {
fill: none;
stroke: $blue-500;
<<<<<<< HEAD
stroke-width: 1px;
=======
stroke-width: 2px;
>>>>>>> upstream/master
}
circle {
stroke: $blue-700;
fill: $blue-700;
<<<<<<< HEAD
=======
stroke-width: 4px;
>>>>>>> upstream/master
}
}
......@@ -176,12 +176,7 @@
}
&.mr-memory-usage {
<<<<<<< HEAD
margin-top: 10px;
margin-bottom: 10px;
=======
margin: 5px 0 10px 25px;
>>>>>>> upstream/master
}
}
......@@ -504,32 +499,9 @@
background: $border-color;
position: absolute;
top: -5px;
<<<<<<< HEAD
}
}
.mr-info-list.mr-memory-usage {
.legend {
height: 75%;
=======
>>>>>>> upstream/master
}
}
<<<<<<< HEAD
p {
float: left;
padding-left: 20px;
&::before {
top: 13px;
}
}
.memory-graph-container {
float: left;
margin-left: 5px;
=======
.mr-info-list.mr-memory-usage {
.legend {
height: 65%;
......@@ -547,7 +519,6 @@
&::before {
top: 13px;
}
>>>>>>> upstream/master
}
.memory-graph-container {
......@@ -757,7 +728,6 @@
}
}
<<<<<<< HEAD
#merge-request-widget-app .loading {
padding-top: 5px;
border-top: 1px solid $well-inner-border;
......@@ -851,15 +821,6 @@
}
}
.mr-memory-usage {
p.usage-info-loading {
margin-bottom: 6px;
.usage-info-load-spinner {
margin-right: 10px;
font-size: 16px;
}
=======
.mr-memory-usage {
p.usage-info-loading,
p.usage-info-unavailable,
......@@ -870,7 +831,6 @@
p.usage-info-loading .usage-info-load-spinner {
margin-right: 10px;
font-size: 16px;
>>>>>>> upstream/master
}
@media (max-width: $screen-md-min) {
......
......@@ -9,10 +9,7 @@ const deploymentMockData = [
name: 'review/diplo',
url: '/root/acets-review-apps/environments/15',
stop_url: '/root/acets-review-apps/environments/15/stop',
<<<<<<< HEAD
=======
metrics_url: '/root/acets-review-apps/environments/15/deployments/1/metrics',
>>>>>>> upstream/master
external_url: 'http://diplo.',
external_url_formatted: 'diplo.',
deployed_at: '2017-03-22T22:44:42.258Z',
......@@ -160,10 +157,7 @@ describe('MRWidgetDeployment', () => {
expect(el.querySelector('.js-deploy-url').getAttribute('href')).toEqual(deployment.external_url);
expect(el.querySelector('.js-deploy-url').innerText).toContain(deployment.external_url_formatted);
expect(el.querySelector('.js-deploy-time').innerText).toContain(vm.formatDate(deployment.deployed_at));
<<<<<<< HEAD
=======
expect(el.querySelector('.js-mr-memory-usage')).toBeDefined();
>>>>>>> upstream/master
expect(el.querySelector('button')).toBeDefined();
});
......@@ -173,10 +167,7 @@ describe('MRWidgetDeployment', () => {
Vue.nextTick(() => {
expect(el.querySelectorAll('.ci-widget').length).toEqual(3);
<<<<<<< HEAD
=======
expect(el.querySelectorAll('.js-mr-memory-usage').length).toEqual(3);
>>>>>>> upstream/master
done();
});
});
......@@ -188,10 +179,7 @@ describe('MRWidgetDeployment', () => {
expect(el.querySelectorAll('.js-deploy-meta').length).toEqual(0);
expect(el.querySelectorAll('.js-deploy-url').length).toEqual(0);
expect(el.querySelectorAll('.js-deploy-time').length).toEqual(0);
<<<<<<< HEAD
=======
expect(el.querySelectorAll('.js-mr-memory-usage').length).toEqual(0);
>>>>>>> upstream/master
expect(el.querySelectorAll('.button').length).toEqual(0);
done();
});
......
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