diff --git a/backend/app/Controllers/ElementController.php b/backend/app/Controllers/ElementController.php index 4942d19..0e71cea 100644 --- a/backend/app/Controllers/ElementController.php +++ b/backend/app/Controllers/ElementController.php @@ -46,7 +46,6 @@ class ElementController 'id' => $element->getId(), 'title' => $element->getTitle(), 'description' => $element->getDescription(), - 'richText' => $element->getRichText(), ], ], 200); } diff --git a/backend/app/Element/CreateElementDto.php b/backend/app/Element/CreateElementDto.php index 1e48b41..3bad829 100644 --- a/backend/app/Element/CreateElementDto.php +++ b/backend/app/Element/CreateElementDto.php @@ -10,7 +10,6 @@ class CreateElementDto public Set $set, public string $title, public string $description, - public string $richText, public ?Element $parentElement, ) { } diff --git a/backend/app/Element/Element.php b/backend/app/Element/Element.php index 2c9395a..7f007ce 100644 --- a/backend/app/Element/Element.php +++ b/backend/app/Element/Element.php @@ -10,7 +10,6 @@ class Element private int $id, private string $title, private string $description, - private string $richText, private Set $set, private ?Element $parentElement, ) { @@ -31,11 +30,6 @@ class Element return $this->description; } - public function getRichText(): string - { - return $this->richText; - } - public function getSet(): Set { return $this->set; diff --git a/backend/app/Element/ElementModel.php b/backend/app/Element/ElementModel.php index a1ffa17..4f79f3b 100644 --- a/backend/app/Element/ElementModel.php +++ b/backend/app/Element/ElementModel.php @@ -10,7 +10,6 @@ use Illuminate\Database\Eloquent\Model; * @property int $set_id * @property string $title * @property string $description - * @property string $rich_text * @property int|null $parent_element_id * * @method static Builder|ElementModel newModelQuery() @@ -21,7 +20,6 @@ use Illuminate\Database\Eloquent\Model; * @method static Builder|ElementModel whereSetId($value) * @method static Builder|ElementModel whereTitle($value) * @method static Builder|ElementModel whereDescription($value) - * @method static Builder|ElementModel whereRichText($value) * * @mixin \Eloquent */ @@ -35,7 +33,6 @@ class ElementModel extends Model 'set_id', 'title', 'description', - 'rich_text', 'parent_element_id', ]; diff --git a/backend/app/Element/EloquentElementRepository.php b/backend/app/Element/EloquentElementRepository.php index 455852c..7b7065a 100644 --- a/backend/app/Element/EloquentElementRepository.php +++ b/backend/app/Element/EloquentElementRepository.php @@ -18,7 +18,6 @@ class EloquentElementRepository implements ElementRepository 'set_id' => $dto->set->getId(), 'title' => $dto->title, 'description' => $dto->description, - 'rich_text' => $dto->richText, 'parent_element_id' => $dto->parentElement?->getId(), ]); @@ -26,7 +25,6 @@ class EloquentElementRepository implements ElementRepository id: $model->id, title: $dto->title, description: $dto->description, - richText: $dto->richText, set: $dto->set, parentElement: $dto->parentElement, ); @@ -107,7 +105,6 @@ class EloquentElementRepository implements ElementRepository id: $model->id, title: $model->title, description: $model->description, - richText: $model->rich_text, set: $set, parentElement: $parentElement, ); diff --git a/backend/app/Element/UseCases/CreateElement/CreateElement.php b/backend/app/Element/UseCases/CreateElement/CreateElement.php index 47d5684..1cb4b37 100644 --- a/backend/app/Element/UseCases/CreateElement/CreateElement.php +++ b/backend/app/Element/UseCases/CreateElement/CreateElement.php @@ -31,7 +31,6 @@ class CreateElement throw new BadRequestException('title is required'); } $description = $request->description ?? ''; - $richText = $request->richText ?? ''; $set = $this->setRepo->find($request->setId); if ($set === null) { @@ -47,7 +46,6 @@ class CreateElement set: $set, title: $request->title, description: $description, - richText: $richText, parentElement: null, )); } @@ -70,7 +68,6 @@ class CreateElement set: $set, title: $request->title, description: $description, - richText: $richText, parentElement: $parentElement, )); } diff --git a/backend/app/Element/UseCases/CreateElement/CreateElementRequest.php b/backend/app/Element/UseCases/CreateElement/CreateElementRequest.php index 908a4d6..b028326 100644 --- a/backend/app/Element/UseCases/CreateElement/CreateElementRequest.php +++ b/backend/app/Element/UseCases/CreateElement/CreateElementRequest.php @@ -8,7 +8,6 @@ class CreateElementRequest public ?int $setId, public ?string $title, public ?string $description, - public ?string $richText, 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 0f96d3a..f09b3b0 100644 --- a/backend/database/migrations/2026_05_24_000001_elements_table.php +++ b/backend/database/migrations/2026_05_24_000001_elements_table.php @@ -13,7 +13,6 @@ return new class extends Migration $table->foreignId('set_id')->constrained('sets'); $table->string('title'); $table->text('description')->default(''); - $table->text('rich_text')->default(''); $table->foreignId('parent_element_id') ->nullable() ->constrained('elements'); diff --git a/backend/database/seeders/ElementSeeder.php b/backend/database/seeders/ElementSeeder.php index 02d2467..b356df9 100644 --- a/backend/database/seeders/ElementSeeder.php +++ b/backend/database/seeders/ElementSeeder.php @@ -18,9 +18,6 @@ class ElementSeeder extends Seeder set: $baderechSet, title: $baderechSet->getName(), description: $baderechSet->getDescription(), - richText: '

Begin with a clear map for avodah growth.

' - . '

Move steadily from awareness ' - . 'to practice.

', parentElement: null, )); $elementRepository->create(new CreateElementDto( @@ -28,16 +25,12 @@ class ElementSeeder extends Seeder title: 'Avodah Foundations', description: 'Core foundations for building a steady ' . 'avodah practice.', - richText: '

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

', parentElement: $rootElement, )); $elementRepository->create(new CreateElementDto( set: $baderechSet, title: 'Daily Practice', description: 'Practical steps for consistent daily growth.', - richText: '

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

', parentElement: $rootElement, )); } diff --git a/backend/tests/Fakes/FakeElementRepository.php b/backend/tests/Fakes/FakeElementRepository.php index 4cf8bce..09acc9d 100644 --- a/backend/tests/Fakes/FakeElementRepository.php +++ b/backend/tests/Fakes/FakeElementRepository.php @@ -21,7 +21,6 @@ class FakeElementRepository implements ElementRepository id: $id, title: $dto->title, description: $dto->description, - richText: $dto->richText, set: $dto->set, parentElement: $dto->parentElement, ); @@ -98,7 +97,6 @@ class FakeElementRepository implements ElementRepository id: $element->getId(), title: $element->getTitle(), description: $element->getDescription(), - richText: $element->getRichText(), set: $element->getSet(), parentElement: $parentElement, ); diff --git a/backend/tests/Feature/ElementsEndpointTest.php b/backend/tests/Feature/ElementsEndpointTest.php index 8f24235..b4949e4 100644 --- a/backend/tests/Feature/ElementsEndpointTest.php +++ b/backend/tests/Feature/ElementsEndpointTest.php @@ -26,21 +26,18 @@ class ElementsEndpointTest extends TestCase set: $set, title: 'Baderech HaAvodah', description: 'A structured path for growth', - richText: '

A structured path for growth

', parentElement: null, )); $firstChildElement = $elementRepository->create(new CreateElementDto( set: $set, title: 'Avodah Foundations', description: 'Foundations for steady avodah', - richText: '

Foundations rich text

', parentElement: $element, )); $secondChildElement = $elementRepository->create(new CreateElementDto( set: $set, title: 'Daily Practice', description: 'Daily practices for growth', - richText: '

Daily practice rich text

', parentElement: $element, )); @@ -64,7 +61,6 @@ class ElementsEndpointTest extends TestCase 'id' => $element->getId(), 'title' => 'Baderech HaAvodah', 'description' => 'A structured path for growth', - 'richText' => '

A structured path for growth

', ], ]); } diff --git a/backend/tests/Feature/SetsEndpointTest.php b/backend/tests/Feature/SetsEndpointTest.php index 32aabd2..a1c3ce9 100644 --- a/backend/tests/Feature/SetsEndpointTest.php +++ b/backend/tests/Feature/SetsEndpointTest.php @@ -32,7 +32,6 @@ class SetsEndpointTest extends TestCase set: $baderechSet, title: $baderechSet->getName(), description: $baderechSet->getDescription(), - richText: '', parentElement: null, ) ); diff --git a/backend/tests/Unit/Controllers/ElementControllerTest.php b/backend/tests/Unit/Controllers/ElementControllerTest.php index 569835e..0d6e0f2 100644 --- a/backend/tests/Unit/Controllers/ElementControllerTest.php +++ b/backend/tests/Unit/Controllers/ElementControllerTest.php @@ -30,21 +30,18 @@ class ElementControllerTest extends TestCase $set, 'Baderech HaAvodah', 'A structured path for growth', - '

A structured path for growth

', null, ); $firstChildElement = $this->createElement( $set, 'Avodah Foundations', 'Foundations for steady avodah', - '

Foundations rich text

', $element, ); $secondChildElement = $this->createElement( $set, 'Daily Practice', 'Daily practices for growth', - '

Daily practice rich text

', $element, ); @@ -58,10 +55,6 @@ class ElementControllerTest extends TestCase 'A structured path for growth', $body['element']['description'], ); - $this->assertSame( - '

A structured path for growth

', - $body['element']['richText'], - ); $this->assertSame([ [ 'id' => $firstChildElement->getId(), @@ -112,14 +105,12 @@ class ElementControllerTest extends TestCase DomainSet $set, string $title, string $description, - string $richText, ?Element $parentElement, ): Element { return $this->elementRepo->create(new CreateElementDto( set: $set, title: $title, description: $description, - richText: $richText, parentElement: $parentElement, )); } diff --git a/backend/tests/Unit/Element/ElementTest.php b/backend/tests/Unit/Element/ElementTest.php index 8c09251..3a0cdce 100644 --- a/backend/tests/Unit/Element/ElementTest.php +++ b/backend/tests/Unit/Element/ElementTest.php @@ -20,7 +20,6 @@ class ElementTest extends TestCase id: 1, title: 'Root', description: 'Root description', - richText: '

Root rich text

', set: $set, parentElement: null, ); @@ -28,7 +27,6 @@ class ElementTest extends TestCase id: 2, title: 'Child', description: 'Child description', - richText: '

Child rich text

', set: $set, parentElement: $rootElement, ); @@ -39,10 +37,6 @@ class ElementTest extends TestCase 'Child description', $childElement->getDescription(), ); - $this->assertSame( - '

Child rich text

', - $childElement->getRichText(), - ); $this->assertSame($set, $childElement->getSet()); $this->assertSame($rootElement, $childElement->getParentElement()); $this->assertNull($rootElement->getParentElement()); diff --git a/backend/tests/Unit/Element/UseCases/CreateElementTest.php b/backend/tests/Unit/Element/UseCases/CreateElementTest.php index 55458eb..cef6aa4 100644 --- a/backend/tests/Unit/Element/UseCases/CreateElementTest.php +++ b/backend/tests/Unit/Element/UseCases/CreateElementTest.php @@ -48,14 +48,12 @@ class CreateElementTest extends TestCase setId: $set->getId(), title: 'Root', description: 'Root description', - richText: '

Root rich text

', parentElementId: null, )); $this->assertInstanceOf(Element::class, $element); $this->assertSame('Root', $element->getTitle()); $this->assertSame('Root description', $element->getDescription()); - $this->assertSame('

Root rich text

', $element->getRichText()); $this->assertSame($set->getId(), $element->getSet()->getId()); $this->assertNull($element->getParentElement()); } @@ -68,7 +66,6 @@ class CreateElementTest extends TestCase setId: $set->getId(), title: 'Root', description: 'Root description', - richText: '

Root rich text

', parentElementId: null, ) ); @@ -78,7 +75,6 @@ class CreateElementTest extends TestCase setId: $set->getId(), title: 'Child', description: 'Child description', - richText: '

Child rich text

', parentElementId: $rootElement->getId(), ) ); @@ -88,17 +84,13 @@ class CreateElementTest extends TestCase 'Child description', $childElement->getDescription(), ); - $this->assertSame( - '

Child rich text

', - $childElement->getRichText(), - ); $this->assertSame( $rootElement->getId(), $childElement->getParentElement()->getId(), ); } - public function testCreatesElementWithBlankContentWhenMissing(): void + public function testCreatesElementWithBlankDescriptionWhenMissing(): void { $set = $this->createSet('Daily learning'); @@ -106,12 +98,10 @@ class CreateElementTest extends TestCase setId: $set->getId(), title: 'Root', description: null, - richText: null, parentElementId: null, )); $this->assertSame('', $element->getDescription()); - $this->assertSame('', $element->getRichText()); } public function testThrowsWhenSetIdMissing(): void @@ -123,7 +113,6 @@ class CreateElementTest extends TestCase setId: null, title: 'Root', description: 'Root description', - richText: '

Root rich text

', parentElementId: null, )); } @@ -137,7 +126,6 @@ class CreateElementTest extends TestCase setId: 1, title: null, description: 'Root description', - richText: '

Root rich text

', parentElementId: null, )); } @@ -151,7 +139,6 @@ class CreateElementTest extends TestCase setId: 99, title: 'Root', description: 'Root description', - richText: '

Root rich text

', parentElementId: null, )); } @@ -169,7 +156,6 @@ class CreateElementTest extends TestCase setId: $set->getId(), title: 'Child', description: 'Child description', - richText: '

Child rich text

', parentElementId: 99, )); } @@ -181,7 +167,6 @@ class CreateElementTest extends TestCase setId: $set->getId(), title: 'Root', description: 'Root description', - richText: '

Root rich text

', parentElementId: null, )); @@ -194,7 +179,6 @@ class CreateElementTest extends TestCase setId: $set->getId(), title: 'Another root', description: 'Another root description', - richText: '

Another root rich text

', parentElementId: null, )); } @@ -208,7 +192,6 @@ class CreateElementTest extends TestCase setId: $parentSet->getId(), title: 'Parent root', description: 'Parent root description', - richText: '

Parent root rich text

', parentElementId: null, ) ); @@ -222,7 +205,6 @@ class CreateElementTest extends TestCase setId: $childSet->getId(), title: 'Invalid child', description: 'Invalid child description', - richText: '

Invalid child rich text

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

A structured path for growth

', null, ); @@ -47,10 +46,6 @@ class GetElementTest extends TestCase 'A structured path for growth', $foundElement->getDescription(), ); - $this->assertSame( - '

A structured path for growth

', - $foundElement->getRichText(), - ); } public function testReturnsDirectChildElements(): void @@ -60,28 +55,24 @@ class GetElementTest extends TestCase $set, 'Baderech HaAvodah', 'A structured path for growth', - '

A structured path for growth

', null, ); $firstChildElement = $this->createElement( $set, 'Avodah Foundations', 'Foundations for steady avodah', - '

Foundations rich text

', $parentElement, ); $secondChildElement = $this->createElement( $set, 'Daily Practice', 'Daily practices for growth', - '

Daily practice rich text

', $parentElement, ); $this->createElement( $set, 'Nested Practice', 'Nested description', - '

Nested rich text

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

Other parent rich text

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

Other child rich text

', $otherParentElement, ); @@ -156,14 +145,12 @@ class GetElementTest extends TestCase DomainSet $set, string $title, string $description, - string $richText, ?Element $parentElement, ): Element { return $this->elementRepo->create(new CreateElementDto( set: $set, title: $title, description: $description, - richText: $richText, parentElement: $parentElement, )); } diff --git a/frontend/rabbi_gerzi/cypress/e2e/media.cy.ts b/frontend/rabbi_gerzi/cypress/e2e/media.cy.ts index 4dda0e4..832233d 100644 --- a/frontend/rabbi_gerzi/cypress/e2e/media.cy.ts +++ b/frontend/rabbi_gerzi/cypress/e2e/media.cy.ts @@ -41,17 +41,7 @@ describe('media page sets', () => { cy.location('pathname').should('eq', '/element/1') cy.get('[data-cy="element-page"]').should('be.visible') cy.contains('h1', 'Baderech HaAvodah').should('be.visible') - cy.get('[data-cy="element-rich-text"]').within(() => { - cy.contains('Begin with a clear map for avodah growth.') - .should('be.visible') - cy.contains('strong', 'Move steadily').should('be.visible') - }) cy.get('[data-cy="child-element-list"]').should('be.visible') - cy.get('[data-cy="child-element-list"]') - .should( - 'not.contain.text', - 'Avodah foundations begin with honest awareness', - ) cy.contains('[data-cy="child-element-link"]', 'Avodah Foundations') .as('avodahFoundationsLink') .should('have.attr', 'href', '/element/2') @@ -73,10 +63,5 @@ describe('media page sets', () => { .click() cy.location('pathname').should('eq', '/element/2') cy.contains('h1', 'Avodah Foundations').should('be.visible') - cy.get('[data-cy="element-rich-text"]') - .should( - 'contain.text', - 'Avodah foundations begin with honest awareness', - ) }) }) diff --git a/frontend/rabbi_gerzi/src/stores/elements.ts b/frontend/rabbi_gerzi/src/stores/elements.ts index 6c5f1f4..b7ae058 100644 --- a/frontend/rabbi_gerzi/src/stores/elements.ts +++ b/frontend/rabbi_gerzi/src/stores/elements.ts @@ -1,26 +1,22 @@ import { ref } from 'vue' import { defineStore } from 'pinia' -export interface ChildElement { +export interface Element { id: number title: string description: string } -export interface Element extends ChildElement { - richText: string -} - interface ElementResponse { element: Element - childElements: ChildElement[] + childElements: Element[] } const API_BASE_URL = import.meta.env.VITE_API_BASE_URL as string export const useElementsStore = defineStore('elements', () => { const element = ref(null) - const childElements = ref([]) + const childElements = ref([]) const isLoading = ref(false) const error = ref(null) diff --git a/frontend/rabbi_gerzi/src/views/ElementPage.vue b/frontend/rabbi_gerzi/src/views/ElementPage.vue index 1956a22..fd8a5fa 100644 --- a/frontend/rabbi_gerzi/src/views/ElementPage.vue +++ b/frontend/rabbi_gerzi/src/views/ElementPage.vue @@ -49,13 +49,6 @@ watch( {{ element.title }} -
-