Skip to content
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

UI V2 #4086

Merged
merged 642 commits into from
May 10, 2018
Merged

UI V2 #4086

merged 642 commits into from
May 10, 2018

Conversation

johncowen
Copy link
Contributor

This PR includes a redesigned/rebuilt user interface using the Ember v2 framework. The primary aim is to provide feature parity with the current user interface along with providing a solid foundation for moving forwards adding new features and improvements to the user interface.

Further addition in this PR include changes to enable 404 redirection as is required for a modern SPA, plus the usage of a CONSUL_UI_BETA environment variable to enable this new user interface.

Setting the CONSUL_UI_BETA environment variable to a 'truthy' value and specifying the -ui command line flag will enable the new user interface.

John Cowen and others added 30 commits March 20, 2018 15:46
Add some todo's in to remind me to think consider this further at a
later date. For example, is normalizePayload to be a hook or an
overridable method
Move away from using `reopen` to using Mixins
Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

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

Go bits reviewed. It is all good but suggested some simplifications/style tweaks etc.

Great job.

Incidentally, I'm in two minds about whether it would be better to squash merge this or rebase your branch to squash those commits - over 250 commits is a lot to merge. In my mind it's easier to grok the master history if major features like this are added in a single squashed commit during merge but that does loose history from your branch and not every one on the team agrees with me ;). No big deal either way but if you're not sure we can bikeshed it in Slack.

agent/http.go Outdated
@@ -41,6 +42,18 @@ type HTTPServer struct {
proto string
}

type RedirectFS struct {
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: public types and functions should really have a comment. We don't always do this in Consul currently but IMO it's a convention that's worth keeping. Example for this would be:

// RedirectFS is an http.FileSystem implementation that ... We use it because...

// Open implements http.FileSystem

agent/http.go Outdated
func (fs *RedirectFS) Open(name string) (http.File, error) {
file, err := fs.fs.Open(name)
if err != nil {
file, err = fs.fs.Open("/index.html")
Copy link
Member

Choose a reason for hiding this comment

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

Was this copied from another project? I know we do similar things in other places for example https://github.com/hashicorp/terraform-registry/blob/master/helper/fallback-fs/fallback.go.

Copy link
Member

Choose a reason for hiding this comment

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

Nope, I just implemented it myself. I didn't think to look for this particular thing in another project.

agent/http.go Outdated
new_ui = true
default:
new_ui = false
}
Copy link
Member

Choose a reason for hiding this comment

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

Can just use:

new_ui, err := strconv.ParseBool(os.Getenv("CONSUL_UI_BETA"))
if err != nil {
  // Invalid/empty value is treated as false
  new_ui = false
}

https://golang.org/pkg/strconv/#ParseBool

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I can do that for simplicity. IMO ParseBool should also handle y,Y,Yes etc as true values but it doesn't. Many env variables I have used in other products and had in my own in the past like yes/no values for things. I was trying to keep it intuitive. Then again people using Consul are probably used to how we handle things anyways.

agent/http.go Outdated
default:
new_ui = false
}
var uifs http.FileSystem = nil;
Copy link
Member

Choose a reason for hiding this comment

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

= nil is redundant as it's the zero value for an interface anyway.

@johncowen johncowen merged commit e5eeb0a into master May 10, 2018
@mkeeler mkeeler deleted the feature/ui-v2 branch June 1, 2018 14:47
@johncowen johncowen added the theme/ui Anything related to the UI label Nov 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/ui Anything related to the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants