-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add widget-report component and method to get data #1805
Add widget-report component and method to get data #1805
Conversation
This pull request is not mergeable. Please rebase and repush. |
a355ecb
to
3c9d22a
Compare
9a51552
to
2688ed7
Compare
@miq-bot add_label enhancement |
@miq-bot remove_label wip |
|
||
this.$onInit = function() { | ||
$http.get('/dashboard/widget_report_data/' + vm.id) | ||
.then(function(response) { vm.widgetReportModel.content = $sce.getTrustedHtml(response.data.content);}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.then(function(response) {
vm.widgetReportModel.content = $sce.getTrustedHtml(response.data.content);
})
But.. you're sure about getTrustedHtml
, right? (vs trustAsHtml
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far it wasn't problem. I like getTrustedHtml
safety but trustAsHtml
will work for "anything". What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, getTrustedHtml
is definitely safer, it doesn't seem to remove colors from reports.. let's keep it until someone complains :)
@@ -127,6 +127,12 @@ def start_url | |||
redirect_to start_url_for_user(nil) | |||
end | |||
|
|||
def widget_report_data | |||
widget = MiqWidget.find(params[:id]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rbac
8f168da
to
16e3979
Compare
This pull request is not mergeable. Please rebase and repush. |
getTrustedHTML returns value that is safe for HTML context or throws an exception
16e3979
to
2af02cd
Compare
def widget_report_data | ||
widget = find_record_with_rbac(MiqWidget, params[:id]) | ||
render :json => {:content => widget.contents_for_user(current_user).contents, | ||
:minimized => @sb[:dashboards][@sb[:active_db]][:minimized].include?(params[:id])} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad rebase?
Two methods begin, only one ends :)
2af02cd
to
9b29df6
Compare
@himdel Fixed :) |
Checked commits ZitaNemeckova/manageiq-ui-classic@b175711~...9b29df6 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
https://www.pivotaltracker.com/story/show/147760695
@miq-bot add_label wip, dashboards, fine/no
Cloud Intel -> Dashboard -> widget with report
Before/After: Behavior and graphics will be same.