Repository navigation
Non-breaking update to powerbi-models dependency to 0.9.0 which has support for validateDashboardLoad. Update embed load to call abstract validate method which is provided by concrete Report and Dashboard classes. - #49
Conversation
…upport for validateDashboardLoad. Update embed load to call abstract validate method which is provided by concrete Report and Dashboard classes.
| load(config: models.ILoadConfiguration): Promise<void>; | ||
| validateLoad(config: models.ILoadConfiguration): Promise<models.IError[]>; | ||
| load(config: models.IReportLoadConfiguration): Promise<void>; | ||
| validateLoad(config: models.IReportLoadConfiguration): Promise<models.IError[]>; |
There was a problem hiding this comment.
can this be IDashboardLoadConfiguration or the mock app is only for report?
There was a problem hiding this comment.
add in general what's the difference between validate(config) above and validateLoad(config) here?
There was a problem hiding this comment.
Well at the time I thinking it would be best to reduce the number of changes and was taking advantage of fact that Dashboard confirguration is also a valid Report configuration but I think you are right. It is probably better to explicitly support both to avoid confusion.
If this is straight forward to update I'll try adding it.
There was a problem hiding this comment.
They perform the similar function just in different places since powerbi-models is shared across code. The one in IApp is strictly for mocking during tests to simulate product code while the former actually part of SDK.
It would probably be clearer to rename validate to validateLoad so people know it's generic for validating loading, but less generic than validateReportLoad which is only for report loads.
Although the powerbi-models@0.8.0 had a better scalability and semantics the namespace is breaking change and would have caused breaking change for consumers of powerbi-client. We decided to revert and refactor to a different change which is more sublte and allows powerbi-client to consume it without being a breaking change since it's usage of validation methods is internal.
Also, note that we use
abstract validatemethod in theembedclass which enforces that it is called and is implemented as opposed to the previous implementation which extended theloadmethod and relied on developer calling correct code.Main feedback looking for is to actually re-confirm it's non-breaking even though there is breaking change in dependency since
validateLoadchanged tovalidateReportLoadetc.