Compare commits
No commits in common. "8a06f5a57ce3d4ac13d3cd432a144ed847c55548" and "2c79ab64ade080892e26fed111aa7e96ebe76b15" have entirely different histories.
8a06f5a57c
...
2c79ab64ad
20 changed files with 0 additions and 148 deletions
|
|
@ -47,7 +47,6 @@ class ElementController
|
||||||
'title' => $element->getTitle(),
|
'title' => $element->getTitle(),
|
||||||
'description' => $element->getDescription(),
|
'description' => $element->getDescription(),
|
||||||
'richText' => $element->getRichText(),
|
'richText' => $element->getRichText(),
|
||||||
'pdfPath' => $element->getPdfPath(),
|
|
||||||
],
|
],
|
||||||
], 200);
|
], 200);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ class CreateElementDto
|
||||||
public string $title,
|
public string $title,
|
||||||
public string $description,
|
public string $description,
|
||||||
public string $richText,
|
public string $richText,
|
||||||
public ?string $pdfPath,
|
|
||||||
public ?Element $parentElement,
|
public ?Element $parentElement,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ class Element
|
||||||
private string $title,
|
private string $title,
|
||||||
private string $description,
|
private string $description,
|
||||||
private string $richText,
|
private string $richText,
|
||||||
private ?string $pdfPath,
|
|
||||||
private Set $set,
|
private Set $set,
|
||||||
private ?Element $parentElement,
|
private ?Element $parentElement,
|
||||||
) {
|
) {
|
||||||
|
|
@ -37,11 +36,6 @@ class Element
|
||||||
return $this->richText;
|
return $this->richText;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPdfPath(): ?string
|
|
||||||
{
|
|
||||||
return $this->pdfPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getSet(): Set
|
public function getSet(): Set
|
||||||
{
|
{
|
||||||
return $this->set;
|
return $this->set;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
* @property string $title
|
* @property string $title
|
||||||
* @property string $description
|
* @property string $description
|
||||||
* @property string $rich_text
|
* @property string $rich_text
|
||||||
* @property string|null $pdf_path
|
|
||||||
* @property int|null $parent_element_id
|
* @property int|null $parent_element_id
|
||||||
*
|
*
|
||||||
* @method static Builder<static>|ElementModel newModelQuery()
|
* @method static Builder<static>|ElementModel newModelQuery()
|
||||||
|
|
@ -23,7 +22,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
* @method static Builder<static>|ElementModel whereTitle($value)
|
* @method static Builder<static>|ElementModel whereTitle($value)
|
||||||
* @method static Builder<static>|ElementModel whereDescription($value)
|
* @method static Builder<static>|ElementModel whereDescription($value)
|
||||||
* @method static Builder<static>|ElementModel whereRichText($value)
|
* @method static Builder<static>|ElementModel whereRichText($value)
|
||||||
* @method static Builder<static>|ElementModel wherePdfPath($value)
|
|
||||||
*
|
*
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
|
|
@ -38,7 +36,6 @@ class ElementModel extends Model
|
||||||
'title',
|
'title',
|
||||||
'description',
|
'description',
|
||||||
'rich_text',
|
'rich_text',
|
||||||
'pdf_path',
|
|
||||||
'parent_element_id',
|
'parent_element_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ class EloquentElementRepository implements ElementRepository
|
||||||
'title' => $dto->title,
|
'title' => $dto->title,
|
||||||
'description' => $dto->description,
|
'description' => $dto->description,
|
||||||
'rich_text' => $dto->richText,
|
'rich_text' => $dto->richText,
|
||||||
'pdf_path' => $dto->pdfPath,
|
|
||||||
'parent_element_id' => $dto->parentElement?->getId(),
|
'parent_element_id' => $dto->parentElement?->getId(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -28,7 +27,6 @@ class EloquentElementRepository implements ElementRepository
|
||||||
title: $dto->title,
|
title: $dto->title,
|
||||||
description: $dto->description,
|
description: $dto->description,
|
||||||
richText: $dto->richText,
|
richText: $dto->richText,
|
||||||
pdfPath: $dto->pdfPath,
|
|
||||||
set: $dto->set,
|
set: $dto->set,
|
||||||
parentElement: $dto->parentElement,
|
parentElement: $dto->parentElement,
|
||||||
);
|
);
|
||||||
|
|
@ -110,7 +108,6 @@ class EloquentElementRepository implements ElementRepository
|
||||||
title: $model->title,
|
title: $model->title,
|
||||||
description: $model->description,
|
description: $model->description,
|
||||||
richText: $model->rich_text,
|
richText: $model->rich_text,
|
||||||
pdfPath: $model->pdf_path,
|
|
||||||
set: $set,
|
set: $set,
|
||||||
parentElement: $parentElement,
|
parentElement: $parentElement,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ class CreateElement
|
||||||
}
|
}
|
||||||
$description = $request->description ?? '';
|
$description = $request->description ?? '';
|
||||||
$richText = $request->richText ?? '';
|
$richText = $request->richText ?? '';
|
||||||
$pdfPath = $request->pdfPath === '' ? null : $request->pdfPath;
|
|
||||||
|
|
||||||
$set = $this->setRepo->find($request->setId);
|
$set = $this->setRepo->find($request->setId);
|
||||||
if ($set === null) {
|
if ($set === null) {
|
||||||
|
|
@ -49,7 +48,6 @@ class CreateElement
|
||||||
title: $request->title,
|
title: $request->title,
|
||||||
description: $description,
|
description: $description,
|
||||||
richText: $richText,
|
richText: $richText,
|
||||||
pdfPath: $pdfPath,
|
|
||||||
parentElement: null,
|
parentElement: null,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
@ -73,7 +71,6 @@ class CreateElement
|
||||||
title: $request->title,
|
title: $request->title,
|
||||||
description: $description,
|
description: $description,
|
||||||
richText: $richText,
|
richText: $richText,
|
||||||
pdfPath: $pdfPath,
|
|
||||||
parentElement: $parentElement,
|
parentElement: $parentElement,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ class CreateElementRequest
|
||||||
public ?string $title,
|
public ?string $title,
|
||||||
public ?string $description,
|
public ?string $description,
|
||||||
public ?string $richText,
|
public ?string $richText,
|
||||||
public ?string $pdfPath,
|
|
||||||
public ?int $parentElementId,
|
public ?int $parentElementId,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ return new class extends Migration
|
||||||
$table->string('title');
|
$table->string('title');
|
||||||
$table->text('description')->default('');
|
$table->text('description')->default('');
|
||||||
$table->text('rich_text')->default('');
|
$table->text('rich_text')->default('');
|
||||||
$table->string('pdf_path')->nullable();
|
|
||||||
$table->foreignId('parent_element_id')
|
$table->foreignId('parent_element_id')
|
||||||
->nullable()
|
->nullable()
|
||||||
->constrained('elements');
|
->constrained('elements');
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ class ElementSeeder extends Seeder
|
||||||
richText: '<p>Begin with a clear map for avodah growth.</p>'
|
richText: '<p>Begin with a clear map for avodah growth.</p>'
|
||||||
. '<p><strong>Move steadily</strong> from awareness '
|
. '<p><strong>Move steadily</strong> from awareness '
|
||||||
. 'to practice.</p>',
|
. 'to practice.</p>',
|
||||||
pdfPath: '/assets/pdfs/baderech.pdf',
|
|
||||||
parentElement: null,
|
parentElement: null,
|
||||||
));
|
));
|
||||||
$elementRepository->create(new CreateElementDto(
|
$elementRepository->create(new CreateElementDto(
|
||||||
|
|
@ -31,7 +30,6 @@ class ElementSeeder extends Seeder
|
||||||
. 'avodah practice.',
|
. 'avodah practice.',
|
||||||
richText: '<p>Avodah foundations begin with honest awareness '
|
richText: '<p>Avodah foundations begin with honest awareness '
|
||||||
. 'and small repeatable steps.</p>',
|
. 'and small repeatable steps.</p>',
|
||||||
pdfPath: null,
|
|
||||||
parentElement: $rootElement,
|
parentElement: $rootElement,
|
||||||
));
|
));
|
||||||
$elementRepository->create(new CreateElementDto(
|
$elementRepository->create(new CreateElementDto(
|
||||||
|
|
@ -40,7 +38,6 @@ class ElementSeeder extends Seeder
|
||||||
description: 'Practical steps for consistent daily growth.',
|
description: 'Practical steps for consistent daily growth.',
|
||||||
richText: '<p>Daily practice turns inspiration into a '
|
richText: '<p>Daily practice turns inspiration into a '
|
||||||
. 'dependable rhythm.</p>',
|
. 'dependable rhythm.</p>',
|
||||||
pdfPath: null,
|
|
||||||
parentElement: $rootElement,
|
parentElement: $rootElement,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ class FakeElementRepository implements ElementRepository
|
||||||
title: $dto->title,
|
title: $dto->title,
|
||||||
description: $dto->description,
|
description: $dto->description,
|
||||||
richText: $dto->richText,
|
richText: $dto->richText,
|
||||||
pdfPath: $dto->pdfPath,
|
|
||||||
set: $dto->set,
|
set: $dto->set,
|
||||||
parentElement: $dto->parentElement,
|
parentElement: $dto->parentElement,
|
||||||
);
|
);
|
||||||
|
|
@ -100,7 +99,6 @@ class FakeElementRepository implements ElementRepository
|
||||||
title: $element->getTitle(),
|
title: $element->getTitle(),
|
||||||
description: $element->getDescription(),
|
description: $element->getDescription(),
|
||||||
richText: $element->getRichText(),
|
richText: $element->getRichText(),
|
||||||
pdfPath: $element->getPdfPath(),
|
|
||||||
set: $element->getSet(),
|
set: $element->getSet(),
|
||||||
parentElement: $parentElement,
|
parentElement: $parentElement,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ class ElementsEndpointTest extends TestCase
|
||||||
title: 'Baderech HaAvodah',
|
title: 'Baderech HaAvodah',
|
||||||
description: 'A structured path for growth',
|
description: 'A structured path for growth',
|
||||||
richText: '<p>A structured path for growth</p>',
|
richText: '<p>A structured path for growth</p>',
|
||||||
pdfPath: '/assets/pdfs/baderech.pdf',
|
|
||||||
parentElement: null,
|
parentElement: null,
|
||||||
));
|
));
|
||||||
$firstChildElement = $elementRepository->create(new CreateElementDto(
|
$firstChildElement = $elementRepository->create(new CreateElementDto(
|
||||||
|
|
@ -35,7 +34,6 @@ class ElementsEndpointTest extends TestCase
|
||||||
title: 'Avodah Foundations',
|
title: 'Avodah Foundations',
|
||||||
description: 'Foundations for steady avodah',
|
description: 'Foundations for steady avodah',
|
||||||
richText: '<p>Foundations rich text</p>',
|
richText: '<p>Foundations rich text</p>',
|
||||||
pdfPath: '/assets/pdfs/foundations.pdf',
|
|
||||||
parentElement: $element,
|
parentElement: $element,
|
||||||
));
|
));
|
||||||
$secondChildElement = $elementRepository->create(new CreateElementDto(
|
$secondChildElement = $elementRepository->create(new CreateElementDto(
|
||||||
|
|
@ -43,7 +41,6 @@ class ElementsEndpointTest extends TestCase
|
||||||
title: 'Daily Practice',
|
title: 'Daily Practice',
|
||||||
description: 'Daily practices for growth',
|
description: 'Daily practices for growth',
|
||||||
richText: '<p>Daily practice rich text</p>',
|
richText: '<p>Daily practice rich text</p>',
|
||||||
pdfPath: null,
|
|
||||||
parentElement: $element,
|
parentElement: $element,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
@ -68,7 +65,6 @@ class ElementsEndpointTest extends TestCase
|
||||||
'title' => 'Baderech HaAvodah',
|
'title' => 'Baderech HaAvodah',
|
||||||
'description' => 'A structured path for growth',
|
'description' => 'A structured path for growth',
|
||||||
'richText' => '<p>A structured path for growth</p>',
|
'richText' => '<p>A structured path for growth</p>',
|
||||||
'pdfPath' => '/assets/pdfs/baderech.pdf',
|
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ class SetsEndpointTest extends TestCase
|
||||||
title: $baderechSet->getName(),
|
title: $baderechSet->getName(),
|
||||||
description: $baderechSet->getDescription(),
|
description: $baderechSet->getDescription(),
|
||||||
richText: '',
|
richText: '',
|
||||||
pdfPath: null,
|
|
||||||
parentElement: null,
|
parentElement: null,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ class ElementControllerTest extends TestCase
|
||||||
'Baderech HaAvodah',
|
'Baderech HaAvodah',
|
||||||
'A structured path for growth',
|
'A structured path for growth',
|
||||||
'<p>A structured path for growth</p>',
|
'<p>A structured path for growth</p>',
|
||||||
'/assets/pdfs/baderech.pdf',
|
|
||||||
null,
|
null,
|
||||||
);
|
);
|
||||||
$firstChildElement = $this->createElement(
|
$firstChildElement = $this->createElement(
|
||||||
|
|
@ -39,7 +38,6 @@ class ElementControllerTest extends TestCase
|
||||||
'Avodah Foundations',
|
'Avodah Foundations',
|
||||||
'Foundations for steady avodah',
|
'Foundations for steady avodah',
|
||||||
'<p>Foundations rich text</p>',
|
'<p>Foundations rich text</p>',
|
||||||
'/assets/pdfs/foundations.pdf',
|
|
||||||
$element,
|
$element,
|
||||||
);
|
);
|
||||||
$secondChildElement = $this->createElement(
|
$secondChildElement = $this->createElement(
|
||||||
|
|
@ -47,7 +45,6 @@ class ElementControllerTest extends TestCase
|
||||||
'Daily Practice',
|
'Daily Practice',
|
||||||
'Daily practices for growth',
|
'Daily practices for growth',
|
||||||
'<p>Daily practice rich text</p>',
|
'<p>Daily practice rich text</p>',
|
||||||
null,
|
|
||||||
$element,
|
$element,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -65,10 +62,6 @@ class ElementControllerTest extends TestCase
|
||||||
'<p>A structured path for growth</p>',
|
'<p>A structured path for growth</p>',
|
||||||
$body['element']['richText'],
|
$body['element']['richText'],
|
||||||
);
|
);
|
||||||
$this->assertSame(
|
|
||||||
'/assets/pdfs/baderech.pdf',
|
|
||||||
$body['element']['pdfPath'],
|
|
||||||
);
|
|
||||||
$this->assertSame([
|
$this->assertSame([
|
||||||
[
|
[
|
||||||
'id' => $firstChildElement->getId(),
|
'id' => $firstChildElement->getId(),
|
||||||
|
|
@ -120,7 +113,6 @@ class ElementControllerTest extends TestCase
|
||||||
string $title,
|
string $title,
|
||||||
string $description,
|
string $description,
|
||||||
string $richText,
|
string $richText,
|
||||||
?string $pdfPath,
|
|
||||||
?Element $parentElement,
|
?Element $parentElement,
|
||||||
): Element {
|
): Element {
|
||||||
return $this->elementRepo->create(new CreateElementDto(
|
return $this->elementRepo->create(new CreateElementDto(
|
||||||
|
|
@ -128,7 +120,6 @@ class ElementControllerTest extends TestCase
|
||||||
title: $title,
|
title: $title,
|
||||||
description: $description,
|
description: $description,
|
||||||
richText: $richText,
|
richText: $richText,
|
||||||
pdfPath: $pdfPath,
|
|
||||||
parentElement: $parentElement,
|
parentElement: $parentElement,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ class ElementTest extends TestCase
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
|
||||||
set: $set,
|
set: $set,
|
||||||
parentElement: null,
|
parentElement: null,
|
||||||
);
|
);
|
||||||
|
|
@ -30,7 +29,6 @@ class ElementTest extends TestCase
|
||||||
title: 'Child',
|
title: 'Child',
|
||||||
description: 'Child description',
|
description: 'Child description',
|
||||||
richText: '<p>Child rich text</p>',
|
richText: '<p>Child rich text</p>',
|
||||||
pdfPath: '/assets/pdfs/child.pdf',
|
|
||||||
set: $set,
|
set: $set,
|
||||||
parentElement: $rootElement,
|
parentElement: $rootElement,
|
||||||
);
|
);
|
||||||
|
|
@ -45,13 +43,8 @@ class ElementTest extends TestCase
|
||||||
'<p>Child rich text</p>',
|
'<p>Child rich text</p>',
|
||||||
$childElement->getRichText(),
|
$childElement->getRichText(),
|
||||||
);
|
);
|
||||||
$this->assertSame(
|
|
||||||
'/assets/pdfs/child.pdf',
|
|
||||||
$childElement->getPdfPath(),
|
|
||||||
);
|
|
||||||
$this->assertSame($set, $childElement->getSet());
|
$this->assertSame($set, $childElement->getSet());
|
||||||
$this->assertSame($rootElement, $childElement->getParentElement());
|
$this->assertSame($rootElement, $childElement->getParentElement());
|
||||||
$this->assertNull($rootElement->getPdfPath());
|
|
||||||
$this->assertNull($rootElement->getParentElement());
|
$this->assertNull($rootElement->getParentElement());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,6 @@ class CreateElementTest extends TestCase
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: '/assets/pdfs/root.pdf',
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
@ -57,7 +56,6 @@ class CreateElementTest extends TestCase
|
||||||
$this->assertSame('Root', $element->getTitle());
|
$this->assertSame('Root', $element->getTitle());
|
||||||
$this->assertSame('Root description', $element->getDescription());
|
$this->assertSame('Root description', $element->getDescription());
|
||||||
$this->assertSame('<p>Root rich text</p>', $element->getRichText());
|
$this->assertSame('<p>Root rich text</p>', $element->getRichText());
|
||||||
$this->assertSame('/assets/pdfs/root.pdf', $element->getPdfPath());
|
|
||||||
$this->assertSame($set->getId(), $element->getSet()->getId());
|
$this->assertSame($set->getId(), $element->getSet()->getId());
|
||||||
$this->assertNull($element->getParentElement());
|
$this->assertNull($element->getParentElement());
|
||||||
}
|
}
|
||||||
|
|
@ -71,7 +69,6 @@ class CreateElementTest extends TestCase
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
@ -82,7 +79,6 @@ class CreateElementTest extends TestCase
|
||||||
title: 'Child',
|
title: 'Child',
|
||||||
description: 'Child description',
|
description: 'Child description',
|
||||||
richText: '<p>Child rich text</p>',
|
richText: '<p>Child rich text</p>',
|
||||||
pdfPath: '/assets/pdfs/child.pdf',
|
|
||||||
parentElementId: $rootElement->getId(),
|
parentElementId: $rootElement->getId(),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
@ -96,10 +92,6 @@ class CreateElementTest extends TestCase
|
||||||
'<p>Child rich text</p>',
|
'<p>Child rich text</p>',
|
||||||
$childElement->getRichText(),
|
$childElement->getRichText(),
|
||||||
);
|
);
|
||||||
$this->assertSame(
|
|
||||||
'/assets/pdfs/child.pdf',
|
|
||||||
$childElement->getPdfPath(),
|
|
||||||
);
|
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
$rootElement->getId(),
|
$rootElement->getId(),
|
||||||
$childElement->getParentElement()->getId(),
|
$childElement->getParentElement()->getId(),
|
||||||
|
|
@ -115,29 +107,11 @@ class CreateElementTest extends TestCase
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: null,
|
description: null,
|
||||||
richText: null,
|
richText: null,
|
||||||
pdfPath: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->assertSame('', $element->getDescription());
|
$this->assertSame('', $element->getDescription());
|
||||||
$this->assertSame('', $element->getRichText());
|
$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: '<p>Root rich text</p>',
|
|
||||||
pdfPath: '',
|
|
||||||
parentElementId: null,
|
|
||||||
));
|
|
||||||
|
|
||||||
$this->assertNull($element->getPdfPath());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testThrowsWhenSetIdMissing(): void
|
public function testThrowsWhenSetIdMissing(): void
|
||||||
|
|
@ -150,7 +124,6 @@ class CreateElementTest extends TestCase
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
@ -165,7 +138,6 @@ class CreateElementTest extends TestCase
|
||||||
title: null,
|
title: null,
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
@ -180,7 +152,6 @@ class CreateElementTest extends TestCase
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
@ -199,7 +170,6 @@ class CreateElementTest extends TestCase
|
||||||
title: 'Child',
|
title: 'Child',
|
||||||
description: 'Child description',
|
description: 'Child description',
|
||||||
richText: '<p>Child rich text</p>',
|
richText: '<p>Child rich text</p>',
|
||||||
pdfPath: null,
|
|
||||||
parentElementId: 99,
|
parentElementId: 99,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
@ -212,7 +182,6 @@ class CreateElementTest extends TestCase
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
@ -226,7 +195,6 @@ class CreateElementTest extends TestCase
|
||||||
title: 'Another root',
|
title: 'Another root',
|
||||||
description: 'Another root description',
|
description: 'Another root description',
|
||||||
richText: '<p>Another root rich text</p>',
|
richText: '<p>Another root rich text</p>',
|
||||||
pdfPath: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
@ -241,7 +209,6 @@ class CreateElementTest extends TestCase
|
||||||
title: 'Parent root',
|
title: 'Parent root',
|
||||||
description: 'Parent root description',
|
description: 'Parent root description',
|
||||||
richText: '<p>Parent root rich text</p>',
|
richText: '<p>Parent root rich text</p>',
|
||||||
pdfPath: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
@ -256,7 +223,6 @@ class CreateElementTest extends TestCase
|
||||||
title: 'Invalid child',
|
title: 'Invalid child',
|
||||||
description: 'Invalid child description',
|
description: 'Invalid child description',
|
||||||
richText: '<p>Invalid child rich text</p>',
|
richText: '<p>Invalid child rich text</p>',
|
||||||
pdfPath: null,
|
|
||||||
parentElementId: $parentElement->getId(),
|
parentElementId: $parentElement->getId(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ class GetElementTest extends TestCase
|
||||||
'Baderech HaAvodah',
|
'Baderech HaAvodah',
|
||||||
'A structured path for growth',
|
'A structured path for growth',
|
||||||
'<p>A structured path for growth</p>',
|
'<p>A structured path for growth</p>',
|
||||||
'/assets/pdfs/baderech.pdf',
|
|
||||||
null,
|
null,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -52,10 +51,6 @@ class GetElementTest extends TestCase
|
||||||
'<p>A structured path for growth</p>',
|
'<p>A structured path for growth</p>',
|
||||||
$foundElement->getRichText(),
|
$foundElement->getRichText(),
|
||||||
);
|
);
|
||||||
$this->assertSame(
|
|
||||||
'/assets/pdfs/baderech.pdf',
|
|
||||||
$foundElement->getPdfPath(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testReturnsDirectChildElements(): void
|
public function testReturnsDirectChildElements(): void
|
||||||
|
|
@ -66,7 +61,6 @@ class GetElementTest extends TestCase
|
||||||
'Baderech HaAvodah',
|
'Baderech HaAvodah',
|
||||||
'A structured path for growth',
|
'A structured path for growth',
|
||||||
'<p>A structured path for growth</p>',
|
'<p>A structured path for growth</p>',
|
||||||
'/assets/pdfs/baderech.pdf',
|
|
||||||
null,
|
null,
|
||||||
);
|
);
|
||||||
$firstChildElement = $this->createElement(
|
$firstChildElement = $this->createElement(
|
||||||
|
|
@ -74,7 +68,6 @@ class GetElementTest extends TestCase
|
||||||
'Avodah Foundations',
|
'Avodah Foundations',
|
||||||
'Foundations for steady avodah',
|
'Foundations for steady avodah',
|
||||||
'<p>Foundations rich text</p>',
|
'<p>Foundations rich text</p>',
|
||||||
'/assets/pdfs/foundations.pdf',
|
|
||||||
$parentElement,
|
$parentElement,
|
||||||
);
|
);
|
||||||
$secondChildElement = $this->createElement(
|
$secondChildElement = $this->createElement(
|
||||||
|
|
@ -82,7 +75,6 @@ class GetElementTest extends TestCase
|
||||||
'Daily Practice',
|
'Daily Practice',
|
||||||
'Daily practices for growth',
|
'Daily practices for growth',
|
||||||
'<p>Daily practice rich text</p>',
|
'<p>Daily practice rich text</p>',
|
||||||
null,
|
|
||||||
$parentElement,
|
$parentElement,
|
||||||
);
|
);
|
||||||
$this->createElement(
|
$this->createElement(
|
||||||
|
|
@ -90,7 +82,6 @@ class GetElementTest extends TestCase
|
||||||
'Nested Practice',
|
'Nested Practice',
|
||||||
'Nested description',
|
'Nested description',
|
||||||
'<p>Nested rich text</p>',
|
'<p>Nested rich text</p>',
|
||||||
null,
|
|
||||||
$firstChildElement,
|
$firstChildElement,
|
||||||
);
|
);
|
||||||
$otherSet = $this->createSet(2, 'Daily Learning');
|
$otherSet = $this->createSet(2, 'Daily Learning');
|
||||||
|
|
@ -100,14 +91,12 @@ class GetElementTest extends TestCase
|
||||||
'Other parent description',
|
'Other parent description',
|
||||||
'<p>Other parent rich text</p>',
|
'<p>Other parent rich text</p>',
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
);
|
);
|
||||||
$this->createElement(
|
$this->createElement(
|
||||||
$otherSet,
|
$otherSet,
|
||||||
'Other Child',
|
'Other Child',
|
||||||
'Other child description',
|
'Other child description',
|
||||||
'<p>Other child rich text</p>',
|
'<p>Other child rich text</p>',
|
||||||
null,
|
|
||||||
$otherParentElement,
|
$otherParentElement,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -168,7 +157,6 @@ class GetElementTest extends TestCase
|
||||||
string $title,
|
string $title,
|
||||||
string $description,
|
string $description,
|
||||||
string $richText,
|
string $richText,
|
||||||
?string $pdfPath,
|
|
||||||
?Element $parentElement,
|
?Element $parentElement,
|
||||||
): Element {
|
): Element {
|
||||||
return $this->elementRepo->create(new CreateElementDto(
|
return $this->elementRepo->create(new CreateElementDto(
|
||||||
|
|
@ -176,7 +164,6 @@ class GetElementTest extends TestCase
|
||||||
title: $title,
|
title: $title,
|
||||||
description: $description,
|
description: $description,
|
||||||
richText: $richText,
|
richText: $richText,
|
||||||
pdfPath: $pdfPath,
|
|
||||||
parentElement: $parentElement,
|
parentElement: $parentElement,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,6 @@ describe('media page sets', () => {
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
cy.contains('strong', 'Move steadily').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('be.visible')
|
||||||
cy.get('[data-cy="child-element-list"]')
|
cy.get('[data-cy="child-element-list"]')
|
||||||
.should(
|
.should(
|
||||||
|
|
@ -82,6 +78,5 @@ describe('media page sets', () => {
|
||||||
'contain.text',
|
'contain.text',
|
||||||
'Avodah foundations begin with honest awareness',
|
'Avodah foundations begin with honest awareness',
|
||||||
)
|
)
|
||||||
cy.get('[data-cy="element-pdf-link"]').should('not.exist')
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -9,7 +9,6 @@ export interface ChildElement {
|
||||||
|
|
||||||
export interface Element extends ChildElement {
|
export interface Element extends ChildElement {
|
||||||
richText: string
|
richText: string
|
||||||
pdfPath: string | null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ElementResponse {
|
interface ElementResponse {
|
||||||
|
|
|
||||||
|
|
@ -56,18 +56,6 @@ watch(
|
||||||
v-html="element.richText"
|
v-html="element.richText"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div v-if="element.pdfPath !== null" class="element-page__actions">
|
|
||||||
<a
|
|
||||||
:href="element.pdfPath"
|
|
||||||
class="element-page__pdf-link"
|
|
||||||
data-cy="element-pdf-link"
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
>
|
|
||||||
View PDF
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<nav
|
<nav
|
||||||
v-if="childElements.length > 0"
|
v-if="childElements.length > 0"
|
||||||
class="element-page__children"
|
class="element-page__children"
|
||||||
|
|
@ -149,44 +137,6 @@ watch(
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
.element-page__actions {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
margin-top: 1.75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.element-page__pdf-link {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
min-height: 2.75rem;
|
|
||||||
padding: 0.7rem 1.15rem;
|
|
||||||
color: var(--color-white);
|
|
||||||
background: var(--color-olive);
|
|
||||||
border-radius: 8px;
|
|
||||||
font-family: var(--font-sans);
|
|
||||||
font-size: 0.95rem;
|
|
||||||
font-weight: 700;
|
|
||||||
line-height: 1;
|
|
||||||
text-decoration: none;
|
|
||||||
transition:
|
|
||||||
background-color 180ms ease,
|
|
||||||
box-shadow 180ms ease,
|
|
||||||
transform 180ms ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.element-page__pdf-link:hover,
|
|
||||||
.element-page__pdf-link:focus-visible {
|
|
||||||
background: #4d5b3c;
|
|
||||||
box-shadow: 0 10px 24px rgb(44 44 44 / 12%);
|
|
||||||
transform: translateY(-1px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.element-page__pdf-link:focus-visible {
|
|
||||||
outline: 3px solid rgb(94 107 76 / 38%);
|
|
||||||
outline-offset: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.element-page__children {
|
.element-page__children {
|
||||||
margin-top: 3rem;
|
margin-top: 3rem;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue