Comments (6)
Just adding to this, based on Filament's defaults, I think that this possibly suits as the default values and then in the docs might be worth adding the different styles (eg button-only view, larger icon etc.)
Impersonate::make()
->link()
->iconSize(IconSize::Small)
->label('Login as'),
The comparison style is to Filament's pre-built actions in v3 which you may want to stay consistent with:
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
Tables\Actions\ForceDeleteAction::make(),
Tables\Actions\RestoreAction::make()
from filament-impersonate.
Hmm. I don't think we set a label for the table action, since it's usually desirable to just show an action with no label when it's inline.
I bet you could do Impersonate::make()->label('Impersonate')->redirectTo('/admin')
yourself in the group, can you try that?
Not sure what the best solution here is. I like it being just an icon when inline, but clearly it needs a label in a group like this.
from filament-impersonate.
Hmm. I don't think we set a label for the table action, since it's usually desirable to just show an action with no label when it's inline.
I bet you could do
Impersonate::make()->label('Impersonate')->redirectTo('/admin')
yourself in the group, can you try that?Not sure what the best solution here is. I like it being just an icon when inline, but clearly it needs a label in a group like this.
Thanks. I had already tried that but that doesn't generate label like the other elements in the group. It's not crucial; if I can find the time I'll see how this can best be achieved.
from filament-impersonate.
I changed the code for STS\FilamentImpersonate\Tables\Actions\Impersonate
to this:
protected function setUp(): void
{
parent::setUp();
// $this
// ->iconButton()
// ->icon('impersonate-icon')
// ->action(fn ($record) => $this->impersonate($record))
// ->hidden(fn ($record) => !$this->canBeImpersonated($record));
$this->icon('impersonate-icon');
$this->color('primary');
$this->action(fn ($record) => $this->impersonate($record));
$this->hidden(fn ($record) => !$this->canBeImpersonated($record));
}
And now in my Action group I get this:
This does look more consistent IMHO.
from filament-impersonate.
For now I've implemented a custom Action class that extends STS\FilamentImpersonate\Tables\Actions\Impersonate
Filament\Tables\Actions\Action
so I'm happy 😉
Thanks for this great plugin!
from filament-impersonate.
The actual solution is:
Impersonate::make()->grouped()
from filament-impersonate.
Related Issues (20)
- Enable to show banner HOT 5
- [Suggestion] Submit to Filament plugins site HOT 1
- Crashing when leaving impersonate HOT 4
- Cause gap on Filament Sidebar HOT 5
- Problem to impersonate with admin guard HOT 7
- Error on impersionate HOT 4
- Display issue HOT 8
- Error on redirect FilamentManager::getUserName() HOT 3
- Auto mode not working properly
- registerRenderHook(): Argument #1 ($name) must be of type string, null given HOT 6
- Banner hidden by my navbar HOT 1
- Trapped in exception when impersonating soft-deleted user HOT 1
- Table Impersonate does not work with widgets HOT 2
- Trouble on impersonate from resources other than UserResource HOT 3
- Add Laravel 11 support HOT 3
- ImpersonateManager does not leave the impersonation HOT 5
- localize HOT 1
- It does not work with Multi-Tenant app HOT 1
- Always impersonating myself HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filament-impersonate.