-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: mikolaj <mikolaj.adamczyk@ez.no> Co-authored-by: katarzynazawada <>
- Loading branch information
1 parent
65f22bf
commit bc3ce24
Showing
7 changed files
with
102 additions
and
1 deletion.
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
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
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,26 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\AdminUi\Behat\Component; | ||
|
||
use Ibexa\Behat\Browser\Locator\VisibleCSSLocator; | ||
|
||
class DeleteContentDialog extends Dialog | ||
{ | ||
public function confirmTrashing(): void | ||
{ | ||
$this->getHTMLPage()->find($this->getLocator('trashConfirmCheckbox'))->click(); | ||
} | ||
|
||
public function specifyLocators(): array | ||
{ | ||
return array_merge(parent::specifyLocators(), [ | ||
new VisibleCSSLocator('trashConfirmCheckbox', '.modal-content .ibexa-input--checkbox'), | ||
]); | ||
} | ||
} |
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
43 changes: 43 additions & 0 deletions
43
src/lib/Form/TrashLocationOptionProvider/CanHaveDrafts.php
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,43 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\AdminUi\Form\TrashLocationOptionProvider; | ||
|
||
use Ibexa\Contracts\Core\Repository\Values\Content\Location; | ||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | ||
use Symfony\Component\Form\FormInterface; | ||
use Symfony\Contracts\Translation\TranslatorInterface; | ||
|
||
final class CanHaveDrafts implements TrashLocationOptionProvider | ||
{ | ||
private TranslatorInterface $translator; | ||
|
||
public function __construct(TranslatorInterface $translator) | ||
{ | ||
$this->translator = $translator; | ||
} | ||
|
||
public function supports(Location $location): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function addOptions(FormInterface $form, Location $location): void | ||
{ | ||
$form | ||
->add('can_have_drafts', ChoiceType::class, [ | ||
'label' => | ||
/** @Desc("Drafts") */ | ||
$this->translator->trans('drafts.list', [], 'ibexa_drafts'), | ||
'help_multiline' => [ | ||
/** @Desc("Sending this content item to Trash will also delete all drafts of content items that haven’t been published yet, and belong to the trashed subtree.") */ | ||
$this->translator->trans('trash.modal.send_to_trash_draft_warning.message', [], 'ibexa_drafts'), | ||
], | ||
]); | ||
} | ||
} |