Repository navigation
feat: disable subject option, saturday leaderboard reset, and resource content display #425
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
Changes from all commits
3c90cea
b3f6894
c75438a
347aa4f
b2fb9c4
904128a
1609250
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ public function rules(): array | |
| 'custom_titles.*' => 'required|string|max:100', | ||
| 'files' => 'required|array|min:1|max:20', | ||
| 'files.*' => 'required|image|mimes:jpg,jpeg,png,webp|max:5120', | ||
| 'content' => 'nullable|string', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
# Inspect the columns used for resource content and change-request payloads.
rg -n -C 3 "'content'|\"content\"|'payload'|\"payload\"" database/migrations app/Models/ResourceChangeRequest.phpRepository: hscstack/platform Length of output: 11450 🏁 Script executed: rg -n -C 12 -F -- 'storeBulkImages' app/Http/Controllers app/Http/Requests app/Models
printf '\n--- ResourceChangeRequest relevant methods ---\n'
sed -n '80,145p' app/Models/ResourceChangeRequest.php
printf '\n--- ResourceController relevant method ---\n'
sed -n '180,290p' app/Http/Controllers/ResourceController.phpRepository: hscstack/platform Length of output: 7881 🏁 Script executed: sed -n '158,225p' app/Http/Controllers/ResourceController.phpRepository: hscstack/platform Length of output: 2482 Limit bulk-image content to the resource column capacity.
🤖 Prompt for AI Agents |
||
| ]; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <?php | ||
|
|
||
| use Illuminate\Database\Migrations\Migration; | ||
| use Illuminate\Database\Schema\Blueprint; | ||
| use Illuminate\Support\Facades\Schema; | ||
|
|
||
| return new class extends Migration | ||
| { | ||
| /** | ||
| * Run the migrations. | ||
| */ | ||
| public function up(): void | ||
| { | ||
| Schema::table('subjects', function (Blueprint $table) { | ||
| if (! Schema::hasColumn('subjects', 'is_disabled')) { | ||
| $table->boolean('is_disabled')->default(false)->after('is_trackable'); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * Reverse the migrations. | ||
| */ | ||
| public function down(): void | ||
| { | ||
| Schema::table('subjects', function (Blueprint $table) { | ||
| if (Schema::hasColumn('subjects', 'is_disabled')) { | ||
| $table->dropColumn('is_disabled'); | ||
| } | ||
| }); | ||
| } | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Exclude disabled subjects' nodes from the sitemap too.
This filter removes the subject URL, but the separate node query at lines 65-67 still loads its nodes. Lines 71-95 then add their
/{subject}/{node}URLs to the sitemap. Filter that query by an enabled subject so sitemap generation excludes the complete disabled-subject path.🧰 Tools
🪛 PHPStan (2.2.16)
[error] 51-51: Call to an undefined static method App\Models\Subject::where().
(staticMethod.notFound)
🤖 Prompt for AI Agents