@bfwk/elements-palette
Advanced tools
Comparing version 0.7.4 to 0.7.5
@@ -6,10 +6,13 @@ # Change Log | ||
## [0.7.4](https://github.com/salesforce/builder-framework/compare/v0.7.2...v0.7.4) (2021-08-05) | ||
## [0.7.5](https://github.com/salesforce/builder-framework/compare/v0.7.4...v0.7.5) (2021-08-06) | ||
**Note:** Version bump only for package @bfwk/elements-palette | ||
### Features | ||
* add palette change handler @W-9229726 ([#164](https://github.com/salesforce/builder-framework/issues/164)) ([91827fe](https://github.com/salesforce/builder-framework/commit/91827febded645c3d1fab1d2958bd68c71972e05)) | ||
## [0.6.7](https://git.soma.salesforce.com/BuilderFramework/builder-framework/compare/v0.6.6...v0.6.7) (2021-04-05) | ||
@@ -16,0 +19,0 @@ |
@@ -120,2 +120,3 @@ import { PartImpl, createReducerFromMutators, createMutatorMap } from '@bfwk/store'; | ||
this.instrumentation = new PaletteInstrumentation(instrumentationService); | ||
this.pubsub.subscribeToEvent(SECTIONS_CHANGE, this.handleSectionsChanged.bind(this)); | ||
} | ||
@@ -130,7 +131,6 @@ // TODO handle the situation where the fetch goes in multiple pages or over time | ||
}); | ||
this.dispatch(createAddSectionsAction(this.processPaletteFetch(items))); | ||
this.pubsub.publishEvent({ | ||
eventType: SECTIONS_CHANGE, | ||
payload: { | ||
sections: this.sections, | ||
sections: items, | ||
}, | ||
@@ -155,2 +155,18 @@ }); | ||
} | ||
handleSectionsChanged(event) { | ||
let sections = this.processPaletteFetch(event.payload.sections); | ||
let sectionNames = new Set(); | ||
this.sections.forEach(section => { | ||
sectionNames.add(section.sectionName); | ||
}); | ||
let newSections = []; | ||
sections.forEach((section) => { | ||
if (!sectionNames.has(section.sectionName)) { | ||
newSections.push(section); | ||
} | ||
}); | ||
if (newSections.length > 0) { | ||
this.dispatch(createAddSectionsAction(newSections)); | ||
} | ||
} | ||
processPaletteFetch(items) { | ||
@@ -157,0 +173,0 @@ return items.tabs.map(section => { |
@@ -19,2 +19,3 @@ import { PaletteService } from '@bfwk/data-service'; | ||
wireToSections(listener: (payload: WirePayload) => void): () => void; | ||
private handleSectionsChanged; | ||
private processPaletteFetch; | ||
@@ -21,0 +22,0 @@ private transformPaletteSection; |
{ | ||
"name": "@bfwk/elements-palette", | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"description": "LBF Elements Palette", | ||
@@ -31,8 +31,8 @@ "type": "module", | ||
"dependencies": { | ||
"@bfwk/data-service": "0.7.4", | ||
"@bfwk/error-handler": "0.7.4", | ||
"@bfwk/instrumentation": "0.7.4", | ||
"@bfwk/pub-sub": "0.7.4", | ||
"@bfwk/store": "0.7.4", | ||
"@bfwk/utils": "0.7.4" | ||
"@bfwk/data-service": "0.7.5", | ||
"@bfwk/error-handler": "0.7.5", | ||
"@bfwk/instrumentation": "0.7.5", | ||
"@bfwk/pub-sub": "0.7.5", | ||
"@bfwk/store": "0.7.5", | ||
"@bfwk/utils": "0.7.5" | ||
}, | ||
@@ -39,0 +39,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38186
355
+ Added@bfwk/command@0.7.5(transitive)
+ Added@bfwk/data-service@0.7.5(transitive)
+ Added@bfwk/error-handler@0.7.5(transitive)
+ Added@bfwk/instrumentation@0.7.5(transitive)
+ Added@bfwk/pub-sub@0.7.5(transitive)
+ Added@bfwk/store@0.7.5(transitive)
+ Added@bfwk/utils@0.7.5(transitive)
- Removed@bfwk/command@0.7.4(transitive)
- Removed@bfwk/data-service@0.7.4(transitive)
- Removed@bfwk/error-handler@0.7.4(transitive)
- Removed@bfwk/instrumentation@0.7.4(transitive)
- Removed@bfwk/pub-sub@0.7.4(transitive)
- Removed@bfwk/store@0.7.4(transitive)
- Removed@bfwk/utils@0.7.4(transitive)
Updated@bfwk/data-service@0.7.5
Updated@bfwk/error-handler@0.7.5
Updated@bfwk/instrumentation@0.7.5
Updated@bfwk/pub-sub@0.7.5
Updated@bfwk/store@0.7.5
Updated@bfwk/utils@0.7.5