- Introduced `StoreURLAppForm` and `StoreURLAppData` for form handling and data transformation. - Added `UrlAppService` to streamline URL app creation with settings like `accessUrl` and `isConnectedToMicrosoft`. - Enhanced user access controls with role-based permissions using `UserAccessTypeEnum`. - Updated UI for URL app creation with support for logos and dynamic role selection. - Implemented feature tests to validate URL app creation and access URL formatting.
35 lines
1014 B
PHP
35 lines
1014 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Data\Application;
|
|
|
|
use App\Enums\UserAccessTypeEnum;
|
|
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
|
use Spatie\LaravelData\Data;
|
|
|
|
class StoreURLAppData extends Data
|
|
{
|
|
public function __construct(
|
|
public string $name,
|
|
public UserAccessTypeEnum $userAccessType,
|
|
public string $accessUrl,
|
|
public bool $isConnectedToMicrosoft = false,
|
|
public ?TemporaryUploadedFile $logo = null,
|
|
/** @var array<int> */
|
|
public array $roleIds = [],
|
|
) {}
|
|
|
|
public static function fromArray(array $value): StoreURLAppData
|
|
{
|
|
return new self(
|
|
name: $value['name'],
|
|
userAccessType: UserAccessTypeEnum::from($value['userAccessOption']),
|
|
accessUrl: $value['accessUrl'],
|
|
isConnectedToMicrosoft: (bool) ($value['isConnectedToMicrosoft'] ?? false),
|
|
logo: $value['logo'] ?? null,
|
|
roleIds: $value['roleIds'] ?? [],
|
|
);
|
|
}
|
|
}
|