Re: Review Request 44724: AMBARI-12906: Alert notifications are created even if credential fields are left empty

2016-03-29 Thread Alexandr Antonenko


> On March 29, 2016, 1:13 p.m., Jonathan Hurley wrote:
> > Was this committed? If so, can we close the review?

Yes this was committed. We can close this review.


- Alexandr


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44724/#review125866
---


On March 26, 2016, 6:28 p.m., Qin Liu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44724/
> ---
> 
> (Updated March 26, 2016, 6:28 p.m.)
> 
> 
> Review request for Ambari, Alexandr Antonenko, Di Li, Jonathan Hurley, and 
> Richard Zang.
> 
> 
> Bugs: AMBARI-12906
> https://issues.apache.org/jira/browse/AMBARI-12906
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> User should not be allowed to save changes if the credential fields are left 
> empty when creating new Alert Notifications.
> 
> Steps to reproduce:
> 1. Create New Alert Notification
> 2. Enter Name = test
> 3. Tick the checkbox for 'Use Authentication'
> 4. Keep username and password empty
> 5. Click on Save
> 6. New alert notifications is created.
> 
> 
> Diffs
> -
> 
>   
> ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
>  79e524e 
>   ambari-web/app/messages.js 421143a 
>   ambari-web/app/templates/main/alerts/create_alert_notification.hbs 0a83f63 
>   ambari-web/app/utils/validator.js 6426163 
>   
> ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
>  f16bf4d 
> 
> Diff: https://reviews.apache.org/r/44724/diff/
> 
> 
> Testing
> ---
> 
> FIX:
> 1. With the fix, user won't be allowd to to save changes if Email is selected 
> for alert notification and Use authentication is chosen and the credential 
> fields are left empty when creating new Alert Notifications or editing 
> existing Alert Notifications.
> 2. The error message "Username is required" will be shown if the Username is 
> empty.
> 3. The error message "Password is required" will be shown if the password is 
> empty. 
> The fix here uses a similar approach that was used for the Password 
> Confirmation error handling.
> 
> TESTS:
> The fix has been tested with HDP UI.
> manage_alert_notifications_controller_test.js has also been modified to test 
> changes.
> 
> The following is the result of running ambari-web tests:
> 
> 24957 tests complete (31 seconds)
> 145 tests pending
> 
> 
> Thanks,
> 
> Qin Liu
> 
>



Re: Review Request 44724: AMBARI-12906: Alert notifications are created even if credential fields are left empty

2016-03-29 Thread Jonathan Hurley

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44724/#review125866
---



Was this committed? If so, can we close the review?

- Jonathan Hurley


On March 26, 2016, 2:28 p.m., Qin Liu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44724/
> ---
> 
> (Updated March 26, 2016, 2:28 p.m.)
> 
> 
> Review request for Ambari, Alexandr Antonenko, Di Li, Jonathan Hurley, and 
> Richard Zang.
> 
> 
> Bugs: AMBARI-12906
> https://issues.apache.org/jira/browse/AMBARI-12906
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> User should not be allowed to save changes if the credential fields are left 
> empty when creating new Alert Notifications.
> 
> Steps to reproduce:
> 1. Create New Alert Notification
> 2. Enter Name = test
> 3. Tick the checkbox for 'Use Authentication'
> 4. Keep username and password empty
> 5. Click on Save
> 6. New alert notifications is created.
> 
> 
> Diffs
> -
> 
>   
> ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
>  79e524e 
>   ambari-web/app/messages.js 421143a 
>   ambari-web/app/templates/main/alerts/create_alert_notification.hbs 0a83f63 
>   ambari-web/app/utils/validator.js 6426163 
>   
> ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
>  f16bf4d 
> 
> Diff: https://reviews.apache.org/r/44724/diff/
> 
> 
> Testing
> ---
> 
> FIX:
> 1. With the fix, user won't be allowd to to save changes if Email is selected 
> for alert notification and Use authentication is chosen and the credential 
> fields are left empty when creating new Alert Notifications or editing 
> existing Alert Notifications.
> 2. The error message "Username is required" will be shown if the Username is 
> empty.
> 3. The error message "Password is required" will be shown if the password is 
> empty. 
> The fix here uses a similar approach that was used for the Password 
> Confirmation error handling.
> 
> TESTS:
> The fix has been tested with HDP UI.
> manage_alert_notifications_controller_test.js has also been modified to test 
> changes.
> 
> The following is the result of running ambari-web tests:
> 
> 24957 tests complete (31 seconds)
> 145 tests pending
> 
> 
> Thanks,
> 
> Qin Liu
> 
>



