Skip to content

Rich parameters: ability to specify order of fields in UI #6362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aaronlehmann opened this issue Feb 27, 2023 · 6 comments · Fixed by #6747
Closed

Rich parameters: ability to specify order of fields in UI #6362

aaronlehmann opened this issue Feb 27, 2023 · 6 comments · Fixed by #6747
Assignees
Labels
parameters Area: parameters

Comments

@aaronlehmann
Copy link
Contributor

Currently, rich parameters defined in the TF templates appear to be presented in alphabetical order by name. It would be useful to have an "ordinal" field or other mechanism to influence the ordering of fields.

@mtojek mtojek added the parameters Area: parameters label Feb 28, 2023
@dcarrion87
Copy link
Contributor

dcarrion87 commented Feb 28, 2023

Is there a work around to order input parameters. It almost seems completely random. I can't seem to even trick it so they're alphabetical.

E.g. Why would ray_worker_max_replicas appear above instance_type in the UI?

data "coder_parameter" "ray_image" {
  name        = "Ray Docker Image"
  mutable     = true
  type        = "string"
  description = "Docker image used for the Ray head and workers"
  default     = "rayproject/ray-ml:2.2.0-py38-cu116"
}


data "coder_parameter" "instance_type" {
  name        = "Instance Type"
  description = "Select an instance type"
  mutable     = true
  type        = "string"
...
}

data "coder_parameter" "ray_worker_max_replicas" {
  name        = "Maximum Worker Replicas"
  description = "Number of worker replicas that can dynamically be created"
  mutable     = true
  type        = "number"
  default     = 1
}

@matifali
Copy link
Member

matifali commented Feb 28, 2023

I agree with @dcarrion87. I tried changing the order by renaming but it didn't work. By default they seem alphabetical.
Related coder/terraform-provider-coder#103

@mtojek
Copy link
Member

mtojek commented Mar 20, 2023

I spent some time chasing a bug around rich parameters, and I have a feeling that the order can be random sometimes. I think that we should try to keep the order of fields as they appear in the file.

@bpmct Do you think that I can pull it into this week's sprint?

@bpmct
Copy link
Member

bpmct commented Mar 20, 2023

Agreed, let’s do it :)

@mtojek
Copy link
Member

mtojek commented Mar 21, 2023

I'm going with this issue.

@mtojek
Copy link
Member

mtojek commented Mar 21, 2023

I merged the PR to order fields alphabetically. I will spend some time to see if we can "pull" the order form *.tf files. At first glance, it's rather tricky to do this without extra file inspecting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parameters Area: parameters
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants