Compare commits
No commits in common. "c5ea3640b73ae17acf52f1f90a304d4b1db8c2bf" and "8a06f5a57ce3d4ac13d3cd432a144ed847c55548" have entirely different histories.
c5ea3640b7
...
8a06f5a57c
19 changed files with 0 additions and 302 deletions
|
|
@ -48,7 +48,6 @@ class ElementController
|
||||||
'description' => $element->getDescription(),
|
'description' => $element->getDescription(),
|
||||||
'richText' => $element->getRichText(),
|
'richText' => $element->getRichText(),
|
||||||
'pdfPath' => $element->getPdfPath(),
|
'pdfPath' => $element->getPdfPath(),
|
||||||
'youtubeUrl' => $element->getYoutubeUrl(),
|
|
||||||
],
|
],
|
||||||
], 200);
|
], 200);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ class CreateElementDto
|
||||||
public string $description,
|
public string $description,
|
||||||
public string $richText,
|
public string $richText,
|
||||||
public ?string $pdfPath,
|
public ?string $pdfPath,
|
||||||
public ?string $youtubeUrl,
|
|
||||||
public ?Element $parentElement,
|
public ?Element $parentElement,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ class Element
|
||||||
private string $description,
|
private string $description,
|
||||||
private string $richText,
|
private string $richText,
|
||||||
private ?string $pdfPath,
|
private ?string $pdfPath,
|
||||||
private ?string $youtubeUrl,
|
|
||||||
private Set $set,
|
private Set $set,
|
||||||
private ?Element $parentElement,
|
private ?Element $parentElement,
|
||||||
) {
|
) {
|
||||||
|
|
@ -43,11 +42,6 @@ class Element
|
||||||
return $this->pdfPath;
|
return $this->pdfPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getYoutubeUrl(): ?string
|
|
||||||
{
|
|
||||||
return $this->youtubeUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getSet(): Set
|
public function getSet(): Set
|
||||||
{
|
{
|
||||||
return $this->set;
|
return $this->set;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
* @property string $description
|
* @property string $description
|
||||||
* @property string $rich_text
|
* @property string $rich_text
|
||||||
* @property string|null $pdf_path
|
* @property string|null $pdf_path
|
||||||
* @property string|null $youtube_url
|
|
||||||
* @property int|null $parent_element_id
|
* @property int|null $parent_element_id
|
||||||
*
|
*
|
||||||
* @method static Builder<static>|ElementModel newModelQuery()
|
* @method static Builder<static>|ElementModel newModelQuery()
|
||||||
|
|
@ -25,7 +24,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
* @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)
|
* @method static Builder<static>|ElementModel wherePdfPath($value)
|
||||||
* @method static Builder<static>|ElementModel whereYoutubeUrl($value)
|
|
||||||
*
|
*
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
|
|
@ -41,7 +39,6 @@ class ElementModel extends Model
|
||||||
'description',
|
'description',
|
||||||
'rich_text',
|
'rich_text',
|
||||||
'pdf_path',
|
'pdf_path',
|
||||||
'youtube_url',
|
|
||||||
'parent_element_id',
|
'parent_element_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ class EloquentElementRepository implements ElementRepository
|
||||||
'description' => $dto->description,
|
'description' => $dto->description,
|
||||||
'rich_text' => $dto->richText,
|
'rich_text' => $dto->richText,
|
||||||
'pdf_path' => $dto->pdfPath,
|
'pdf_path' => $dto->pdfPath,
|
||||||
'youtube_url' => $dto->youtubeUrl,
|
|
||||||
'parent_element_id' => $dto->parentElement?->getId(),
|
'parent_element_id' => $dto->parentElement?->getId(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -30,7 +29,6 @@ class EloquentElementRepository implements ElementRepository
|
||||||
description: $dto->description,
|
description: $dto->description,
|
||||||
richText: $dto->richText,
|
richText: $dto->richText,
|
||||||
pdfPath: $dto->pdfPath,
|
pdfPath: $dto->pdfPath,
|
||||||
youtubeUrl: $dto->youtubeUrl,
|
|
||||||
set: $dto->set,
|
set: $dto->set,
|
||||||
parentElement: $dto->parentElement,
|
parentElement: $dto->parentElement,
|
||||||
);
|
);
|
||||||
|
|
@ -113,7 +111,6 @@ class EloquentElementRepository implements ElementRepository
|
||||||
description: $model->description,
|
description: $model->description,
|
||||||
richText: $model->rich_text,
|
richText: $model->rich_text,
|
||||||
pdfPath: $model->pdf_path,
|
pdfPath: $model->pdf_path,
|
||||||
youtubeUrl: $model->youtube_url,
|
|
||||||
set: $set,
|
set: $set,
|
||||||
parentElement: $parentElement,
|
parentElement: $parentElement,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,6 @@ class CreateElement
|
||||||
$description = $request->description ?? '';
|
$description = $request->description ?? '';
|
||||||
$richText = $request->richText ?? '';
|
$richText = $request->richText ?? '';
|
||||||
$pdfPath = $request->pdfPath === '' ? null : $request->pdfPath;
|
$pdfPath = $request->pdfPath === '' ? null : $request->pdfPath;
|
||||||
$youtubeUrl = $request->youtubeUrl === ''
|
|
||||||
? null
|
|
||||||
: $request->youtubeUrl;
|
|
||||||
|
|
||||||
$set = $this->setRepo->find($request->setId);
|
$set = $this->setRepo->find($request->setId);
|
||||||
if ($set === null) {
|
if ($set === null) {
|
||||||
|
|
@ -53,7 +50,6 @@ class CreateElement
|
||||||
description: $description,
|
description: $description,
|
||||||
richText: $richText,
|
richText: $richText,
|
||||||
pdfPath: $pdfPath,
|
pdfPath: $pdfPath,
|
||||||
youtubeUrl: $youtubeUrl,
|
|
||||||
parentElement: null,
|
parentElement: null,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
@ -78,7 +74,6 @@ class CreateElement
|
||||||
description: $description,
|
description: $description,
|
||||||
richText: $richText,
|
richText: $richText,
|
||||||
pdfPath: $pdfPath,
|
pdfPath: $pdfPath,
|
||||||
youtubeUrl: $youtubeUrl,
|
|
||||||
parentElement: $parentElement,
|
parentElement: $parentElement,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ class CreateElementRequest
|
||||||
public ?string $description,
|
public ?string $description,
|
||||||
public ?string $richText,
|
public ?string $richText,
|
||||||
public ?string $pdfPath,
|
public ?string $pdfPath,
|
||||||
public ?string $youtubeUrl,
|
|
||||||
public ?int $parentElementId,
|
public ?int $parentElementId,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ return new class extends Migration
|
||||||
$table->text('description')->default('');
|
$table->text('description')->default('');
|
||||||
$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->foreignId('parent_element_id')
|
$table->foreignId('parent_element_id')
|
||||||
->nullable()
|
->nullable()
|
||||||
->constrained('elements');
|
->constrained('elements');
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,6 @@ class ElementSeeder extends Seeder
|
||||||
. '<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',
|
pdfPath: '/assets/pdfs/baderech.pdf',
|
||||||
youtubeUrl: 'https://www.youtube.com/watch?v='
|
|
||||||
. 'yHx-r4p6hHU&t=1s',
|
|
||||||
parentElement: null,
|
parentElement: null,
|
||||||
));
|
));
|
||||||
$elementRepository->create(new CreateElementDto(
|
$elementRepository->create(new CreateElementDto(
|
||||||
|
|
@ -34,7 +32,6 @@ class ElementSeeder extends Seeder
|
||||||
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,
|
||||||
youtubeUrl: null,
|
|
||||||
parentElement: $rootElement,
|
parentElement: $rootElement,
|
||||||
));
|
));
|
||||||
$elementRepository->create(new CreateElementDto(
|
$elementRepository->create(new CreateElementDto(
|
||||||
|
|
@ -44,7 +41,6 @@ class ElementSeeder extends Seeder
|
||||||
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,
|
||||||
youtubeUrl: null,
|
|
||||||
parentElement: $rootElement,
|
parentElement: $rootElement,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ class FakeElementRepository implements ElementRepository
|
||||||
description: $dto->description,
|
description: $dto->description,
|
||||||
richText: $dto->richText,
|
richText: $dto->richText,
|
||||||
pdfPath: $dto->pdfPath,
|
pdfPath: $dto->pdfPath,
|
||||||
youtubeUrl: $dto->youtubeUrl,
|
|
||||||
set: $dto->set,
|
set: $dto->set,
|
||||||
parentElement: $dto->parentElement,
|
parentElement: $dto->parentElement,
|
||||||
);
|
);
|
||||||
|
|
@ -102,7 +101,6 @@ class FakeElementRepository implements ElementRepository
|
||||||
description: $element->getDescription(),
|
description: $element->getDescription(),
|
||||||
richText: $element->getRichText(),
|
richText: $element->getRichText(),
|
||||||
pdfPath: $element->getPdfPath(),
|
pdfPath: $element->getPdfPath(),
|
||||||
youtubeUrl: $element->getYoutubeUrl(),
|
|
||||||
set: $element->getSet(),
|
set: $element->getSet(),
|
||||||
parentElement: $parentElement,
|
parentElement: $parentElement,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,6 @@ class ElementsEndpointTest extends TestCase
|
||||||
|
|
||||||
public function testReturnsElementTitle(): void
|
public function testReturnsElementTitle(): void
|
||||||
{
|
{
|
||||||
$sampleYoutubeUrl = 'https://www.youtube.com/watch?v='
|
|
||||||
. 'yHx-r4p6hHU&t=1s';
|
|
||||||
$setRepository = app(SetRepository::class);
|
$setRepository = app(SetRepository::class);
|
||||||
$elementRepository = app(ElementRepository::class);
|
$elementRepository = app(ElementRepository::class);
|
||||||
$set = $setRepository->create(new CreateSetDto(
|
$set = $setRepository->create(new CreateSetDto(
|
||||||
|
|
@ -30,7 +28,6 @@ class ElementsEndpointTest extends TestCase
|
||||||
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',
|
pdfPath: '/assets/pdfs/baderech.pdf',
|
||||||
youtubeUrl: $sampleYoutubeUrl,
|
|
||||||
parentElement: null,
|
parentElement: null,
|
||||||
));
|
));
|
||||||
$firstChildElement = $elementRepository->create(new CreateElementDto(
|
$firstChildElement = $elementRepository->create(new CreateElementDto(
|
||||||
|
|
@ -39,7 +36,6 @@ class ElementsEndpointTest extends TestCase
|
||||||
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',
|
pdfPath: '/assets/pdfs/foundations.pdf',
|
||||||
youtubeUrl: null,
|
|
||||||
parentElement: $element,
|
parentElement: $element,
|
||||||
));
|
));
|
||||||
$secondChildElement = $elementRepository->create(new CreateElementDto(
|
$secondChildElement = $elementRepository->create(new CreateElementDto(
|
||||||
|
|
@ -48,7 +44,6 @@ class ElementsEndpointTest extends TestCase
|
||||||
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,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
|
||||||
parentElement: $element,
|
parentElement: $element,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
@ -74,7 +69,6 @@ class ElementsEndpointTest extends TestCase
|
||||||
'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',
|
'pdfPath' => '/assets/pdfs/baderech.pdf',
|
||||||
'youtubeUrl' => $sampleYoutubeUrl,
|
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ class SetsEndpointTest extends TestCase
|
||||||
description: $baderechSet->getDescription(),
|
description: $baderechSet->getDescription(),
|
||||||
richText: '',
|
richText: '',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
|
||||||
parentElement: null,
|
parentElement: null,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ class ElementControllerTest extends TestCase
|
||||||
'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',
|
'/assets/pdfs/baderech.pdf',
|
||||||
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
|
||||||
null,
|
null,
|
||||||
);
|
);
|
||||||
$firstChildElement = $this->createElement(
|
$firstChildElement = $this->createElement(
|
||||||
|
|
@ -41,7 +40,6 @@ class ElementControllerTest extends TestCase
|
||||||
'Foundations for steady avodah',
|
'Foundations for steady avodah',
|
||||||
'<p>Foundations rich text</p>',
|
'<p>Foundations rich text</p>',
|
||||||
'/assets/pdfs/foundations.pdf',
|
'/assets/pdfs/foundations.pdf',
|
||||||
null,
|
|
||||||
$element,
|
$element,
|
||||||
);
|
);
|
||||||
$secondChildElement = $this->createElement(
|
$secondChildElement = $this->createElement(
|
||||||
|
|
@ -50,7 +48,6 @@ class ElementControllerTest extends TestCase
|
||||||
'Daily practices for growth',
|
'Daily practices for growth',
|
||||||
'<p>Daily practice rich text</p>',
|
'<p>Daily practice rich text</p>',
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
$element,
|
$element,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -72,10 +69,6 @@ class ElementControllerTest extends TestCase
|
||||||
'/assets/pdfs/baderech.pdf',
|
'/assets/pdfs/baderech.pdf',
|
||||||
$body['element']['pdfPath'],
|
$body['element']['pdfPath'],
|
||||||
);
|
);
|
||||||
$this->assertSame(
|
|
||||||
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
|
||||||
$body['element']['youtubeUrl'],
|
|
||||||
);
|
|
||||||
$this->assertSame([
|
$this->assertSame([
|
||||||
[
|
[
|
||||||
'id' => $firstChildElement->getId(),
|
'id' => $firstChildElement->getId(),
|
||||||
|
|
@ -128,7 +121,6 @@ class ElementControllerTest extends TestCase
|
||||||
string $description,
|
string $description,
|
||||||
string $richText,
|
string $richText,
|
||||||
?string $pdfPath,
|
?string $pdfPath,
|
||||||
?string $youtubeUrl,
|
|
||||||
?Element $parentElement,
|
?Element $parentElement,
|
||||||
): Element {
|
): Element {
|
||||||
return $this->elementRepo->create(new CreateElementDto(
|
return $this->elementRepo->create(new CreateElementDto(
|
||||||
|
|
@ -137,7 +129,6 @@ class ElementControllerTest extends TestCase
|
||||||
description: $description,
|
description: $description,
|
||||||
richText: $richText,
|
richText: $richText,
|
||||||
pdfPath: $pdfPath,
|
pdfPath: $pdfPath,
|
||||||
youtubeUrl: $youtubeUrl,
|
|
||||||
parentElement: $parentElement,
|
parentElement: $parentElement,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ class ElementTest extends TestCase
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
|
||||||
set: $set,
|
set: $set,
|
||||||
parentElement: null,
|
parentElement: null,
|
||||||
);
|
);
|
||||||
|
|
@ -32,7 +31,6 @@ class ElementTest extends TestCase
|
||||||
description: 'Child description',
|
description: 'Child description',
|
||||||
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',
|
|
||||||
set: $set,
|
set: $set,
|
||||||
parentElement: $rootElement,
|
parentElement: $rootElement,
|
||||||
);
|
);
|
||||||
|
|
@ -51,14 +49,9 @@ class ElementTest extends TestCase
|
||||||
'/assets/pdfs/child.pdf',
|
'/assets/pdfs/child.pdf',
|
||||||
$childElement->getPdfPath(),
|
$childElement->getPdfPath(),
|
||||||
);
|
);
|
||||||
$this->assertSame(
|
|
||||||
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
|
||||||
$childElement->getYoutubeUrl(),
|
|
||||||
);
|
|
||||||
$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->getPdfPath());
|
||||||
$this->assertNull($rootElement->getYoutubeUrl());
|
|
||||||
$this->assertNull($rootElement->getParentElement());
|
$this->assertNull($rootElement->getParentElement());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,6 @@ class CreateElementTest extends TestCase
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
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',
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
@ -59,10 +58,6 @@ class CreateElementTest extends TestCase
|
||||||
$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('/assets/pdfs/root.pdf', $element->getPdfPath());
|
||||||
$this->assertSame(
|
|
||||||
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
|
||||||
$element->getYoutubeUrl(),
|
|
||||||
);
|
|
||||||
$this->assertSame($set->getId(), $element->getSet()->getId());
|
$this->assertSame($set->getId(), $element->getSet()->getId());
|
||||||
$this->assertNull($element->getParentElement());
|
$this->assertNull($element->getParentElement());
|
||||||
}
|
}
|
||||||
|
|
@ -77,7 +72,6 @@ class CreateElementTest extends TestCase
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
@ -89,7 +83,6 @@ class CreateElementTest extends TestCase
|
||||||
description: 'Child description',
|
description: 'Child description',
|
||||||
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',
|
|
||||||
parentElementId: $rootElement->getId(),
|
parentElementId: $rootElement->getId(),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
@ -107,10 +100,6 @@ class CreateElementTest extends TestCase
|
||||||
'/assets/pdfs/child.pdf',
|
'/assets/pdfs/child.pdf',
|
||||||
$childElement->getPdfPath(),
|
$childElement->getPdfPath(),
|
||||||
);
|
);
|
||||||
$this->assertSame(
|
|
||||||
'https://youtu.be/yHx-r4p6hHU',
|
|
||||||
$childElement->getYoutubeUrl(),
|
|
||||||
);
|
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
$rootElement->getId(),
|
$rootElement->getId(),
|
||||||
$childElement->getParentElement()->getId(),
|
$childElement->getParentElement()->getId(),
|
||||||
|
|
@ -127,14 +116,12 @@ class CreateElementTest extends TestCase
|
||||||
description: null,
|
description: null,
|
||||||
richText: null,
|
richText: null,
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: 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());
|
$this->assertNull($element->getPdfPath());
|
||||||
$this->assertNull($element->getYoutubeUrl());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCreatesElementWithNullPdfPathWhenBlank(): void
|
public function testCreatesElementWithNullPdfPathWhenBlank(): void
|
||||||
|
|
@ -147,30 +134,12 @@ class CreateElementTest extends TestCase
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: '',
|
pdfPath: '',
|
||||||
youtubeUrl: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->assertNull($element->getPdfPath());
|
$this->assertNull($element->getPdfPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCreatesElementWithNullYoutubeUrlWhenBlank(): 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: null,
|
|
||||||
youtubeUrl: '',
|
|
||||||
parentElementId: null,
|
|
||||||
));
|
|
||||||
|
|
||||||
$this->assertNull($element->getYoutubeUrl());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testThrowsWhenSetIdMissing(): void
|
public function testThrowsWhenSetIdMissing(): void
|
||||||
{
|
{
|
||||||
$this->expectException(BadRequestException::class);
|
$this->expectException(BadRequestException::class);
|
||||||
|
|
@ -182,7 +151,6 @@ class CreateElementTest extends TestCase
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
@ -198,7 +166,6 @@ class CreateElementTest extends TestCase
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
@ -214,7 +181,6 @@ class CreateElementTest extends TestCase
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
@ -234,7 +200,6 @@ class CreateElementTest extends TestCase
|
||||||
description: 'Child description',
|
description: 'Child description',
|
||||||
richText: '<p>Child rich text</p>',
|
richText: '<p>Child rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
|
||||||
parentElementId: 99,
|
parentElementId: 99,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
@ -248,7 +213,6 @@ class CreateElementTest extends TestCase
|
||||||
description: 'Root description',
|
description: 'Root description',
|
||||||
richText: '<p>Root rich text</p>',
|
richText: '<p>Root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
@ -263,7 +227,6 @@ class CreateElementTest extends TestCase
|
||||||
description: 'Another root description',
|
description: 'Another root description',
|
||||||
richText: '<p>Another root rich text</p>',
|
richText: '<p>Another root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
@ -279,7 +242,6 @@ class CreateElementTest extends TestCase
|
||||||
description: 'Parent root description',
|
description: 'Parent root description',
|
||||||
richText: '<p>Parent root rich text</p>',
|
richText: '<p>Parent root rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
|
||||||
parentElementId: null,
|
parentElementId: null,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
@ -295,7 +257,6 @@ class CreateElementTest extends TestCase
|
||||||
description: 'Invalid child description',
|
description: 'Invalid child description',
|
||||||
richText: '<p>Invalid child rich text</p>',
|
richText: '<p>Invalid child rich text</p>',
|
||||||
pdfPath: null,
|
pdfPath: null,
|
||||||
youtubeUrl: null,
|
|
||||||
parentElementId: $parentElement->getId(),
|
parentElementId: $parentElement->getId(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ class GetElementTest extends TestCase
|
||||||
'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',
|
'/assets/pdfs/baderech.pdf',
|
||||||
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
|
||||||
null,
|
null,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -57,10 +56,6 @@ class GetElementTest extends TestCase
|
||||||
'/assets/pdfs/baderech.pdf',
|
'/assets/pdfs/baderech.pdf',
|
||||||
$foundElement->getPdfPath(),
|
$foundElement->getPdfPath(),
|
||||||
);
|
);
|
||||||
$this->assertSame(
|
|
||||||
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
|
|
||||||
$foundElement->getYoutubeUrl(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testReturnsDirectChildElements(): void
|
public function testReturnsDirectChildElements(): void
|
||||||
|
|
@ -73,7 +68,6 @@ class GetElementTest extends TestCase
|
||||||
'<p>A structured path for growth</p>',
|
'<p>A structured path for growth</p>',
|
||||||
'/assets/pdfs/baderech.pdf',
|
'/assets/pdfs/baderech.pdf',
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
);
|
);
|
||||||
$firstChildElement = $this->createElement(
|
$firstChildElement = $this->createElement(
|
||||||
$set,
|
$set,
|
||||||
|
|
@ -81,7 +75,6 @@ class GetElementTest extends TestCase
|
||||||
'Foundations for steady avodah',
|
'Foundations for steady avodah',
|
||||||
'<p>Foundations rich text</p>',
|
'<p>Foundations rich text</p>',
|
||||||
'/assets/pdfs/foundations.pdf',
|
'/assets/pdfs/foundations.pdf',
|
||||||
null,
|
|
||||||
$parentElement,
|
$parentElement,
|
||||||
);
|
);
|
||||||
$secondChildElement = $this->createElement(
|
$secondChildElement = $this->createElement(
|
||||||
|
|
@ -90,7 +83,6 @@ class GetElementTest extends TestCase
|
||||||
'Daily practices for growth',
|
'Daily practices for growth',
|
||||||
'<p>Daily practice rich text</p>',
|
'<p>Daily practice rich text</p>',
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
$parentElement,
|
$parentElement,
|
||||||
);
|
);
|
||||||
$this->createElement(
|
$this->createElement(
|
||||||
|
|
@ -99,7 +91,6 @@ class GetElementTest extends TestCase
|
||||||
'Nested description',
|
'Nested description',
|
||||||
'<p>Nested rich text</p>',
|
'<p>Nested rich text</p>',
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
$firstChildElement,
|
$firstChildElement,
|
||||||
);
|
);
|
||||||
$otherSet = $this->createSet(2, 'Daily Learning');
|
$otherSet = $this->createSet(2, 'Daily Learning');
|
||||||
|
|
@ -110,7 +101,6 @@ class GetElementTest extends TestCase
|
||||||
'<p>Other parent rich text</p>',
|
'<p>Other parent rich text</p>',
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
);
|
);
|
||||||
$this->createElement(
|
$this->createElement(
|
||||||
$otherSet,
|
$otherSet,
|
||||||
|
|
@ -118,7 +108,6 @@ class GetElementTest extends TestCase
|
||||||
'Other child description',
|
'Other child description',
|
||||||
'<p>Other child rich text</p>',
|
'<p>Other child rich text</p>',
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
$otherParentElement,
|
$otherParentElement,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -180,7 +169,6 @@ class GetElementTest extends TestCase
|
||||||
string $description,
|
string $description,
|
||||||
string $richText,
|
string $richText,
|
||||||
?string $pdfPath,
|
?string $pdfPath,
|
||||||
?string $youtubeUrl,
|
|
||||||
?Element $parentElement,
|
?Element $parentElement,
|
||||||
): Element {
|
): Element {
|
||||||
return $this->elementRepo->create(new CreateElementDto(
|
return $this->elementRepo->create(new CreateElementDto(
|
||||||
|
|
@ -189,7 +177,6 @@ class GetElementTest extends TestCase
|
||||||
description: $description,
|
description: $description,
|
||||||
richText: $richText,
|
richText: $richText,
|
||||||
pdfPath: $pdfPath,
|
pdfPath: $pdfPath,
|
||||||
youtubeUrl: $youtubeUrl,
|
|
||||||
parentElement: $parentElement,
|
parentElement: $parentElement,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,11 +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.get('[data-cy="element-youtube-embed"]')
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.attr', 'src')
|
|
||||||
.and('include', 'https://www.youtube.com/embed/yHx-r4p6hHU')
|
|
||||||
.and('include', 'start=1')
|
|
||||||
cy.contains('[data-cy="element-pdf-link"]', 'View PDF')
|
cy.contains('[data-cy="element-pdf-link"]', 'View PDF')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.and('have.attr', 'href', '/assets/pdfs/baderech.pdf')
|
.and('have.attr', 'href', '/assets/pdfs/baderech.pdf')
|
||||||
|
|
@ -87,7 +82,6 @@ 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-youtube-embed"]').should('not.exist')
|
|
||||||
cy.get('[data-cy="element-pdf-link"]').should('not.exist')
|
cy.get('[data-cy="element-pdf-link"]').should('not.exist')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ export interface ChildElement {
|
||||||
export interface Element extends ChildElement {
|
export interface Element extends ChildElement {
|
||||||
richText: string
|
richText: string
|
||||||
pdfPath: string | null
|
pdfPath: string | null
|
||||||
youtubeUrl: string | null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ElementResponse {
|
interface ElementResponse {
|
||||||
|
|
|
||||||
|
|
@ -5,22 +5,10 @@ import { useRoute } from 'vue-router'
|
||||||
import SiteHeader from '@/components/SiteHeader.vue'
|
import SiteHeader from '@/components/SiteHeader.vue'
|
||||||
import { useElementsStore } from '@/stores/elements'
|
import { useElementsStore } from '@/stores/elements'
|
||||||
|
|
||||||
type TimestampPart = string | undefined
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const elementsStore = useElementsStore()
|
const elementsStore = useElementsStore()
|
||||||
const { element, childElements, isLoading, error } = storeToRefs(elementsStore)
|
const { element, childElements, isLoading, error } = storeToRefs(elementsStore)
|
||||||
|
|
||||||
const youtubeIframeAllow = [
|
|
||||||
'accelerometer',
|
|
||||||
'autoplay',
|
|
||||||
'clipboard-write',
|
|
||||||
'encrypted-media',
|
|
||||||
'gyroscope',
|
|
||||||
'picture-in-picture',
|
|
||||||
'web-share',
|
|
||||||
].join('; ')
|
|
||||||
|
|
||||||
const elementId = computed(() => {
|
const elementId = computed(() => {
|
||||||
const routeElementId = route.params.id
|
const routeElementId = route.params.id
|
||||||
|
|
||||||
|
|
@ -31,12 +19,6 @@ const elementId = computed(() => {
|
||||||
return routeElementId
|
return routeElementId
|
||||||
})
|
})
|
||||||
|
|
||||||
const youtubeEmbedUrl = computed(() => {
|
|
||||||
const youtubeUrl = element.value?.youtubeUrl ?? null
|
|
||||||
|
|
||||||
return getYoutubeEmbedUrl(youtubeUrl)
|
|
||||||
})
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
elementId,
|
elementId,
|
||||||
(currentElementId) => {
|
(currentElementId) => {
|
||||||
|
|
@ -48,154 +30,6 @@ watch(
|
||||||
},
|
},
|
||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
function getYoutubeEmbedUrl(youtubeUrl: string | null): string | null {
|
|
||||||
if (youtubeUrl === null || youtubeUrl === '') {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
let parsedUrl: URL
|
|
||||||
try {
|
|
||||||
parsedUrl = new URL(youtubeUrl)
|
|
||||||
} catch {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
const videoId = getYoutubeVideoId(parsedUrl)
|
|
||||||
if (videoId === null) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
const embedUrl = new URL(`https://www.youtube.com/embed/${videoId}`)
|
|
||||||
const startSeconds = getYoutubeStartSeconds(parsedUrl)
|
|
||||||
if (startSeconds !== null) {
|
|
||||||
embedUrl.searchParams.set('start', startSeconds.toString())
|
|
||||||
}
|
|
||||||
|
|
||||||
return embedUrl.toString()
|
|
||||||
}
|
|
||||||
|
|
||||||
function getYoutubeVideoId(parsedUrl: URL): string | null {
|
|
||||||
if (isShortYoutubeHost(parsedUrl.hostname)) {
|
|
||||||
return normalizeYoutubeVideoId(getFirstPathSegment(parsedUrl))
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isYoutubeHost(parsedUrl.hostname)) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parsedUrl.pathname === '/watch') {
|
|
||||||
return normalizeYoutubeVideoId(parsedUrl.searchParams.get('v'))
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parsedUrl.pathname.startsWith('/embed/')) {
|
|
||||||
return normalizeYoutubeVideoId(getPathSegment(parsedUrl, 1))
|
|
||||||
}
|
|
||||||
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
function getYoutubeStartSeconds(parsedUrl: URL): number | null {
|
|
||||||
const startParam = parsedUrl.searchParams.get('start')
|
|
||||||
if (startParam !== null) {
|
|
||||||
return getPositiveSeconds(startParam)
|
|
||||||
}
|
|
||||||
|
|
||||||
const timestampParam = parsedUrl.searchParams.get('t')
|
|
||||||
if (timestampParam === null) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
return getTimestampSeconds(timestampParam)
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTimestampSeconds(timestampParam: string): number | null {
|
|
||||||
if (/^\d+$/.test(timestampParam)) {
|
|
||||||
return getPositiveSeconds(timestampParam)
|
|
||||||
}
|
|
||||||
|
|
||||||
const hourRegex = '^(?:(\\d+)h)?'
|
|
||||||
const minuteRegex = '(?:(\\d+)m)?'
|
|
||||||
const secondRegex = '(?:(\\d+)s)?$'
|
|
||||||
const fullTimestampRegex = hourRegex + minuteRegex + secondRegex
|
|
||||||
const timestampPattern = new RegExp(fullTimestampRegex)
|
|
||||||
const timestampMatch = timestampParam.match(timestampPattern)
|
|
||||||
if (timestampMatch === null) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
const hours = getTimestampHours(timestampMatch[1])
|
|
||||||
const minutes = getTimestampMinutes(timestampMatch[2])
|
|
||||||
const seconds = getTimestampSecondsPart(timestampMatch[3])
|
|
||||||
const totalSeconds = hours + minutes + seconds
|
|
||||||
|
|
||||||
return totalSeconds > 0 ? totalSeconds : null
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTimestampHours(timestampPart: TimestampPart): number {
|
|
||||||
return getPartSeconds(timestampPart, 3600)
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTimestampMinutes(timestampPart: TimestampPart): number {
|
|
||||||
return getPartSeconds(timestampPart, 60)
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTimestampSecondsPart(timestampPart: TimestampPart): number {
|
|
||||||
return getPartSeconds(timestampPart, 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPartSeconds(timestamp: TimestampPart, multiplier: number): number {
|
|
||||||
if (timestamp === undefined) {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
return Number(timestamp) * multiplier
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPositiveSeconds(secondsParam: string): number | null {
|
|
||||||
const seconds = Number(secondsParam)
|
|
||||||
if (!Number.isInteger(seconds) || seconds < 0) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
return seconds
|
|
||||||
}
|
|
||||||
|
|
||||||
function getFirstPathSegment(parsedUrl: URL): string | null {
|
|
||||||
return getPathSegment(parsedUrl, 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPathSegment(parsedUrl: URL, segmentIndex: number): string | null {
|
|
||||||
const pathSegments = parsedUrl.pathname.split('/').filter((pathSegment) => {
|
|
||||||
return pathSegment !== ''
|
|
||||||
})
|
|
||||||
|
|
||||||
return pathSegments[segmentIndex] ?? null
|
|
||||||
}
|
|
||||||
|
|
||||||
function normalizeYoutubeVideoId(videoId: string | null): string | null {
|
|
||||||
if (videoId === null || videoId === '') {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!/^[A-Za-z0-9_-]+$/.test(videoId)) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
return videoId
|
|
||||||
}
|
|
||||||
|
|
||||||
function isYoutubeHost(hostname: string): boolean {
|
|
||||||
const normalizedHostname = hostname.toLowerCase()
|
|
||||||
const isRootYoutubeHost = normalizedHostname === 'youtube.com'
|
|
||||||
const isYoutubeSubdomain = normalizedHostname.endsWith('.youtube.com')
|
|
||||||
|
|
||||||
return isRootYoutubeHost || isYoutubeSubdomain
|
|
||||||
}
|
|
||||||
|
|
||||||
function isShortYoutubeHost(hostname: string): boolean {
|
|
||||||
return hostname.toLowerCase() === 'youtu.be'
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -222,18 +56,6 @@ function isShortYoutubeHost(hostname: string): boolean {
|
||||||
v-html="element.richText"
|
v-html="element.richText"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div v-if="youtubeEmbedUrl !== null" class="element-page__youtube">
|
|
||||||
<iframe
|
|
||||||
:src="youtubeEmbedUrl"
|
|
||||||
:allow="youtubeIframeAllow"
|
|
||||||
class="element-page__youtube-iframe"
|
|
||||||
data-cy="element-youtube-embed"
|
|
||||||
title="YouTube video player"
|
|
||||||
loading="lazy"
|
|
||||||
allowfullscreen
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="element.pdfPath !== null" class="element-page__actions">
|
<div v-if="element.pdfPath !== null" class="element-page__actions">
|
||||||
<a
|
<a
|
||||||
:href="element.pdfPath"
|
:href="element.pdfPath"
|
||||||
|
|
@ -327,21 +149,6 @@ function isShortYoutubeHost(hostname: string): boolean {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
.element-page__youtube {
|
|
||||||
aspect-ratio: 16 / 9;
|
|
||||||
margin-top: 1.75rem;
|
|
||||||
overflow: hidden;
|
|
||||||
background: #000000;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.element-page__youtube-iframe {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.element-page__actions {
|
.element-page__actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue