Compare commits
No commits in common. "e71d398840831fdb9b44967c952224ebd746e5dc" and "c5ea3640b73ae17acf52f1f90a304d4b1db8c2bf" have entirely different histories.
e71d398840
...
c5ea3640b7
19 changed files with 0 additions and 129 deletions
|
|
@ -46,7 +46,6 @@ class ElementController
|
||||||
'id' => $element->getId(),
|
'id' => $element->getId(),
|
||||||
'title' => $element->getTitle(),
|
'title' => $element->getTitle(),
|
||||||
'description' => $element->getDescription(),
|
'description' => $element->getDescription(),
|
||||||
'iconImageUrl' => $element->getIconImageUrl(),
|
|
||||||
'richText' => $element->getRichText(),
|
'richText' => $element->getRichText(),
|
||||||
'pdfPath' => $element->getPdfPath(),
|
'pdfPath' => $element->getPdfPath(),
|
||||||
'youtubeUrl' => $element->getYoutubeUrl(),
|
'youtubeUrl' => $element->getYoutubeUrl(),
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ class CreateElementDto
|
||||||
public Set $set,
|
public Set $set,
|
||||||
public string $title,
|
public string $title,
|
||||||
public string $description,
|
public string $description,
|
||||||
public ?string $iconImageUrl,
|
|
||||||
public string $richText,
|
public string $richText,
|
||||||
public ?string $pdfPath,
|
public ?string $pdfPath,
|
||||||
public ?string $youtubeUrl,
|
public ?string $youtubeUrl,
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ class Element
|
||||||
private int $id,
|
private int $id,
|
||||||
private string $title,
|
private string $title,
|
||||||
private string $description,
|
private string $description,
|
||||||
private ?string $iconImageUrl,
|
|
||||||
private string $richText,
|
private string $richText,
|
||||||
private ?string $pdfPath,
|
private ?string $pdfPath,
|
||||||
private ?string $youtubeUrl,
|
private ?string $youtubeUrl,
|
||||||
|
|
@ -34,11 +33,6 @@ class Element
|
||||||
return $this->description;
|
return $this->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIconImageUrl(): ?string
|
|
||||||
{
|
|
||||||
return $this->iconImageUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getRichText(): string
|
public function getRichText(): string
|
||||||
{
|
{
|
||||||
return $this->richText;
|
return $this->richText;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
* @property int $set_id
|
* @property int $set_id
|
||||||
* @property string $title
|
* @property string $title
|
||||||
* @property string $description
|
* @property string $description
|
||||||
* @property string|null $icon_image_url
|
|
||||||
* @property string $rich_text
|
* @property string $rich_text
|
||||||
* @property string|null $pdf_path
|
* @property string|null $pdf_path
|
||||||
* @property string|null $youtube_url
|
* @property string|null $youtube_url
|
||||||
|
|
@ -24,7 +23,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
* @method static Builder<static>|ElementModel whereSetId($value)
|
* @method static Builder<static>|ElementModel whereSetId($value)
|
||||||
* @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 whereIconImageUrl($value)
|
|
||||||
* @method static Builder<static>|ElementModel whereRichText($value)
|
* @method static Builder<static>|ElementModel whereRichText($value)
|
||||||
* @method static Builder<static>|ElementModel wherePdfPath($value)
|
* @method static Builder<static>|ElementModel wherePdfPath($value)
|
||||||
* @method static Builder<static>|ElementModel whereYoutubeUrl($value)
|
* @method static Builder<static>|ElementModel whereYoutubeUrl($value)
|
||||||
|
|
@ -41,7 +39,6 @@ class ElementModel extends Model
|
||||||
'set_id',
|
'set_id',
|
||||||
'title',
|
'title',
|
||||||
'description',
|
'description',
|
||||||
'icon_image_url',
|
|
||||||
'rich_text',
|
'rich_text',
|
||||||
'pdf_path',
|
'pdf_path',
|
||||||
'youtube_url',
|
'youtube_url',
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ class EloquentElementRepository implements ElementRepository
|
||||||
'set_id' => $dto->set->getId(),
|
'set_id' => $dto->set->getId(),
|
||||||
'title' => $dto->title,
|
'title' => $dto->title,
|
||||||
'description' => $dto->description,
|
'description' => $dto->description,
|
||||||
'icon_image_url' => $dto->iconImageUrl,
|
|
||||||
'rich_text' => $dto->richText,
|
'rich_text' => $dto->richText,
|
||||||
'pdf_path' => $dto->pdfPath,
|
'pdf_path' => $dto->pdfPath,
|
||||||
'youtube_url' => $dto->youtubeUrl,
|
'youtube_url' => $dto->youtubeUrl,
|
||||||
|
|
@ -29,7 +28,6 @@ class EloquentElementRepository implements ElementRepository
|
||||||
id: $model->id,
|
id: $model->id,
|
||||||
title: $dto->title,
|
title: $dto->title,
|
||||||
description: $dto->description,
|
description: $dto->description,
|
||||||
iconImageUrl: $dto->iconImageUrl,
|
|
||||||
richText: $dto->richText,
|
richText: $dto->richText,
|
||||||
pdfPath: $dto->pdfPath,
|
pdfPath: $dto->pdfPath,
|
||||||
youtubeUrl: $dto->youtubeUrl,
|
youtubeUrl: $dto->youtubeUrl,
|
||||||
|
|
@ -113,7 +111,6 @@ class EloquentElementRepository implements ElementRepository
|
||||||
id: $model->id,
|
id: $model->id,
|
||||||
title: $model->title,
|
title: $model->title,
|
||||||
description: $model->description,
|
description: $model->description,
|
||||||
iconImageUrl: $model->icon_image_url,
|
|
||||||
richText: $model->rich_text,
|
richText: $model->rich_text,
|
||||||
pdfPath: $model->pdf_path,
|
pdfPath: $model->pdf_path,
|
||||||
youtubeUrl: $model->youtube_url,
|
youtubeUrl: $model->youtube_url,
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,6 @@ class CreateElement
|
||||||
throw new BadRequestException('title is required');
|
throw new BadRequestException('title is required');
|
||||||
}
|
}
|
||||||
$description = $request->description ?? '';
|
$description = $request->description ?? '';
|
||||||
$iconImageUrl = $request->iconImageUrl === ''
|
|
||||||
? null
|
|
||||||
: $request->iconImageUrl;
|
|
||||||
$richText = $request->richText ?? '';
|
$richText = $request->richText ?? '';
|
||||||
$pdfPath = $request->pdfPath === '' ? null : $request->pdfPath;
|
$pdfPath = $request->pdfPath === '' ? null : $request->pdfPath;
|
||||||
$youtubeUrl = $request->youtubeUrl === ''
|
$youtubeUrl = $request->youtubeUrl === ''
|
||||||
|
|
@ -54,7 +51,6 @@ class CreateElement
|
||||||
set: $set,
|
set: $set,
|
||||||
title: $request->title,
|
title: $request->title,
|
||||||
description: $description,
|
description: $description,
|
||||||
iconImageUrl: $iconImageUrl,
|
|
||||||
richText: $richText,
|
richText: $richText,
|
||||||
pdfPath: $pdfPath,
|
pdfPath: $pdfPath,
|
||||||
youtubeUrl: $youtubeUrl,
|
youtubeUrl: $youtubeUrl,
|
||||||
|
|
@ -80,7 +76,6 @@ class CreateElement
|
||||||
set: $set,
|
set: $set,
|
||||||
title: $request->title,
|
title: $request->title,
|
||||||
description: $description,
|
description: $description,
|
||||||
iconImageUrl: $iconImageUrl,
|
|
||||||
richText: $richText,
|
richText: $richText,
|
||||||
pdfPath: $pdfPath,
|
pdfPath: $pdfPath,
|
||||||
youtubeUrl: $youtubeUrl,
|
youtubeUrl: $youtubeUrl,
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ class CreateElementRequest
|
||||||
public ?int $setId,
|
public ?int $setId,
|
||||||
public ?string $title,
|
public ?string $title,
|
||||||
public ?string $description,
|
public ?string $description,
|
||||||
public ?string $iconImageUrl,
|
|
||||||
public ?string $richText,
|
public ?string $richText,
|
||||||
public ?string $pdfPath,
|
public ?string $pdfPath,
|
||||||
public ?string $youtubeUrl,
|
public ?string $youtubeUrl,
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ return new class extends Migration
|
||||||
$table->foreignId('set_id')->constrained('sets');
|
$table->foreignId('set_id')->constrained('sets');
|
||||||
$table->string('title');
|
$table->string('title');
|
||||||
$table->text('description')->default('');
|
$table->text('description')->default('');
|
||||||
$table->string('icon_image_url')->nullable();
|
|
||||||
$table->text('rich_text')->default('');
|
$table->text('rich_text')->default('');
|
||||||
$table->string('pdf_path')->nullable();
|
$table->string('pdf_path')->nullable();
|
||||||
$table->string('youtube_url')->nullable();
|
$table->string('youtube_url')->nullable();
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ class ElementSeeder extends Seeder
|
||||||
set: $baderechSet,
|
set: $baderechSet,
|
||||||
title: $baderechSet->getName(),
|
title: $baderechSet->getName(),
|
||||||
description: $baderechSet->getDescription(),
|
description: $baderechSet->getDescription(),
|
||||||
iconImageUrl: '/assets/baderech-haavodah-icon.png',
|
|
||||||
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>',
|
||||||
|
|
@ -32,7 +31,6 @@ class ElementSeeder extends Seeder
|
||||||
title: 'Avodah Foundations',
|
title: 'Avodah Foundations',
|
||||||
description: 'Core foundations for building a steady '
|
description: 'Core foundations for building a steady '
|
||||||
. 'avodah practice.',
|
. 'avodah practice.',
|
||||||
iconImageUrl: null,
|
|
||||||
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,
|
pdfPath: null,
|
||||||
|
|
@ -43,7 +41,6 @@ class ElementSeeder extends Seeder
|
||||||
set: $baderechSet,
|
set: $baderechSet,
|
||||||
title: 'Daily Practice',
|
title: 'Daily Practice',
|
||||||
description: 'Practical steps for consistent daily growth.',
|
description: 'Practical steps for consistent daily growth.',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Daily practice turns inspiration into a '
|
richText: '<p>Daily practice turns inspiration into a '
|
||||||
. 'dependable rhythm.</p>',
|
. 'dependable rhythm.</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ class FakeElementRepository implements ElementRepository
|
||||||
id: $id,
|
id: $id,
|
||||||
title: $dto->title,
|
title: $dto->title,
|
||||||
description: $dto->description,
|
description: $dto->description,
|
||||||
iconImageUrl: $dto->iconImageUrl,
|
|
||||||
richText: $dto->richText,
|
richText: $dto->richText,
|
||||||
pdfPath: $dto->pdfPath,
|
pdfPath: $dto->pdfPath,
|
||||||
youtubeUrl: $dto->youtubeUrl,
|
youtubeUrl: $dto->youtubeUrl,
|
||||||
|
|
@ -101,7 +100,6 @@ class FakeElementRepository implements ElementRepository
|
||||||
id: $element->getId(),
|
id: $element->getId(),
|
||||||
title: $element->getTitle(),
|
title: $element->getTitle(),
|
||||||
description: $element->getDescription(),
|
description: $element->getDescription(),
|
||||||
iconImageUrl: $element->getIconImageUrl(),
|
|
||||||
richText: $element->getRichText(),
|
richText: $element->getRichText(),
|
||||||
pdfPath: $element->getPdfPath(),
|
pdfPath: $element->getPdfPath(),
|
||||||
youtubeUrl: $element->getYoutubeUrl(),
|
youtubeUrl: $element->getYoutubeUrl(),
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ class ElementsEndpointTest extends TestCase
|
||||||
set: $set,
|
set: $set,
|
||||||
title: 'Baderech HaAvodah',
|
title: 'Baderech HaAvodah',
|
||||||
description: 'A structured path for growth',
|
description: 'A structured path for growth',
|
||||||
iconImageUrl: '/assets/baderech-haavodah-icon.png',
|
|
||||||
richText: '<p>A structured path for growth</p>',
|
richText: '<p>A structured path for growth</p>',
|
||||||
pdfPath: '/assets/pdfs/baderech.pdf',
|
pdfPath: '/assets/pdfs/baderech.pdf',
|
||||||
youtubeUrl: $sampleYoutubeUrl,
|
youtubeUrl: $sampleYoutubeUrl,
|
||||||
|
|
@ -38,7 +37,6 @@ class ElementsEndpointTest extends TestCase
|
||||||
set: $set,
|
set: $set,
|
||||||
title: 'Avodah Foundations',
|
title: 'Avodah Foundations',
|
||||||
description: 'Foundations for steady avodah',
|
description: 'Foundations for steady avodah',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Foundations rich text</p>',
|
richText: '<p>Foundations rich text</p>',
|
||||||
pdfPath: '/assets/pdfs/foundations.pdf',
|
pdfPath: '/assets/pdfs/foundations.pdf',
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
@ -48,7 +46,6 @@ class ElementsEndpointTest extends TestCase
|
||||||
set: $set,
|
set: $set,
|
||||||
title: 'Daily Practice',
|
title: 'Daily Practice',
|
||||||
description: 'Daily practices for growth',
|
description: 'Daily practices for growth',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Daily practice rich text</p>',
|
richText: '<p>Daily practice rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
@ -75,7 +72,6 @@ class ElementsEndpointTest extends TestCase
|
||||||
'id' => $element->getId(),
|
'id' => $element->getId(),
|
||||||
'title' => 'Baderech HaAvodah',
|
'title' => 'Baderech HaAvodah',
|
||||||
'description' => 'A structured path for growth',
|
'description' => 'A structured path for growth',
|
||||||
'iconImageUrl' => '/assets/baderech-haavodah-icon.png',
|
|
||||||
'richText' => '<p>A structured path for growth</p>',
|
'richText' => '<p>A structured path for growth</p>',
|
||||||
'pdfPath' => '/assets/pdfs/baderech.pdf',
|
'pdfPath' => '/assets/pdfs/baderech.pdf',
|
||||||
'youtubeUrl' => $sampleYoutubeUrl,
|
'youtubeUrl' => $sampleYoutubeUrl,
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ class SetsEndpointTest extends TestCase
|
||||||
set: $baderechSet,
|
set: $baderechSet,
|
||||||
title: $baderechSet->getName(),
|
title: $baderechSet->getName(),
|
||||||
description: $baderechSet->getDescription(),
|
description: $baderechSet->getDescription(),
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '',
|
richText: '',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ class ElementControllerTest extends TestCase
|
||||||
$set,
|
$set,
|
||||||
'Baderech HaAvodah',
|
'Baderech HaAvodah',
|
||||||
'A structured path for growth',
|
'A structured path for growth',
|
||||||
'/assets/baderech-icon.png',
|
|
||||||
'<p>A structured path for growth</p>',
|
'<p>A structured path for growth</p>',
|
||||||
'/assets/pdfs/baderech.pdf',
|
'/assets/pdfs/baderech.pdf',
|
||||||
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
||||||
|
|
@ -40,7 +39,6 @@ class ElementControllerTest extends TestCase
|
||||||
$set,
|
$set,
|
||||||
'Avodah Foundations',
|
'Avodah Foundations',
|
||||||
'Foundations for steady avodah',
|
'Foundations for steady avodah',
|
||||||
null,
|
|
||||||
'<p>Foundations rich text</p>',
|
'<p>Foundations rich text</p>',
|
||||||
'/assets/pdfs/foundations.pdf',
|
'/assets/pdfs/foundations.pdf',
|
||||||
null,
|
null,
|
||||||
|
|
@ -50,7 +48,6 @@ class ElementControllerTest extends TestCase
|
||||||
$set,
|
$set,
|
||||||
'Daily Practice',
|
'Daily Practice',
|
||||||
'Daily practices for growth',
|
'Daily practices for growth',
|
||||||
null,
|
|
||||||
'<p>Daily practice rich text</p>',
|
'<p>Daily practice rich text</p>',
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
|
|
@ -71,10 +68,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/baderech-icon.png',
|
|
||||||
$body['element']['iconImageUrl'],
|
|
||||||
);
|
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
'/assets/pdfs/baderech.pdf',
|
'/assets/pdfs/baderech.pdf',
|
||||||
$body['element']['pdfPath'],
|
$body['element']['pdfPath'],
|
||||||
|
|
@ -133,7 +126,6 @@ class ElementControllerTest extends TestCase
|
||||||
DomainSet $set,
|
DomainSet $set,
|
||||||
string $title,
|
string $title,
|
||||||
string $description,
|
string $description,
|
||||||
?string $iconImageUrl,
|
|
||||||
string $richText,
|
string $richText,
|
||||||
?string $pdfPath,
|
?string $pdfPath,
|
||||||
?string $youtubeUrl,
|
?string $youtubeUrl,
|
||||||
|
|
@ -143,7 +135,6 @@ class ElementControllerTest extends TestCase
|
||||||
set: $set,
|
set: $set,
|
||||||
title: $title,
|
title: $title,
|
||||||
description: $description,
|
description: $description,
|
||||||
iconImageUrl: $iconImageUrl,
|
|
||||||
richText: $richText,
|
richText: $richText,
|
||||||
pdfPath: $pdfPath,
|
pdfPath: $pdfPath,
|
||||||
youtubeUrl: $youtubeUrl,
|
youtubeUrl: $youtubeUrl,
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ class ElementTest extends TestCase
|
||||||
id: 1,
|
id: 1,
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
@ -31,7 +30,6 @@ class ElementTest extends TestCase
|
||||||
id: 2,
|
id: 2,
|
||||||
title: 'Child',
|
title: 'Child',
|
||||||
description: 'Child description',
|
description: 'Child description',
|
||||||
iconImageUrl: '/assets/child-icon.svg',
|
|
||||||
richText: '<p>Child rich text</p>',
|
richText: '<p>Child rich text</p>',
|
||||||
pdfPath: '/assets/pdfs/child.pdf',
|
pdfPath: '/assets/pdfs/child.pdf',
|
||||||
youtubeUrl: 'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
youtubeUrl: 'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
||||||
|
|
@ -45,10 +43,6 @@ class ElementTest extends TestCase
|
||||||
'Child description',
|
'Child description',
|
||||||
$childElement->getDescription(),
|
$childElement->getDescription(),
|
||||||
);
|
);
|
||||||
$this->assertSame(
|
|
||||||
'/assets/child-icon.svg',
|
|
||||||
$childElement->getIconImageUrl(),
|
|
||||||
);
|
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
'<p>Child rich text</p>',
|
'<p>Child rich text</p>',
|
||||||
$childElement->getRichText(),
|
$childElement->getRichText(),
|
||||||
|
|
@ -63,7 +57,6 @@ class ElementTest extends TestCase
|
||||||
);
|
);
|
||||||
$this->assertSame($set, $childElement->getSet());
|
$this->assertSame($set, $childElement->getSet());
|
||||||
$this->assertSame($rootElement, $childElement->getParentElement());
|
$this->assertSame($rootElement, $childElement->getParentElement());
|
||||||
$this->assertNull($rootElement->getIconImageUrl());
|
|
||||||
$this->assertNull($rootElement->getPdfPath());
|
$this->assertNull($rootElement->getPdfPath());
|
||||||
$this->assertNull($rootElement->getYoutubeUrl());
|
$this->assertNull($rootElement->getYoutubeUrl());
|
||||||
$this->assertNull($rootElement->getParentElement());
|
$this->assertNull($rootElement->getParentElement());
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ class CreateElementTest extends TestCase
|
||||||
setId: $set->getId(),
|
setId: $set->getId(),
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
iconImageUrl: '/assets/root-icon.svg',
|
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: '/assets/pdfs/root.pdf',
|
pdfPath: '/assets/pdfs/root.pdf',
|
||||||
youtubeUrl: 'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
youtubeUrl: 'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
||||||
|
|
@ -58,10 +57,6 @@ class CreateElementTest extends TestCase
|
||||||
$this->assertInstanceOf(Element::class, $element);
|
$this->assertInstanceOf(Element::class, $element);
|
||||||
$this->assertSame('Root', $element->getTitle());
|
$this->assertSame('Root', $element->getTitle());
|
||||||
$this->assertSame('Root description', $element->getDescription());
|
$this->assertSame('Root description', $element->getDescription());
|
||||||
$this->assertSame(
|
|
||||||
'/assets/root-icon.svg',
|
|
||||||
$element->getIconImageUrl(),
|
|
||||||
);
|
|
||||||
$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('/assets/pdfs/root.pdf', $element->getPdfPath());
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
|
|
@ -80,7 +75,6 @@ class CreateElementTest extends TestCase
|
||||||
setId: $set->getId(),
|
setId: $set->getId(),
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
@ -93,7 +87,6 @@ class CreateElementTest extends TestCase
|
||||||
setId: $set->getId(),
|
setId: $set->getId(),
|
||||||
title: 'Child',
|
title: 'Child',
|
||||||
description: 'Child description',
|
description: 'Child description',
|
||||||
iconImageUrl: '/assets/child-icon.svg',
|
|
||||||
richText: '<p>Child rich text</p>',
|
richText: '<p>Child rich text</p>',
|
||||||
pdfPath: '/assets/pdfs/child.pdf',
|
pdfPath: '/assets/pdfs/child.pdf',
|
||||||
youtubeUrl: 'https://youtu.be/yHx-r4p6hHU',
|
youtubeUrl: 'https://youtu.be/yHx-r4p6hHU',
|
||||||
|
|
@ -106,10 +99,6 @@ class CreateElementTest extends TestCase
|
||||||
'Child description',
|
'Child description',
|
||||||
$childElement->getDescription(),
|
$childElement->getDescription(),
|
||||||
);
|
);
|
||||||
$this->assertSame(
|
|
||||||
'/assets/child-icon.svg',
|
|
||||||
$childElement->getIconImageUrl(),
|
|
||||||
);
|
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
'<p>Child rich text</p>',
|
'<p>Child rich text</p>',
|
||||||
$childElement->getRichText(),
|
$childElement->getRichText(),
|
||||||
|
|
@ -136,7 +125,6 @@ class CreateElementTest extends TestCase
|
||||||
setId: $set->getId(),
|
setId: $set->getId(),
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: null,
|
description: null,
|
||||||
iconImageUrl: null,
|
|
||||||
richText: null,
|
richText: null,
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
@ -144,30 +132,11 @@ class CreateElementTest extends TestCase
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->assertSame('', $element->getDescription());
|
$this->assertSame('', $element->getDescription());
|
||||||
$this->assertNull($element->getIconImageUrl());
|
|
||||||
$this->assertSame('', $element->getRichText());
|
$this->assertSame('', $element->getRichText());
|
||||||
$this->assertNull($element->getPdfPath());
|
$this->assertNull($element->getPdfPath());
|
||||||
$this->assertNull($element->getYoutubeUrl());
|
$this->assertNull($element->getYoutubeUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCreatesElementWithNullIconImageUrlWhenBlank(): void
|
|
||||||
{
|
|
||||||
$set = $this->createSet('Daily learning');
|
|
||||||
|
|
||||||
$element = $this->createElement->execute(new CreateElementRequest(
|
|
||||||
setId: $set->getId(),
|
|
||||||
title: 'Root',
|
|
||||||
description: 'Root description',
|
|
||||||
iconImageUrl: '',
|
|
||||||
richText: '<p>Root rich text</p>',
|
|
||||||
pdfPath: null,
|
|
||||||
youtubeUrl: null,
|
|
||||||
parentElementId: null,
|
|
||||||
));
|
|
||||||
|
|
||||||
$this->assertNull($element->getIconImageUrl());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testCreatesElementWithNullPdfPathWhenBlank(): void
|
public function testCreatesElementWithNullPdfPathWhenBlank(): void
|
||||||
{
|
{
|
||||||
$set = $this->createSet('Daily learning');
|
$set = $this->createSet('Daily learning');
|
||||||
|
|
@ -176,7 +145,6 @@ class CreateElementTest extends TestCase
|
||||||
setId: $set->getId(),
|
setId: $set->getId(),
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: '',
|
pdfPath: '',
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
@ -194,7 +162,6 @@ class CreateElementTest extends TestCase
|
||||||
setId: $set->getId(),
|
setId: $set->getId(),
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: '',
|
youtubeUrl: '',
|
||||||
|
|
@ -213,7 +180,6 @@ class CreateElementTest extends TestCase
|
||||||
setId: null,
|
setId: null,
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
@ -230,7 +196,6 @@ class CreateElementTest extends TestCase
|
||||||
setId: 1,
|
setId: 1,
|
||||||
title: null,
|
title: null,
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
@ -247,7 +212,6 @@ class CreateElementTest extends TestCase
|
||||||
setId: 99,
|
setId: 99,
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
@ -268,7 +232,6 @@ class CreateElementTest extends TestCase
|
||||||
setId: $set->getId(),
|
setId: $set->getId(),
|
||||||
title: 'Child',
|
title: 'Child',
|
||||||
description: 'Child description',
|
description: 'Child description',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Child rich text</p>',
|
richText: '<p>Child rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
@ -283,7 +246,6 @@ class CreateElementTest extends TestCase
|
||||||
setId: $set->getId(),
|
setId: $set->getId(),
|
||||||
title: 'Root',
|
title: 'Root',
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
@ -299,7 +261,6 @@ class CreateElementTest extends TestCase
|
||||||
setId: $set->getId(),
|
setId: $set->getId(),
|
||||||
title: 'Another root',
|
title: 'Another root',
|
||||||
description: 'Another root description',
|
description: 'Another root description',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Another root rich text</p>',
|
richText: '<p>Another root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
@ -316,7 +277,6 @@ class CreateElementTest extends TestCase
|
||||||
setId: $parentSet->getId(),
|
setId: $parentSet->getId(),
|
||||||
title: 'Parent root',
|
title: 'Parent root',
|
||||||
description: 'Parent root description',
|
description: 'Parent root description',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Parent root rich text</p>',
|
richText: '<p>Parent root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
@ -333,7 +293,6 @@ class CreateElementTest extends TestCase
|
||||||
setId: $childSet->getId(),
|
setId: $childSet->getId(),
|
||||||
title: 'Invalid child',
|
title: 'Invalid child',
|
||||||
description: 'Invalid child description',
|
description: 'Invalid child description',
|
||||||
iconImageUrl: null,
|
|
||||||
richText: '<p>Invalid child rich text</p>',
|
richText: '<p>Invalid child rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
youtubeUrl: null,
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ class GetElementTest extends TestCase
|
||||||
$set,
|
$set,
|
||||||
'Baderech HaAvodah',
|
'Baderech HaAvodah',
|
||||||
'A structured path for growth',
|
'A structured path for growth',
|
||||||
'/assets/baderech-icon.png',
|
|
||||||
'<p>A structured path for growth</p>',
|
'<p>A structured path for growth</p>',
|
||||||
'/assets/pdfs/baderech.pdf',
|
'/assets/pdfs/baderech.pdf',
|
||||||
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
||||||
|
|
@ -50,10 +49,6 @@ class GetElementTest extends TestCase
|
||||||
'A structured path for growth',
|
'A structured path for growth',
|
||||||
$foundElement->getDescription(),
|
$foundElement->getDescription(),
|
||||||
);
|
);
|
||||||
$this->assertSame(
|
|
||||||
'/assets/baderech-icon.png',
|
|
||||||
$foundElement->getIconImageUrl(),
|
|
||||||
);
|
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
'<p>A structured path for growth</p>',
|
'<p>A structured path for growth</p>',
|
||||||
$foundElement->getRichText(),
|
$foundElement->getRichText(),
|
||||||
|
|
@ -75,7 +70,6 @@ class GetElementTest extends TestCase
|
||||||
$set,
|
$set,
|
||||||
'Baderech HaAvodah',
|
'Baderech HaAvodah',
|
||||||
'A structured path for growth',
|
'A structured path for growth',
|
||||||
null,
|
|
||||||
'<p>A structured path for growth</p>',
|
'<p>A structured path for growth</p>',
|
||||||
'/assets/pdfs/baderech.pdf',
|
'/assets/pdfs/baderech.pdf',
|
||||||
null,
|
null,
|
||||||
|
|
@ -85,7 +79,6 @@ class GetElementTest extends TestCase
|
||||||
$set,
|
$set,
|
||||||
'Avodah Foundations',
|
'Avodah Foundations',
|
||||||
'Foundations for steady avodah',
|
'Foundations for steady avodah',
|
||||||
null,
|
|
||||||
'<p>Foundations rich text</p>',
|
'<p>Foundations rich text</p>',
|
||||||
'/assets/pdfs/foundations.pdf',
|
'/assets/pdfs/foundations.pdf',
|
||||||
null,
|
null,
|
||||||
|
|
@ -95,7 +88,6 @@ class GetElementTest extends TestCase
|
||||||
$set,
|
$set,
|
||||||
'Daily Practice',
|
'Daily Practice',
|
||||||
'Daily practices for growth',
|
'Daily practices for growth',
|
||||||
null,
|
|
||||||
'<p>Daily practice rich text</p>',
|
'<p>Daily practice rich text</p>',
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
|
|
@ -105,7 +97,6 @@ class GetElementTest extends TestCase
|
||||||
$set,
|
$set,
|
||||||
'Nested Practice',
|
'Nested Practice',
|
||||||
'Nested description',
|
'Nested description',
|
||||||
null,
|
|
||||||
'<p>Nested rich text</p>',
|
'<p>Nested rich text</p>',
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
|
|
@ -116,7 +107,6 @@ class GetElementTest extends TestCase
|
||||||
$otherSet,
|
$otherSet,
|
||||||
'Other Parent',
|
'Other Parent',
|
||||||
'Other parent description',
|
'Other parent description',
|
||||||
null,
|
|
||||||
'<p>Other parent rich text</p>',
|
'<p>Other parent rich text</p>',
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
|
|
@ -126,7 +116,6 @@ class GetElementTest extends TestCase
|
||||||
$otherSet,
|
$otherSet,
|
||||||
'Other Child',
|
'Other Child',
|
||||||
'Other child description',
|
'Other child description',
|
||||||
null,
|
|
||||||
'<p>Other child rich text</p>',
|
'<p>Other child rich text</p>',
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
|
|
@ -189,7 +178,6 @@ class GetElementTest extends TestCase
|
||||||
DomainSet $set,
|
DomainSet $set,
|
||||||
string $title,
|
string $title,
|
||||||
string $description,
|
string $description,
|
||||||
?string $iconImageUrl,
|
|
||||||
string $richText,
|
string $richText,
|
||||||
?string $pdfPath,
|
?string $pdfPath,
|
||||||
?string $youtubeUrl,
|
?string $youtubeUrl,
|
||||||
|
|
@ -199,7 +187,6 @@ class GetElementTest extends TestCase
|
||||||
set: $set,
|
set: $set,
|
||||||
title: $title,
|
title: $title,
|
||||||
description: $description,
|
description: $description,
|
||||||
iconImageUrl: $iconImageUrl,
|
|
||||||
richText: $richText,
|
richText: $richText,
|
||||||
pdfPath: $pdfPath,
|
pdfPath: $pdfPath,
|
||||||
youtubeUrl: $youtubeUrl,
|
youtubeUrl: $youtubeUrl,
|
||||||
|
|
|
||||||
|
|
@ -41,10 +41,6 @@ describe('media page sets', () => {
|
||||||
cy.location('pathname').should('eq', '/element/1')
|
cy.location('pathname').should('eq', '/element/1')
|
||||||
cy.get('[data-cy="element-page"]').should('be.visible')
|
cy.get('[data-cy="element-page"]').should('be.visible')
|
||||||
cy.contains('h1', 'Baderech HaAvodah').should('be.visible')
|
cy.contains('h1', 'Baderech HaAvodah').should('be.visible')
|
||||||
cy.get('[data-cy="element-icon"]')
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.attr', 'src')
|
|
||||||
.and('include', '/assets/baderech-haavodah-icon.png')
|
|
||||||
cy.get('[data-cy="element-rich-text"]').within(() => {
|
cy.get('[data-cy="element-rich-text"]').within(() => {
|
||||||
cy.contains('Begin with a clear map for avodah growth.')
|
cy.contains('Begin with a clear map for avodah growth.')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
|
|
@ -86,7 +82,6 @@ describe('media page sets', () => {
|
||||||
.click()
|
.click()
|
||||||
cy.location('pathname').should('eq', '/element/2')
|
cy.location('pathname').should('eq', '/element/2')
|
||||||
cy.contains('h1', 'Avodah Foundations').should('be.visible')
|
cy.contains('h1', 'Avodah Foundations').should('be.visible')
|
||||||
cy.get('[data-cy="element-icon"]').should('not.exist')
|
|
||||||
cy.get('[data-cy="element-rich-text"]')
|
cy.get('[data-cy="element-rich-text"]')
|
||||||
.should(
|
.should(
|
||||||
'contain.text',
|
'contain.text',
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ export interface ChildElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Element extends ChildElement {
|
export interface Element extends ChildElement {
|
||||||
iconImageUrl: string | null
|
|
||||||
richText: string
|
richText: string
|
||||||
pdfPath: string | null
|
pdfPath: string | null
|
||||||
youtubeUrl: string | null
|
youtubeUrl: string | null
|
||||||
|
|
|
||||||
|
|
@ -211,14 +211,6 @@ function isShortYoutubeHost(hostname: string): boolean {
|
||||||
{{ error }}
|
{{ error }}
|
||||||
</p>
|
</p>
|
||||||
<section v-else-if="element" class="element-page__content">
|
<section v-else-if="element" class="element-page__content">
|
||||||
<img
|
|
||||||
v-if="element.iconImageUrl !== null"
|
|
||||||
:src="element.iconImageUrl"
|
|
||||||
:alt="`${element.title} icon`"
|
|
||||||
class="element-page__icon"
|
|
||||||
data-cy="element-icon"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<h1 class="element-page__heading">
|
<h1 class="element-page__heading">
|
||||||
{{ element.title }}
|
{{ element.title }}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
@ -304,14 +296,6 @@ function isShortYoutubeHost(hostname: string): boolean {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.element-page__icon {
|
|
||||||
display: block;
|
|
||||||
width: 132px;
|
|
||||||
height: 132px;
|
|
||||||
margin: 0 auto 1.8rem;
|
|
||||||
object-fit: contain;
|
|
||||||
}
|
|
||||||
|
|
||||||
.element-page__heading {
|
.element-page__heading {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: #2c2c2c;
|
color: #2c2c2c;
|
||||||
|
|
@ -475,11 +459,5 @@ function isShortYoutubeHost(hostname: string): boolean {
|
||||||
.element-page__children {
|
.element-page__children {
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.element-page__icon {
|
|
||||||
width: 108px;
|
|
||||||
height: 108px;
|
|
||||||
margin-bottom: 1.4rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue