Skip to content

Implement UI::Configuration so users can customize Flipper UI text#306

Merged
AlexWheeler merged 1 commit intomasterfrom
ui-configuration
Nov 21, 2017
Merged

Implement UI::Configuration so users can customize Flipper UI text#306
AlexWheeler merged 1 commit intomasterfrom
ui-configuration

Conversation

@AlexWheeler
Copy link
Copy Markdown
Collaborator

spike on #63 to allow users to customize the Flipper UI text, curious what everyone thinks.

Flipper::UI.configure do |c|
  c.percentage_of_actors.title = "% of Actors"
  c.percentage_of_actors.description = "percentage of actors rule :)"

  c.actors.description = "Enable any actor by entering that actor's flipper_id"

  c.delete.title = "DO NOT PRESS!"
  c.delete.description = "Who knows what will happen?!"
end

results in:
screen shot 2017-11-17 at 8 19 50 am

I also played with the idea of making the configuration have a bit cleaner dsl something like. the latter is cleaner, but the above is simpler, would be cool to hear thoughts on this:

Flipper::UI.configure do |c|

  c.actors do
    title ""
    description ""
  end
  
end

Copy link
Copy Markdown
Collaborator

@jnunemaker jnunemaker left a comment

Choose a reason for hiding this comment

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

I like it! I'm 100% down with shipping this as is. Some thoughts for this PR or a follow up:

  • feature_creation_enabled and application_breadcrumb_href - Should we move these into UI::Configuration? If we wanted backwards compatibility we could even make the current writer methods just update the configuration instance.

@jnunemaker
Copy link
Copy Markdown
Collaborator

I hit submit too soon. Lol.

I also played with the idea of making the configuration have a bit cleaner dsl something like. the latter is cleaner, but the above is simpler, would be cool to hear thoughts on this:

I like the way you did it. I'm a fan of pure/boring ruby over DSL's.

@AlexWheeler
Copy link
Copy Markdown
Collaborator Author

@jnunemaker great idea, I'll add move feature_creation_enabled / application_breadcrumb_href to UI::Configuration in next PR.

what do you think about the failing line length code climate issues for the strings. splitting them into multi lines to make code climate happy makes it messier imo

@jnunemaker
Copy link
Copy Markdown
Collaborator

jnunemaker commented Nov 18, 2017 via email

@AlexWheeler AlexWheeler merged commit 0e9f3e3 into master Nov 21, 2017
@AlexWheeler AlexWheeler deleted the ui-configuration branch November 21, 2017 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants