mirror of
https://github.com/Karaka-Management/oms-Profile.git
synced 2026-02-15 14:58:40 +00:00
Merge branch 'develop' of https://github.com/Karaka-Management/oms-Profile into develop
This commit is contained in:
commit
c6d276ba4a
14
.github/user_bug_report.md
vendored
14
.github/user_bug_report.md
vendored
|
|
@ -8,9 +8,11 @@ assignees: ''
|
||||||
---
|
---
|
||||||
|
|
||||||
# Bug Description
|
# Bug Description
|
||||||
|
|
||||||
A clear and concise description of what the bug is.
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
# How to Reproduce
|
# How to Reproduce
|
||||||
|
|
||||||
Steps to reproduce the behavior:
|
Steps to reproduce the behavior:
|
||||||
|
|
||||||
1. Go to '...'
|
1. Go to '...'
|
||||||
|
|
@ -19,16 +21,20 @@ Steps to reproduce the behavior:
|
||||||
4. See error
|
4. See error
|
||||||
|
|
||||||
# Expected Behavior
|
# Expected Behavior
|
||||||
|
|
||||||
A clear and concise description of what you expected to happen.
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
# Screenshots
|
# Screenshots
|
||||||
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
# System Information
|
# System Information
|
||||||
- System: [e.g. PC or iPhone11, ...]
|
|
||||||
- OS: [e.g. iOS]
|
- System: [e.g. PC or iPhone11, ...]
|
||||||
- Browser [e.g. chrome, safari]
|
- OS: [e.g. iOS]
|
||||||
- KarakaVersion [e.g. 22]
|
- Browser [e.g. chrome, safari]
|
||||||
|
- KarakaVersion [e.g. 22]
|
||||||
|
|
||||||
# Additional Information
|
# Additional Information
|
||||||
|
|
||||||
Add any other context about the problem here.
|
Add any other context about the problem here.
|
||||||
|
|
|
||||||
3
.github/user_feature_request.md
vendored
3
.github/user_feature_request.md
vendored
|
|
@ -8,11 +8,14 @@ assignees: ''
|
||||||
---
|
---
|
||||||
|
|
||||||
# What is the feature you request
|
# What is the feature you request
|
||||||
|
|
||||||
* A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
* A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
* A clear and concise description of what you want to happen.
|
* A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
# Alternatives
|
# Alternatives
|
||||||
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
# Additional Information
|
# Additional Information
|
||||||
|
|
||||||
Add any other context or screenshots about the feature request here.
|
Add any other context or screenshots about the feature request here.
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ namespace Modules\Profile\Controller;
|
||||||
use Modules\Admin\Models\AccountMapper;
|
use Modules\Admin\Models\AccountMapper;
|
||||||
use Modules\Admin\Models\Address;
|
use Modules\Admin\Models\Address;
|
||||||
use Modules\Admin\Models\AddressMapper;
|
use Modules\Admin\Models\AddressMapper;
|
||||||
use Modules\Media\Models\NullMedia;
|
|
||||||
use Modules\Media\Models\MediaMapper;
|
use Modules\Media\Models\MediaMapper;
|
||||||
|
use Modules\Media\Models\NullMedia;
|
||||||
use Modules\Media\Models\PathSettings;
|
use Modules\Media\Models\PathSettings;
|
||||||
use Modules\Profile\Models\ContactElement;
|
use Modules\Profile\Models\ContactElement;
|
||||||
use Modules\Profile\Models\ContactElementMapper;
|
use Modules\Profile\Models\ContactElementMapper;
|
||||||
|
|
@ -271,10 +271,10 @@ final class ApiController extends Controller
|
||||||
public function validateContactElementCreate(RequestAbstract $request) : array
|
public function validateContactElementCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['account'] = (empty($request->getData('account')) && empty($request->getData('profile'))))
|
if (($val['account'] = (!$request->hasData('account') && !$request->hasData('profile')))
|
||||||
|| ($val['type'] = !\is_numeric($request->getData('type')))
|
|| ($val['type'] = !\is_numeric($request->getData('type')))
|
||||||
|| ($val['content'] = empty($request->getData('content')))
|
|| ($val['content'] = !$request->hasData('content'))
|
||||||
|| ($val['contact'] = empty($request->getData('contact')))
|
|| ($val['contact'] = !$request->hasData('contact'))
|
||||||
) {
|
) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
@ -356,11 +356,11 @@ final class ApiController extends Controller
|
||||||
private function validateAddressCreate(RequestAbstract $request) : array
|
private function validateAddressCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['account'] = (empty($request->getData('account')) && empty($request->getData('profile'))))
|
if (($val['account'] = (!$request->hasData('account') && !$request->hasData('profile')))
|
||||||
|| ($val['type'] = !\is_numeric($request->getData('type')))
|
|| ($val['type'] = !\is_numeric($request->getData('type')))
|
||||||
|| ($val['country'] = empty($request->getData('country')))
|
|| ($val['country'] = !$request->hasData('country'))
|
||||||
|| ($val['city'] = empty($request->getData('city')))
|
|| ($val['city'] = !$request->hasData('city'))
|
||||||
|| ($val['address'] = empty($request->getData('address')))
|
|| ($val['address'] = !$request->hasData('address'))
|
||||||
) {
|
) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||||
* @license OMS License 2.0
|
* @license OMS License 2.0
|
||||||
* @link https://jingga.app
|
* @link https://jingga.app
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @template T of ContactElement
|
||||||
|
* @extends DataMapperFactory<T>
|
||||||
*/
|
*/
|
||||||
final class ContactElementMapper extends DataMapperFactory
|
final class ContactElementMapper extends DataMapperFactory
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||||
* @license OMS License 2.0
|
* @license OMS License 2.0
|
||||||
* @link https://jingga.app
|
* @link https://jingga.app
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @template T of Contact
|
||||||
|
* @extends DataMapperFactory<T>
|
||||||
*/
|
*/
|
||||||
final class ContactMapper extends DataMapperFactory
|
final class ContactMapper extends DataMapperFactory
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||||
* @license OMS License 2.0
|
* @license OMS License 2.0
|
||||||
* @link https://jingga.app
|
* @link https://jingga.app
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @template T of Profile
|
||||||
|
* @extends DataMapperFactory<T>
|
||||||
*/
|
*/
|
||||||
final class ProfileMapper extends DataMapperFactory
|
final class ProfileMapper extends DataMapperFactory
|
||||||
{
|
{
|
||||||
|
|
@ -72,7 +75,7 @@ final class ProfileMapper extends DataMapperFactory
|
||||||
/**
|
/**
|
||||||
* Model to use by the mapper.
|
* Model to use by the mapper.
|
||||||
*
|
*
|
||||||
* @var class-string
|
* @var class-string<T>
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const MODEL = Profile::class;
|
public const MODEL = Profile::class;
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ use phpOMS\Application\ApplicationAbstract;
|
||||||
use phpOMS\Dispatcher\Dispatcher;
|
use phpOMS\Dispatcher\Dispatcher;
|
||||||
use phpOMS\Event\EventManager;
|
use phpOMS\Event\EventManager;
|
||||||
use phpOMS\Localization\ISO3166TwoEnum;
|
use phpOMS\Localization\ISO3166TwoEnum;
|
||||||
|
use phpOMS\Localization\L11nManager;
|
||||||
use phpOMS\Message\Http\HttpRequest;
|
use phpOMS\Message\Http\HttpRequest;
|
||||||
use phpOMS\Message\Http\HttpResponse;
|
use phpOMS\Message\Http\HttpResponse;
|
||||||
use phpOMS\Message\Http\RequestStatusCode;
|
use phpOMS\Message\Http\RequestStatusCode;
|
||||||
|
|
@ -66,6 +67,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../Modules/');
|
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../Modules/');
|
||||||
$this->app->dispatcher = new Dispatcher($this->app);
|
$this->app->dispatcher = new Dispatcher($this->app);
|
||||||
$this->app->eventManager = new EventManager($this->app->dispatcher);
|
$this->app->eventManager = new EventManager($this->app->dispatcher);
|
||||||
|
$this->app->l11nManager = new L11nManager();
|
||||||
$this->app->eventManager->importFromFile(__DIR__ . '/../../../Web/Api/Hooks.php');
|
$this->app->eventManager->importFromFile(__DIR__ . '/../../../Web/Api/Hooks.php');
|
||||||
|
|
||||||
$account = new Account();
|
$account = new Account();
|
||||||
|
|
@ -73,7 +75,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
$permission = new AccountPermission();
|
$permission = new AccountPermission();
|
||||||
$permission->setUnit(1);
|
$permission->setUnit(1);
|
||||||
$permission->setApp('backend');
|
$permission->setApp(2);
|
||||||
$permission->setPermission(
|
$permission->setPermission(
|
||||||
PermissionType::READ
|
PermissionType::READ
|
||||||
| PermissionType::CREATE
|
| PermissionType::CREATE
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user