/*
 * Copyright 2016 EPAM Systems
 *
 *
 * This file is part of EPAM Report Portal.
 * https://github.com/reportportal/commons-model
 *
 * Report Portal is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Report Portal is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Report Portal.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.epam.ta.reportportal.ws.model.widget;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;

import static com.epam.ta.reportportal.ws.model.ValidationConstraints.MAX_WIDGET_LIMIT;
import static com.epam.ta.reportportal.ws.model.ValidationConstraints.MIN_WIDGET_LIMIT;

/**
 * Part of widget domain object. Describe chart parameters
 *
 * @author Aliaksei_Makayed
 */
@JsonInclude(Include.NON_NULL)
public class ContentParameters {

	@NotNull
	@JsonProperty(value = "widgetType", required = true)
	@ApiModelProperty(required = true, allowableValues = "line_chart, column_chart, bar_chart, combine_pie_chart, trends_chart, "
			+ "not_passed_chart, cases_trend_chart, table, activity_panel, statistics_panel, unique_bug_table, bug_trend, "
			+ "launches_comparison_chart, launches_duration_chart, launches_table")
	private String widgetType;

	// fields for main data(for example: graphs at the chart)
	@JsonProperty(value = "contentFields", required = true)
	private List<String> contentFields;

	@NotNull
	@Min(value = MIN_WIDGET_LIMIT)
	@Max(value = MAX_WIDGET_LIMIT)
	@JsonProperty(value = "itemsCount", required = true)
	private int itemsCount;

	@JsonProperty(value = "widgetOptions")
	private Map<String, Object> widgetOptions;

	@NotNull
	public String getWidgetType() {
		return widgetType;
	}

	public void setWidgetType(@NotNull String widgetType) {
		this.widgetType = widgetType;
	}

	public List<String> getContentFields() {
		return contentFields;
	}

	public void setContentFields(List<String> contentFields) {
		this.contentFields = contentFields;
	}

	public int getItemsCount() {
		return itemsCount;
	}

	public void setItemsCount(int itemsCount) {
		this.itemsCount = itemsCount;
	}

	public Map<String, Object> getWidgetOptions() {
		return widgetOptions;
	}

	public void setWidgetOptions(Map<String, Object> widgetOptions) {
		this.widgetOptions = widgetOptions;
	}
}
@@ -1687,147 +1687,114 @@
  = %22
-line_c
+oldLineC
 hart, 
-column_chart, bar_chart, combine_pie_chart, trends_chart, %22%0A%09%09%09+ %22not_passed_chart,
+investigatedTrend, launchStatistics, statisticTrend,%22%0A%09%09%09+ %22
  cases
-_t
+T
 rend
-_chart, table, activity_panel, s
+, notPassed, overallS
 tati
@@ -1802,22 +1802,16 @@
 tics
-_panel
 , unique
 _bug
@@ -1810,14 +1810,12 @@
 ique
-_bug_t
+BugT
 able
@@ -1823,32 +1823,39 @@
  bug
-_t
+T
 rend, 
-%22%0A%09%09%09+ %22
+activityStream, 
 launches
 _com
@@ -1850,18 +1850,17 @@
 launches
-_c
+C
 ompariso
@@ -1860,23 +1860,30 @@
 mparison
-_c
+C
 hart,
+%22%0A%09%09%09+ %22
  launche
@@ -1887,19 +1887,17 @@
 ches
-_d
+D
 uration
-_c
+C
 hart
@@ -1910,14 +1910,139 @@
 ches
-_t
+T
 able
+, topTestCases, flakyTestCases, passingRateSummary, passingRatePerLaunch,%22%0A%09%09%09+ %22 productStatus, mostTimeConsuming, cumulative
 %22)%0A%09

Update widget type