Giter Club home page Giter Club logo

filament-copyactions's Issues

Safari "NotAllowedError"

In a local dev env using https and Safari 16.2 on macOS 12.6 as the browser, I'm seeing this console error when clicking the generated copy button:

[Error] Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

Works fine in Chrome. From what I can tell Safari doesn't like that the clipboard action is coming from the result of an API query instead of a user click. Is this a known issue / limitation? Thank you.

It doesn't copy anything

Describe the bug
I install the plugin and It worked as expected from the UI, except that it didn't copy anything to Clipboard

Does not work and logs error in console

Describe the bug
The Form-CopyAction does not work. Nothing is copied to clipboard. On mount of the action, there is an JS error logged in the console:

Uncaught SyntaxError: missing ) after argument list
    at new AsyncFunction (<anonymous>)
    at safeAsyncFunction (livewire.js?id=6b5eb707:1249:21)
    at generateFunctionFromString (livewire.js?id=6b5eb707:1259:16)
    at generateEvaluatorFromString (livewire.js?id=6b5eb707:1264:16)
    at normalEvaluator (livewire.js?id=6b5eb707:1229:111)
    at evaluateLater (livewire.js?id=6b5eb707:1219:12)
    at livewire.js?id=6b5eb707:3776:35
    at Function.<anonymous> (livewire.js?id=6b5eb707:1850:58)
    at flushHandlers (livewire.js?id=6b5eb707:1353:48)
    at stopDeferring (livewire.js?id=6b5eb707:1358:7)
safeAsyncFunction @ livewire.js?id=6b5eb707:1249
generateFunctionFromString @ livewire.js?id=6b5eb707:1259
generateEvaluatorFromString @ livewire.js?id=6b5eb707:1264
normalEvaluator @ livewire.js?id=6b5eb707:1229
evaluateLater @ livewire.js?id=6b5eb707:1219
(anonymous) @ livewire.js?id=6b5eb707:3776
(anonymous) @ livewire.js?id=6b5eb707:1850
flushHandlers @ livewire.js?id=6b5eb707:1353
stopDeferring @ livewire.js?id=6b5eb707:1358
deferHandlingDirectives @ livewire.js?id=6b5eb707:1361
initTree @ livewire.js?id=6b5eb707:868
(anonymous) @ livewire.js?id=6b5eb707:816
(anonymous) @ livewire.js?id=6b5eb707:1037
onMutate @ livewire.js?id=6b5eb707:1037
setTimeout (async)
handleError @ livewire.js?id=6b5eb707:1201
safeAsyncFunction @ livewire.js?id=6b5eb707:1255
generateFunctionFromString @ livewire.js?id=6b5eb707:1259
generateEvaluatorFromString @ livewire.js?id=6b5eb707:1264
normalEvaluator @ livewire.js?id=6b5eb707:1229
evaluateLater @ livewire.js?id=6b5eb707:1219
(anonymous) @ livewire.js?id=6b5eb707:3776
(anonymous) @ livewire.js?id=6b5eb707:1850
flushHandlers @ livewire.js?id=6b5eb707:1353
stopDeferring @ livewire.js?id=6b5eb707:1358
deferHandlingDirectives @ livewire.js?id=6b5eb707:1361
initTree @ livewire.js?id=6b5eb707:868
(anonymous) @ livewire.js?id=6b5eb707:816
(anonymous) @ livewire.js?id=6b5eb707:1037
onMutate @ livewire.js?id=6b5eb707:1037
childList (async)
swapElements @ livewire.js?id=6b5eb707:7932
patch @ livewire.js?id=6b5eb707:7904
patchChildren @ livewire.js?id=6b5eb707:8077
patch @ livewire.js?id=6b5eb707:7921
patchChildren @ livewire.js?id=6b5eb707:8077
patch @ livewire.js?id=6b5eb707:7921
patchChildren @ livewire.js?id=6b5eb707:8077
patch @ livewire.js?id=6b5eb707:7921
patchChildren @ livewire.js?id=6b5eb707:8077
patch @ livewire.js?id=6b5eb707:7921
patchChildren @ livewire.js?id=6b5eb707:8077
patchChildren @ livewire.js?id=6b5eb707:8030
patch @ livewire.js?id=6b5eb707:7921
patchChildren @ livewire.js?id=6b5eb707:8077
patch @ livewire.js?id=6b5eb707:7921
patchChildren @ livewire.js?id=6b5eb707:8077
patch @ livewire.js?id=6b5eb707:7921
patchChildren @ livewire.js?id=6b5eb707:8077
patch @ livewire.js?id=6b5eb707:7921
patchChildren @ livewire.js?id=6b5eb707:8077
patch @ livewire.js?id=6b5eb707:7921
patchChildren @ livewire.js?id=6b5eb707:8077
patch @ livewire.js?id=6b5eb707:7921
morph @ livewire.js?id=6b5eb707:8122
morph2 @ livewire.js?id=6b5eb707:8898
(anonymous) @ livewire.js?id=6b5eb707:8958

