Skip to content

[Ban UI] Add Ai vue settings for Group and Admin

Frédéric Caplette requested to merge fc-setup-group-admin-ai-settings into master

What does this MR do and why?

Add Ai vue settings for Group and Admin

This adds the scaffholding for groups and admin section of AI settings behind a two disabled ff: ai_settings_vue_admin and ai_settings_vue_group which render vue apps. This commit adds the base JS and rails helper to render the new settings. This MR will:

  1. Add 2 Feature flags ai_settings_vue_group and ai_settings_vue_admin
  2. Add the index.js file to initiate ai settings applications
  3. Add the common structure for our Vue components
  4. Add the ruby helpers structure to allow a centralize way to initiate data from the serve and pass it to the client side
  5. Have the conditional rendering in the haml to only show the Vue apps if the feature flag is enabled.
  6. Have the toggle for the settings by using settings_section component

This issue will not:

  1. Have a working settings page
  2. Implement API actions

NOTE: The diff is a around 500 +-, but really most of this is boilerplate code and require little to no logic which is why I think it's fine as is. The group part could have been a separate MR, but given how small of an addition it is, I decided to keep it in context of this MR.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Admin:

Before After
Screenshot 2024-07-03 at 3.47.11 PM.png Screenshot 2024-07-03 at 3.43.57 PM.png

Group:

Before After
Nothing! Screenshot 2024-07-04 at 3.02.56 PM.png

How to set up and validate locally

  1. Make sure you have AI features enabled to test this change https://docs.gitlab.com/ee/development/ai_features/index.html
  2. Go to your rails console and run Feature.enable(:ai_settings_vue_admin)
  3. Navigate to the admin area
  4. Go in Settings => General
  5. Note that you will not see the AI settings if you are on SAAS. You can comment out ee/app/views/admin/application_settings/_ai_powered.html.haml:1
  6. Notice the header AI-powered features
  7. There are no settings yet
  8. Go to your rails console and run Feature.enable(:ai_settings_vue_group)
  9. Navigate to a group where you are the admin and have AI features enabled
  10. Navigate to Settings -> General
  11. Notice the group header for AI-powered features

Note: if you do not see the settings, try to turn off the FF. If you still do not see it, then it can mean either of these criteria is not met:

  1. Is the group you are looking at has enabled AI features on your GDK? https://docs.gitlab.com/ee/development/ai_features/index.html#recommended-run-gdk-in-saas-mode-and-enable-ai-features-for-a-test-group
  2. Do you have an ultimate license for your instance?
Edited by Frédéric Caplette

Merge request reports