diff --git a/backend/app/Controllers/ElementController.php b/backend/app/Controllers/ElementController.php index b485f73..4942d19 100644 --- a/backend/app/Controllers/ElementController.php +++ b/backend/app/Controllers/ElementController.php @@ -47,7 +47,6 @@ class ElementController 'title' => $element->getTitle(), 'description' => $element->getDescription(), 'richText' => $element->getRichText(), - 'pdfPath' => $element->getPdfPath(), ], ], 200); } diff --git a/backend/app/Element/CreateElementDto.php b/backend/app/Element/CreateElementDto.php index e5cc6fe..1e48b41 100644 --- a/backend/app/Element/CreateElementDto.php +++ b/backend/app/Element/CreateElementDto.php @@ -11,7 +11,6 @@ class CreateElementDto public string $title, public string $description, public string $richText, - public ?string $pdfPath, public ?Element $parentElement, ) { } diff --git a/backend/app/Element/Element.php b/backend/app/Element/Element.php index f8e9f38..2c9395a 100644 --- a/backend/app/Element/Element.php +++ b/backend/app/Element/Element.php @@ -11,7 +11,6 @@ class Element private string $title, private string $description, private string $richText, - private ?string $pdfPath, private Set $set, private ?Element $parentElement, ) { @@ -37,11 +36,6 @@ class Element return $this->richText; } - public function getPdfPath(): ?string - { - return $this->pdfPath; - } - public function getSet(): Set { return $this->set; diff --git a/backend/app/Element/ElementModel.php b/backend/app/Element/ElementModel.php index 2655d04..a1ffa17 100644 --- a/backend/app/Element/ElementModel.php +++ b/backend/app/Element/ElementModel.php @@ -11,7 +11,6 @@ use Illuminate\Database\Eloquent\Model; * @property string $title * @property string $description * @property string $rich_text - * @property string|null $pdf_path * @property int|null $parent_element_id * * @method static Builder|ElementModel newModelQuery() @@ -23,7 +22,6 @@ use Illuminate\Database\Eloquent\Model; * @method static Builder|ElementModel whereTitle($value) * @method static Builder|ElementModel whereDescription($value) * @method static Builder|ElementModel whereRichText($value) - * @method static Builder|ElementModel wherePdfPath($value) * * @mixin \Eloquent */ @@ -38,7 +36,6 @@ class ElementModel extends Model 'title', 'description', 'rich_text', - 'pdf_path', 'parent_element_id', ]; diff --git a/backend/app/Element/EloquentElementRepository.php b/backend/app/Element/EloquentElementRepository.php index 389d37b..455852c 100644 --- a/backend/app/Element/EloquentElementRepository.php +++ b/backend/app/Element/EloquentElementRepository.php @@ -19,7 +19,6 @@ class EloquentElementRepository implements ElementRepository 'title' => $dto->title, 'description' => $dto->description, 'rich_text' => $dto->richText, - 'pdf_path' => $dto->pdfPath, 'parent_element_id' => $dto->parentElement?->getId(), ]); @@ -28,7 +27,6 @@ class EloquentElementRepository implements ElementRepository title: $dto->title, description: $dto->description, richText: $dto->richText, - pdfPath: $dto->pdfPath, set: $dto->set, parentElement: $dto->parentElement, ); @@ -110,7 +108,6 @@ class EloquentElementRepository implements ElementRepository title: $model->title, description: $model->description, richText: $model->rich_text, - pdfPath: $model->pdf_path, set: $set, parentElement: $parentElement, ); diff --git a/backend/app/Element/UseCases/CreateElement/CreateElement.php b/backend/app/Element/UseCases/CreateElement/CreateElement.php index 364ef0a..47d5684 100644 --- a/backend/app/Element/UseCases/CreateElement/CreateElement.php +++ b/backend/app/Element/UseCases/CreateElement/CreateElement.php @@ -32,7 +32,6 @@ class CreateElement } $description = $request->description ?? ''; $richText = $request->richText ?? ''; - $pdfPath = $request->pdfPath === '' ? null : $request->pdfPath; $set = $this->setRepo->find($request->setId); if ($set === null) { @@ -49,7 +48,6 @@ class CreateElement title: $request->title, description: $description, richText: $richText, - pdfPath: $pdfPath, parentElement: null, )); } @@ -73,7 +71,6 @@ class CreateElement title: $request->title, description: $description, richText: $richText, - pdfPath: $pdfPath, parentElement: $parentElement, )); } diff --git a/backend/app/Element/UseCases/CreateElement/CreateElementRequest.php b/backend/app/Element/UseCases/CreateElement/CreateElementRequest.php index b63628a..908a4d6 100644 --- a/backend/app/Element/UseCases/CreateElement/CreateElementRequest.php +++ b/backend/app/Element/UseCases/CreateElement/CreateElementRequest.php @@ -9,7 +9,6 @@ class CreateElementRequest public ?string $title, public ?string $description, public ?string $richText, - public ?string $pdfPath, public ?int $parentElementId, ) { } diff --git a/backend/database/migrations/2026_05_24_000001_elements_table.php b/backend/database/migrations/2026_05_24_000001_elements_table.php index c0edefa..0f96d3a 100644 --- a/backend/database/migrations/2026_05_24_000001_elements_table.php +++ b/backend/database/migrations/2026_05_24_000001_elements_table.php @@ -14,7 +14,6 @@ return new class extends Migration $table->string('title'); $table->text('description')->default(''); $table->text('rich_text')->default(''); - $table->string('pdf_path')->nullable(); $table->foreignId('parent_element_id') ->nullable() ->constrained('elements'); diff --git a/backend/database/seeders/ElementSeeder.php b/backend/database/seeders/ElementSeeder.php index 592396d..02d2467 100644 --- a/backend/database/seeders/ElementSeeder.php +++ b/backend/database/seeders/ElementSeeder.php @@ -21,7 +21,6 @@ class ElementSeeder extends Seeder richText: '

Begin with a clear map for avodah growth.

' . '

Move steadily from awareness ' . 'to practice.

', - pdfPath: '/assets/pdfs/baderech.pdf', parentElement: null, )); $elementRepository->create(new CreateElementDto( @@ -31,7 +30,6 @@ class ElementSeeder extends Seeder . 'avodah practice.', richText: '

Avodah foundations begin with honest awareness ' . 'and small repeatable steps.

', - pdfPath: null, parentElement: $rootElement, )); $elementRepository->create(new CreateElementDto( @@ -40,7 +38,6 @@ class ElementSeeder extends Seeder description: 'Practical steps for consistent daily growth.', richText: '

Daily practice turns inspiration into a ' . 'dependable rhythm.

', - pdfPath: null, parentElement: $rootElement, )); } diff --git a/backend/tests/Fakes/FakeElementRepository.php b/backend/tests/Fakes/FakeElementRepository.php index 0ccdfeb..4cf8bce 100644 --- a/backend/tests/Fakes/FakeElementRepository.php +++ b/backend/tests/Fakes/FakeElementRepository.php @@ -22,7 +22,6 @@ class FakeElementRepository implements ElementRepository title: $dto->title, description: $dto->description, richText: $dto->richText, - pdfPath: $dto->pdfPath, set: $dto->set, parentElement: $dto->parentElement, ); @@ -100,7 +99,6 @@ class FakeElementRepository implements ElementRepository title: $element->getTitle(), description: $element->getDescription(), richText: $element->getRichText(), - pdfPath: $element->getPdfPath(), set: $element->getSet(), parentElement: $parentElement, ); diff --git a/backend/tests/Feature/ElementsEndpointTest.php b/backend/tests/Feature/ElementsEndpointTest.php index a24a6c8..8f24235 100644 --- a/backend/tests/Feature/ElementsEndpointTest.php +++ b/backend/tests/Feature/ElementsEndpointTest.php @@ -27,7 +27,6 @@ class ElementsEndpointTest extends TestCase title: 'Baderech HaAvodah', description: 'A structured path for growth', richText: '

A structured path for growth

', - pdfPath: '/assets/pdfs/baderech.pdf', parentElement: null, )); $firstChildElement = $elementRepository->create(new CreateElementDto( @@ -35,7 +34,6 @@ class ElementsEndpointTest extends TestCase title: 'Avodah Foundations', description: 'Foundations for steady avodah', richText: '

Foundations rich text

', - pdfPath: '/assets/pdfs/foundations.pdf', parentElement: $element, )); $secondChildElement = $elementRepository->create(new CreateElementDto( @@ -43,7 +41,6 @@ class ElementsEndpointTest extends TestCase title: 'Daily Practice', description: 'Daily practices for growth', richText: '

Daily practice rich text

', - pdfPath: null, parentElement: $element, )); @@ -68,7 +65,6 @@ class ElementsEndpointTest extends TestCase 'title' => 'Baderech HaAvodah', 'description' => 'A structured path for growth', 'richText' => '

A structured path for growth

', - 'pdfPath' => '/assets/pdfs/baderech.pdf', ], ]); } diff --git a/backend/tests/Feature/SetsEndpointTest.php b/backend/tests/Feature/SetsEndpointTest.php index ed0bbca..32aabd2 100644 --- a/backend/tests/Feature/SetsEndpointTest.php +++ b/backend/tests/Feature/SetsEndpointTest.php @@ -33,7 +33,6 @@ class SetsEndpointTest extends TestCase title: $baderechSet->getName(), description: $baderechSet->getDescription(), richText: '', - pdfPath: null, parentElement: null, ) ); diff --git a/backend/tests/Unit/Controllers/ElementControllerTest.php b/backend/tests/Unit/Controllers/ElementControllerTest.php index d9ffe2f..569835e 100644 --- a/backend/tests/Unit/Controllers/ElementControllerTest.php +++ b/backend/tests/Unit/Controllers/ElementControllerTest.php @@ -31,7 +31,6 @@ class ElementControllerTest extends TestCase 'Baderech HaAvodah', 'A structured path for growth', '

A structured path for growth

', - '/assets/pdfs/baderech.pdf', null, ); $firstChildElement = $this->createElement( @@ -39,7 +38,6 @@ class ElementControllerTest extends TestCase 'Avodah Foundations', 'Foundations for steady avodah', '

Foundations rich text

', - '/assets/pdfs/foundations.pdf', $element, ); $secondChildElement = $this->createElement( @@ -47,7 +45,6 @@ class ElementControllerTest extends TestCase 'Daily Practice', 'Daily practices for growth', '

Daily practice rich text

', - null, $element, ); @@ -65,10 +62,6 @@ class ElementControllerTest extends TestCase '

A structured path for growth

', $body['element']['richText'], ); - $this->assertSame( - '/assets/pdfs/baderech.pdf', - $body['element']['pdfPath'], - ); $this->assertSame([ [ 'id' => $firstChildElement->getId(), @@ -120,7 +113,6 @@ class ElementControllerTest extends TestCase string $title, string $description, string $richText, - ?string $pdfPath, ?Element $parentElement, ): Element { return $this->elementRepo->create(new CreateElementDto( @@ -128,7 +120,6 @@ class ElementControllerTest extends TestCase title: $title, description: $description, richText: $richText, - pdfPath: $pdfPath, parentElement: $parentElement, )); } diff --git a/backend/tests/Unit/Element/ElementTest.php b/backend/tests/Unit/Element/ElementTest.php index 7808344..8c09251 100644 --- a/backend/tests/Unit/Element/ElementTest.php +++ b/backend/tests/Unit/Element/ElementTest.php @@ -21,7 +21,6 @@ class ElementTest extends TestCase title: 'Root', description: 'Root description', richText: '

Root rich text

', - pdfPath: null, set: $set, parentElement: null, ); @@ -30,7 +29,6 @@ class ElementTest extends TestCase title: 'Child', description: 'Child description', richText: '

Child rich text

', - pdfPath: '/assets/pdfs/child.pdf', set: $set, parentElement: $rootElement, ); @@ -45,13 +43,8 @@ class ElementTest extends TestCase '

Child rich text

', $childElement->getRichText(), ); - $this->assertSame( - '/assets/pdfs/child.pdf', - $childElement->getPdfPath(), - ); $this->assertSame($set, $childElement->getSet()); $this->assertSame($rootElement, $childElement->getParentElement()); - $this->assertNull($rootElement->getPdfPath()); $this->assertNull($rootElement->getParentElement()); } } diff --git a/backend/tests/Unit/Element/UseCases/CreateElementTest.php b/backend/tests/Unit/Element/UseCases/CreateElementTest.php index 2b34873..55458eb 100644 --- a/backend/tests/Unit/Element/UseCases/CreateElementTest.php +++ b/backend/tests/Unit/Element/UseCases/CreateElementTest.php @@ -49,7 +49,6 @@ class CreateElementTest extends TestCase title: 'Root', description: 'Root description', richText: '

Root rich text

', - pdfPath: '/assets/pdfs/root.pdf', parentElementId: null, )); @@ -57,7 +56,6 @@ class CreateElementTest extends TestCase $this->assertSame('Root', $element->getTitle()); $this->assertSame('Root description', $element->getDescription()); $this->assertSame('

Root rich text

', $element->getRichText()); - $this->assertSame('/assets/pdfs/root.pdf', $element->getPdfPath()); $this->assertSame($set->getId(), $element->getSet()->getId()); $this->assertNull($element->getParentElement()); } @@ -71,7 +69,6 @@ class CreateElementTest extends TestCase title: 'Root', description: 'Root description', richText: '

Root rich text

', - pdfPath: null, parentElementId: null, ) ); @@ -82,7 +79,6 @@ class CreateElementTest extends TestCase title: 'Child', description: 'Child description', richText: '

Child rich text

', - pdfPath: '/assets/pdfs/child.pdf', parentElementId: $rootElement->getId(), ) ); @@ -96,10 +92,6 @@ class CreateElementTest extends TestCase '

Child rich text

', $childElement->getRichText(), ); - $this->assertSame( - '/assets/pdfs/child.pdf', - $childElement->getPdfPath(), - ); $this->assertSame( $rootElement->getId(), $childElement->getParentElement()->getId(), @@ -115,29 +107,11 @@ class CreateElementTest extends TestCase title: 'Root', description: null, richText: null, - pdfPath: null, parentElementId: null, )); $this->assertSame('', $element->getDescription()); $this->assertSame('', $element->getRichText()); - $this->assertNull($element->getPdfPath()); - } - - public function testCreatesElementWithNullPdfPathWhenBlank(): void - { - $set = $this->createSet('Daily learning'); - - $element = $this->createElement->execute(new CreateElementRequest( - setId: $set->getId(), - title: 'Root', - description: 'Root description', - richText: '

Root rich text

', - pdfPath: '', - parentElementId: null, - )); - - $this->assertNull($element->getPdfPath()); } public function testThrowsWhenSetIdMissing(): void @@ -150,7 +124,6 @@ class CreateElementTest extends TestCase title: 'Root', description: 'Root description', richText: '

Root rich text

', - pdfPath: null, parentElementId: null, )); } @@ -165,7 +138,6 @@ class CreateElementTest extends TestCase title: null, description: 'Root description', richText: '

Root rich text

', - pdfPath: null, parentElementId: null, )); } @@ -180,7 +152,6 @@ class CreateElementTest extends TestCase title: 'Root', description: 'Root description', richText: '

Root rich text

', - pdfPath: null, parentElementId: null, )); } @@ -199,7 +170,6 @@ class CreateElementTest extends TestCase title: 'Child', description: 'Child description', richText: '

Child rich text

', - pdfPath: null, parentElementId: 99, )); } @@ -212,7 +182,6 @@ class CreateElementTest extends TestCase title: 'Root', description: 'Root description', richText: '

Root rich text

', - pdfPath: null, parentElementId: null, )); @@ -226,7 +195,6 @@ class CreateElementTest extends TestCase title: 'Another root', description: 'Another root description', richText: '

Another root rich text

', - pdfPath: null, parentElementId: null, )); } @@ -241,7 +209,6 @@ class CreateElementTest extends TestCase title: 'Parent root', description: 'Parent root description', richText: '

Parent root rich text

', - pdfPath: null, parentElementId: null, ) ); @@ -256,7 +223,6 @@ class CreateElementTest extends TestCase title: 'Invalid child', description: 'Invalid child description', richText: '

Invalid child rich text

', - pdfPath: null, parentElementId: $parentElement->getId(), )); } diff --git a/backend/tests/Unit/Element/UseCases/GetElementTest.php b/backend/tests/Unit/Element/UseCases/GetElementTest.php index 2b11d63..71c67a0 100644 --- a/backend/tests/Unit/Element/UseCases/GetElementTest.php +++ b/backend/tests/Unit/Element/UseCases/GetElementTest.php @@ -32,7 +32,6 @@ class GetElementTest extends TestCase 'Baderech HaAvodah', 'A structured path for growth', '

A structured path for growth

', - '/assets/pdfs/baderech.pdf', null, ); @@ -52,10 +51,6 @@ class GetElementTest extends TestCase '

A structured path for growth

', $foundElement->getRichText(), ); - $this->assertSame( - '/assets/pdfs/baderech.pdf', - $foundElement->getPdfPath(), - ); } public function testReturnsDirectChildElements(): void @@ -66,7 +61,6 @@ class GetElementTest extends TestCase 'Baderech HaAvodah', 'A structured path for growth', '

A structured path for growth

', - '/assets/pdfs/baderech.pdf', null, ); $firstChildElement = $this->createElement( @@ -74,7 +68,6 @@ class GetElementTest extends TestCase 'Avodah Foundations', 'Foundations for steady avodah', '

Foundations rich text

', - '/assets/pdfs/foundations.pdf', $parentElement, ); $secondChildElement = $this->createElement( @@ -82,7 +75,6 @@ class GetElementTest extends TestCase 'Daily Practice', 'Daily practices for growth', '

Daily practice rich text

', - null, $parentElement, ); $this->createElement( @@ -90,7 +82,6 @@ class GetElementTest extends TestCase 'Nested Practice', 'Nested description', '

Nested rich text

', - null, $firstChildElement, ); $otherSet = $this->createSet(2, 'Daily Learning'); @@ -100,14 +91,12 @@ class GetElementTest extends TestCase 'Other parent description', '

Other parent rich text

', null, - null, ); $this->createElement( $otherSet, 'Other Child', 'Other child description', '

Other child rich text

', - null, $otherParentElement, ); @@ -168,7 +157,6 @@ class GetElementTest extends TestCase string $title, string $description, string $richText, - ?string $pdfPath, ?Element $parentElement, ): Element { return $this->elementRepo->create(new CreateElementDto( @@ -176,7 +164,6 @@ class GetElementTest extends TestCase title: $title, description: $description, richText: $richText, - pdfPath: $pdfPath, parentElement: $parentElement, )); } diff --git a/frontend/rabbi_gerzi/cypress/e2e/media.cy.ts b/frontend/rabbi_gerzi/cypress/e2e/media.cy.ts index 5901c8e..4dda0e4 100644 --- a/frontend/rabbi_gerzi/cypress/e2e/media.cy.ts +++ b/frontend/rabbi_gerzi/cypress/e2e/media.cy.ts @@ -46,10 +46,6 @@ describe('media page sets', () => { .should('be.visible') cy.contains('strong', 'Move steadily').should('be.visible') }) - cy.contains('[data-cy="element-pdf-link"]', 'View PDF') - .should('be.visible') - .and('have.attr', 'href', '/assets/pdfs/baderech.pdf') - .and('have.attr', 'target', '_blank') cy.get('[data-cy="child-element-list"]').should('be.visible') cy.get('[data-cy="child-element-list"]') .should( @@ -82,6 +78,5 @@ describe('media page sets', () => { 'contain.text', 'Avodah foundations begin with honest awareness', ) - cy.get('[data-cy="element-pdf-link"]').should('not.exist') }) }) diff --git a/frontend/rabbi_gerzi/public/assets/pdfs/baderech.pdf b/frontend/rabbi_gerzi/public/assets/pdfs/baderech.pdf deleted file mode 100644 index 8864294..0000000 Binary files a/frontend/rabbi_gerzi/public/assets/pdfs/baderech.pdf and /dev/null differ diff --git a/frontend/rabbi_gerzi/src/stores/elements.ts b/frontend/rabbi_gerzi/src/stores/elements.ts index eb82ffc..6c5f1f4 100644 --- a/frontend/rabbi_gerzi/src/stores/elements.ts +++ b/frontend/rabbi_gerzi/src/stores/elements.ts @@ -9,7 +9,6 @@ export interface ChildElement { export interface Element extends ChildElement { richText: string - pdfPath: string | null } interface ElementResponse { diff --git a/frontend/rabbi_gerzi/src/views/ElementPage.vue b/frontend/rabbi_gerzi/src/views/ElementPage.vue index 10fdbbf..1956a22 100644 --- a/frontend/rabbi_gerzi/src/views/ElementPage.vue +++ b/frontend/rabbi_gerzi/src/views/ElementPage.vue @@ -56,18 +56,6 @@ watch( v-html="element.richText" /> - -