axem-solutions / dem

Containerized Development Environment Manager for embedded development
Other
94 stars 15 forks source link

[FeatureRequest] Dev Env Settings Window > Task settings tab #213

Open janosmurai opened 2 months ago

janosmurai commented 2 months ago

Create the Task settings tab UI.

The layout should look like this:

image

Requirements

  1. The table should be loaded with the tasks already assigned to the Dev Env. This can happen if the user reaches the Dev Env Settings window using the dem modify command.
  2. The status of the table should not be saved to the dev_env.json file until the user selects the save button. If the user selects the save button the current status should be written to the dev_env.json file and the Dev Env Settings window should be closed.
  3. The user should be able to navigate the table entries by rows. The navigation should be controlled by the arrow keys and the ‘j' and 'k’ keys.
  4. The actual cursor position should be indicated by highlighting the row. See https://textual.textualize.io/widgets/data_table/ for reference.
  5. If a task is selected and the user presses the delete key, the task should be deleted.
  6. The lowest row’s purpose is to add new tasks. It contains 4 cells:
    1. Task name input field: The user can enter the name for the task. This name must be unique for the Dev Env. If the user enters a name that has already been taken, an error message should be presented in the error field.
    1. Tool Image select field: The user can select which tool image to use for the task. The available tool images should be the ones assigned to the Dev Env.
    1. Host select field: The user can select on which host the task should run. The list of available hosts can be loaded from the platform class’s hosts variable.
    1. Command input field: The user can enter the command to run in the container.
  7. When the cursor selects the row to add a new task only the first cell should be highlighted. In the new task row, the user should be able to navigate horizontally using the arrow keys or vi mode. In the list, only one of the input/select fields should be selectable. If a cell is selected it doesn’t mean the user can modify it’s content. The user should press the enter key to enter modification mode. In modify mode, the user can make their modifications by either entering the text or choosing from the drop-down menu. The user has two options to exit the modification mode: pressing enter saves their modification, or pressing esc clears their modification and reloads the original value (if no previous value was selected then the default text). By returning from modification mode the user should be able to navigate again with the arrows or vi mode.
  8. If the user selects the back button the entered tasks should be stored, but not saved to the dev_env.json file. Pressing the back button should load the Tool Image Selection tab. After returning to the Task Settings tab the stored tasks should be loaded.
  9. Pressing cancel should close the Dev Env Settings window without saving any entered information.
  10. Pressing save should write the Dev Env’s descriptor to the dev_env.json file and close the Dev Env Settings window.

Testing

The Task Settings window should work with both the create and modify commands.

create command

When first loaded the Task Settings should have an empty table.

modify command

When first loaded the Task Settings should load the already available tasks. The tasks are available from the dev_env class’s tasks variable.


For axem internal use only: Jira: https://axem.atlassian.net/browse/DEM-295