-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EZP-28509: Design improvements for Section list
- Loading branch information
1 parent
7036e95
commit 61cfe03
Showing
9 changed files
with
263 additions
and
37 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
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
29 changes: 29 additions & 0 deletions
29
src/bundle/Resources/public/js/scripts/admin.section.view.js
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 @@ | ||
(function () { | ||
const btns = document.querySelectorAll('.btn--open-udw'); | ||
const udwContainer = document.getElementById('react-udw'); | ||
const token = document.querySelector('meta[name="CSRF-Token"]').content; | ||
const siteaccess = document.querySelector('meta[name="SiteAccess"]').content; | ||
const closeUDW = () => udwContainer.innerHTML = ''; | ||
const onConfirm = (form, content) => { | ||
const field = form.querySelector('#' + form.getAttribute('name') + '_locations_location'); | ||
|
||
field.value = content.map(item => item.id).join(); | ||
|
||
closeUDW(); | ||
form.submit(); | ||
}; | ||
const onCancel = () => closeUDW(); | ||
const openUDW = (event) => { | ||
event.preventDefault(); | ||
|
||
const form = event.target.closest('form'); | ||
|
||
ReactDOM.render(React.createElement(eZ.modules.UniversalDiscovery, { | ||
onConfirm: onConfirm.bind(this, form), | ||
onCancel, | ||
restInfo: {token, siteaccess} | ||
}), udwContainer); | ||
}; | ||
|
||
btns.forEach(btn => btn.addEventListener('click', openUDW, false)); | ||
})(); |
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,44 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace EzSystems\EzPlatformAdminUi\Form\Data\Section; | ||
|
||
use eZ\Publish\API\Repository\Values\Content\Section; | ||
|
||
/** | ||
* @todo Add validation | ||
*/ | ||
class SectionsDeleteData | ||
{ | ||
/** @var array|null */ | ||
protected $sections; | ||
|
||
/** | ||
* @param Section[]|null $sections | ||
*/ | ||
public function __construct(array $sections = []) | ||
{ | ||
$this->sections = $sections; | ||
} | ||
|
||
/** | ||
* @return array|null | ||
*/ | ||
public function getSections(): ?array | ||
{ | ||
return $this->sections; | ||
} | ||
|
||
/** | ||
* @param array|null $sections | ||
*/ | ||
public function setSections(?array $sections) | ||
{ | ||
$this->sections = $sections; | ||
} | ||
} |
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
Oops, something went wrong.