diff --git a/composer.json b/composer.json index ca6d7e6..fc0e5b6 100644 --- a/composer.json +++ b/composer.json @@ -12,12 +12,16 @@ { "name": "chokeslam", "email": "chokeslam5608@gmail.com" + }, + { + "name": "Simon Asika", + "email": "asika32764@gmail.com" } ], "minimum-stability": "beta", "require": { - "myclabs/php-enum": "^1.8", - "lyrasoft/luna": "^1.0||^2.0" + "php": ">=8.2", + "lyrasoft/luna": "^2.0" }, "extra": { "windwalker": { diff --git a/resources/migrations/20211112105026329690_FaqInit.php b/resources/migrations/2021111210500001_FaqInit.php similarity index 100% rename from resources/migrations/20211112105026329690_FaqInit.php rename to resources/migrations/2021111210500001_FaqInit.php diff --git a/src/Entity/Faq.php b/src/Entity/Faq.php index 3a89b29..7e343e3 100644 --- a/src/Entity/Faq.php +++ b/src/Entity/Faq.php @@ -11,6 +11,7 @@ namespace Lyrasoft\Faq\Entity; +use Windwalker\Core\DateTime\ServerTimeCast; use Windwalker\ORM\Attributes\AutoIncrement; use Unicorn\Enum\BasicState; use Windwalker\ORM\Attributes\Cast; @@ -62,7 +63,7 @@ class Faq implements EntityInterface protected int $ordering = 0; #[Column('created')] - #[CastNullable(Chronos::class)] + #[CastNullable(ServerTimeCast::class)] #[CreatedTime] protected ?Chronos $created = null; @@ -71,7 +72,7 @@ class Faq implements EntityInterface protected int $createdBy = 0; #[Column('modified')] - #[CastNullable(Chronos::class)] + #[CastNullable(ServerTimeCast::class)] #[CurrentTime] protected ?Chronos $modified = null; @@ -180,7 +181,7 @@ public function getCreated(): ?Chronos public function setCreated(\DateTimeInterface|string|null $created): static { - $this->created = Chronos::wrapOrNull($created); + $this->created = Chronos::tryWrap($created); return $this; } @@ -204,7 +205,7 @@ public function getModified(): ?Chronos public function setModified(\DateTimeInterface|string|null $modified): static { - $this->modified = Chronos::wrapOrNull($modified); + $this->modified = Chronos::tryWrap($modified); return $this; } diff --git a/src/Module/Admin/Faq/assets/faq-edit.js b/src/Module/Admin/Faq/assets/faq-edit.js deleted file mode 100644 index 07d1866..0000000 --- a/src/Module/Admin/Faq/assets/faq-edit.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Part of starter project. - * - * @copyright Copyright (C) 2021 __ORGANIZATION__. - * @license __LICENSE__ - */ - -import u from '@main'; - -u.$ui.bootstrap.tooltip(); - -const form = '#admin-form'; - -u.formValidation() - .then(() => u.$ui.disableOnSubmit(form)); -u.form(form).initComponent(); -u.$ui.keepAlive(location.href); diff --git a/src/Module/Admin/Faq/assets/faq-edit.ts b/src/Module/Admin/Faq/assets/faq-edit.ts new file mode 100644 index 0000000..332c9a5 --- /dev/null +++ b/src/Module/Admin/Faq/assets/faq-edit.ts @@ -0,0 +1,10 @@ +import u from '@main'; + +u.$ui.bootstrap.tooltip(); + +const formId = '#admin-form'; + +u.formValidation() + .then(() => u.$ui.disableOnSubmit(formId)); +u.form(formId).initComponent(); +u.$ui.keepAlive(location.href); diff --git a/src/Module/Admin/Faq/assets/faq-list.js b/src/Module/Admin/Faq/assets/faq-list.js deleted file mode 100644 index db022e5..0000000 --- a/src/Module/Admin/Faq/assets/faq-list.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Part of starter project. - * - * @copyright Copyright (C) 2021 __ORGANIZATION__. - * @license __LICENSE__ - */ - -import u from '@main'; - -u.$ui.bootstrap.tooltip(); - -const form = '#admin-form'; - -u.grid(form).initComponent(); -u.$ui.disableOnSubmit(form); -u.$ui.checkboxesMultiSelect(form); diff --git a/src/Module/Admin/Faq/assets/faq-list.ts b/src/Module/Admin/Faq/assets/faq-list.ts new file mode 100644 index 0000000..7c8ee5b --- /dev/null +++ b/src/Module/Admin/Faq/assets/faq-list.ts @@ -0,0 +1,9 @@ +import u from '@main'; + +u.$ui.bootstrap.tooltip(); + +const formId = '#admin-form'; + +u.grid(formId).initComponent(); +u.$ui.disableOnSubmit(formId); +u.$ui.checkboxesMultiSelect(formId); diff --git a/src/Module/Front/Faq/assets/faq-list.js b/src/Module/Front/Faq/assets/faq-list.ts similarity index 100% rename from src/Module/Front/Faq/assets/faq-list.js rename to src/Module/Front/Faq/assets/faq-list.ts