Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADVAPP-291]: Performance improvements #500

Merged
merged 9 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ SEND_QUERIES_TO_RAY=false

LARAVEL_SCHEDULER_ENABLED=true
LARAVEL_QUEUE_ENABLED=true
CACHE_ICONS=true

# A comma separated list of emails that will be seeded as internal users
DEMO_INTERNAL_USER_EMAILS=
Expand Down
2 changes: 1 addition & 1 deletion app-modules/alert/src/Providers/AlertServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class AlertServiceProvider extends ServiceProvider

public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new AlertPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new AlertPlugin()));
}

public function boot(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class AnalyticsServiceProvider extends ServiceProvider
{
public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new AnalyticsPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new AnalyticsPlugin()));
}

public function boot(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ApplicationServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new ApplicationPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new ApplicationPlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AssistantServiceProvider extends ServiceProvider
{
public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new AssistantPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new AssistantPlugin()));
}

public function boot(): void
Expand Down
2 changes: 1 addition & 1 deletion app-modules/audit/src/Providers/AuditServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AuditServiceProvider extends ServiceProvider
{
public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new AuditPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new AuditPlugin()));

app('config')->set('audit', require base_path('app-modules/audit/config/audit.php'));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class AuthorizationServiceProvider extends ServiceProvider
{
public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new AuthorizationPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new AuthorizationPlugin()));

$this->app->singleton(AuthorizationPermissionRegistry::class, function ($app) {
return new AuthorizationPermissionRegistry();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CampaignServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new CampaignPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new CampaignPlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CareTeamServiceProvider extends ServiceProvider

public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new CareTeamPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new CareTeamPlugin()));
}

public function boot(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CaseloadManagementServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new CaseloadManagementPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new CaseloadManagementPlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ConsentServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new ConsentPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new ConsentPlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class DivisionServiceProvider extends ServiceProvider

public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new DivisionPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new DivisionPlugin()));
}

public function boot(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class EngagementServiceProvider extends ServiceProvider
{
public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new EngagementPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new EngagementPlugin()));
}

public function boot(): void
Expand Down
2 changes: 1 addition & 1 deletion app-modules/form/src/Providers/FormServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class FormServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new FormPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new FormPlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class InAppCommunicationServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new InAppCommunicationPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new InAppCommunicationPlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class IntegrationAIServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new IntegrationAIPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new IntegrationAIPlugin()));

$this->app->singleton(AIChatClient::class, function () {
if ($this->app->runningUnitTests() || config('services.azure_open_ai.enable_test_mode') === true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class IntegrationAwsSesEventHandlingServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new IntegrationAwsSesEventHandlingPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new IntegrationAwsSesEventHandlingPlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class IntegrationGoogleAnalyticsServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new IntegrationGoogleAnalyticsPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new IntegrationGoogleAnalyticsPlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class IntegrationGoogleRecaptchaServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new IntegrationGoogleRecaptchaPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new IntegrationGoogleRecaptchaPlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class IntegrationMicrosoftClarityServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new IntegrationMicrosoftClarityPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new IntegrationMicrosoftClarityPlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class IntegrationTwilioServiceProvider extends ServiceProvider
{
public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new IntegrationTwilioPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new IntegrationTwilioPlugin()));

$this->app->bind(EngagementResponseSenderFinder::class, function () {
if (config('services.twilio.enable_test_sender') === true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class InteractionServiceProvider extends ServiceProvider

public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new InteractionPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new InteractionPlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class InventoryManagementServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new InventoryManagementPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new InventoryManagementPlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class KnowledgeBaseServiceProvider extends ServiceProvider

public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new KnowledgeBasePlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new KnowledgeBasePlugin()));
}

public function boot(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class MeetingCenterServiceProvider extends ServiceProvider
{
public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new MeetingCenterPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new MeetingCenterPlugin()));
}

public function boot(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class PortalServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new PortalPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new PortalPlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ProspectServiceProvider extends ServiceProvider

public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new ProspectPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new ProspectPlugin()));
}

public function boot(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ReportServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new ReportPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new ReportPlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ServiceManagementServiceProvider extends ServiceProvider

public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new ServiceManagementPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new ServiceManagementPlugin()));

$this->app->bind(ServiceRequestNumberGenerator::class, SqidPlusSixServiceRequestNumberGenerator::class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class StudentDataModelServiceProvider extends ServiceProvider

public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new StudentDataModelPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new StudentDataModelPlugin()));
}

public function boot(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class SurveyServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new SurveyPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new SurveyPlugin()));
}

public function boot()
Expand Down
2 changes: 1 addition & 1 deletion app-modules/task/src/Providers/TaskServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class TaskServiceProvider extends ServiceProvider
{
public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new TaskPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new TaskPlugin()));
}

public function boot(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@

use App\Models\User;
use AdvisingApp\Task\Enums\TaskStatus;
use AdvisingApp\Prospect\Models\Prospect;
use Worksome\RequestFactories\RequestFactory;
use AdvisingApp\StudentDataModel\Models\Student;

class EditTaskRequestFactory extends RequestFactory
{
public function definition(): array
{
$student = Student::factory()->create();
$prospect = Prospect::factory()->create();

return [
'title' => str(fake()->words(asText: 3))->title()->toString(),
'description' => fake()->sentence(),
'status' => fake()->randomElement(TaskStatus::cases())->value,
'due' => now()->addWeek(),
'assigned_to' => User::factory()->create()->id,
'concern_id' => $student->getKey(),
'concern_type' => $student->getMorphClass(),
'concern_type' => $prospect->getMorphClass(),
'concern_id' => $prospect->getKey(),
];
}
}
2 changes: 1 addition & 1 deletion app-modules/team/src/Providers/TeamServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TeamServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new TeamPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new TeamPlugin()));
}

public function boot()
Expand Down
2 changes: 1 addition & 1 deletion app-modules/theme/src/Providers/ThemeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ThemeServiceProvider extends ServiceProvider
{
public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new ThemePlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new ThemePlugin()));
}

public function boot(AuthorizationPermissionRegistry $permissionRegistry, AuthorizationRoleRegistry $roleRegistry): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class TimelineServiceProvider extends ServiceProvider
{
public function register()
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new TimelinePlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new TimelinePlugin()));
}

public function boot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class WebhookServiceProvider extends ServiceProvider
{
public function register(): void
{
Panel::configureUsing(fn (Panel $panel) => $panel->plugin(new WebhookPlugin()));
Panel::configureUsing(fn (Panel $panel) => ($panel->getId() !== 'admin') || $panel->plugin(new WebhookPlugin()));

$this->app->bind(
MessageValidator::class,
Expand Down
Loading