Browse Source

remove collectionsStateMap from Page

pages-datasources
mohamedsalem401 1 year ago
parent
commit
608fdd9d3e
  1. 3
      packages/core/src/dom_components/model/ComponentWrapper.ts
  2. 2
      packages/core/src/pages/model/Page.ts
  3. 1
      packages/core/test/specs/dom_components/model/ComponentWrapper.ts

3
packages/core/src/dom_components/model/ComponentWrapper.ts

@ -103,10 +103,9 @@ export default class ComponentWrapper extends ComponentWithCollectionsState<Data
} }
onCollectionsStateMapUpdate(collectionsStateMap: DataCollectionStateMap) { onCollectionsStateMapUpdate(collectionsStateMap: DataCollectionStateMap) {
const { page, head } = this; const { head } = this;
super.onCollectionsStateMapUpdate(collectionsStateMap); super.onCollectionsStateMapUpdate(collectionsStateMap);
head.onCollectionsStateMapUpdate(collectionsStateMap); head.onCollectionsStateMapUpdate(collectionsStateMap);
if (page) page.collectionsStateMap = collectionsStateMap;
} }
syncComponentsCollectionState() { syncComponentsCollectionState() {

2
packages/core/src/pages/model/Page.ts

@ -39,8 +39,6 @@ export interface PagePropertiesDefined extends Pick<PageProperties, 'id' | 'name
} }
export default class Page extends Model<PagePropertiesDefined> { export default class Page extends Model<PagePropertiesDefined> {
collectionsStateMap: DataCollectionStateMap = {};
defaults() { defaults() {
return { return {
name: '', name: '',

1
packages/core/test/specs/dom_components/model/ComponentWrapper.ts

@ -97,7 +97,6 @@ describe('ComponentWrapper', () => {
const stateMap = wrapper.collectionsStateMap; const stateMap = wrapper.collectionsStateMap;
expect(stateMap).toHaveProperty(keyRootData); expect(stateMap).toHaveProperty(keyRootData);
expect(wrapper.page?.collectionsStateMap).toEqual(stateMap);
expect(wrapper.head.collectionsStateMap).toEqual(stateMap); expect(wrapper.head.collectionsStateMap).toEqual(stateMap);
}); });

Loading…
Cancel
Save