From 67bd1d53d85d5f66cc920cb572ceb2521f25f192 Mon Sep 17 00:00:00 2001 From: kandarp-canyon Date: Wed, 11 Dec 2024 01:47:33 +0530 Subject: [PATCH] [ADVAPP-1046]:Feature Flag Cleanup: TagFeatureFlag (#1170) --- .../ProspectResource/Pages/ListProspects.php | 4 +- .../ProspectResource/Pages/ViewProspect.php | 6 +-- .../Resources/ProspectTagResource.php | 6 --- .../Pages/Concerns/HasStudentHeader.php | 3 +- .../StudentResource/Pages/ListStudents.php | 3 +- .../Schemas/StudentProfileInfolist.php | 4 +- .../Filament/Resources/StudentTagResource.php | 6 --- app/Features/TagFeatureFlag.php | 47 ----------------- ...03_084103_data_tag_active_feature_flag.php | 50 ------------------- 9 files changed, 6 insertions(+), 123 deletions(-) delete mode 100644 app/Features/TagFeatureFlag.php delete mode 100644 database/migrations/2024_12_03_084103_data_tag_active_feature_flag.php diff --git a/app-modules/prospect/src/Filament/Resources/ProspectResource/Pages/ListProspects.php b/app-modules/prospect/src/Filament/Resources/ProspectResource/Pages/ListProspects.php index 1321b4f82a..80bbfc68fa 100644 --- a/app-modules/prospect/src/Filament/Resources/ProspectResource/Pages/ListProspects.php +++ b/app-modules/prospect/src/Filament/Resources/ProspectResource/Pages/ListProspects.php @@ -40,7 +40,6 @@ use App\Enums\TagType; use Filament\Forms\Get; use Filament\Tables\Table; -use App\Features\TagFeatureFlag; use Filament\Actions\CreateAction; use Filament\Actions\ImportAction; use Filament\Tables\Filters\Filter; @@ -171,8 +170,7 @@ function (Builder $query, array $data) { $query->whereIn('tag_id', $data['values']); }); } - ) - ->visible(fn (): bool => TagFeatureFlag::active()), + ), ]) ->actions([ ViewAction::make(), diff --git a/app-modules/prospect/src/Filament/Resources/ProspectResource/Pages/ViewProspect.php b/app-modules/prospect/src/Filament/Resources/ProspectResource/Pages/ViewProspect.php index 89d841057a..8d33cc771a 100644 --- a/app-modules/prospect/src/Filament/Resources/ProspectResource/Pages/ViewProspect.php +++ b/app-modules/prospect/src/Filament/Resources/ProspectResource/Pages/ViewProspect.php @@ -36,7 +36,6 @@ namespace AdvisingApp\Prospect\Filament\Resources\ProspectResource\Pages; -use App\Features\TagFeatureFlag; use Filament\Actions\EditAction; use Filament\Infolists\Infolist; use Filament\Resources\Pages\ViewRecord; @@ -116,8 +115,7 @@ public function infolist(Infolist $infolist): Infolist TextEntry::make('tags.name') ->label('Tags') ->badge() - ->placeholder('-') - ->visible(fn (): bool => TagFeatureFlag::active()), + ->placeholder('-'), ]) ->columns(2), Section::make('Engagement Restrictions') @@ -142,7 +140,7 @@ public function infolist(Infolist $infolist): Infolist protected function getHeaderActions(): array { return [ - ProspectTagsAction::make()->visible(fn (): bool => TagFeatureFlag::active() && auth()->user()?->can('prospect.tags.manage')), + ProspectTagsAction::make()->visible(fn (): bool => auth()->user()?->can('prospect.tags.manage')), ConvertToStudent::make()->visible(fn (Prospect $record) => ! $record->student()->exists()), DisassociateStudent::make()->visible(fn (Prospect $record) => $record->student()->exists()), EditAction::make(), diff --git a/app-modules/prospect/src/Filament/Resources/ProspectTagResource.php b/app-modules/prospect/src/Filament/Resources/ProspectTagResource.php index 11547fc05d..bad5b82a69 100644 --- a/app-modules/prospect/src/Filament/Resources/ProspectTagResource.php +++ b/app-modules/prospect/src/Filament/Resources/ProspectTagResource.php @@ -38,7 +38,6 @@ use App\Models\Tag; use App\Enums\TagType; -use App\Features\TagFeatureFlag; use Filament\Resources\Resource; use Illuminate\Database\Eloquent\Builder; use App\Filament\Clusters\ConstituentManagement; @@ -61,11 +60,6 @@ class ProspectTagResource extends Resource protected static ?string $navigationGroup = 'Prospects'; - public static function canAccess(): bool - { - return TagFeatureFlag::active() && parent::canAccess(); - } - public static function getPages(): array { return [ diff --git a/app-modules/student-data-model/src/Filament/Resources/StudentResource/Pages/Concerns/HasStudentHeader.php b/app-modules/student-data-model/src/Filament/Resources/StudentResource/Pages/Concerns/HasStudentHeader.php index 6ab9010640..1c0c6c3adf 100644 --- a/app-modules/student-data-model/src/Filament/Resources/StudentResource/Pages/Concerns/HasStudentHeader.php +++ b/app-modules/student-data-model/src/Filament/Resources/StudentResource/Pages/Concerns/HasStudentHeader.php @@ -36,7 +36,6 @@ namespace AdvisingApp\StudentDataModel\Filament\Resources\StudentResource\Pages\Concerns; -use App\Features\TagFeatureFlag; use App\Settings\DisplaySettings; use Illuminate\Contracts\View\View; use AdvisingApp\Notification\Filament\Actions\SubscribeHeaderAction; @@ -92,7 +91,7 @@ public function getHeader(): ?View protected function getHeaderActions(): array { return [ - StudentTagsAction::make()->visible(fn (): bool => TagFeatureFlag::active() && auth()->user()->can('student.tags.manage')), + StudentTagsAction::make()->visible(fn (): bool => auth()->user()->can('student.tags.manage')), SyncStudentSisAction::make(), SubscribeHeaderAction::make(), ]; diff --git a/app-modules/student-data-model/src/Filament/Resources/StudentResource/Pages/ListStudents.php b/app-modules/student-data-model/src/Filament/Resources/StudentResource/Pages/ListStudents.php index b19921fdb8..963ebe956d 100644 --- a/app-modules/student-data-model/src/Filament/Resources/StudentResource/Pages/ListStudents.php +++ b/app-modules/student-data-model/src/Filament/Resources/StudentResource/Pages/ListStudents.php @@ -40,7 +40,6 @@ use App\Models\User; use App\Enums\TagType; use Filament\Tables\Table; -use App\Features\TagFeatureFlag; use Filament\Tables\Filters\Filter; use AdvisingApp\Segment\Models\Segment; use Filament\Tables\Actions\ViewAction; @@ -155,7 +154,7 @@ function (Builder $query, array $data) { $query->whereIn('tag_id', $data['values']); }); } - )->visible(fn (): bool => TagFeatureFlag::active()), + ), ]) ->actions([ ViewAction::make() diff --git a/app-modules/student-data-model/src/Filament/Resources/StudentResource/Schemas/StudentProfileInfolist.php b/app-modules/student-data-model/src/Filament/Resources/StudentResource/Schemas/StudentProfileInfolist.php index 4f7e04da56..e94064e700 100644 --- a/app-modules/student-data-model/src/Filament/Resources/StudentResource/Schemas/StudentProfileInfolist.php +++ b/app-modules/student-data-model/src/Filament/Resources/StudentResource/Schemas/StudentProfileInfolist.php @@ -36,7 +36,6 @@ namespace AdvisingApp\StudentDataModel\Filament\Resources\StudentResource\Schemas; -use App\Features\TagFeatureFlag; use Filament\Infolists\Infolist; use App\Infolists\Components\Subsection; use Filament\Infolists\Components\Section; @@ -54,8 +53,7 @@ public static function configure(Infolist $infolist): Infolist TextEntry::make('tags.name') ->label('Tags') ->badge() - ->placeholder('-') - ->visible(fn (): bool => TagFeatureFlag::active()), + ->placeholder('-'), TextEntry::make('email_2') ->label('Alternate Email') ->placeholder('-'), diff --git a/app-modules/student-data-model/src/Filament/Resources/StudentTagResource.php b/app-modules/student-data-model/src/Filament/Resources/StudentTagResource.php index eb743e4325..50d095a648 100644 --- a/app-modules/student-data-model/src/Filament/Resources/StudentTagResource.php +++ b/app-modules/student-data-model/src/Filament/Resources/StudentTagResource.php @@ -38,7 +38,6 @@ use App\Models\Tag; use App\Enums\TagType; -use App\Features\TagFeatureFlag; use Filament\Resources\Resource; use Illuminate\Database\Eloquent\Builder; use App\Filament\Clusters\ConstituentManagement; @@ -61,11 +60,6 @@ class StudentTagResource extends Resource protected static ?string $navigationGroup = 'Students'; - public static function canAccess(): bool - { - return TagFeatureFlag::active() && parent::canAccess(); - } - public static function getPages(): array { return [ diff --git a/app/Features/TagFeatureFlag.php b/app/Features/TagFeatureFlag.php deleted file mode 100644 index 250e6953a9..0000000000 --- a/app/Features/TagFeatureFlag.php +++ /dev/null @@ -1,47 +0,0 @@ - - - Copyright © 2016-2024, Canyon GBS LLC. All rights reserved. - - Advising App™ is licensed under the Elastic License 2.0. For more details, - see https://github.com/canyongbs/advisingapp/blob/main/LICENSE. - - Notice: - - - You may not provide the software to third parties as a hosted or managed - service, where the service provides users with access to any substantial set of - the features or functionality of the software. - - You may not move, change, disable, or circumvent the license key functionality - in the software, and you may not remove or obscure any functionality in the - software that is protected by the license key. - - You may not alter, remove, or obscure any licensing, copyright, or other notices - of the licensor in the software. Any use of the licensor’s trademarks is subject - to applicable law. - - Canyon GBS LLC respects the intellectual property rights of others and expects the - same in return. Canyon GBS™ and Advising App™ are registered trademarks of - Canyon GBS LLC, and we are committed to enforcing and protecting our trademarks - vigorously. - - The software solution, including services, infrastructure, and code, is offered as a - Software as a Service (SaaS) by Canyon GBS LLC. - - Use of this software implies agreement to the license terms and conditions as stated - in the Elastic License 2.0. - - For more information or inquiries please visit our website at - https://www.canyongbs.com or contact us via email at legal@canyongbs.com. - - -*/ - -namespace App\Features; - -use App\Support\AbstractFeatureFlag; - -class TagFeatureFlag extends AbstractFeatureFlag -{ - public function resolve(mixed $scope): mixed - { - return false; - } -} diff --git a/database/migrations/2024_12_03_084103_data_tag_active_feature_flag.php b/database/migrations/2024_12_03_084103_data_tag_active_feature_flag.php deleted file mode 100644 index 95cc524cd1..0000000000 --- a/database/migrations/2024_12_03_084103_data_tag_active_feature_flag.php +++ /dev/null @@ -1,50 +0,0 @@ - - - Copyright © 2016-2024, Canyon GBS LLC. All rights reserved. - - Advising App™ is licensed under the Elastic License 2.0. For more details, - see https://github.com/canyongbs/advisingapp/blob/main/LICENSE. - - Notice: - - - You may not provide the software to third parties as a hosted or managed - service, where the service provides users with access to any substantial set of - the features or functionality of the software. - - You may not move, change, disable, or circumvent the license key functionality - in the software, and you may not remove or obscure any functionality in the - software that is protected by the license key. - - You may not alter, remove, or obscure any licensing, copyright, or other notices - of the licensor in the software. Any use of the licensor’s trademarks is subject - to applicable law. - - Canyon GBS LLC respects the intellectual property rights of others and expects the - same in return. Canyon GBS™ and Advising App™ are registered trademarks of - Canyon GBS LLC, and we are committed to enforcing and protecting our trademarks - vigorously. - - The software solution, including services, infrastructure, and code, is offered as a - Software as a Service (SaaS) by Canyon GBS LLC. - - Use of this software implies agreement to the license terms and conditions as stated - in the Elastic License 2.0. - - For more information or inquiries please visit our website at - https://www.canyongbs.com or contact us via email at legal@canyongbs.com. - - -*/ - -use App\Features\TagFeatureFlag; -use Illuminate\Database\Migrations\Migration; - -return new class () extends Migration { - public function up(): void - { - TagFeatureFlag::activate(); - } - - public function down(): void - { - TagFeatureFlag::deactivate(); - } -};