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

Survey Branch Fix #416

Merged
merged 61 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
c41adb6
Merge pull request #341 from canyongbs/develop
Orrison Dec 7, 2023
e1ed32a
Merge pull request #367 from canyongbs/develop
Orrison Dec 14, 2023
be22e39
Merge pull request #393 from canyongbs/develop
Orrison Dec 22, 2023
1236eb0
Merge pull request #408 from canyongbs/develop
Orrison Dec 28, 2023
54f54fe
Register survey field blocks.
dgoetzit Jan 3, 2024
4129bad
Update field labels.
dgoetzit Jan 3, 2024
60f05b6
Merge pull request #412 from canyongbs/feature/advapp-136-survey-blocks
Orrison Jan 4, 2024
d06233b
Setup the separate column licenses
Orrison Jan 2, 2024
ab3e3f6
Update LicenseSettings with addon changes
Orrison Jan 2, 2024
4938452
Update and remove old references
Orrison Jan 2, 2024
f218ca3
Fix bug with ListUsers header
Orrison Jan 2, 2024
969732a
Create a license management processes
Orrison Jan 2, 2024
964c8f7
Setup rules and auditing
Orrison Jan 3, 2024
7492447
helpers and disables
Orrison Jan 3, 2024
a8f0624
chore: fix enforcement of copyright on all files
Orrison Jan 3, 2024
dd49f2a
Create AssetExchange model, add soft deletes.
dgoetzit Dec 28, 2023
77d723b
Asset exchange type and system classification.
dgoetzit Dec 28, 2023
b71c071
Add policies.
dgoetzit Dec 28, 2023
d6e7cca
Utilize two model system.
dgoetzit Jan 2, 2024
3f33042
Add check out action.
dgoetzit Jan 3, 2024
fa3bff3
Add check in action.
dgoetzit Jan 3, 2024
8175cf1
Make status configurable on check in.
dgoetzit Jan 3, 2024
0b7db9e
Clean up action validation.
dgoetzit Jan 3, 2024
1f07cfb
Update policies, roles.
dgoetzit Jan 3, 2024
54e7d51
Add classification controls to asset status resource.
dgoetzit Jan 3, 2024
627f2d5
Clean up.
dgoetzit Jan 3, 2024
8772bb4
chore: fix enforcement of copyright on all files
dgoetzit Jan 3, 2024
fb54dbe
chore: fix code style
joelicatajr Jan 3, 2024
60230e4
Remove open search fields and indexing from prospects.
dgoetzit Jan 3, 2024
0630c2f
Init event registration
Orrison Dec 27, 2023
22399e1
Fix survey widget auth
Orrison Dec 27, 2023
e9f66c4
Clear out all non-related code from Event Reg Widget Controller
Orrison Dec 27, 2023
a308bb3
Setup EventRegistrationForm Controller and relations
Orrison Dec 27, 2023
99d0c79
Setup the event registration widget
Orrison Dec 27, 2023
b9d0e76
Fix namespace
Orrison Dec 28, 2023
a5fe53b
Start adding the ability to add a Form to the Event edit page
Orrison Dec 28, 2023
e268d4f
Make null safe
Orrison Dec 28, 2023
dc668f8
Fix double hydration issue
Orrison Dec 28, 2023
6ef9777
FIx some bugs with submissions
Orrison Dec 28, 2023
08b83cf
Fix relationship saving
Orrison Dec 28, 2023
01fc338
Upgrade filament and remove hydration fix
Orrison Dec 28, 2023
98f8b4f
Fix issue with signed urls
Orrison Dec 28, 2023
c225975
Share event configuration between create and edit
Orrison Dec 28, 2023
265ed0c
Start working on adding the content
Orrison Dec 28, 2023
d140a07
Fix data saving issues
Orrison Dec 28, 2023
b4d7b4c
Fix more issues
Orrison Dec 28, 2023
0cc9f66
Remove todo
Orrison Dec 28, 2023
38fb9d0
Split the generation logic
Orrison Dec 28, 2023
8a2c878
Fix bug with multistep
Orrison Dec 28, 2023
3e348a2
Init viewing event attendees
Orrison Dec 28, 2023
0be7d34
More work on Attendee
Orrison Dec 28, 2023
4c5c3f8
Fix bug
Orrison Dec 29, 2023
12b6131
Start displaying the attendee submission
Orrison Dec 29, 2023
37de56e
Display an attendees submissions
Orrison Dec 29, 2023
f71c2e7
Relate a Student or Prospect to an EventAttendee
Orrison Dec 29, 2023
5ae60bb
Clear out unneded columns
Orrison Dec 29, 2023
3defeb9
composer update
Orrison Dec 29, 2023
f93ac5d
chore: fix enforcement of copyright on all files
Orrison Dec 29, 2023
b25e780
chore: fix code style
joelicatajr Dec 29, 2023
8d495f2
PR Feedback
Orrison Jan 2, 2024
8a3fb31
Regenerate the helper file
Orrison Jan 3, 2024
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
374 changes: 370 additions & 4 deletions _ide_helper_models.php

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions app-modules/assistant/src/Filament/Pages/ManageAiSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
namespace AdvisingApp\Assistant\Filament\Pages;

