-
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
Timeprofile copy fix #3835
Timeprofile copy fix #3835
Conversation
Add timeProfileFormAction to specs Fix specs descriptions so they no longer lie Add spec for timeprofile_copy
c6c9533
to
cb132d5
Compare
@@ -224,4 +224,5 @@ | |||
|
|||
:javascript | |||
ManageIQ.angular.app.value('timeProfileFormId', '#{@timeprofile.id || "new"}'); | |||
ManageIQ.angular.app.value('timeProfileFormAction', '#{params[:action]}'); |
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.
Cannot be passed directly.
3fb5d49
to
39913cf
Compare
Checked commits ZitaNemeckova/manageiq-ui-classic@a1323d4~...39913cf with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 **
|
@@ -253,6 +254,7 @@ def timeprofile_new | |||
def timeprofile_edit | |||
assert_privileges("tp_edit") | |||
@timeprofile = TimeProfile.find(params[:id]) | |||
@timeprofile_action = "timeprofile_edit" |
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.
@ZitaNemeckova The code looks good and it works. I just haven't checked the specs. Anyway, I wonder why we need https://github.com/ManageIQ/manageiq-ui-classic/pull/3835/files#diff-679158917bc83d666b7fa919b44817ebR246
and https://github.com/ManageIQ/manageiq-ui-classic/pull/3835/files#diff-679158917bc83d666b7fa919b44817ebR257 if this is already set in params[;action]
- maybe we could use it instead of setting @timeprofile_action
.. but maybe not :D
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.
It's preventing Cross-Site Scripting (Hakiri is catching this kind of vulnerabilities). I cannot pass anything from params
directly to haml.
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.
Ah, of course! Forgot.. Thanks! 👍
@ZitaNemeckova Copying works well but I just found another thing: after I clicked on Copy selected Time Profile and made some changes but did not change the Description and clicked on Save button, this has happened: |
@hstastna I'm not sure about |
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1524352
Introduced in ManageIQ/manageiq#10524
How to reproduce:
My Settings -> Time Profiles -> select one time profile -> Configuration -> Copy
Before:
Form is empty. Nothing pre-filled.
After:
Form is pre-filled.
@miq-bot add_label wip, bug, angular dialogs, gaprindashvili/yes, fine/yes, euwe/yes