Re: Review Request 44724: AMBARI-12906: Alert notifications are created even if credential fields are left empty

2016-03-24 Thread Richard Zang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44724/#review125330
---


Ship it!




Ship It!

- Richard Zang


On March 20, 2016, 5:50 a.m., Qin Liu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44724/
> ---
> 
> (Updated March 20, 2016, 5:50 a.m.)
> 
> 
> Review request for Ambari, Di Li and Jonathan Hurley.
> 
> 
> Bugs: AMBARI-12906
> https://issues.apache.org/jira/browse/AMBARI-12906
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> User should not be allowed to save changes if the credential fields are left 
> empty when creating new Alert Notifications.
> 
> Steps to reproduce:
> 1. Create New Alert Notification
> 2. Enter Name = test
> 3. Tick the checkbox for 'Use Authentication'
> 4. Keep username and password empty
> 5. Click on Save
> 6. New alert notifications is created.
> 
> 
> Diffs
> -
> 
>   
> ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
>  79e524e 
>   ambari-web/app/messages.js 421143a 
>   ambari-web/app/templates/main/alerts/create_alert_notification.hbs 0a83f63 
>   ambari-web/app/utils/validator.js 6426163 
>   
> ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
>  f16bf4d 
> 
> Diff: https://reviews.apache.org/r/44724/diff/
> 
> 
> Testing
> ---
> 
> FIX:
> 1. With the fix, user won't be allowd to to save changes if Email is selected 
> for alert notification and Use authentication is chosen and the credential 
> fields are left empty when creating new Alert Notifications or editing 
> existing Alert Notifications.
> 2. The error message "Username is required" will be shown if the Username is 
> empty.
> 3. The error message "Password is required" will be shown if the password is 
> empty. 
> The fix here uses a similar approach that was used for the Password 
> Confirmation error handling.
> 
> TESTS:
> The fix has been tested with HDP UI.
> manage_alert_notifications_controller_test.js has also been modified to test 
> changes.
> 
> The following is the result of running ambari-web tests:
> 
> 24957 tests complete (31 seconds)
> 145 tests pending
> 
> 
> Thanks,
> 
> Qin Liu
> 
>



Re: Review Request 44724: AMBARI-12906: Alert notifications are created even if credential fields are left empty

2016-03-24 Thread Jonathan Hurley


> On March 22, 2016, 11:07 a.m., Jonathan Hurley wrote:
> > Any unit tests to cover this?
> 
> Qin Liu wrote:
> Hi Jonathan, I didn't add unit tests to cover checking spaces but I 
> tested it from UI. Can I still ship it? Or, can I add it from another patch 
> if you really want it? :-)
> 
> Also, Di is off and will be back in 2 weeks. Can I ship without waiting 
> for him back since this is just minor follow-up issue? Thank you very much!

I gave it a Ship It, so I'm fine if you feel that this change doesn't need a 
specific test. We normally want 2 +1's before comitting. You can add anyone who 
has been working in ambari-web recently.


- Jonathan


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44724/#review124805
---


