Skip to content

Refactor filters from crud model to get/set model with objects representing each level instead of targets. - #24

Merged
Matt Mazzola (mattmazzola) merged 8 commits into
devfrom
dev-mattm-setfilters
Aug 1, 2016
Merged

Matt Mazzola (mattmazzola) merged 8 commits into
devfrom
dev-mattm-setfilters

Conversation

@mattmazzola

Copy link
Copy Markdown
Contributor

Added Page and Visual objects
Added IFilterable
Updated powerbi-models dependency
Updated tests existing tests and added new ones for Page and Visual related actions.

@msftclas Microsoft Contribution License Agreements (msftclas) added the documentation Improvements or additions to documentation label Jul 27, 2016
Comment thread .vscode/settings.json
// Place your settings in this file to overwrite default and user settings.
{
"editor.tabSize": 4,
"editor.insertSpaces": true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is unrelated but I noticed half of the files are using 2 spaces and others using 4. Going to reformat everything to 2 space after the code review is complete, but didn't want to do it now since it introduces lot of white-space change noise in the review.

Comment thread src/service.ts
private getTargetUrl(target?: models.IPageTarget | models.IVisualTarget): string {
let targetUrl;
if (event.name === 'pageChanged') {
value.page = new Page(embed, event.value.page.name);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the weird part about require event data to be instances of Pages classes instead normal page objects.

It feels awkward to have logic specific to different types of events instead of treating them uniformly.

@mattmazzola

Matt Mazzola (mattmazzola) commented Jul 28, 2016 •

Copy link
Copy Markdown
Contributor Author

I still have some more tests to add, but wanted to send it out early

Comment thread src/report.ts
}

export class Report extends embed.Embed implements IReport, IFilterable {
static allowedEvents = ["dataSelected", "filtersApplied", "pageChanged", "error"];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

what about loaded event?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yea, you had commented on this in previous review. The loaded event is for all embeds so it's in the generic embed class.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

OK, I forgot what was the answer there. Thanks for the reminder

@mattmazzola
Matt Mazzola (mattmazzola) deleted the dev-mattm-setfilters branch August 1, 2016 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants