Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(source): fix mismatched return type #45

Merged
merged 1 commit into from
Jan 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/os/data/columndefinition.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
goog.provide('os.data.ColumnDefinition');
goog.require('os.IPersistable');
goog.require('os.parse.IColumnDefinition');



/**
* All the properties that can define a column definition for SlickGrid
* @param {string=} opt_name
* @param {string=} opt_field
* @implements {os.IPersistable}
* @implements {os.parse.IColumnDefinition}
* @constructor
*/
os.data.ColumnDefinition = function(opt_name, opt_field) {
Expand Down
4 changes: 2 additions & 2 deletions src/os/parse/baseparserconfig.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
goog.provide('os.parse.BaseParserConfig');
goog.require('os.parse.IColumnDefinition');
goog.require('os.data.ColumnDefinition');



Expand All @@ -10,7 +10,7 @@ goog.require('os.parse.IColumnDefinition');
*/
os.parse.BaseParserConfig = function() {
/**
* @type {Array.<os.parse.IColumnDefinition>}
* @type {Array.<os.data.ColumnDefinition>}
*/
this['columns'] = [];

Expand Down
9 changes: 0 additions & 9 deletions src/os/parse/icolumndefinition.js

This file was deleted.

14 changes: 13 additions & 1 deletion src/os/source/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ goog.provide('os.source');
goog.require('goog.Timer');
goog.require('ol.layer.Property');
goog.require('os');
goog.require('os.data.ColumnDefinition');
goog.require('os.data.RecordField');
goog.require('os.filter.IFilterable');
goog.require('os.implements');
Expand Down Expand Up @@ -89,7 +90,7 @@ os.source.getFilterColumns = function(source, opt_local) {
if (!columns) {
var filterable = os.ui.filter.FilterManager.getInstance().getFilterable(source.getId());
if (filterable) {
columns = filterable.getFilterColumns();
columns = filterable.getFilterColumns().map(os.source.mapFilterColumns);
}
}
}
Expand All @@ -98,6 +99,17 @@ os.source.getFilterColumns = function(source, opt_local) {
};


/**
* @param {!os.ogc.FeatureTypeColumn} c The feature type column to convert
* @return {!os.data.ColumnDefinition}
*/
os.source.mapFilterColumns = function(c) {
var col = new os.data.ColumnDefinition(c.name);
col['type'] = c.type;
return col;
};


/**
* @param {os.source.ISource} source
* @return {boolean}
Expand Down
18 changes: 9 additions & 9 deletions src/os/ui/column/columnmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,33 @@ os.ui.column.ColumnManagerCtrl = function($scope, $element) {
this.element_ = $element;

/**
* @type {Object.<string, os.parse.IColumnDefinition>}
* @type {Object.<string, os.data.ColumnDefinition>}
* @private
*/
this.sourceColumns_ = {};

/**
* @type {Array.<os.parse.IColumnDefinition>}
* @type {Array.<os.data.ColumnDefinition>}
*/
this['shownColumns'] = [];

/**
* @type {?Array.<os.parse.IColumnDefinition>}
* @type {?Array.<os.data.ColumnDefinition>}
*/
this['shownSelected'] = [];

/**
* @type {Array.<os.parse.IColumnDefinition>}
* @type {Array.<os.data.ColumnDefinition>}
*/
this['hiddenColumns'] = [];

/**
* @type {?Array.<os.parse.IColumnDefinition>}
* @type {?Array.<os.data.ColumnDefinition>}
*/
this['hiddenSelected'] = [];

/**
* @type {Array.<Object.<os.parse.IColumnDefinition, string>>}
* @type {Array.<{col: os.data.ColumnDefinition, list: string}>}
*/
this['searchResults'] = [];

Expand Down Expand Up @@ -342,7 +342,7 @@ os.ui.column.ColumnManagerCtrl.prototype.validate_ = function() {

/**
* Generate row content in slick table
* @param {os.parse.IColumnDefinition} column
* @param {os.data.ColumnDefinition} column
* @param {(os.data.ColumnDefinition|string)} col
* @return {string} The value
* @private
Expand All @@ -355,7 +355,7 @@ os.ui.column.ColumnManagerCtrl.prototype.getColumnValue_ = function(column, col)
/**
* @param {string} term
* @param {string} columnName
* @return {Array.<Object.<os.parse.IColumnDefinition, string>>}
* @return {Array.<{col: os.data.ColumnDefinition, list: string}>}
* @private
*/
os.ui.column.ColumnManagerCtrl.prototype.find_ = function(term, columnName) {
Expand Down Expand Up @@ -473,7 +473,7 @@ os.ui.column.ColumnManagerCtrl.prototype.handleKeyEvent_ = function(event) {

/**
* Launches a column manager window with the given columns
* @param {Array.<os.parse.IColumnDefinition>} columns
* @param {Array.<os.data.ColumnDefinition>} columns
* @param {Function} callback
*/
os.ui.column.launchColumnManager = function(columns, callback) {
Expand Down