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_terminationvalue inWorkspace automatically terminates after -
We should fetch the required value of the associated agent's default_max_hours_before_terminationvia GraphQL when we load all agents. -
Remove existing logic from the Rails view which passes default_max_hours_before_terminationee/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
}
}
-
Remove all associated client-side logic which injects and uses global defaultMaxHoursBeforeTerminationin ee/app/assets/javascripts/workspaces/user/pages/create.vue and any othe rfiles, since we will now always obtain it from the selected agent-specific value via graphql:
inject: ['defaultMaxHoursBeforeTermination'],
Edited by zli