use App\Models\User;
use App\Enums\Feature;
use Filament\Forms\Form;
use Filament\Pages\SettingsPage;
use Filament\Forms\Components\Textarea;
Expand All @@ -58,15 +57,19 @@ public static function shouldRegisterNavigation(): bool
/** @var User $user */
$user = auth()->user();

return $user->can([Feature::PersonalAssistant->getGateName(), 'assistant.access_ai_settings']);
// TODO: Feature/License Gate | if has AI License

return $user->can(['assistant.access_ai_settings']);
}

public function mount(): void
{
/** @var User $user */
$user = auth()->user();

abort_unless($user->can([Feature::PersonalAssistant->getGateName(), 'assistant.access_ai_settings']), 403);
// TODO: Feature/License Gate | if has AI License

abort_unless($user->can(['assistant.access_ai_settings']), 403);

parent::mount();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
namespace AdvisingApp\Assistant\Filament\Pages;

use App\Models\User;
use App\Enums\Feature;
use Filament\Forms\Get;
use Filament\Pages\Page;
use Livewire\Attributes\On;
Expand All @@ -49,7 +48,6 @@
use Filament\Actions\StaticAction;
use Illuminate\Support\Collection;
use Filament\Forms\Components\Radio;
use Illuminate\Support\Facades\Gate;
use Filament\Forms\Components\Select;
use Filament\Support\Enums\Alignment;
use Filament\Support\Enums\ActionSize;
Expand Down Expand Up @@ -110,12 +108,14 @@ public static function shouldRegisterNavigation(): bool
/** @var User $user */
$user = auth()->user();

return Gate::check(Feature::PersonalAssistant->getGateName()) && $user->can('assistant.access');
// TODO: Feature/License Gate | if has AI License

return $user->can('assistant.access');
}