On March 20, 2016, 1:50 a.m., Qin Liu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44724/
> ---
> 
> (Updated March 20, 2016, 1:50 a.m.)
> 
> 
> Review request for Ambari, Di Li and Jonathan Hurley.
> 
> 
> Bugs: AMBARI-12906
> https://issues.apache.org/jira/browse/AMBARI-12906
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> User should not be allowed to save changes if the credential fields are left 
> empty when creating new Alert Notifications.
> 
> Steps to reproduce:
> 1. Create New Alert Notification
> 2. Enter Name = test
> 3. Tick the checkbox for 'Use Authentication'
> 4. Keep username and password empty
> 5. Click on Save
> 6. New alert notifications is created.
> 
> 
> Diffs
> -
> 
>   
> ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
>  79e524e 
>   ambari-web/app/messages.js 421143a 
>   ambari-web/app/templates/main/alerts/create_alert_notification.hbs 0a83f63 
>   ambari-web/app/utils/validator.js 6426163 
>   
> ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
>  f16bf4d 
> 
> Diff: https://reviews.apache.org/r/44724/diff/
> 
> 
> Testing
> ---
> 
> FIX:
> 1. With the fix, user won't be allowd to to save changes if Email is selected 
> for alert notification and Use authentication is chosen and the credential 
> fields are left empty when creating new Alert Notifications or editing 
> existing Alert Notifications.
> 2. The error message "Username is required" will be shown if the Username is 
> empty.
> 3. The error message "Password is required" will be shown if the password is 
> empty. 
> The fix here uses a similar approach that was used for the Password 
> Confirmation error handling.
> 
> TESTS:
> The fix has been tested with HDP UI.
> manage_alert_notifications_controller_test.js has also been modified to test 
> changes.
> 
> The following is the result of running ambari-web tests:
> 
> 24957 tests complete (31 seconds)
> 145 tests pending
> 
> 
> Thanks,
> 
> Qin Liu
> 
>



Re: Review Request 44724: AMBARI-12906: Alert notifications are created even if credential fields are left empty

2016-03-24 Thread Qin Liu


> On March 22, 2016, 3:07 p.m., Jonathan Hurley wrote:
> > Any unit tests to cover this?

Hi Jonathan, I didn't add unit tests to cover checking spaces but I tested it 
from UI. Can I still ship it? Or, can I add it from another patch if you really 
want it? :-)

Also, Di is off and will be back in 2 weeks. Can I ship without waiting for him 
back since this is just minor follow-up issue? Thank you very much!


- Qin


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44724/#review124805
---


On March 20, 2016, 5:50 a.m., Qin Liu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44724/
> ---
> 
> (Updated March 20, 2016, 5:50 a.m.)
> 
> 
> Review request for Ambari, Di Li and Jonathan Hurley.
> 
> 
> Bugs: AMBARI-12906
> https://issues.apache.org/jira/browse/AMBARI-12906
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> User should not be allowed to save changes if the credential fields are left 
> empty when creating new Alert Notifications.
> 
> Steps to reproduce:
> 1. Create New Alert Notification
> 2. Enter Name = test
> 3. Tick the checkbox for 'Use Authentication'
> 4. Keep username and password empty
> 5. Click on Save
> 6. New alert notifications is created.
> 
> 
> Diffs
> -
> 
>   
> ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
>  79e524e 
>   ambari-web/app/messages.js 421143a 
>   ambari-web/app/templates/main/alerts/create_alert_notification.hbs 0a83f63 
>   ambari-web/app/utils/validator.js 6426163 
>   
> ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
>  f16bf4d 
> 
> Diff: https://reviews.apache.org/r/44724/diff/
> 
> 
> Testing
> ---
> 
> FIX:
> 1. With the fix, user won't be allowd to to save changes if Email is selected 
> for alert notification and Use authentication is chosen and the credential 
> fields are left empty when creating new Alert Notifications or editing 
> existing Alert Notifications.
> 2. The error message "Username is required" will be shown if the Username is 
> empty.
> 3. The error message "Password is required" will be shown if the password is 
> empty. 
> The fix here uses a similar approach that was used for the Password 
> Confirmation error handling.
> 
> TESTS:
> The fix has been tested with HDP UI.
> manage_alert_notifications_controller_test.js has also been modified to test 
> changes.
> 
> The following is the result of running ambari-web tests:
> 
> 24957 tests complete (31 seconds)
> 145 tests pending
> 
> 
> Thanks,
> 
> Qin Liu
> 
>