To Reproduce

  1. Install the package in an existing admin panel
  2. Update the input as described
Forms\Components\TextInput::make('password')
                    ->label('Password')
                    ->required(fn (?User $record) => is_null($record))
                    ->minLength(8)
                    ->disabledOn(['edit'])
                    ->hintAction(Forms\Components\Actions\Action::make('password-reset')
                        ->hidden(fn (?User $record) => is_null($record))
                        ->label('reset')
                        ->link()
                        ->form(fn (?User $record) => [
                            Forms\Components\TextInput::make('link')
                                ->default(\Filament\Facades\Filament::getResetPasswordUrl(app('auth.password.broker')->createToken($record), $record))
                                ->suffixAction(CopyAction::make())
                        ])->modalHeading('Reset password')
                    )
                    ->password()
                    ->revealable(fn (?User $record) => is_null($record))
                    ->dehydrateStateUsing(fn (string $state): string => Hash::make($state))
                    ->dehydrated(fn (?string $state): bool => filled($state)),
  1. Click the copy button
  2. Nothing is copied to clipboard. An error is logged to the console on mount of the action modal.

Expected behavior
Input value is copied to clipboard. No error is logged

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Run on MacOS, current versions of Chrome & Safari, both local and hosted with SSL certificates.

Not copying

Describe the bug
Installed the package and not copying

To Reproduce
Steps to reproduce the behavior:

  1. Install the package in an existing admin panel
  2. Update the input as described
CopyableTextColumn::make('license')
                    ->copyMessage('License copied to clipboard')
                    ->label('License')
                    ->searchable()
                    ->alignment(Alignment::Center)
Forms\Components\TextInput::make('license')
                            ->required()
                            ->suffixAction(CopyAction::make())
                            ->disabledOn('edit')
                            ->hiddenOn('create')
  1. Open the page with the edited input
  2. Copy the text
  3. Paste the copied text

Expected behavior
The text is in the clipboard

Screenshots
Screenshot 2024-02-21 alle 14 33 47

Screenshot 2024-02-21 alle 14 33 37

Undefined variable `$success` after upgrading to 1.1.1

Describe the bug
After upgrading to 1.1.1 version, I got an error Undefined variable $success

After checking the file history, it seems this commit that leads to this errors.

@if ($icon && $iconPosition === 'before')
<x-filament-copyactions::copy-button
:success="$copyMessage"
:content="$copyableText"
:iconColor="$iconColor"
:icon="$icon" />
@endif

@if ($icon && $iconPosition === 'after')
<x-filament-copyactions::copy-button
:success="$success"
:content="$copyableText"
:iconColor="$iconColor"
:icon="$icon" />
@endif

To Reproduce
Steps to reproduce the behavior:

  1. Implement CopyableTextColumn component on a resource
  2. Open the resource index page, and you will see the error

Expected behavior
There is no error

Table action not working with tooltip

The table action is not working if you set a tooltip on the action.
When you set a tooltip the x-data of the button ends up empty, and when you try to copy, the console show the error copyable is not defined.

Is there a workaround ? I don't care about the "Copied!" tooltip if there is a conflict with that.

`CopyableTextColumn` component shown a smaller text

Describe the bug
Just switched from TextColumn to use CopyableTextColumn component, but the styling was changed.

To Reproduce
Steps to reproduce the behavior:

  1. Use TextColumn and CopyableTextColumn component with a same text
  2. See that text on TextColumn shown bigger and doesn't has any padding. But, text on CopyableTextColumn component shown smaller and has a padding.

Expected behavior
I think it should not change the default text styling, isn't?

Screenshots
image

Additional context
Actually I don't know is this a bug or an expected behavior. I'm just trying to use CopyableTextColumn component, but looks like it has a different styling. I know, this can be solved easily by publishing the views, but I just want a confirmation is it a bug or not. If you think this was a bug, I'm happy to create a PR for a fix.

Usage in Notifications

Describe the ideal solution or feature request

I'd like to use this action in a Notification for the user to copy a personal access token.

Such an action must extend Filament\Notifications\Actions\Action.

Difficulty, impact, and usage score

Technical difficulty User goals Usage frequency
"Nicer" in terms of UI design, so I don't have to put the raw token in the notification body. Weekly/Monthly

How does this tie into our current project?

Allows usage in any notification.

CopyableTextColumn only show icon

It would be great, if you can change the behaviour of the CopyableTextColumn, so that its possible, to just show the copy icon / only change the getCopyableText content,.

For example, I wanna have a column to copy the full HTML a-Tag of a row , but don't wanna display it in the table itself:

image

Customize notification on actions

Similar to the Column, just give the option to customize the message after clicking on the copy button on forms. Somehing like:

\Webbingbrasil\FilamentCopyActions\Forms\Actions\CopyAction::make()
                    ->copyable(fn($component) => "xxx")
                    ->successMessage(fn($component) => "my message"))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.