forked from EasyCorp/EasyAdminBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Impersonate from user menu dropdown EasyCorp#6524
- Loading branch information
1 parent
e7141eb
commit e80ccc5
Showing
20 changed files
with
106 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"/app.d52c6a33.css" | ||
], | ||
"js": [ | ||
"/app.3048ce28.js" | ||
"/app.fb2fb73c.js" | ||
] | ||
}, | ||
"form": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace EasyCorp\Bundle\EasyAdminBundle\Config\Menu; | ||
|
||
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Menu\MenuItemInterface; | ||
use EasyCorp\Bundle\EasyAdminBundle\Dto\MenuItemDto; | ||
use Symfony\Contracts\Translation\TranslatableInterface; | ||
|
||
/** | ||
* @see EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem::linkToAccessImpersonation() | ||
* | ||
* @author Elías Fernández <[email protected]> | ||
*/ | ||
final class AccessImpersonationMenuItem implements MenuItemInterface | ||
{ | ||
use MenuItemTrait; | ||
|
||
public function __construct(TranslatableInterface|string $label, ?string $icon) | ||
{ | ||
$this->dto = new MenuItemDto(); | ||
|
||
$this->dto->setType(MenuItemDto::TYPE_ACCESS_IMPERSONATION); | ||
$this->dto->setLabel($label); | ||
$this->dto->setIcon($icon); | ||
$this->dto->setLinkUrl('test'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
src/Resources/public/app.3048ce28.js → src/Resources/public/app.fb2fb73c.js
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"/app.d52c6a33.css" | ||
], | ||
"js": [ | ||
"/app.3048ce28.js" | ||
"/app.fb2fb73c.js" | ||
] | ||
}, | ||
"form": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div id="modal-impersonate" class="modal fade" tabindex="-1"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-body p-4"> | ||
<form method="get"> | ||
<div class="row"> | ||
<div class="col-12"> | ||
<div class="field-text form-group"> | ||
<label for="_switch_user" class="form-control-label required">{{ 'impersonate.username'|trans(domain = 'EasyAdminBundle') }}</label> | ||
<div class="form-widget"> | ||
<input type="text" name="_switch_user" id="impersonate_user_name" required="required" class="form-control" value=""> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" data-bs-dismiss="modal" class="btn btn-sm btn-secondary" id="impersonate-modal-clear-button" formtarget="_self"> | ||
<i class="fa fa-close"></i> {{ 'action.close'|trans(domain = 'EasyAdminBundle') }} | ||
</button> | ||
|
||
<button type="button" data-bs-dismiss="modal" class="btn btn-sm btn-primary" id="impersonate-modal-apply-button" formtarget="_self"> | ||
<i class="fa fa-check"></i> {{ 'user.impersonate_user'|trans(domain = 'EasyAdminBundle') }} | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters