/**
 * @copyright Copyright 2014 Google Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @fileoverview Version info class, including update and verify scripts.
 *
 * v7   2015-Jan    Adds 'params' to the dashboard, allowing a list of
 *                  name/value pairs that can be overridden by URL params.
 *
 * @author joemu@google.com (Joe Allan Muharsky)
 */


goog.provide('p3rf.perfkit.explorer.components.dashboard.versions.DashboardSchemaV7');

goog.require('p3rf.perfkit.explorer.components.dashboard.versions.DashboardVersionUtil');


goog.scope(function() {
  var DashboardVersionUtil = p3rf.perfkit.explorer.components.dashboard.versions.DashboardVersionUtil;

  p3rf.perfkit.explorer.components.dashboard.versions.DashboardSchemaV7 = function() {
    this.version = '7';
  };
  var DashboardSchema = p3rf.perfkit.explorer.components.dashboard.versions.DashboardSchemaV7;

  DashboardSchema.prototype.verify = function(dashboard) {
    if (!goog.isDef(dashboard.params)) {
      return false;
    }
  };

  DashboardSchema.prototype.update = function(dashboard) {
    if (!goog.isDef(dashboard.params)) {
      dashboard.params = [];
    }
  };
});

@@ -1083,33 +1083,159 @@
 ');%0A
-%0A%0Agoog.scope(function() %7B
+goog.require('p3rf.perfkit.explorer.models.perfkit_simple_builder.QueryFilterModel');%0A%0A%0Agoog.scope(function() %7B%0A  var explorer = p3rf.perfkit.explorer;
 %0A  v
@@ -1260,29 +1260,16 @@
 nUtil = 
-p3rf.perfkit.
 explorer
@@ -1325,24 +1325,93 @@
 il;%0A
-%0A  p3rf.perfkit.
+  var QueryFilterModel = explorer.models.perfkit_simple_builder.QueryFilterModel;%0A%0A  
 expl
@@ -1531,29 +1531,24 @@
 chema = 
-p3rf.perfkit.
+(%0A      
 explorer
@@ -1595,16 +1595,17 @@
 SchemaV7
+)
 ;%0A%0A  Das
@@ -1729,148 +1729,980 @@
   %7D%0A
-  %7D;%0A%0A  DashboardSchema.prototype.update = function(dashboard) %7B%0A    if (!goog.isDef(dashboard.params)) %7B%0A      dashboard.params = %5B%5D;%0A    %7D
+%0A    return DashboardVersionUtil.VerifyDashboard(%0A        dashboard, null, function(widget) %7B%0A      // Add the filters object if it doesn't exist.%0A      // TODO: Replace this in the future with a PartialDashboard updater%0A      // that completes a miminal dashboard model.%0A      if (!goog.isDef(widget.datasource.config.filters)) %7B%0A        widget.datasource.config.filters = new QueryFilterModel();%0A      %7D%0A%0A      return true;%0A    %7D);%0A  %7D;%0A%0A  DashboardSchema.prototype.update = function(dashboard) %7B%0A    if (!goog.isDef(dashboard.params)) %7B%0A      dashboard.params = %5B%5D;%0A    %7D%0A%0A    DashboardVersionUtil.UpdateDashboard(dashboard, null, function(widget) %7B%0A      // Add the filters object if it doesn't exist.%0A      // TODO: Replace this in the future with a PartialDashboard updater%0A      // that completes a miminal dashboard model.%0A      if (!goog.isDef(widget.datasource.config.filters)) %7B%0A        widget.datasource.config.filters = new QueryFilterModel();%0A      %7D%0A    %7D);
 %0A  %7D

Add widgetconfig workaround to v7 updater.