oooholdings / nova-password-generator

Random Password Generation Field for Laravel Nova
MIT License
10 stars 4 forks source link

feat req: show password on update #20

Closed chrillep closed 1 year ago

chrillep commented 1 year ago

i would like to have the same features on update as on detail and index. We are using a settings plugin so the only view available is always update/save. but basicly

PasswordGenerator::make( 'Personal Access Token' )
    ->showValueOnUpdate( bool $show = true )
    ->blurValueOnUpdate( bool $show = true )
    ->redactValueOnUpdate( bool $redact = true, string $character = '•' )
btrsco commented 1 year ago

@chrillep This sounds like a good idea, I just have one question about the implementation. Are you expecting to use this field the same way as the details/index page (basically readonly) or still be able to edit the value and show the generator UI?

chrillep commented 1 year ago

ooh yeah sry. meant a mix of create and index/detail. as you said.

still be able to edit the value and show the generator UI.

i almost feel like we are getting to

PasswordGenerator::make( 'Personal Access Token' )
    ->showValue( bool $show = true ) // show value on index/detail/update || where visible
    ->blurValue(bool $show = true ) // blur value on index/detail/update || where visible
    ->redactValue( bool $redact = true, string $character = '•' ) // redact value on index/detail/update || where visible

if its any help we use https://github.com/outl1ne/nova-settings

but this would benefit every update view.

sidenote: this will also make it clearer that the field has been filled before/has data when in the update view.

chrillep commented 1 year ago

btw love the plugin !

chrillep commented 1 year ago

is it this part?

https://github.com/oooholdings/nova-password-generator/blob/2b350ab763e4e17857a10a16ac790dec8c6d2e7e/resources/js/components/FormField.vue#L168-L170

changed to

        setInitialValue() {
            this.value = this.field.value;
        },
btrsco commented 1 year ago

Sorry for the delay, I just started a new job and have haven't had much free time.

So I have looked over your pull request and am confused as to what exactly you're asking for. Can you please explain your use-case a little more? Seems like you're using a Settings package and that page mimics the form pages all the time. Do you just want the value to be filled automatically instead of being empty or is there more to this specific feature request?

FreekVR commented 1 year ago

I have an (I think) somewhat similar request though I am not sure the PR covers that.

We are using the password generator to generate an optional API secret attached to a specific model. That secret can be used by external services to access an API allowing for mutations to some related model.

We'd like to show this secret (which we store as plain text) on the edit forms as well, so it's clear from that context if one already exists so that the user doesn't accidentally overwrite an existing secret.

chrillep commented 1 year ago

Sorry for the delay, I just started a new job and have haven't had much free time.

So I have looked over your pull request and am confused as to what exactly you're asking for. Can you please explain your use-case a little more? Seems like you're using a Settings package and that page mimics the form pages all the time. Do you just want the value to be filled automatically instead of being empty or is there more to this specific feature request?

Your spot on .

We want the value to be filled automatically instead of being empty.

btrsco commented 1 year ago

Thank you for the feature request @chrillep, again sorry it took so long to get to this. This has been implemented in v1.8.0

chrillep commented 1 year ago

Thank you for the feature request @chrillep, again sorry it took so long to get to this. This has been implemented in v1.8.0

no worries just appreciate the work u put in!