Skip to content

Refactor(profile preferences): refactor rails eval [RUN-AS-IF-FOSS]

What does this MR do?

This MR refactors the rails eval'ed profiles/preferences/update.js.erb to form event listener functions.

Screenshots (strongly suggested)

This is the page that is being refactored, no visible change:

Before After
Screen_Shot_2021-02-02_at_13.11.16 Screen_Shot_2021-01-08_at_15.48.21
Screen_Shot_2021-02-02_at_13.11.46 Screen_Shot_2021-02-02_at_13.13.33

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

To test this out:

  • Run bundle exec rails c and enable this feature flag: Feature.enable(:user_time_settings)
  • Navigate to http://localhost:3000/profile/preferences and scroll to the bottom.
  • Change settings (note: radio buttons submit the form immediately!)
  • Click "Save changes"
  • Refresh the page, you should see the changes persisted

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team

Related to #250846 (closed)

Edited by Jose Ivan Vargas

Merge request reports