Re: Review Request 44724: AMBARI-12906: Alert notifications are created even if credential fields are left empty

2016-03-22 Thread Jonathan Hurley

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44724/#review124805
---


Ship it!




Any unit tests to cover this?

- Jonathan Hurley


On March 20, 2016, 1:50 a.m., Qin Liu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44724/
> ---
> 
> (Updated March 20, 2016, 1:50 a.m.)
> 
> 
> Review request for Ambari, Di Li and Jonathan Hurley.
> 
> 
> Bugs: AMBARI-12906
> https://issues.apache.org/jira/browse/AMBARI-12906
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> User should not be allowed to save changes if the credential fields are left 
> empty when creating new Alert Notifications.
> 
> Steps to reproduce:
> 1. Create New Alert Notification
> 2. Enter Name = test
> 3. Tick the checkbox for 'Use Authentication'
> 4. Keep username and password empty
> 5. Click on Save
> 6. New alert notifications is created.
> 
> 
> Diffs
> -
> 
>   
> ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
>  79e524e 
>   ambari-web/app/messages.js 421143a 
>   ambari-web/app/templates/main/alerts/create_alert_notification.hbs 0a83f63 
>   ambari-web/app/utils/validator.js 6426163 
>   
> ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
>  f16bf4d 
> 
> Diff: https://reviews.apache.org/r/44724/diff/
> 
> 
> Testing
> ---
> 
> FIX:
> 1. With the fix, user won't be allowd to to save changes if Email is selected 
> for alert notification and Use authentication is chosen and the credential 
> fields are left empty when creating new Alert Notifications or editing 
> existing Alert Notifications.
> 2. The error message "Username is required" will be shown if the Username is 
> empty.
> 3. The error message "Password is required" will be shown if the password is 
> empty. 
> The fix here uses a similar approach that was used for the Password 
> Confirmation error handling.
> 
> TESTS:
> The fix has been tested with HDP UI.
> manage_alert_notifications_controller_test.js has also been modified to test 
> changes.
> 
> The following is the result of running ambari-web tests:
> 
> 24957 tests complete (31 seconds)
> 145 tests pending
> 
> 
> Thanks,
> 
> Qin Liu
> 
>



Re: Review Request 44724: AMBARI-12906: Alert notifications are created even if credential fields are left empty

2016-03-20 Thread Di Li

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44724/#review124180
---




ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js 
(line 530)


same question as Jonathan, make sure to check falsy


- Di Li


On March 15, 2016, 7:17 p.m., Qin Liu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44724/
> ---
> 
> (Updated March 15, 2016, 7:17 p.m.)
> 
> 
> Review request for Ambari, Di Li and Jonathan Hurley.
> 
> 
> Bugs: AMBARI-12906
> https://issues.apache.org/jira/browse/AMBARI-12906
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> User should not be allowed to save changes if the credential fields are left 
> empty when creating new Alert Notifications.
> 
> Steps to reproduce:
> 1. Create New Alert Notification
> 2. Enter Name = test
> 3. Tick the checkbox for 'Use Authentication'
> 4. Keep username and password empty
> 5. Click on Save
> 6. New alert notifications is created.
> 
> 
> Diffs
> -
> 
>   
> ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
>  79e524e 
>   ambari-web/app/messages.js 8e69dd0 
>   ambari-web/app/templates/main/alerts/create_alert_notification.hbs 0a83f63 
>   
> ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
>  f16bf4d 
> 
> Diff: https://reviews.apache.org/r/44724/diff/
> 
> 
> Testing
> ---
> 
> FIX:
> 1. With the fix, user won't be allowd to to save changes if Email is selected 
> for alert notification and Use authentication is chosen and the credential 
> fields are left empty when creating new Alert Notifications or editing 
> existing Alert Notifications.
> 2. The error message "Username is required" will be shown if the Username is 
> empty.
> 3. The error message "Password is required" will be shown if the password is 
> empty. 
> The fix here uses a similar approach that was used for the Password 
> Confirmation error handling.
> 
> TESTS:
> The fix has been tested with HDP UI.
> manage_alert_notifications_controller_test.js has also been modified to test 
> changes.
> 
> The following is the result of running ambari-web tests:
> 
> 24957 tests complete (31 seconds)
> 145 tests pending
> 
> 
> Thanks,
> 
> Qin Liu
> 
>



