Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Customizable Headers and Footers, fixes #11 #38

Merged
merged 9 commits into from
Jun 6, 2017

Conversation

pottedmeat
Copy link
Contributor

Type: feature

The following has been addressed in the PR:

  • There is a related issue
  • All code matches the style guide
  • Unit or Functional tests are included in the PR

Description:

  • Header => ColumnHeaders
  • HeaderCell => ColumnHeaderCell
  • Adds Header as a general-purpose wrapper, like footer
  • Adds headers/footers as grid properties to allow custom children
  • Provides an enum to indicate you want column headers in the header or footer area

@codecov
Copy link

codecov bot commented May 24, 2017

Codecov Report

Merging #38 into master will increase coverage by 0.13%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #38      +/-   ##
==========================================
+ Coverage   98.55%   98.69%   +0.13%     
==========================================
  Files          12       13       +1     
  Lines         277      306      +29     
  Branches       49       55       +6     
==========================================
+ Hits          273      302      +29     
  Partials        4        4
Impacted Files Coverage Δ
src/ColumnHeaderCell.ts 100% <100%> (ø)
src/GridRegistry.ts 96.77% <100%> (+0.22%) ⬆️
src/Row.ts 100% <100%> (ø) ⬆️
src/Grid.ts 97.43% <100%> (+0.56%) ⬆️
src/Header.ts 100% <100%> (ø) ⬆️
src/ColumnHeaders.ts 100% <100%> (ø)
src/Cell.ts 100% <100%> (ø) ⬆️
src/providers/ArrayDataProvider.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fb48e0...2afd0af. Read the comment docs.

import { v, w } from '@dojo/widget-core/d';
import { DNode } from '@dojo/widget-core/interfaces';
import { RegistryMixin, RegistryMixinProperties } from '@dojo/widget-core/mixins/Registry';
import { ThemeableMixin, theme, ThemeableProperties } from '@dojo/widget-core/mixins/Themeable';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theme should be first

src/Grid.ts Outdated
@@ -25,6 +27,8 @@ export const GridBase = ThemeableMixin(RegistryMixin(WidgetBase));
export interface GridProperties extends ThemeableProperties, HasColumns {
registry?: GridRegistry;
dataProvider: DataProviderBase;
footers?: Array<HeaderType | DNode>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally we use (HeaderType | DNode)[]

src/Grid.ts Outdated
onSortRequest
}),
theme
}, <DNode[]> headers.map((child) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems odd we need a cast here. Also this logic is quite hard to follow in line and is duplicated below. This should probably be broken into a function that is easier to grok and maintain.

@dylans dylans added this to the 2017.05 milestone May 27, 2017
@eheasley eheasley modified the milestones: 2017.05, 2017.06 Jun 6, 2017
@pottedmeat pottedmeat merged commit 1b53c5d into dojo:master Jun 6, 2017
@pottedmeat pottedmeat deleted the feature-headers-footers branch June 6, 2017 21:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants