diff --git a/app/Liquid/Tags/PluginRenderTag.php b/app/Liquid/Tags/PluginRenderTag.php deleted file mode 100644 index e4c441a..0000000 --- a/app/Liquid/Tags/PluginRenderTag.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ - private const PARENT_CONTEXT_KEYS = ['trmnl', 'size', 'data', 'config']; - - protected function buildPartialContext(RenderContext $rootContext, string $templateName, array $variables = []): RenderContext - { - $partialContext = $rootContext->newIsolatedSubContext($templateName); - - foreach (self::PARENT_CONTEXT_KEYS as $key) { - $value = $rootContext->get($key); - if ($value !== null && ! $value instanceof MissingValue) { - $partialContext->set($key, $value); - } - } - - foreach ($variables as $key => $value) { - $partialContext->set($key, $value); - } - - foreach ($this->attributes as $key => $value) { - $partialContext->set($key, $rootContext->evaluate($value)); - } - - return $partialContext; - } -} diff --git a/app/Models/Plugin.php b/app/Models/Plugin.php index d377956..5eeeb6b 100644 --- a/app/Models/Plugin.php +++ b/app/Models/Plugin.php @@ -10,7 +10,6 @@ use App\Liquid\Filters\Numbers; use App\Liquid\Filters\StandardFilters; use App\Liquid\Filters\StringMarkup; use App\Liquid\Filters\Uniqueness; -use App\Liquid\Tags\PluginRenderTag; use App\Liquid\Tags\TemplateTag; use App\Services\Plugin\Parsers\ResponseParserRegistry; use App\Services\PluginImportService; @@ -500,8 +499,6 @@ class Plugin extends Model // Register the template tag for inline templates $environment->tagRegistry->register(TemplateTag::class); - // Use plugin render tag so partials receive trmnl, size, data, config - $environment->tagRegistry->register(PluginRenderTag::class); // Apply Liquid replacements (including 'with' syntax conversion) $processedMarkup = $this->applyLiquidReplacements($markup); diff --git a/database/migrations/2026_02_01_121714_add_maximum_compatibility_to_devices_table.php b/database/migrations/2026_02_01_121714_add_maximum_compatibility_to_devices_table.php index bd0d54b..a682c62 100644 --- a/database/migrations/2026_02_01_121714_add_maximum_compatibility_to_devices_table.php +++ b/database/migrations/2026_02_01_121714_add_maximum_compatibility_to_devices_table.php @@ -8,15 +8,15 @@ return new class extends Migration { public function up(): void { - Schema::table('devices', function (Blueprint $table): void { - $table->boolean('maximum_compatibility')->default(false); + Schema::table("devices", function (Blueprint $table): void { + $table->boolean("maximum_compatibility")->default(false); }); } public function down(): void { - Schema::table('devices', function (Blueprint $table): void { - $table->dropColumn('maximum_compatibility'); + Schema::table("devices", function (Blueprint $table): void { + $table->dropColumn("maximum_compatibility"); }); } }; diff --git a/tests/Feature/Api/DeviceEndpointsTest.php b/tests/Feature/Api/DeviceEndpointsTest.php index 44fb651..54edb10 100644 --- a/tests/Feature/Api/DeviceEndpointsTest.php +++ b/tests/Feature/Api/DeviceEndpointsTest.php @@ -100,7 +100,7 @@ test('display endpoint includes maximum_compatibility value when true for device $device = Device::factory()->create([ 'mac_address' => '00:11:22:33:44:55', 'api_key' => 'test-api-key', - 'maximum_compatibility' => true, + 'maximum_compatibility' => true ]); $response = $this->withHeaders([ diff --git a/tests/Feature/PluginInlineTemplatesTest.php b/tests/Feature/PluginInlineTemplatesTest.php index 0bd5963..76b29d7 100644 --- a/tests/Feature/PluginInlineTemplatesTest.php +++ b/tests/Feature/PluginInlineTemplatesTest.php @@ -1,7 +1,6 @@ assertStringContainsString('"35":[{"name":"Ryan","age":35}]', $result); $this->assertStringContainsString('"29":[{"name":"Sara","age":29},{"name":"Jimbob","age":29}]', $result); }); - -test('shared template receives trmnl context when', function (): void { - $user = User::factory()->create(['name' => 'Jane Smith']); - - $plugin = Plugin::factory()->create([ - 'user_id' => $user->id, - 'name' => 'Departures', - 'markup_language' => 'liquid', - 'render_markup_shared' => <<<'LIQUID' -{% template departures_view %} -
-{% endtemplate %} -LIQUID - , - 'render_markup' => <<<'LIQUID' -