Skip to content

Commit

Permalink
fix: revert sizing plugin forColumns
Browse files Browse the repository at this point in the history
None of this logic was previously working, because the feature 'columnResizing'
that was added in commit: 7a09878 and being
used to lookup the plugin was incorrect.
Since we were always getting back the table.columns.values, we can revert this
unused logic.
  • Loading branch information
joelamb committed Oct 9, 2023
1 parent 01f5fd0 commit 54bb525
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions ember-headless-table/src/plugins/-private/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ function columnsFor<DataType = any>(

let visibility = findPlugin(table.plugins, 'columnVisibility');
let reordering = findPlugin(table.plugins, 'columnOrder');
let sizing = findPlugin(table.plugins, 'columnResizing');

// TODO: actually resolve the graph, rather than use the hardcoded feature names
// atm, this only "happens" to work based on expectations of
Expand All @@ -302,10 +301,6 @@ function columnsFor<DataType = any>(
table.plugins.some((plugin) => plugin instanceof (requester as Class<Plugin>))
);

if (sizing && sizing.constructor === requester) {
return table.columns.values();
}

if (visibility && visibility.constructor === requester) {
return table.columns.values();
}
Expand Down Expand Up @@ -341,15 +336,6 @@ function columnsFor<DataType = any>(
return visibility.columns;
}

if (sizing) {
assert(
`<#${sizing.name}> defined a 'columns' property, but did not return valid data.`,
sizing.columns && Array.isArray(sizing.columns)
);

return sizing.columns;
}

return table.columns.values();
}

Expand All @@ -375,15 +361,6 @@ function columnsFor<DataType = any>(
return visibility.columns;
}

if (sizing) {
assert(
`<#${sizing.name}> defined a 'columns' property, but did not return valid data.`,
sizing.columns && Array.isArray(sizing.columns)
);

return sizing.columns;
}

return table.columns.values();
}

Expand Down

0 comments on commit 54bb525

Please sign in to comment.