flipper
flipper copied to clipboard
Human readable actor names
Right now in flipper our actor names look something like:
It would be nice if there was a way to specify a human readable string, eg by using the to_s
method on the model. Perhaps there is a way to do this and I'm missing it? If so apologies.
I totally love this idea. I was thinking that likely the easiest way would be some sort of hydrator for actors. Given a dehydrated actor id (or ids) it invokes a block you provide to return a fully hydrated object (AR model, or whatever). Something in Flipper::UI config like actor_hydrator could maybe do this. I'd probably make it work with batches of ids by default to avoid n+1 lookups too.
Another alternative would be to store this along with the actor id but becomes a cache invalidation issue pretty quick.
I Would like to follow up on this.
It would be very helpful to have some simple information next to the actor,
because in a long list of User:1234567
it get's out of hand which customer is allowed to see the feature very quickly.
So I guess either we could store this information in the Gate Table, or (preferable) have another flipper method in the model like flipper_name
to be able to delegate that information to a custom column i.e. username, email...
could it be possible to maybe use an alternative unique attribute such as user.email? e.g.
def flipper_id
email
end
You definitely can. The problem is that people change their email addresses so you’d need to be sure to update flipper if so.
Worth mentioning I laid out a plan for this if someone has the time to make a PR.
https://github.com/jnunemaker/flipper/issues/657#issuecomment-1215365903
Hey @jnunemaker, I have PR #737 ready for this!
I’ll check it out soon! On vacation so I’ll be slower than usual. Thanks!
I’ll check it out soon! On vacation so I’ll be slower than usual. Thanks!
Hey John, hope you had a nice vacation! Let me know if you're able to get to this sometime soon.
I realized I should have mentioned your handle. There goes @jnunemaker
closed by https://github.com/flippercloud/flipper/pull/737