Frontend: Prefill "Time before automatic termination" with the selected agent's default_max_hours_before_termination

MR: Prefill "Time before automatic termination" wit... (!159400 - merged)

Description

During workspace create page, we should update GraphQL query to include agent_config defaultMaxHoursBeforeTermination. On page load and agent selected, we will display the default value from backend as the default value. When the agent is switched, we will update to other default.

Acceptance Criteria

  • When user creates a workspace through UI, they should see the selected agent's default_max_hours_before_termination value in Workspace automatically terminates after
  • We should fetch the required value of the associated agent's default_max_hours_before_termination via GraphQL when we load all agents.
  • Remove existing logic from the Rails view which passes default_max_hours_before_termination ee/app/views/remote_development/workspaces/index.html.haml to the frontend:
#js-workspaces{ data: {
    options: {
      workspaces_list_path: remote_development_workspaces_path,
      empty_state_svg_path: image_path('illustrations/empty-state/empty-workspaces-md.svg'),
      default_max_hours_before_termination: RemoteDevelopment::Settings.get_single_setting(:default_max_hours_before_termination)
    }.to_json
  }
}
  inject: ['defaultMaxHoursBeforeTermination'],
Edited by zli