Re: Review Request 44724: AMBARI-12906: Alert notifications are created even if credential fields are left empty

2016-03-19 Thread Qin Liu

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44724/
---

(Updated March 20, 2016, 5:50 a.m.)


Review request for Ambari, Di Li and Jonathan Hurley.


Changes
---

I added isEmptyOrSpaces in Validator to check for empty and white spaces.


Bugs: AMBARI-12906
https://issues.apache.org/jira/browse/AMBARI-12906


Repository: ambari


Description
---

User should not be allowed to save changes if the credential fields are left 
empty when creating new Alert Notifications.

Steps to reproduce:
1. Create New Alert Notification
2. Enter Name = test
3. Tick the checkbox for 'Use Authentication'
4. Keep username and password empty
5. Click on Save
6. New alert notifications is created.


Diffs (updated)
-

  
ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js 
79e524e 
  ambari-web/app/messages.js 421143a 
  ambari-web/app/templates/main/alerts/create_alert_notification.hbs 0a83f63 
  ambari-web/app/utils/validator.js 6426163 
  
ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
 f16bf4d 

Diff: https://reviews.apache.org/r/44724/diff/


Testing
---

FIX:
1. With the fix, user won't be allowd to to save changes if Email is selected 
for alert notification and Use authentication is chosen and the credential 
fields are left empty when creating new Alert Notifications or editing existing 
Alert Notifications.
2. The error message "Username is required" will be shown if the Username is 
empty.
3. The error message "Password is required" will be shown if the password is 
empty. 
The fix here uses a similar approach that was used for the Password 
Confirmation error handling.

TESTS:
The fix has been tested with HDP UI.
manage_alert_notifications_controller_test.js has also been modified to test 
changes.

The following is the result of running ambari-web tests:

24957 tests complete (31 seconds)
145 tests pending


Thanks,

Qin Liu



Re: Review Request 44724: AMBARI-12906: Alert notifications are created even if credential fields are left empty

2016-03-19 Thread Jonathan Hurley

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44724/#review124178
---




ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js 
(line 516)


I'm not up-to-date on JavaScript syntax; is this also checking for empty 
values as well? Such as a bunch of spaces?


- Jonathan Hurley


On March 15, 2016, 3:17 p.m., Qin Liu wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44724/
> ---
> 
> (Updated March 15, 2016, 3:17 p.m.)
> 
> 
> Review request for Ambari, Di Li and Jonathan Hurley.
> 
> 
> Bugs: AMBARI-12906
> https://issues.apache.org/jira/browse/AMBARI-12906
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> User should not be allowed to save changes if the credential fields are left 
> empty when creating new Alert Notifications.
> 
> Steps to reproduce:
> 1. Create New Alert Notification
> 2. Enter Name = test
> 3. Tick the checkbox for 'Use Authentication'
> 4. Keep username and password empty
> 5. Click on Save
> 6. New alert notifications is created.
> 
> 
> Diffs
> -
> 
>   
> ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
>  79e524e 
>   ambari-web/app/messages.js 8e69dd0 
>   ambari-web/app/templates/main/alerts/create_alert_notification.hbs 0a83f63 
>   
> ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
>  f16bf4d 
> 
> Diff: https://reviews.apache.org/r/44724/diff/
> 
> 
> Testing
> ---
> 
> FIX:
> 1. With the fix, user won't be allowd to to save changes if Email is selected 
> for alert notification and Use authentication is chosen and the credential 
> fields are left empty when creating new Alert Notifications or editing 
> existing Alert Notifications.
> 2. The error message "Username is required" will be shown if the Username is 
> empty.
> 3. The error message "Password is required" will be shown if the password is 
> empty. 
> The fix here uses a similar approach that was used for the Password 
> Confirmation error handling.
> 
> TESTS:
> The fix has been tested with HDP UI.
> manage_alert_notifications_controller_test.js has also been modified to test 
> changes.
> 
> The following is the result of running ambari-web tests:
> 
> 24957 tests complete (31 seconds)
> 145 tests pending
> 
> 
> Thanks,
> 
> Qin Liu
> 
>



