test fixes and changes for release

This commit is contained in:
Dennis Eichhorn 2022-12-25 00:06:17 +01:00
parent 7f769063eb
commit 505199b4fa
4 changed files with 30 additions and 6 deletions

View File

@ -194,6 +194,9 @@ final class ApiController extends Controller
);
$profile->image = !empty($uploaded) ? \reset($uploaded) : new NullMedia();
if (!($profile->image instanceof NullMedia)) {
$profile->image = $this->app->moduleManager->get('Media')->resizeImage($profile->image, 100, 100, false);
}
$this->updateModel($request->header->account, $old, $profile, ProfileMapper::class, 'profile', $request->getOrigin());
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Profile', 'Profile successfully updated', $profile);

View File

@ -100,8 +100,10 @@ final class BackendController extends Controller
$profileImage = $this->app->appSettings->get(names: SettingsEnum::DEFAULT_PROFILE_IMAGE, module: 'Profile');
/** @var \Modules\Media\Modles\Media $image */
$image = MediaMapper::get()->where('id', (int) $profileImage->content)->execute();
/** @var \Modules\Media\Models\Media $image */
$image = MediaMapper::get()
->where('id', (int) $profileImage->content)
->execute();
$view->setData('defaultImage', $image);
@ -144,7 +146,7 @@ final class BackendController extends Controller
->with('location')
->with('contactElements');
/** @var \Modules\Profile\Modles\Profile $profile */
/** @var \Modules\Profile\Models\Profile $profile */
$profile = $request->getData('for') !== null
? $mapperQuery->where('account', (int) $request->getData('for'))->execute()
: $mapperQuery->where('id', (int) $request->getData('id'))->execute();
@ -162,14 +164,14 @@ final class BackendController extends Controller
$accGrpSelector = new \Modules\Profile\Theme\Backend\Components\AccountGroupSelector\BaseView($this->app->l11nManager, $request, $response);
$view->addData('accGrpSelector', $accGrpSelector);
/** @var \Modules\Media\Modles\Media[] $media */
/** @var \Modules\Media\Models\Media[] $media */
$media = MediaMapper::getAll()
->with('createdBy')
->where('createdBy', (int) $profile->account->getId())
->limit(25)
->execute();
$view->setData('media', $media instanceof NullMedia ? [] : (!\is_array($media) ? [$media] : $media));
$view->setData('media', $media);
$profileImage = $this->app->appSettings->get(names: SettingsEnum::DEFAULT_PROFILE_IMAGE, module: 'Profile');
$image = MediaMapper::get()->where('id', (int) $profileImage->content)->execute();

View File

@ -105,7 +105,7 @@ class Contact
* @var int
* @since 1.0.0
*/
private int $profile = 0;
public int $profile = 0;
/**
* Constructor.

View File

@ -257,6 +257,25 @@ $CONFIG = [
'root' => '/',
'https' => false,
],
'app' => [
'path' => __DIR__,
'default' => [
'app' => 'Backend',
'id' => 'backend',
'lang' => 'en',
'theme' => 'Backend',
'org' => 1,
],
'domains' => [
'127.0.0.1' => [
'app' => 'Backend',
'id' => 'backend',
'lang' => 'en',
'theme' => 'Backend',
'org' => 1,
],
],
],
'socket' => [
'master' => [
'host' => '127.0.0.1',