mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Merge remote-tracking branch 'origin/master' into issues521_531_540
This commit is contained in:
@@ -33,11 +33,11 @@ class ApiController extends AbstractCRUDController
|
||||
* Base method for handling api action.
|
||||
*
|
||||
* @param mixed $id
|
||||
* @param mixed $_format
|
||||
* @param string $_format
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function entityApi(Request $request, $id, $_format): Response
|
||||
public function entityApi(Request $request, $id, ?string $_format = 'json'): Response
|
||||
{
|
||||
switch ($request->getMethod()) {
|
||||
case Request::METHOD_GET:
|
||||
|
@@ -8,30 +8,31 @@ window.addEventListener('DOMContentLoaded', function (e) {
|
||||
document.querySelectorAll('.notification_toggle_read_status')
|
||||
.forEach(function (el, i) {
|
||||
createApp({
|
||||
template: '<notification-read-toggle ' +
|
||||
':notificationId="notificationId" ' +
|
||||
':buttonClass="buttonClass" ' +
|
||||
':buttonNoText="buttonNoText" ' +
|
||||
':showUrl="showUrl" ' +
|
||||
':isRead="isRead"' +
|
||||
'@markRead="onMarkRead" @markUnread="onMarkUnread"' +
|
||||
'></notification-read-toggle>',
|
||||
template: `<notification-read-toggle
|
||||
:notificationId="notificationId"
|
||||
:buttonClass="buttonClass"
|
||||
:buttonNoText="buttonNoText"
|
||||
:showUrl="showUrl"
|
||||
:isRead="isRead"
|
||||
@markRead="onMarkRead"
|
||||
@markUnread="onMarkUnread">
|
||||
</notification-read-toggle>`,
|
||||
components: {
|
||||
NotificationReadToggle,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
notificationId: +el.dataset.notificationId,
|
||||
notificationId: el.dataset.notificationId,
|
||||
buttonClass: el.dataset.buttonClass,
|
||||
buttonNoText: 'false' === el.dataset.buttonText,
|
||||
showUrl: el.dataset.showButtonUrl,
|
||||
isRead: 1 === +el.dataset.notificationCurrentIsRead,
|
||||
isRead: 1 === el.dataset.notificationCurrentIsRead,
|
||||
container: el.dataset.container
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
getContainer() {
|
||||
return document.querySelectorAll('div.' + this.container);
|
||||
return document.querySelectorAll(`div.${this.container}`);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@@ -81,7 +81,7 @@ export default {
|
||||
/// [Option] showUrl is href for show page second button.
|
||||
// When passed, the component return a button-group with 2 buttons.
|
||||
isButtonGroup() {
|
||||
return !!this.showUrl
|
||||
return this.showUrl;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@@ -44,13 +44,21 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
|
||||
|
||||
switch ($type) {
|
||||
case DateTime::class:
|
||||
return DateTime::createFromFormat(DateTimeInterface::ISO8601, $data['datetime']);
|
||||
$result = DateTime::createFromFormat(DateTimeInterface::ISO8601, $data['datetime']);
|
||||
break;
|
||||
|
||||
case DateTimeInterface::class:
|
||||
case DateTimeImmutable::class:
|
||||
return DateTimeImmutable::createFromFormat(DateTimeInterface::ISO8601, $data['datetime']);
|
||||
$result = DateTimeImmutable::createFromFormat(DateTimeInterface::ISO8601, $data['datetime']);
|
||||
break;
|
||||
}
|
||||
|
||||
if (false === $result) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
throw new UnexpectedValueException();
|
||||
}
|
||||
|
||||
|
@@ -32,7 +32,7 @@ class PhonenumberNormalizer implements ContextAwareNormalizerInterface, Denormal
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $data
|
||||
* @param string|null $data
|
||||
* @param mixed $type
|
||||
* @param null|mixed $format
|
||||
*
|
||||
@@ -40,7 +40,7 @@ class PhonenumberNormalizer implements ContextAwareNormalizerInterface, Denormal
|
||||
*/
|
||||
public function denormalize($data, $type, $format = null, array $context = [])
|
||||
{
|
||||
if ('' === trim($data)) {
|
||||
if ('' === trim((string) $data)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user