diff --git a/_ide_helper_models.php b/_ide_helper_models.php index 3fbd28d018..b84d0c1d9a 100644 --- a/_ide_helper_models.php +++ b/_ide_helper_models.php @@ -383,6 +383,8 @@ class IdeHelperTenant {} * @property-read int|null $care_teams_count * @property-read \Illuminate\Database\Eloquent\Collection $caseloads * @property-read int|null $caseloads_count + * @property-read \Illuminate\Database\Eloquent\Collection $changeRequestResponses + * @property-read int|null $change_request_responses_count * @property-read \Illuminate\Database\Eloquent\Collection $changeRequestTypes * @property-read int|null $change_request_types_count * @property-read \Illuminate\Database\Eloquent\Collection $changeRequests @@ -1809,6 +1811,7 @@ class IdeHelperSmsTemplate {} * @property bool $is_wizard * @property bool $recaptcha_enabled * @property array|null $content + * @property string|null $on_screen_response * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at * @property string|null $deleted_at @@ -1832,6 +1835,7 @@ class IdeHelperSmsTemplate {} * @method static \Illuminate\Database\Eloquent\Builder|Form whereIsAuthenticated($value) * @method static \Illuminate\Database\Eloquent\Builder|Form whereIsWizard($value) * @method static \Illuminate\Database\Eloquent\Builder|Form whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|Form whereOnScreenResponse($value) * @method static \Illuminate\Database\Eloquent\Builder|Form wherePrimaryColor($value) * @method static \Illuminate\Database\Eloquent\Builder|Form whereRecaptchaEnabled($value) * @method static \Illuminate\Database\Eloquent\Builder|Form whereRounding($value) @@ -2646,10 +2650,10 @@ class IdeHelperKnowledgeBaseCategory {} * AdvisingApp\KnowledgeBase\Models\KnowledgeBaseItem * * @property string $id - * @property string $question * @property bool $public - * @property array|null $solution - * @property array|null $notes + * @property string $title + * @property array|null $article_details + * @property string|null $notes * @property string|null $quality_id * @property string|null $status_id * @property string|null $category_id @@ -2668,15 +2672,15 @@ class IdeHelperKnowledgeBaseCategory {} * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem newQuery() * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem query() + * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem whereArticleDetails($value) * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem whereCategoryId($value) * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem whereNotes($value) * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem wherePublic($value) * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem whereQualityId($value) - * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem whereQuestion($value) - * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem whereSolution($value) * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem whereStatusId($value) + * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem whereTitle($value) * @method static \Illuminate\Database\Eloquent\Builder|KnowledgeBaseItem whereUpdatedAt($value) * @mixin \Eloquent */ @@ -3337,8 +3341,12 @@ class IdeHelperProspectStatus {} * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at * @property string|null $deleted_at + * @property-read \Illuminate\Database\Eloquent\Collection $approvals + * @property-read int|null $approvals_count * @property-read \Illuminate\Database\Eloquent\Collection $audits * @property-read int|null $audits_count + * @property-read \Illuminate\Database\Eloquent\Collection $responses + * @property-read int|null $responses_count * @property-read \AdvisingApp\ServiceManagement\Models\ChangeRequestStatus $status * @property-read \AdvisingApp\ServiceManagement\Models\ChangeRequestType $type * @property-read \App\Models\User|null $user @@ -3368,6 +3376,38 @@ class IdeHelperProspectStatus {} class IdeHelperChangeRequest {} } +namespace AdvisingApp\ServiceManagement\Models{ +/** + * AdvisingApp\ServiceManagement\Models\ChangeRequestResponse + * + * @property string $id + * @property string $change_request_id + * @property string $user_id + * @property bool $approved + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property string|null $deleted_at + * @property-read \Illuminate\Database\Eloquent\Collection $audits + * @property-read int|null $audits_count + * @property-read \AdvisingApp\ServiceManagement\Models\ChangeRequest $changeRequest + * @property-read \App\Models\User $user + * @method static \AdvisingApp\ServiceManagement\Database\Factories\ChangeRequestResponseFactory factory($count = null, $state = []) + * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestResponse newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestResponse newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestResponse query() + * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestResponse whereApproved($value) + * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestResponse whereChangeRequestId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestResponse whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestResponse whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestResponse whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestResponse whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestResponse whereUserId($value) + * @mixin \Eloquent + */ + #[\AllowDynamicProperties] + class IdeHelperChangeRequestResponse {} +} + namespace AdvisingApp\ServiceManagement\Models{ /** * AdvisingApp\ServiceManagement\Models\ChangeRequestStatus @@ -3400,6 +3440,7 @@ class IdeHelperChangeRequestStatus {} * * @property string $id * @property string $name + * @property int $number_of_required_approvals * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at * @property-read \Illuminate\Database\Eloquent\Collection $audits @@ -3415,6 +3456,7 @@ class IdeHelperChangeRequestStatus {} * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestType whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestType whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestType whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestType whereNumberOfRequiredApprovals($value) * @method static \Illuminate\Database\Eloquent\Builder|ChangeRequestType whereUpdatedAt($value) * @mixin \Eloquent */ diff --git a/app-modules/form/database/migrations/2023_09_26_194215_create_forms_table.php b/app-modules/form/database/migrations/2023_09_26_194215_create_forms_table.php index 34cf07cf8a..92f3e6ad79 100644 --- a/app-modules/form/database/migrations/2023_09_26_194215_create_forms_table.php +++ b/app-modules/form/database/migrations/2023_09_26_194215_create_forms_table.php @@ -54,6 +54,7 @@ public function up(): void $table->boolean('is_wizard')->default(false); $table->boolean('recaptcha_enabled')->default(false); $table->json('content')->nullable(); + $table->text('on_screen_response')->nullable(); $table->timestamps(); $table->softDeletes(); diff --git a/app-modules/form/src/Filament/Resources/FormResource.php b/app-modules/form/src/Filament/Resources/FormResource.php index 1a7c462d18..afb003757b 100644 --- a/app-modules/form/src/Filament/Resources/FormResource.php +++ b/app-modules/form/src/Filament/Resources/FormResource.php @@ -44,6 +44,7 @@ use AdvisingApp\Form\Filament\Resources\FormResource\Pages\ListForms; use AdvisingApp\Form\Filament\Resources\FormResource\Pages\CreateForm; use AdvisingApp\Form\Filament\Resources\FormResource\Pages\ManageFormSubmissions; +use AdvisingApp\Form\Filament\Resources\FormResource\Pages\SubmissionOnScreenResponse; class FormResource extends Resource { @@ -72,6 +73,7 @@ public static function getRecordSubNavigation(Page $page): array { return $page->generateNavigationItems([ EditForm::class, + SubmissionOnScreenResponse::class, ManageFormSubmissions::class, ]); } @@ -82,6 +84,7 @@ public static function getPages(): array 'index' => ListForms::route('/'), 'create' => CreateForm::route('/create'), 'edit' => EditForm::route('/{record}/edit'), + 'manage-on-screen-response' => SubmissionOnScreenResponse::route('/{record}/on-screen-response'), 'manage-submissions' => ManageFormSubmissions::route('/{record}/submissions'), ]; } diff --git a/app-modules/form/src/Filament/Resources/FormResource/Pages/SubmissionOnScreenResponse.php b/app-modules/form/src/Filament/Resources/FormResource/Pages/SubmissionOnScreenResponse.php new file mode 100644 index 0000000000..e752f99d26 --- /dev/null +++ b/app-modules/form/src/Filament/Resources/FormResource/Pages/SubmissionOnScreenResponse.php @@ -0,0 +1,62 @@ + + + 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. + + +*/ + +namespace AdvisingApp\Form\Filament\Resources\FormResource\Pages; + +use Filament\Forms\Form as FilamentForm; +use Filament\Resources\Pages\EditRecord; +use Filament\Forms\Components\MarkdownEditor; +use AdvisingApp\Form\Filament\Resources\FormResource; + +class SubmissionOnScreenResponse extends EditRecord +{ + protected static string $resource = FormResource::class; + + protected static ?string $navigationLabel = 'On-Screen Response'; + + protected static ?string $navigationIcon = 'heroicon-o-bars-arrow-up'; + + public function form(FilamentForm $form): FilamentForm + { + return $form + ->schema( + [ + MarkdownEditor::make('on_screen_response') + ->disableToolbarButtons(['attachFiles']), + ] + ); + } +} diff --git a/app-modules/form/src/Http/Controllers/FormWidgetController.php b/app-modules/form/src/Http/Controllers/FormWidgetController.php index e0f75a0c40..d4f14b7ba1 100644 --- a/app-modules/form/src/Http/Controllers/FormWidgetController.php +++ b/app-modules/form/src/Http/Controllers/FormWidgetController.php @@ -79,6 +79,7 @@ public function view(GenerateFormKitSchema $generateSchema, Form $form): JsonRes 'schema' => $generateSchema($form), 'primary_color' => Color::all()[$form->primary_color ?? 'blue'], 'rounding' => $form->rounding, + 'on_screen_response' => $form->on_screen_response, ], ); } diff --git a/app-modules/form/src/Models/Form.php b/app-modules/form/src/Models/Form.php index f8b6398d66..0bc6a93b98 100644 --- a/app-modules/form/src/Models/Form.php +++ b/app-modules/form/src/Models/Form.php @@ -55,6 +55,7 @@ class Form extends Submissible 'primary_color', 'rounding', 'content', + 'on_screen_response', ]; protected $casts = [ diff --git a/app-modules/service-management/src/Models/ChangeRequestResponse.php b/app-modules/service-management/src/Models/ChangeRequestResponse.php index ed1e6ebdff..3170e3fa55 100644 --- a/app-modules/service-management/src/Models/ChangeRequestResponse.php +++ b/app-modules/service-management/src/Models/ChangeRequestResponse.php @@ -42,6 +42,9 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use AdvisingApp\Audit\Models\Concerns\Auditable as AuditableTrait; +/** + * @mixin IdeHelperChangeRequestResponse + */ class ChangeRequestResponse extends BaseModel implements Auditable { use AuditableTrait; diff --git a/package-lock.json b/package-lock.json index b70d50c121..09462d5fb3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "env-cmd": "^10.1.0", "esbuild-plugin-polyfill-node": "^0.3.0", "flowbite": "^1.8.1", + "marked": "^11.1.1", "showdown": "^2.1.0", "sortablejs": "^1.15.0", "spectaql": "^2.3.0", @@ -4201,14 +4202,14 @@ } }, "node_modules/marked": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", - "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/marked/-/marked-11.1.1.tgz", + "integrity": "sha512-EgxRjgK9axsQuUa/oKMx5DEY8oXpKJfk61rT5iY3aRlgU6QJtUcxU5OAymdhCvWvhYcd9FKmO5eQoX8m9VGJXg==", "bin": { "marked": "bin/marked.js" }, "engines": { - "node": ">= 12" + "node": ">= 18" } }, "node_modules/maxmin": { @@ -5660,6 +5661,17 @@ "node": ">=14" } }, + "node_modules/spectaql/node_modules/marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/sprintf-js": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", diff --git a/package.json b/package.json index 3b3beb6502..7c0e1ba11d 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "build:survey": "(cd widgets/survey && vite build)", "build:event-registration": "(cd widgets/event-registration && vite build)", "build": "npm run build:js-compile && npm run build:vite && npm run build:filament && npm run build:application && npm run build:form && npm run build:survey && npm run build:event-registration", - "api-docs:generate": "export NODE_OPTIONS=--max_old_space_size=4096 && env-cmd spectaql spectaql.yml" + "api-docs:generate": "export NODE_OPTIONS=--max_old_space_size=4096 && env-cmd spectaql spectaql.yml" }, "devDependencies": { "@headlessui/vue": "^1.7.16", @@ -50,6 +50,7 @@ "env-cmd": "^10.1.0", "esbuild-plugin-polyfill-node": "^0.3.0", "flowbite": "^1.8.1", + "marked": "^11.1.1", "showdown": "^2.1.0", "sortablejs": "^1.15.0", "spectaql": "^2.3.0", diff --git a/widgets/form/src/App.vue b/widgets/form/src/App.vue index ac6aea7bd7..cac26886e9 100644 --- a/widgets/form/src/App.vue +++ b/widgets/form/src/App.vue @@ -32,10 +32,12 @@ -->