Re: Review Request 44724: AMBARI-12906: Alert notifications are created even if credential fields are left empty

2016-03-15 Thread Qin Liu

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44724/
---

(Updated March 15, 2016, 7:17 p.m.)


Review request for Ambari, Di Li and Jonathan Hurley.


Bugs: AMBARI-12906
https://issues.apache.org/jira/browse/AMBARI-12906


Repository: ambari


Description
---

User should not be allowed to save changes if the credential fields are left 
empty when creating new Alert Notifications.

Steps to reproduce:
1. Create New Alert Notification
2. Enter Name = test
3. Tick the checkbox for 'Use Authentication'
4. Keep username and password empty
5. Click on Save
6. New alert notifications is created.


Diffs
-

  
ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js 
79e524e 
  ambari-web/app/messages.js 8e69dd0 
  ambari-web/app/templates/main/alerts/create_alert_notification.hbs 0a83f63 
  
ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
 f16bf4d 

Diff: https://reviews.apache.org/r/44724/diff/


Testing
---

FIX:
1. With the fix, user won't be allowd to to save changes if Email is selected 
for alert notification and Use authentication is chosen and the credential 
fields are left empty when creating new Alert Notifications or editing existing 
Alert Notifications.
2. The error message "Username is required" will be shown if the Username is 
empty.
3. The error message "Password is required" will be shown if the password is 
empty. 
The fix here uses a similar approach that was used for the Password 
Confirmation error handling.

TESTS:
The fix has been tested with HDP UI.
manage_alert_notifications_controller_test.js has also been modified to test 
changes.

The following is the result of running ambari-web tests:

24957 tests complete (31 seconds)
145 tests pending


Thanks,

Qin Liu



Review Request 44724: AMBARI-12906: Alert notifications are created even if credential fields are left empty

2016-03-11 Thread Qin Liu

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44724/
---

Review request for Ambari and Di Li.


Bugs: AMBARI-12906
https://issues.apache.org/jira/browse/AMBARI-12906


Repository: ambari


Description
---

User should not be allowed to save changes if the credential fields are left 
empty when creating new Alert Notifications.

Steps to reproduce:
1. Create New Alert Notification
2. Enter Name = test
3. Tick the checkbox for 'Use Authentication'
4. Keep username and password empty
5. Click on Save
6. New alert notifications is created.


Diffs
-

  
ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js 
79e524e 
  ambari-web/app/messages.js 8e69dd0 
  ambari-web/app/templates/main/alerts/create_alert_notification.hbs 0a83f63 
  
ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
 f16bf4d 

Diff: https://reviews.apache.org/r/44724/diff/


Testing
---

FIX:
1. With the fix, user won't be allowd to to save changes if Email is selected 
for alert notification and Use authentication is chosen and the credential 
fields are left empty when creating new Alert Notifications or editing existing 
Alert Notifications.
2. The error message "Username is required" will be shown if the Username is 
empty.
3. The error message "Password is required" will be shown if the password is 
empty. 
The fix here uses a similar approach that was used for the Password 
Confirmation error handling.

TESTS:
The fix has been tested with HDP UI.
manage_alert_notifications_controller_test.js has also been modified to test 
changes.

The following is the result of running ambari-web tests:

24957 tests complete (31 seconds)
145 tests pending


Thanks,

Qin Liu