Skip to content

Commit

Permalink
Avoid special treatment for pageProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlbyk committed Oct 16, 2017
1 parent d2c9570 commit d69275a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ class Griddle extends Component {
settingsComponentObjects,
selectors,
styleConfig: defaultStyleConfig,

pageProperties: {
currentPage: 1,
pageSize: 10
},

enableSettings: true,
textProperties: {
next: 'Next',
Expand Down
2 changes: 1 addition & 1 deletion src/module.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ interface GriddleExtensibility {

interface GriddleInitialState {
enableSettings?: boolean;
pageProperties?: GriddlePageProperties;
sortMethod?: (data: any[], column: string, sortAscending?: boolean) => number;
textProperties?: {
next?: string,
Expand All @@ -399,7 +400,6 @@ export interface GriddleProps<T> extends GriddlePlugin, GriddleInitialState {
plugins?: GriddlePlugin[];
data?: T[];
sortProperties?: GriddleSortKey[];
pageProperties?: GriddlePageProperties;
storeKey?: string;
}

Expand Down
1 change: 0 additions & 1 deletion src/utils/__tests__/initilizerTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { getRowProperties } from '../rowUtils';

const expectedDefaultInitialState = {
data: [],
pageProperties: {},
renderProperties: {
rowProperties: null,
columnProperties: {},
Expand Down
4 changes: 0 additions & 4 deletions src/utils/initializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = function initializer(defaults) {
settingsComponentObjects,
selectors,
styleConfig: defaultStyleConfig,
pageProperties: defaultPageProperties,
...defaultInitialState
} = defaults;

Expand All @@ -23,7 +22,6 @@ module.exports = function initializer(defaults) {
events: userEvents = {},
sortProperties = {},
styleConfig: userStyleConfig = {},
pageProperties: userPageProperties,
components: userComponents,
renderProperties: userRenderProperties = {},
settingsComponentObjects: userSettingsComponentObjects,
Expand Down Expand Up @@ -60,7 +58,6 @@ module.exports = function initializer(defaults) {
...plugins.map(p => p.styleConfig),
userStyleConfig);

const pageProperties = Object.assign({}, defaultPageProperties, userPageProperties);

// TODO: This should also look at the default and plugin initial state objects
const renderProperties = Object.assign({
Expand All @@ -75,7 +72,6 @@ module.exports = function initializer(defaults) {
userInitialState,
{
data,
pageProperties,
renderProperties,
sortProperties,
styleConfig,
Expand Down

0 comments on commit d69275a

Please sign in to comment.