public function mount(): void
{
$this->authorize(Feature::PersonalAssistant->getGateName());
// TODO: Feature/License Gate | if has AI License
$this->authorize('assistant.access');

$this->consentAgreement = ConsentAgreement::where('type', ConsentAgreementType::AzureOpenAI)->first();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

namespace AdvisingApp\Assistant\Policies;

use App\Enums\Feature;
use App\Models\Authenticatable;
use Illuminate\Auth\Access\Response;
use App\Concerns\FeatureAccessEnforcedPolicyBefore;
Expand Down Expand Up @@ -90,8 +89,7 @@ public function forceDelete(Authenticatable $authenticatable, AssistantChatMessa

protected function requiredFeatures(): array
{
return [
Feature::PersonalAssistant,
];
// TODO: Feature/License Gate | if has AI License
return [];
}
}
43 changes: 43 additions & 0 deletions app-modules/authorization/config/roles/web/license_management.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

/*
<COPYRIGHT>

Copyright © 2022-2023, 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.

</COPYRIGHT>
*/

return [
'model' => [
'license' => [
'*',
],
],
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

/*
<COPYRIGHT>

Copyright © 2022-2023, 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.

</COPYRIGHT>
*/

use Illuminate\Database\Query\Builder;
use Illuminate\Database\Migrations\Migration;
use Tpetry\PostgresqlEnhanced\Schema\Blueprint;
use Tpetry\PostgresqlEnhanced\Support\Facades\Schema;

return new class () extends Migration {
public function up(): void
{
Schema::create('licenses', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->foreignUuid('user_id')->constrained('users')->cascadeOnDelete();
$table->string('type');
$table->timestamps();
$table->softDeletes();

$table->uniqueIndex(['user_id', 'type'])->where(fn (Builder $condition) => $condition->whereNull('deleted_at'));
});
}
};
74 changes: 74 additions & 0 deletions app-modules/authorization/src/Enums/LicenseType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php

/*
<COPYRIGHT>

Copyright © 2022-2023, 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.

</COPYRIGHT>
*/

namespace AdvisingApp\Authorization\Enums;

use App\Settings\LicenseSettings;
use Filament\Support\Contracts\HasLabel;
use AdvisingApp\Authorization\Models\License;

enum LicenseType: string implements HasLabel
{
case ConversationalAi = 'conversational_ai';

case RetentionCrm = 'retention_crm';

case RecruitmentCrm = 'recruitment_crm';

public function getLabel(): ?string
{
return match ($this) {
LicenseType::ConversationalAi => 'Conversational AI',
LicenseType::RetentionCrm => 'Retention CRM',
LicenseType::RecruitmentCrm => 'Recruitment CRM',
};
}

public function hasAvailableLicenses(): bool
{
$totalLicensesInUse = License::query()->where('type', $this)->count();

$licenseSettings = app(LicenseSettings::class);

$licenseLimit = match ($this) {
LicenseType::ConversationalAi => $licenseSettings->data->limits->conversationalAiSeats,
LicenseType::RetentionCrm => $licenseSettings->data->limits->retentionCrmSeats,
LicenseType::RecruitmentCrm => $licenseSettings->data->limits->recruitmentCrmSeats,
};

return $totalLicensesInUse < $licenseLimit;
}
}
67 changes: 67 additions & 0 deletions app-modules/authorization/src/Models/License.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

/*
<COPYRIGHT>

Copyright © 2022-2023, 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.

</COPYRIGHT>
*/

namespace AdvisingApp\Authorization\Models;

use App\Models\User;
use App\Models\BaseModel;
use OwenIt\Auditing\Contracts\Auditable;
use Illuminate\Database\Eloquent\SoftDeletes;
use AdvisingApp\Authorization\Enums\LicenseType;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use AdvisingApp\Audit\Models\Concerns\Auditable as AuditableConcern;

/**
* @mixin IdeHelperLicense
*/
class License extends BaseModel implements Auditable
{
use AuditableConcern;
use SoftDeletes;

protected $fillable = [
'type',
];

protected $casts = [
'type' => LicenseType::class,
];

public function user(): BelongsTo
{
return $this->belongsTo(User::class, 'user_id');
}
}
50 changes: 50 additions & 0 deletions app-modules/authorization/src/Observers/LicenseObserver.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

/*
<COPYRIGHT>

Copyright © 2022-2023, 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.

</COPYRIGHT>
*/

namespace AdvisingApp\Authorization\Observers;

use Exception;
use AdvisingApp\Authorization\Models\License;

class LicenseObserver
{
public function creating(License $license): void
{
if (! $license->type->hasAvailableLicenses()) {
throw new Exception("There are no available {$license->type->getLabel()} licenses.");
}
}
}
Loading