Commit d031a3cd authored by Dhiraj Bodicherla's avatar Dhiraj Bodicherla

Update annotations graphql query props

The from and to annotation properties are updated
to starting_at and ending_at
parent 57bfac17
...@@ -45,19 +45,16 @@ export const annotationsYAxis = { ...@@ -45,19 +45,16 @@ export const annotationsYAxis = {
* Fetched list of annotations are parsed into a * Fetched list of annotations are parsed into a
* format the eCharts accepts to draw markLines * format the eCharts accepts to draw markLines
* *
* If Annotation is a single line, the `from` property * If Annotation is a single line, the `starting_at` property
* has a value and the `to` is null. Because annotations * has a value and the `ending_at` is null. Because annotations
* only supports lines the from value does not exist yet. * only supports lines the `ending_at` value does not exist yet.
* *
* *
* @param {Object} annotation object * @param {Object} annotation object
* @returns {Object} markLine object * @returns {Object} markLine object
*/ */
export const parseAnnotations = ({ export const parseAnnotations = ({ starting_at = '', color = colorValues.primaryColor }) => ({
from: annotationFrom = '', xAxis: starting_at,
color = colorValues.primaryColor,
}) => ({
xAxis: annotationFrom,
lineStyle: { lineStyle: {
color, color,
}, },
...@@ -105,7 +102,7 @@ export const generateAnnotationsSeries = ({ deployments = [], annotations = [] } ...@@ -105,7 +102,7 @@ export const generateAnnotationsSeries = ({ deployments = [], annotations = [] }
const annotationsData = annotations.map(annotation => { const annotationsData = annotations.map(annotation => {
return { return {
name: 'annotations', name: 'annotations',
value: [annotation.from, annotationsYAxisCoords.pos], value: [annotation.starting_at, annotationsYAxisCoords.pos],
// style options // style options
symbol: 'none', symbol: 'none',
// metadata that are accessible in `formatTooltipText` method // metadata that are accessible in `formatTooltipText` method
......
...@@ -4,8 +4,8 @@ query getAnnotations($projectPath: ID!) { ...@@ -4,8 +4,8 @@ query getAnnotations($projectPath: ID!) {
annotations: nodes { annotations: nodes {
id id
description description
from starting_at
to ending_at
panelId panelId
} }
} }
......
...@@ -213,23 +213,23 @@ export const deploymentData = [ ...@@ -213,23 +213,23 @@ export const deploymentData = [
export const annotationsData = [ export const annotationsData = [
{ {
id: 'gid://gitlab/Metrics::Dashboard::Annotation/1', id: 'gid://gitlab/Metrics::Dashboard::Annotation/1',
from: '2020-04-01T12:51:58.373Z', starting_at: '2020-04-01T12:51:58.373Z',
to: null, ending_at: null,
panelId: null, panelId: null,
description: 'This is a test annotation', description: 'This is a test annotation',
}, },
{ {
id: 'gid://gitlab/Metrics::Dashboard::Annotation/2', id: 'gid://gitlab/Metrics::Dashboard::Annotation/2',
description: 'test annotation 2', description: 'test annotation 2',
from: '2020-04-02T12:51:58.373Z', starting_at: '2020-04-02T12:51:58.373Z',
to: null, ending_at: null,
panelId: null, panelId: null,
}, },
{ {
id: 'gid://gitlab/Metrics::Dashboard::Annotation/3', id: 'gid://gitlab/Metrics::Dashboard::Annotation/3',
description: 'test annotation 3', description: 'test annotation 3',
from: '2020-04-04T12:51:58.373Z', starting_at: '2020-04-04T12:51:58.373Z',
to: null, ending_at: null,
panelId: null, panelId: null,
}, },
]; ];
......
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