Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

UI: Project-level Config Variables #1915

Merged
merged 30 commits into from
Sep 7, 2021
Merged

UI: Project-level Config Variables #1915

merged 30 commits into from
Sep 7, 2021

Conversation

gregone
Copy link
Contributor

@gregone gregone commented Jul 22, 2021

Fixes #1512

This PR adds Config Variables management to the project settings screen.

The list view displays both static and dynamic variables, with the latter in an abridged form, but only static variables are editable.

Editable attributes:

  • key
  • value
  • internal
  • use key as file path

Variables can also be edited from the UI.

Screen.Recording.2021-09-03.at.13.20.29.mov

@github-actions github-actions bot added the ui label Jul 22, 2021
@gregone
Copy link
Contributor Author

gregone commented Sep 6, 2021

Note for other reviewers: dynamic config vars aren’t added to the database until the first time they’re used in a deployment operation. I tried simply adding the config var to my waypoint.hcl, running waypoint init, and checking the UI and was surprised to find it didn’t work. If you subsequently run a waypoint up, then you’ll see it:

CleanShot 2021-09-03 at 17 37 01@2x

So this is because config syncing run on deploy (and after editing variables)

@gregone gregone requested a review from jgwhite September 6, 2021 14:23
super.setupController(controller, model, transition);
let project = this.modelFor('workspace.projects.project');

controller.project = project;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to do this without set, given controller.project isn’t a @tracked property? I would guess it’s OK but I’m not 100% sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question 🤔. I'll verify and update tomorrow

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looked into it: it's fine and the route updates the controller properly every time. The only concern would be if we were interacting with this controller from outside the route, but we're not.

Copy link
Contributor

@jgwhite jgwhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great 🎉

I left one tiny comment which I think we should fix but it’s not worth holding up the PR for.

ui/app/components/project-config-variables/list-item.ts Outdated Show resolved Hide resolved
Update return value
@gregone gregone merged commit cf53aa7 into main Sep 7, 2021
@gregone gregone deleted the ui-config-variables branch September 7, 2021 10:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config Variables in the browser UI
3 participants