From 0bb9dc395a0e31d3e2808d26dcbfbc45aff3b6d6 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 29 May 2024 13:31:33 -0500 Subject: [PATCH 001/346] Rename instances of Digital Publications Sections to Articles [PUB-191] --- app/Http/Requests/Admin/SlideRequest.php | 2 +- app/Http/Resources/Slide.php | 4 ++-- app/Models/Api/Asset.php | 2 +- app/Models/Api/Publication.php | 4 ++-- .../admin/digitalPublications/articles/form.blade.php | 2 +- .../admin/experiences/slides/_interstitial.blade.php | 4 ++-- .../views/site/digitalPublicationDetail.blade.php | 10 +++++----- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/Http/Requests/Admin/SlideRequest.php b/app/Http/Requests/Admin/SlideRequest.php index ceafaf86d8..b2557a1fa7 100644 --- a/app/Http/Requests/Admin/SlideRequest.php +++ b/app/Http/Requests/Admin/SlideRequest.php @@ -19,7 +19,7 @@ public function rulesForUpdate() return [ 'attract_title' => 'max:150', 'attract_subhead' => 'max:150', - 'section_title' => 'max:150', + 'article_title' => 'max:150', 'caption' => 'max:150', 'interstitial_headline' => 'max:150', 'body_copy' => 'max:500', diff --git a/app/Http/Resources/Slide.php b/app/Http/Resources/Slide.php index d0309a3c37..13214aa355 100644 --- a/app/Http/Resources/Slide.php +++ b/app/Http/Resources/Slide.php @@ -121,10 +121,10 @@ protected function getInterstitalAttributes() $this->media = $this->interstitialExperienceImage; return [ - 'title' => $this->section_title, + 'title' => $this->article_title, 'copy' => $this->body_copy, '__option_body_copy' => !empty($this->body_copy), - '__option_section_title' => !empty($this->section_title), + '__option_article_title' => !empty($this->article_title), '__option_background_image' => count($this->interstitialExperienceImage) > 0, '__option_headline' => !empty($this->interstitial_headline), ]; diff --git a/app/Models/Api/Asset.php b/app/Models/Api/Asset.php index 884595a599..e379f1d9d2 100644 --- a/app/Models/Api/Asset.php +++ b/app/Models/Api/Asset.php @@ -148,7 +148,7 @@ public function getIconAfterAttribute() public function scopeMultimediaAssets($query) { $params = [ - 'resources' => ['images', 'sounds', 'texts', 'videos', 'sections', 'sites'] + 'resources' => ['images', 'sounds', 'texts', 'videos', 'articles', 'sites'] ]; return $query->rawQuery($params); diff --git a/app/Models/Api/Publication.php b/app/Models/Api/Publication.php index 37e4161427..1eccb6402d 100644 --- a/app/Models/Api/Publication.php +++ b/app/Models/Api/Publication.php @@ -12,8 +12,8 @@ class Publication extends BaseApiModel 'search' => '/api/v1/publications/search' ]; - public function sections() + public function articles() { - return $this->hasMany(\App\Models\Api\Section::class, 'section_ids'); + return $this->hasMany(\App\Models\Api\Section::class, 'article_ids'); } } diff --git a/resources/views/admin/digitalPublications/articles/form.blade.php b/resources/views/admin/digitalPublications/articles/form.blade.php index 0ef0611066..da8c971ecb 100644 --- a/resources/views/admin/digitalPublications/articles/form.blade.php +++ b/resources/views/admin/digitalPublications/articles/form.blade.php @@ -46,7 +46,7 @@ 'label' => 'Hide title in listing view', ]) @endslot - + @slot('right') @formField('checkbox', [ 'name' => 'suppress_listing', diff --git a/resources/views/admin/experiences/slides/_interstitial.blade.php b/resources/views/admin/experiences/slides/_interstitial.blade.php index a51a507b02..49bce8ca8d 100644 --- a/resources/views/admin/experiences/slides/_interstitial.blade.php +++ b/resources/views/admin/experiences/slides/_interstitial.blade.php @@ -4,8 +4,8 @@ 'keepAlive' => true, ]) @formField('wysiwyg', [ - 'name' => 'section_title', - 'label' => 'Section Title', + 'name' => 'article_title', + 'label' => 'Article Title', 'maxlength' => 150, ]) diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index 1da462a461..b4e4aa58bf 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -258,7 +258,7 @@ @slot('cols_large','3') @slot('cols_xlarge','3') @endif - + @foreach ($topLevelArticle->children->filter(function($item) { return !$item->suppress_listing; })->sortBy('position') as $item) @@ -294,14 +294,14 @@ @endcomponent @endif @endforeach - + @if ($showAll == true) @endcomponent @endif - + @break @default - + @component('components.organisms._o-grid-listing') @slot('cols_small','2') @slot('cols_medium','3') @@ -336,7 +336,7 @@ @endif @endforeach @endcomponent - + @endswitch @endif @endforeach From 01aca1c464b48bb6584f1bde7b1464551d427fd4 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 26 Jun 2024 12:58:46 -0500 Subject: [PATCH 002/346] Fix interactive features slug bug [WEB-2886] --- app/Models/Experience.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Models/Experience.php b/app/Models/Experience.php index cce9156480..fdea0fbbb9 100644 --- a/app/Models/Experience.php +++ b/app/Models/Experience.php @@ -271,6 +271,11 @@ public function getTitleSlugAttribute() return StringHelpers::getUtf8Slug($this->title); } + public function getTitleSlugAttribute() + { + return StringHelpers::getUtf8Slug($this->title); + } + public $mediasParams = [ 'thumbnail' => [ 'default' => [ From e35ed0b4e20a7d190e005801a372b3249475af18 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Wed, 12 Jun 2024 17:22:47 -0400 Subject: [PATCH 003/346] Adapt migrate:osci-publication to use sqlite + pure HTML blocks --- .../Commands/MigrateOSCIPublicationOne.php | 107 ++++++++++++++---- 1 file changed, 86 insertions(+), 21 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index fca40b5bbb..1ed0628d41 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -8,6 +8,22 @@ use App\Models\DigitalPublicationArticle; use App\Models\Vendor\Block; +/** + * MigrationDB + * + * Wrapper around the migration db -- basically just an open()-er? + * + * TODO: construct() should take a migration filename string + */ +class MigrationDB extends \SQLite3 { + + function __construct() + { + $this->open('migration.sqlite3'); + } + +} + class MigrateOSCIPublicationOne extends Command { /** @@ -22,18 +38,20 @@ class MigrateOSCIPublicationOne extends Command * * @var string */ - protected $description = 'Migrate an OSCI publication to a website DigitalPublication'; + protected $description = 'Migrate an OSCI publication from a migration file to a website DigitalPublication'; - protected $repository; + protected $db; /** * Create a new command instance. * * @return void + * + * TODO: This should take.. a migration filename? */ - public function __construct(PublicationRepository $repository) + public function __construct() { - $this->repository = $repository; + $this->db = new MigrationDB(); parent::__construct(); } @@ -46,37 +64,84 @@ public function handle() { $pubId = $this->argument('id'); - $apiPub = $this->repository->getById($pubId); + // NB!: For each of these types in the admin UI it's impossible to validate the save without setting a date! + + $pubQuery = $this->db->prepare("SELECT json_extract(publications.data,'$._title') as title FROM publications LEFT JOIN tocs ON tocs.package=publications.pub_id WHERE pub_id=:id"); + $pubQuery->bindValue(':id',$pubId); + + $result = $pubQuery->execute(); + $pub = $result->fetchArray(); + + // var_dump($pub); + + // TODO: Handle italics / etc in the title + // TODO: Set any other publication level metadata (date?) + + // $apiPub = $this->repository->getById($pubId); + // echo $pub['title']; $webPub = new DigitalPublication(); - $webPub->title = 'Migrated ' . date('M j, Y') . ' | ' . $apiPub->title; + $webPub->title = 'Migrated ' . date('M j, Y') . ' | ' . $pub["title"]; $webPub->published = false; $webPub->is_dsc_stub = false; $webPub->save(); - foreach ($apiPub->articles as $apiArticle) { + $webPubId = $webPub->id; + + $textsQuery = $this->db->prepare("SELECT coalesce(json_extract(data,'$._title'),'FIXME') as title,text_id FROM texts WHERE package=:pubId and text_id NOT LIKE '%ncxtoc%'"); + $textsQuery->bindValue(':pubId',$pubId); + + $textResult = $textsQuery->execute(); + $text = $textResult->fetchArray(); + + while ($text) { + // echo $text['title'] . $webPubId; + $webArticle = new DigitalPublicationArticle(); - $webArticle->title = $apiArticle->title; + $webArticle->type = "about"; + $webArticle->title = $text['title']; $webArticle->published = false; - $webArticle->digital_publication_id = $webPub->id; - $webArticle->position = $apiArticle->weight; + $webArticle->digital_publication_id = $webPubId; + $webArticle->updated_at = date('M j, Y'); + $webArticle->created_at = date('M j, Y'); + + // TODO + $webArticle->position = 0; + $webArticle->save(); - $block = new Block(); - $block->blockable_id = $webArticle->id; - $block->blockable_type = 'App\Models\DigitalPublicationArticle'; + $blocksQuery = $this->db->prepare("SELECT json_extract(sects.value,'$.html') as html from texts,json_each(texts.data,'$.sections') as sects where texts.text_id=:textId"); + $blocksQuery->bindValue(':textId',$text['text_id']); + + $blocksResult = $blocksQuery->execute(); + + $blk = $blocksResult->fetchArray(); - /* If we decide to break up the text into multiple paragraph blocks, increment - * the `position` value to keep the order in tact. - */ - $block->position = 0; + while ($blk) { + // echo 'sup'; + // echo $blk['html']; + // TODO: .. and for each text's block, do this dance.. + $block = new Block(); + $block->blockable_id = $webArticle->id; + $block->blockable_type = 'App\Models\DigitalPublicationArticle'; - $block->content = ['paragraph' => str_replace(['content)]; - $block->type = 'paragraph'; - $block->save(); - $webArticle->blocks()->save($block); + // TODO + $block->position = 0; + + $block->content = [ 'paragraph' => $blk['html'] ]; + $block->type = 'paragraph'; + $block->save(); + + $webArticle->blocks()->save($block); + + $blk = $blocksResult->fetchArray(); + } $webPub->articles()->save($webArticle); + + $text = $textResult->fetchArray(); + } + $webPub->save(); } } From 670245bd018eb8eb21231d129a16f6c0b86d0e81 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Thu, 13 Jun 2024 13:59:51 -0400 Subject: [PATCH 004/346] Use blocks to fill article contents --- app/Console/Commands/MigrateOSCIPublicationOne.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 1ed0628d41..d022cdf1db 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -109,7 +109,7 @@ public function handle() $webArticle->save(); - $blocksQuery = $this->db->prepare("SELECT json_extract(sects.value,'$.html') as html from texts,json_each(texts.data,'$.sections') as sects where texts.text_id=:textId"); + $blocksQuery = $this->db->prepare("SELECT json_extract(blk.value,'$.html') as html, json_extract(blk.value,'$.blockType') as type, json_extract(blk.value,'$.fallback_url') as figure_url from texts,json_each(texts.data,'$.sections') as sects,json_each(sects.value,'$.blocks') as blk where texts.text_id=:textId"); $blocksQuery->bindValue(':textId',$text['text_id']); $blocksResult = $blocksQuery->execute(); @@ -127,7 +127,12 @@ public function handle() // TODO $block->position = 0; - $block->content = [ 'paragraph' => $blk['html'] ]; + if ($block['type'] == 'figure') { + $block->content = [ 'paragraph' => '
' ]; + } else { + $block->content = [ 'paragraph' => $blk['html'] ]; + } + $block->type = 'paragraph'; $block->save(); From 6cccd5d2bdcf8de58c9e0fe0c47b515e2e9fd115 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Thu, 13 Jun 2024 14:24:00 -0400 Subject: [PATCH 005/346] Populate block position --- app/Console/Commands/MigrateOSCIPublicationOne.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index d022cdf1db..424783a7e8 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -109,7 +109,7 @@ public function handle() $webArticle->save(); - $blocksQuery = $this->db->prepare("SELECT json_extract(blk.value,'$.html') as html, json_extract(blk.value,'$.blockType') as type, json_extract(blk.value,'$.fallback_url') as figure_url from texts,json_each(texts.data,'$.sections') as sects,json_each(sects.value,'$.blocks') as blk where texts.text_id=:textId"); + $blocksQuery = $this->db->prepare("SELECT json_extract(blk.value,'$.html') as html, blk.id as position, json_extract(blk.value,'$.blockType') as type, json_extract(blk.value,'$.fallback_url') as figure_url from texts,json_each(texts.data,'$.sections') as sects,json_each(sects.value,'$.blocks') as blk where texts.text_id=:textId"); $blocksQuery->bindValue(':textId',$text['text_id']); $blocksResult = $blocksQuery->execute(); @@ -117,15 +117,12 @@ public function handle() $blk = $blocksResult->fetchArray(); while ($blk) { - // echo 'sup'; - // echo $blk['html']; - // TODO: .. and for each text's block, do this dance.. + $block = new Block(); $block->blockable_id = $webArticle->id; $block->blockable_type = 'App\Models\DigitalPublicationArticle'; - // TODO - $block->position = 0; + $block->position = $blk['position']; if ($block['type'] == 'figure') { $block->content = [ 'paragraph' => '
' ]; From 3912dc7c9469177c226802a1d3e06cfb5b3dcacf Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Thu, 13 Jun 2024 14:43:40 -0400 Subject: [PATCH 006/346] Fix figure patch and add figure caption --- app/Console/Commands/MigrateOSCIPublicationOne.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 424783a7e8..566fbaaa81 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -109,7 +109,7 @@ public function handle() $webArticle->save(); - $blocksQuery = $this->db->prepare("SELECT json_extract(blk.value,'$.html') as html, blk.id as position, json_extract(blk.value,'$.blockType') as type, json_extract(blk.value,'$.fallback_url') as figure_url from texts,json_each(texts.data,'$.sections') as sects,json_each(sects.value,'$.blocks') as blk where texts.text_id=:textId"); + $blocksQuery = $this->db->prepare("SELECT json_extract(blk.value,'$.html') as html, blk.id as position, json_extract(blk.value,'$.blockType') as type, json_extract(blk.value,'$.fallback_url') as figure_url, coalesce(json_extract(blk.value,'$.caption_html'),'') as figure_capt from texts, json_each(texts.data,'$.sections') as sects,json_each(sects.value,'$.blocks') as blk where texts.text_id=:textId"); $blocksQuery->bindValue(':textId',$text['text_id']); $blocksResult = $blocksQuery->execute(); @@ -123,9 +123,11 @@ public function handle() $block->blockable_type = 'App\Models\DigitalPublicationArticle'; $block->position = $blk['position']; + if ($blk['type'] == 'figure') { + + $figText = '
'.$blk['figure_capt'].'
'; - if ($block['type'] == 'figure') { - $block->content = [ 'paragraph' => '
' ]; + $block->content = [ 'paragraph' => $figText ]; } else { $block->content = [ 'paragraph' => $blk['html'] ]; } From 8f180f88fcab92e799f2d0443f7804a3b36b3064 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Thu, 13 Jun 2024 16:51:03 -0400 Subject: [PATCH 007/346] Fix block order --- app/Console/Commands/MigrateOSCIPublicationOne.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 566fbaaa81..1388a00a98 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -116,15 +116,20 @@ public function handle() $blk = $blocksResult->fetchArray(); + $order = 0; + while ($blk) { $block = new Block(); $block->blockable_id = $webArticle->id; $block->blockable_type = 'App\Models\DigitalPublicationArticle'; - $block->position = $blk['position']; + $block->position = $order; + + // TODO: Adapt Trevin's spec image code here if ($blk['type'] == 'figure') { + // $figText = ''.$blk['figure_url'].''; $figText = '
'.$blk['figure_capt'].'
'; $block->content = [ 'paragraph' => $figText ]; @@ -138,6 +143,7 @@ public function handle() $webArticle->blocks()->save($block); $blk = $blocksResult->fetchArray(); + $order += 1; } $webPub->articles()->save($webArticle); From 0034ad4b38c1b86f289e9705986e43ceb2a9a393 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Fri, 14 Jun 2024 11:11:11 -0400 Subject: [PATCH 008/346] Refine f/n migrate: use 'text' for DigitalPubArticle type --- app/Console/Commands/MigrateOSCIPublicationOne.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 1388a00a98..96bf0e4ebe 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -72,13 +72,9 @@ public function handle() $result = $pubQuery->execute(); $pub = $result->fetchArray(); - // var_dump($pub); - // TODO: Handle italics / etc in the title // TODO: Set any other publication level metadata (date?) - // $apiPub = $this->repository->getById($pubId); - // echo $pub['title']; $webPub = new DigitalPublication(); $webPub->title = 'Migrated ' . date('M j, Y') . ' | ' . $pub["title"]; $webPub->published = false; @@ -94,22 +90,25 @@ public function handle() $text = $textResult->fetchArray(); while ($text) { - // echo $text['title'] . $webPubId; $webArticle = new DigitalPublicationArticle(); - $webArticle->type = "about"; + $webArticle->type = "text"; $webArticle->title = $text['title']; $webArticle->published = false; $webArticle->digital_publication_id = $webPubId; + $webArticle->date = date('M j, Y'); $webArticle->updated_at = date('M j, Y'); $webArticle->created_at = date('M j, Y'); - // TODO + // TODO: Join toc position via json_tree against toc data $webArticle->position = 0; $webArticle->save(); + // TODO: Use a multiline string!! Also this can be moved outside the while + $blocksQuery = $this->db->prepare("SELECT json_extract(blk.value,'$.html') as html, blk.id as position, json_extract(blk.value,'$.blockType') as type, json_extract(blk.value,'$.fallback_url') as figure_url, coalesce(json_extract(blk.value,'$.caption_html'),'') as figure_capt from texts, json_each(texts.data,'$.sections') as sects,json_each(sects.value,'$.blocks') as blk where texts.text_id=:textId"); + $blocksQuery->bindValue(':textId',$text['text_id']); $blocksResult = $blocksQuery->execute(); @@ -146,6 +145,7 @@ public function handle() $order += 1; } + $webArticle->save(); $webPub->articles()->save($webArticle); $text = $textResult->fetchArray(); From ae03b81becbddde7dcc36561f86888bd10c10107 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Fri, 21 Jun 2024 12:53:21 -0500 Subject: [PATCH 009/346] Refactor `migrate:osci-publication` command to access sqlite DB using built-it Laravel mechanisms --- .../Commands/MigrateOSCIPublicationOne.php | 78 ++++--------------- config/database.php | 9 +++ 2 files changed, 25 insertions(+), 62 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 96bf0e4ebe..4b19a58dae 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -3,27 +3,13 @@ namespace App\Console\Commands; use Illuminate\Console\Command; +use Illuminate\Support\Facades\DB; +use Illuminate\Support\Arr; use App\Repositories\Api\PublicationRepository; use App\Models\DigitalPublication; use App\Models\DigitalPublicationArticle; use App\Models\Vendor\Block; -/** - * MigrationDB - * - * Wrapper around the migration db -- basically just an open()-er? - * - * TODO: construct() should take a migration filename string - */ -class MigrationDB extends \SQLite3 { - - function __construct() - { - $this->open('migration.sqlite3'); - } - -} - class MigrateOSCIPublicationOne extends Command { /** @@ -40,21 +26,6 @@ class MigrateOSCIPublicationOne extends Command */ protected $description = 'Migrate an OSCI publication from a migration file to a website DigitalPublication'; - protected $db; - - /** - * Create a new command instance. - * - * @return void - * - * TODO: This should take.. a migration filename? - */ - public function __construct() - { - $this->db = new MigrationDB(); - parent::__construct(); - } - /** * Execute the console command. * @@ -66,34 +37,27 @@ public function handle() // NB!: For each of these types in the admin UI it's impossible to validate the save without setting a date! - $pubQuery = $this->db->prepare("SELECT json_extract(publications.data,'$._title') as title FROM publications LEFT JOIN tocs ON tocs.package=publications.pub_id WHERE pub_id=:id"); - $pubQuery->bindValue(':id',$pubId); - - $result = $pubQuery->execute(); - $pub = $result->fetchArray(); + $pubs = DB::connection('osci_migration')->select("SELECT json_extract(publications.data,'$._title') as title FROM publications LEFT JOIN tocs ON tocs.package=publications.pub_id WHERE pub_id=:id", ['id' => $pubId]); + $pub = Arr::first($pubs); // TODO: Handle italics / etc in the title // TODO: Set any other publication level metadata (date?) $webPub = new DigitalPublication(); - $webPub->title = 'Migrated ' . date('M j, Y') . ' | ' . $pub["title"]; + $webPub->title = 'Migrated ' . date('M j, Y') . ' | ' . $pub->title; $webPub->published = false; $webPub->is_dsc_stub = false; $webPub->save(); $webPubId = $webPub->id; - $textsQuery = $this->db->prepare("SELECT coalesce(json_extract(data,'$._title'),'FIXME') as title,text_id FROM texts WHERE package=:pubId and text_id NOT LIKE '%ncxtoc%'"); - $textsQuery->bindValue(':pubId',$pubId); + $texts = DB::connection('osci_migration')->select("SELECT coalesce(json_extract(data,'$._title'),'FIXME') as title,text_id FROM texts WHERE package=:pubId and text_id NOT LIKE '%ncxtoc%'", ['pubId' => $pubId]); - $textResult = $textsQuery->execute(); - $text = $textResult->fetchArray(); + foreach ($texts as $text) { - while ($text) { - $webArticle = new DigitalPublicationArticle(); $webArticle->type = "text"; - $webArticle->title = $text['title']; + $webArticle->title = $text->title; $webArticle->published = false; $webArticle->digital_publication_id = $webPubId; $webArticle->date = date('M j, Y'); @@ -101,23 +65,17 @@ public function handle() $webArticle->created_at = date('M j, Y'); // TODO: Join toc position via json_tree against toc data - $webArticle->position = 0; + $webArticle->position = 0; $webArticle->save(); // TODO: Use a multiline string!! Also this can be moved outside the while - $blocksQuery = $this->db->prepare("SELECT json_extract(blk.value,'$.html') as html, blk.id as position, json_extract(blk.value,'$.blockType') as type, json_extract(blk.value,'$.fallback_url') as figure_url, coalesce(json_extract(blk.value,'$.caption_html'),'') as figure_capt from texts, json_each(texts.data,'$.sections') as sects,json_each(sects.value,'$.blocks') as blk where texts.text_id=:textId"); - - $blocksQuery->bindValue(':textId',$text['text_id']); - - $blocksResult = $blocksQuery->execute(); - - $blk = $blocksResult->fetchArray(); + $blocks = DB::connection('osci_migration')->select("SELECT json_extract(blk.value,'$.html') as html, blk.id as position, json_extract(blk.value,'$.blockType') as type, json_extract(blk.value,'$.fallback_url') as figure_url, coalesce(json_extract(blk.value,'$.caption_html'),'') as figure_capt from texts, json_each(texts.data,'$.sections') as sects,json_each(sects.value,'$.blocks') as blk where texts.text_id=:textId", ['textId' => $text->text_id]); $order = 0; - while ($blk) { + foreach ($blocks as $blk) { $block = new Block(); $block->blockable_id = $webArticle->id; @@ -126,14 +84,14 @@ public function handle() $block->position = $order; // TODO: Adapt Trevin's spec image code here - if ($blk['type'] == 'figure') { - + if ($blk->type == 'figure') { + // $figText = ''.$blk['figure_url'].''; - $figText = '
'.$blk['figure_capt'].'
'; + $figText = '
'.$blk->figure_capt.'
'; $block->content = [ 'paragraph' => $figText ]; } else { - $block->content = [ 'paragraph' => $blk['html'] ]; + $block->content = [ 'paragraph' => $blk->html ]; } $block->type = 'paragraph'; @@ -141,17 +99,13 @@ public function handle() $webArticle->blocks()->save($block); - $blk = $blocksResult->fetchArray(); $order += 1; } $webArticle->save(); $webPub->articles()->save($webArticle); - - $text = $textResult->fetchArray(); - } - + $webPub->save(); } } diff --git a/config/database.php b/config/database.php index 4445f22dfe..cc2d948edf 100644 --- a/config/database.php +++ b/config/database.php @@ -115,6 +115,15 @@ 'sslmode' => 'prefer', ], + 'osci_migration' => [ + 'driver' => 'sqlite', + 'database' => storage_path('app/migration.sqlite3'), + 'prefix' => '', + 'foreign_key_constraints' => true, + ], + + + ], /* From 8ac4e238651ae8d6892ed9c864e7fd94ce78e2ed Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 25 Jun 2024 15:00:39 -0500 Subject: [PATCH 010/346] Add default nested set values for imported articles [PUB-204] --- app/Console/Commands/MigrateOSCIPublicationOne.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 4b19a58dae..940f9a9cea 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -53,6 +53,9 @@ public function handle() $texts = DB::connection('osci_migration')->select("SELECT coalesce(json_extract(data,'$._title'),'FIXME') as title,text_id FROM texts WHERE package=:pubId and text_id NOT LIKE '%ncxtoc%'", ['pubId' => $pubId]); + // Initialize the left value + $lft = 1; + foreach ($texts as $text) { $webArticle = new DigitalPublicationArticle(); @@ -63,6 +66,8 @@ public function handle() $webArticle->date = date('M j, Y'); $webArticle->updated_at = date('M j, Y'); $webArticle->created_at = date('M j, Y'); + $webArticle->_lft = $lft++; + $webArticle->_rgt = $lft++; // TODO: Join toc position via json_tree against toc data $webArticle->position = 0; From 14879ef2d98905697d753f34dd9f8d6f8fbf5048 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Wed, 26 Jun 2024 11:01:54 -0400 Subject: [PATCH 011/346] Clean up linting errs --- app/Console/Commands/MigrateOSCIPublicationOne.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 940f9a9cea..9ef1165189 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -57,7 +57,6 @@ public function handle() $lft = 1; foreach ($texts as $text) { - $webArticle = new DigitalPublicationArticle(); $webArticle->type = "text"; $webArticle->title = $text->title; @@ -81,7 +80,6 @@ public function handle() $order = 0; foreach ($blocks as $blk) { - $block = new Block(); $block->blockable_id = $webArticle->id; $block->blockable_type = 'App\Models\DigitalPublicationArticle'; @@ -90,9 +88,8 @@ public function handle() // TODO: Adapt Trevin's spec image code here if ($blk->type == 'figure') { - // $figText = ''.$blk['figure_url'].''; - $figText = '
'.$blk->figure_capt.'
'; + $figText = '
' . $blk->figure_capt . '
'; $block->content = [ 'paragraph' => $figText ]; } else { From f1933eb18c4496b7532241aae24709fa5ce5ff53 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Thu, 27 Jun 2024 10:02:56 -0400 Subject: [PATCH 012/346] Media operations from test.jpeg + figure-type-aware block serializations --- .../Commands/MigrateOSCIPublicationOne.php | 137 ++++++++++++++++-- 1 file changed, 121 insertions(+), 16 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 9ef1165189..b863d2b838 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -4,11 +4,14 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Storage; use Illuminate\Support\Arr; +use Illuminate\Support\Str; use App\Repositories\Api\PublicationRepository; use App\Models\DigitalPublication; use App\Models\DigitalPublicationArticle; use App\Models\Vendor\Block; +use A17\Twill\Models\Media; class MigrateOSCIPublicationOne extends Command { @@ -26,6 +29,107 @@ class MigrateOSCIPublicationOne extends Command */ protected $description = 'Migrate an OSCI publication from a migration file to a website DigitalPublication'; + /** + * configure $block (a Block model) with $data + * + */ + private function configureFigBlock($figure,$block) + { + switch ($figure->figure_type) { + case 'html_figure': + // TODO: if $figure->html_content_src set embed_type => url and url => html_content_src + + $block->type = 'media_embed'; + $block->content = json_encode([ + "size" => "m", + "embed_type" => "html", + "embed_code" => $figure->html_content, + "embed_height" => "400px", + "disable_placeholder" => true + ]); + + $block->save(); + + break; + + // TODO: if layered_image instantiate a layered image block + case 'layered_image': + case 'iip_asset': + + $block->type = 'image'; + $block->content = json_encode([ + "is_modal" => false, + "is_zoomable" => false, + "size" => "m", + "use_contain" => true, + "use_alt_background" => true, + "image_link" => null, + "caption" => $figure->caption_html + ]); + + // Media uploads and relations + $imagePath = 'test.jpeg'; + $imageUuid = (string) Str::uuid(); + $imageFilename = Str::random(10) . '.jpg'; + $imageName = $imageUuid . '/' . $imageFilename; + + Storage::disk('s3')->put($imageName, file_get_contents($imagePath)); + + $media = new Media(['uuid'=>$imageName,'width'=>2246,'height'=>1469, 'filename'=>$imageFilename]); + + $media->alt_text = 'Alt text for the image'; + $media->caption = $figure->caption_html; + $media->save(); + + $mediaId = $media->id; + + $block->medias()->attach($mediaId, ['role' => 'default','metadatas' => '{"caption":null,"altText":null,"video":null}']); + + $block->save(); + + break; + + case '360_slider': + // TODO: set block-type for 360 + $block->type = 'paragraph'; + $block->content = [ "paragraph" => "360!!" ]; + $block->save(); + break; + + + case 'rti_viewer': + // TODO: set block-type for media embed with some placeholder text + $block->type = 'paragraph'; + $block->content = [ "paragraph" => "RTI!!" ]; + $block->save(); + break; + + } + } + + /** + * configure $block (a Block model) with $data + * + * NB: "figure" here can be many different block types + */ + private function configureBlock($data,$block) + { + + switch ($data->type) { + case 'figure': + $this->configureFigBlock($data,$block); + $blockId = $block->id; + + break; + default: + $block->content = [ 'paragraph' => $data->html ]; + $block->type = 'paragraph'; + break; + } + + + } + /** * Execute the console command. * @@ -51,12 +155,25 @@ public function handle() $webPubId = $webPub->id; - $texts = DB::connection('osci_migration')->select("SELECT coalesce(json_extract(data,'$._title'),'FIXME') as title,text_id FROM texts WHERE package=:pubId and text_id NOT LIKE '%ncxtoc%'", ['pubId' => $pubId]); + $texts = DB::connection('osci_migration')->select("SELECT coalesce(json_extract(data,'$._title'),'FIXME') as title,text_id FROM texts WHERE package=:pubId", ['pubId' => $pubId]); // Initialize the left value $lft = 1; + $blockQuery = "SELECT json_extract(blk.value,'$.html') AS html," . + "blk.id AS position," . + "json_extract(blk.value,'$.blockType') AS type," . + "json_extract(blk.value,'$.figure_type') AS figure_type," . + "json_extract(blk.value,'$.html_content') AS html_content," . + "json_extract(blk.value,'$.html_content_src') AS html_content_src," . + "coalesce(json_extract(blk.value,'$.caption_html'),'') AS caption_html " . + "FROM texts," . + "json_each(texts.data,'$.sections') AS sects," . + "json_each(sects.value,'$.blocks') AS blk " . + "WHERE texts.text_id=:textId"; + foreach ($texts as $text) { + $webArticle = new DigitalPublicationArticle(); $webArticle->type = "text"; $webArticle->title = $text->title; @@ -73,31 +190,19 @@ public function handle() $webArticle->save(); - // TODO: Use a multiline string!! Also this can be moved outside the while - - $blocks = DB::connection('osci_migration')->select("SELECT json_extract(blk.value,'$.html') as html, blk.id as position, json_extract(blk.value,'$.blockType') as type, json_extract(blk.value,'$.fallback_url') as figure_url, coalesce(json_extract(blk.value,'$.caption_html'),'') as figure_capt from texts, json_each(texts.data,'$.sections') as sects,json_each(sects.value,'$.blocks') as blk where texts.text_id=:textId", ['textId' => $text->text_id]); + $blocks = DB::connection('osci_migration')->select($blockQuery, ['textId' => $text->text_id]); $order = 0; foreach ($blocks as $blk) { + $block = new Block(); $block->blockable_id = $webArticle->id; $block->blockable_type = 'App\Models\DigitalPublicationArticle'; $block->position = $order; - // TODO: Adapt Trevin's spec image code here - if ($blk->type == 'figure') { - // $figText = ''.$blk['figure_url'].''; - $figText = '
' . $blk->figure_capt . '
'; - - $block->content = [ 'paragraph' => $figText ]; - } else { - $block->content = [ 'paragraph' => $blk->html ]; - } - - $block->type = 'paragraph'; - $block->save(); + $this->configureBlock($blk,$block); $webArticle->blocks()->save($block); From 2ae5d7eee151c1e4b1f5248ce1fad437d7b37c6f Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Thu, 27 Jun 2024 10:23:34 -0400 Subject: [PATCH 013/346] Remove over-aggressive json encodings --- app/Console/Commands/MigrateOSCIPublicationOne.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index b863d2b838..1654b937fd 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -40,13 +40,13 @@ private function configureFigBlock($figure,$block) // TODO: if $figure->html_content_src set embed_type => url and url => html_content_src $block->type = 'media_embed'; - $block->content = json_encode([ + $block->content = [ "size" => "m", "embed_type" => "html", "embed_code" => $figure->html_content, "embed_height" => "400px", "disable_placeholder" => true - ]); + ]; $block->save(); @@ -57,7 +57,7 @@ private function configureFigBlock($figure,$block) case 'iip_asset': $block->type = 'image'; - $block->content = json_encode([ + $block->content = [ "is_modal" => false, "is_zoomable" => false, "size" => "m", @@ -65,7 +65,7 @@ private function configureFigBlock($figure,$block) "use_alt_background" => true, "image_link" => null, "caption" => $figure->caption_html - ]); + ]; // Media uploads and relations $imagePath = 'test.jpeg'; @@ -83,7 +83,7 @@ private function configureFigBlock($figure,$block) $mediaId = $media->id; - $block->medias()->attach($mediaId, ['role' => 'default','metadatas' => '{"caption":null,"altText":null,"video":null}']); + $block->medias()->attach($mediaId, ['role' => 'default','crop' => 'default', 'metadatas' => '{"caption":null,"altText":null,"video":null}']); $block->save(); From 1a19f1b1aa980d5fdb00fd4e3e6ce000b1466ea9 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Thu, 27 Jun 2024 11:00:38 -0400 Subject: [PATCH 014/346] Fix lint errs --- .../Commands/MigrateOSCIPublicationOne.php | 61 ++++++++++--------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 1654b937fd..c0a9554532 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -33,7 +33,7 @@ class MigrateOSCIPublicationOne extends Command * configure $block (a Block model) with $data * */ - private function configureFigBlock($figure,$block) + private function configureFigBlock($figure, $block) { switch ($figure->figure_type) { case 'html_figure': @@ -52,20 +52,11 @@ private function configureFigBlock($figure,$block) break; - // TODO: if layered_image instantiate a layered image block + // TODO: if layered_image instantiate a layered image block case 'layered_image': case 'iip_asset': - $block->type = 'image'; - $block->content = [ - "is_modal" => false, - "is_zoomable" => false, - "size" => "m", - "use_contain" => true, - "use_alt_background" => true, - "image_link" => null, - "caption" => $figure->caption_html - ]; + // Media uploads and relations $imagePath = 'test.jpeg'; @@ -75,7 +66,12 @@ private function configureFigBlock($figure,$block) Storage::disk('s3')->put($imageName, file_get_contents($imagePath)); - $media = new Media(['uuid'=>$imageName,'width'=>2246,'height'=>1469, 'filename'=>$imageFilename]); + $media = new Media([ + 'uuid' => $imageName, + 'width' => 2246, + 'height' => 1469, + 'filename' => $imageFilename + ]); $media->alt_text = 'Alt text for the image'; $media->caption = $figure->caption_html; @@ -83,6 +79,17 @@ private function configureFigBlock($figure,$block) $mediaId = $media->id; + $block->content = [ + "is_modal" => false, + "is_zoomable" => false, + "size" => "m", + "use_contain" => true, + "use_alt_background" => true, + "image_link" => null, + "image" => $mediaId, + "caption" => $figure->caption_html + ]; + $block->medias()->attach($mediaId, ['role' => 'default','crop' => 'default', 'metadatas' => '{"caption":null,"altText":null,"video":null}']); $block->save(); @@ -103,7 +110,6 @@ private function configureFigBlock($figure,$block) $block->content = [ "paragraph" => "RTI!!" ]; $block->save(); break; - } } @@ -112,12 +118,11 @@ private function configureFigBlock($figure,$block) * * NB: "figure" here can be many different block types */ - private function configureBlock($data,$block) + private function configureBlock($data, $block) { - switch ($data->type) { case 'figure': - $this->configureFigBlock($data,$block); + $this->configureFigBlock($data, $block); $blockId = $block->id; break; @@ -126,8 +131,6 @@ private function configureBlock($data,$block) $block->type = 'paragraph'; break; } - - } /** @@ -161,19 +164,18 @@ public function handle() $lft = 1; $blockQuery = "SELECT json_extract(blk.value,'$.html') AS html," . - "blk.id AS position," . - "json_extract(blk.value,'$.blockType') AS type," . - "json_extract(blk.value,'$.figure_type') AS figure_type," . - "json_extract(blk.value,'$.html_content') AS html_content," . - "json_extract(blk.value,'$.html_content_src') AS html_content_src," . - "coalesce(json_extract(blk.value,'$.caption_html'),'') AS caption_html " . - "FROM texts," . - "json_each(texts.data,'$.sections') AS sects," . + "blk.id AS position," . + "json_extract(blk.value,'$.blockType') AS type," . + "json_extract(blk.value,'$.figure_type') AS figure_type," . + "json_extract(blk.value,'$.html_content') AS html_content," . + "json_extract(blk.value,'$.html_content_src') AS html_content_src," . + "coalesce(json_extract(blk.value,'$.caption_html'),'') AS caption_html " . + "FROM texts," . + "json_each(texts.data,'$.sections') AS sects," . "json_each(sects.value,'$.blocks') AS blk " . "WHERE texts.text_id=:textId"; foreach ($texts as $text) { - $webArticle = new DigitalPublicationArticle(); $webArticle->type = "text"; $webArticle->title = $text->title; @@ -195,14 +197,13 @@ public function handle() $order = 0; foreach ($blocks as $blk) { - $block = new Block(); $block->blockable_id = $webArticle->id; $block->blockable_type = 'App\Models\DigitalPublicationArticle'; $block->position = $order; - $this->configureBlock($blk,$block); + $this->configureBlock($blk, $block); $webArticle->blocks()->save($block); From f4334b0723e0082b1bc26c40e156a438190354bc Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Thu, 27 Jun 2024 18:20:33 -0400 Subject: [PATCH 015/346] Correct block types + caption usage for 360, rti_viewer --- .../Commands/MigrateOSCIPublicationOne.php | 75 ++++++++++++------- 1 file changed, 48 insertions(+), 27 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index c0a9554532..12f73f94cc 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -37,16 +37,26 @@ private function configureFigBlock($figure, $block) { switch ($figure->figure_type) { case 'html_figure': - // TODO: if $figure->html_content_src set embed_type => url and url => html_content_src - $block->type = 'media_embed'; - $block->content = [ - "size" => "m", - "embed_type" => "html", - "embed_code" => $figure->html_content, - "embed_height" => "400px", - "disable_placeholder" => true - ]; + + if (isset($figure->html_content_src)) { + $block->content = [ + "size" => "m", + "embed_type" => "url", + "embed_url" => $figure->html_content_src, + "embed_height" => "400px", + "disable_placeholder" => true + ]; + + } else { + $block->content = [ + "size" => "m", + "embed_type" => "html", + "embed_code" => $figure->html_content, + "embed_height" => "400px", + "disable_placeholder" => true + ]; + } $block->save(); @@ -57,7 +67,6 @@ private function configureFigBlock($figure, $block) case 'iip_asset': $block->type = 'image'; - // Media uploads and relations $imagePath = 'test.jpeg'; $imageUuid = (string) Str::uuid(); @@ -70,15 +79,14 @@ private function configureFigBlock($figure, $block) 'uuid' => $imageName, 'width' => 2246, 'height' => 1469, - 'filename' => $imageFilename + 'filename' => $imageFilename, + 'locale' => 'en' ]); $media->alt_text = 'Alt text for the image'; $media->caption = $figure->caption_html; $media->save(); - $mediaId = $media->id; - $block->content = [ "is_modal" => false, "is_zoomable" => false, @@ -86,28 +94,43 @@ private function configureFigBlock($figure, $block) "use_contain" => true, "use_alt_background" => true, "image_link" => null, - "image" => $mediaId, + "hide_figure_number" => false, "caption" => $figure->caption_html ]; - - $block->medias()->attach($mediaId, ['role' => 'default','crop' => 'default', 'metadatas' => '{"caption":null,"altText":null,"video":null}']); - + + $block->medias()->save($media, [ + 'metadatas' => '{"caption":null,"altText":null,"video":null}', + 'role' => 'default', + 'crop' => 'default', + 'ratio' => 0, + 'crop_x' => 0, + 'crop_y' => 0, + 'crop_w' => 2246, + 'crop_h' => 1469 + ]); $block->save(); - + // $block->medias()->sync([]); + // var_dump($block); break; case '360_slider': - // TODO: set block-type for 360 - $block->type = 'paragraph'; - $block->content = [ "paragraph" => "360!!" ]; + $block->type = '360_embed'; + $block->content = [ + "size" => "m", + "caption" => $figure->caption_html + ]; + + // TODO: Attach media $block->save(); break; - case 'rti_viewer': - // TODO: set block-type for media embed with some placeholder text - $block->type = 'paragraph'; - $block->content = [ "paragraph" => "RTI!!" ]; + // TODO: insert reader_url, figure # for this text + figure + $block->type = 'video'; + $block->content = [ + "caption" => $figure->caption_html + ]; + $block->save(); break; } @@ -123,8 +146,6 @@ private function configureBlock($data, $block) switch ($data->type) { case 'figure': $this->configureFigBlock($data, $block); - $blockId = $block->id; - break; default: $block->content = [ 'paragraph' => $data->html ]; From fb9a73e1aeb6aa493eda5aaefe8e0b5731da8d34 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Thu, 27 Jun 2024 19:28:56 -0400 Subject: [PATCH 016/346] Break out layered image as a block type --- .../Commands/MigrateOSCIPublicationOne.php | 46 +++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 12f73f94cc..81a2244617 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -62,8 +62,25 @@ private function configureFigBlock($figure, $block) break; - // TODO: if layered_image instantiate a layered image block case 'layered_image': + $block->type = 'layered_image_viewer'; + + // TODO: Instantiate the layers using fig_layer data, attaching each using fig_layer.data to get titles + layer # / order + $block->content = [ + "is_modal" => false, + "is_zoomable" => false, + "size" => "m", + "use_contain" => true, + "use_alt_background" => true, + "image_link" => null, + "hide_figure_number" => false, + "caption" => $figure->caption_html, + "alt_text" => "" + ]; + + $block->save(); + break; + case 'iip_asset': $block->type = 'image'; @@ -87,6 +104,18 @@ private function configureFigBlock($figure, $block) $media->caption = $figure->caption_html; $media->save(); + $block->medias()->attach($media->id, [ + 'locale' => 'en', + 'media_id' => $media->id, + 'metadatas' => '{"caption":null,"captionTitle": null, "altText":null,"video":null}', + 'role' => 'image', + 'crop' => 'desktop', + 'crop_x' => 0, + 'crop_y' => 0, + 'crop_w' => 2246, + 'crop_h' => 1469 + ]); + $block->content = [ "is_modal" => false, "is_zoomable" => false, @@ -95,19 +124,10 @@ private function configureFigBlock($figure, $block) "use_alt_background" => true, "image_link" => null, "hide_figure_number" => false, - "caption" => $figure->caption_html + "caption" => $figure->caption_html, + "alt_text" => "" ]; - - $block->medias()->save($media, [ - 'metadatas' => '{"caption":null,"altText":null,"video":null}', - 'role' => 'default', - 'crop' => 'default', - 'ratio' => 0, - 'crop_x' => 0, - 'crop_y' => 0, - 'crop_w' => 2246, - 'crop_h' => 1469 - ]); + $block->save(); // $block->medias()->sync([]); // var_dump($block); From 7ab4c2e1dac05010e0db08fb4094ad5ad6fe5ac0 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Tue, 2 Jul 2024 09:01:53 -0400 Subject: [PATCH 017/346] Use fallback_url for IIP stub blocks, apply nikhil's fix --- .../Commands/MigrateOSCIPublicationOne.php | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 81a2244617..05607a3a1a 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -84,13 +84,27 @@ private function configureFigBlock($figure, $block) case 'iip_asset': $block->type = 'image'; + // Media uploads and relations - $imagePath = 'test.jpeg'; + $imagePath = isset($figure->static_url) ? $figure->static_url : $figure->fallback_url ; $imageUuid = (string) Str::uuid(); $imageFilename = Str::random(10) . '.jpg'; $imageName = $imageUuid . '/' . $imageFilename; Storage::disk('s3')->put($imageName, file_get_contents($imagePath)); + $block->content = [ + "is_modal" => false, + "is_zoomable" => false, + "size" => "m", + "use_contain" => true, + "use_alt_background" => true, + "image_link" => null, + "hide_figure_number" => false, + "caption" => $figure->caption_html, + "alt_text" => "" + ]; + + $block->save(); $media = new Media([ 'uuid' => $imageName, @@ -116,21 +130,7 @@ private function configureFigBlock($figure, $block) 'crop_h' => 1469 ]); - $block->content = [ - "is_modal" => false, - "is_zoomable" => false, - "size" => "m", - "use_contain" => true, - "use_alt_background" => true, - "image_link" => null, - "hide_figure_number" => false, - "caption" => $figure->caption_html, - "alt_text" => "" - ]; - $block->save(); - // $block->medias()->sync([]); - // var_dump($block); break; case '360_slider': @@ -208,6 +208,8 @@ public function handle() "blk.id AS position," . "json_extract(blk.value,'$.blockType') AS type," . "json_extract(blk.value,'$.figure_type') AS figure_type," . + "json_extract(blk.value,'$.static_url') AS static_url," . + "json_extract(blk.value,'$.fallback_url') AS fallback_url," . "json_extract(blk.value,'$.html_content') AS html_content," . "json_extract(blk.value,'$.html_content_src') AS html_content_src," . "coalesce(json_extract(blk.value,'$.caption_html'),'') AS caption_html " . From 11108c22ae8065e8e454d20838ac9f3a571bcb59 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Fri, 12 Jul 2024 10:51:31 -0400 Subject: [PATCH 018/346] Join layers to fig refs, refine layer, image, and video block handling --- .../Commands/MigrateOSCIPublicationOne.php | 265 ++++++++++++++---- 1 file changed, 203 insertions(+), 62 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 05607a3a1a..edb7e2c107 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -29,43 +29,87 @@ class MigrateOSCIPublicationOne extends Command */ protected $description = 'Migrate an OSCI publication from a migration file to a website DigitalPublication'; + private function mediaFactory($imageData, $caption_html, $fallback_url) + { + + // Media uploads and relations + $imageUrl = isset($imageData->static_url) ? $imageData->static_url : $fallback_url ; + + $imageUuid = (string) Str::uuid(); + $imageUrlPath = parse_url($imageUrl, PHP_URL_PATH); + $imageExt = pathinfo($imageUrlPath, PATHINFO_EXTENSION); + $imageFilename = Str::random(10) . $imageExt; + + $imageName = $imageUuid . '/' . $imageFilename; + + $ctx = stream_context_create(array( + 'http' => + array( + 'timeout' => 120, + ) + )); + $imageContent = file_get_contents($imageUrl, false, $ctx); + + Storage::disk('s3')->put($imageName, $imageContent); + + // TODO: Use the CMS's onboard h/w helpers + $media = new Media([ + 'uuid' => $imageName, + 'width' => $imageData->width, + 'height' => $imageData->height, + 'filename' => $imageFilename, + 'locale' => 'en' + ]); + + $media->alt_text = 'Alt text for the image'; + $media->caption = $caption_html; + $media->save(); + + return $media; + } /** * configure $block (a Block model) with $data * */ private function configureFigBlock($figure, $block) { - switch ($figure->figure_type) { - case 'html_figure': + + $layers = isset($figure->layers_data) ? json_decode($figure->layers_data) : []; + + // TODO: if html_figure and html_content_src, that's a video block bby + switch (true) { + // Non-video embeds (HTML, mostly) become media_embed + case $figure->figure_type === 'html_figure' && !isset($figure->html_content_src): $block->type = 'media_embed'; + $block->content = [ + "size" => "m", + "embed_type" => "html", + "embed_code" => $figure->html_content, + "embed_height" => "400px", + "disable_placeholder" => true, + "caption" => $figure->caption_html + ]; + $block->save(); - if (isset($figure->html_content_src)) { - $block->content = [ - "size" => "m", - "embed_type" => "url", - "embed_url" => $figure->html_content_src, - "embed_height" => "400px", - "disable_placeholder" => true - ]; + break; - } else { - $block->content = [ - "size" => "m", - "embed_type" => "html", - "embed_code" => $figure->html_content, - "embed_height" => "400px", - "disable_placeholder" => true - ]; - } + // HTML embeds with a src are videos + case $figure->figure_type === 'html_figure' && isset($figure->html_content_src): + $block->type = 'video'; + $block->content = [ + "size" => "m", + "media_type" => "youtube", + "url" => $figure->html_content_src + ]; $block->save(); break; - case 'layered_image': - $block->type = 'layered_image_viewer'; - - // TODO: Instantiate the layers using fig_layer data, attaching each using fig_layer.data to get titles + layer # / order + // OSCI's layered_image with only one layer should just be an image + // TODO: Move IIP handling to a func and handle iip_asset in this `case` + case 'layered_image' && count($layers) === 1: + $block->type = 'image'; $block->content = [ "is_modal" => false, "is_zoomable" => false, @@ -77,21 +121,99 @@ private function configureFigBlock($figure, $block) "caption" => $figure->caption_html, "alt_text" => "" ]; + $block->save(); + + $imageData = Arr::first($layers); + $media = $this->mediaFactory($imageData, $figure->caption_html, $figure->fallback_url); + + // TODO: Use converted crop params + $block->medias()->attach($media->id, [ + 'locale' => 'en', + 'media_id' => $media->id, + 'metadatas' => '{"caption":null,"captionTitle": null, "altText":null,"video":null}', + 'role' => 'image', + 'crop' => 'desktop', + 'crop_x' => 0, + 'crop_y' => 0, + 'crop_w' => $imageData->width, + 'crop_h' => $imageData->height + ]); $block->save(); break; - case 'iip_asset': - $block->type = 'image'; + case 'layered_image': + $block->type = 'layered_image_viewer'; + $block->editor_name = 'default'; + $block->content = [ + "size" => "m", + "caption" => $figure->caption_html, + ]; + + $block->save(); + + foreach ($layers as $imageData) { + // Each layer (image or overview) is a child block of the layered image viewer block, so: + // - Create media record + move the asset (if not moved already) + // - Configure a layer block for this layer (image or overview) + // - Attach it to the layer viewer block + + $media = $this->mediaFactory($imageData, $figure->caption_html, $figure->fallback_url); + + $layerBlock = new Block(); + $layerBlock->blockable_id = $block->blockable_id; + $layerBlock->blockable_type = 'digitalPublicationArticles'; + $layerBlock->position = 1; // TODO: order + $layerBlock->parent_id = $block->id; + + // OSCI doesn't expose overlay vs image data so parse the URL filename + $imageUrl = isset($imageData->static_url) ? $imageData->static_url : $figure->fallback_url ; + $imageUrlPath = parse_url($imageUrl, PHP_URL_PATH); + $imageExt = pathinfo($imageUrlPath, PATHINFO_EXTENSION); + switch ($imageExt) { + case 'svg': + $layerBlock->child_key = 'layered_image_viewer_overlay'; + $layerBlock->type = 'layered_image_viewer_overlay'; + break; - // Media uploads and relations - $imagePath = isset($figure->static_url) ? $figure->static_url : $figure->fallback_url ; - $imageUuid = (string) Str::uuid(); - $imageFilename = Str::random(10) . '.jpg'; - $imageName = $imageUuid . '/' . $imageFilename; + default: + $layerBlock->child_key = 'layered_image_viewer_img'; + $layerBlock->type = 'layered_image_viewer_img'; + break; + } - Storage::disk('s3')->put($imageName, file_get_contents($imagePath)); + + $layerBlock->content = [ + "label" => $imageData->title + ]; + + $layerBlock->save(); + + // TODO: Use converted crop params + $layerBlock->medias()->attach($media->id, [ + 'locale' => 'en', + 'media_id' => $media->id, + 'metadatas' => '{"caption":null,"captionTitle": null, "altText":null,"video":null}', + 'role' => 'image', + 'crop' => 'desktop', + 'crop_x' => 0, + 'crop_y' => 0, + 'crop_w' => $imageData->width, + 'crop_h' => $imageData->height + ]); + $layerBlock->save(); + + $block->children()->save($layerBlock); + $block->save(); + } + + $block->save(); + break; + + case 'iip_asset': + // TODO: Properly handle the IIP asset (finally!) + $block->type = 'image'; $block->content = [ "is_modal" => false, "is_zoomable" => false, @@ -106,18 +228,11 @@ private function configureFigBlock($figure, $block) $block->save(); - $media = new Media([ - 'uuid' => $imageName, - 'width' => 2246, - 'height' => 1469, - 'filename' => $imageFilename, - 'locale' => 'en' - ]); + $imageData = Arr::first($layers); - $media->alt_text = 'Alt text for the image'; - $media->caption = $figure->caption_html; - $media->save(); + $media = $this->mediaFactory($imageData, $figure->caption_html, $figure->fallback_url); + // TODO: Use converted crop params $block->medias()->attach($media->id, [ 'locale' => 'en', 'media_id' => $media->id, @@ -126,8 +241,8 @@ private function configureFigBlock($figure, $block) 'crop' => 'desktop', 'crop_x' => 0, 'crop_y' => 0, - 'crop_w' => 2246, - 'crop_h' => 1469 + 'crop_w' => $imageData->width, + 'crop_h' => $imageData->height ]); $block->save(); @@ -135,7 +250,7 @@ private function configureFigBlock($figure, $block) case '360_slider': $block->type = '360_embed'; - $block->content = [ + $block->content = [ "size" => "m", "caption" => $figure->caption_html ]; @@ -147,7 +262,7 @@ private function configureFigBlock($figure, $block) case 'rti_viewer': // TODO: insert reader_url, figure # for this text + figure $block->type = 'video'; - $block->content = [ + $block->content = [ "caption" => $figure->caption_html ]; @@ -185,12 +300,13 @@ public function handle() // NB!: For each of these types in the admin UI it's impossible to validate the save without setting a date! + // Fetch this publication's title by its package name (eg, `caillebotte`) + // TODO: Handle italics / etc in the title + // TODO: Set publication date metadata + $pubs = DB::connection('osci_migration')->select("SELECT json_extract(publications.data,'$._title') as title FROM publications LEFT JOIN tocs ON tocs.package=publications.pub_id WHERE pub_id=:id", ['id' => $pubId]); $pub = Arr::first($pubs); - // TODO: Handle italics / etc in the title - // TODO: Set any other publication level metadata (date?) - $webPub = new DigitalPublication(); $webPub->title = 'Migrated ' . date('M j, Y') . ' | ' . $pub->title; $webPub->published = false; @@ -199,24 +315,50 @@ public function handle() $webPubId = $webPub->id; + // Now select all this pub's texts $texts = DB::connection('osci_migration')->select("SELECT coalesce(json_extract(data,'$._title'),'FIXME') as title,text_id FROM texts WHERE package=:pubId", ['pubId' => $pubId]); // Initialize the left value $lft = 1; - $blockQuery = "SELECT json_extract(blk.value,'$.html') AS html," . - "blk.id AS position," . - "json_extract(blk.value,'$.blockType') AS type," . - "json_extract(blk.value,'$.figure_type') AS figure_type," . - "json_extract(blk.value,'$.static_url') AS static_url," . - "json_extract(blk.value,'$.fallback_url') AS fallback_url," . - "json_extract(blk.value,'$.html_content') AS html_content," . - "json_extract(blk.value,'$.html_content_src') AS html_content_src," . - "coalesce(json_extract(blk.value,'$.caption_html'),'') AS caption_html " . - "FROM texts," . - "json_each(texts.data,'$.sections') AS sects," . - "json_each(sects.value,'$.blocks') AS blk " . - "WHERE texts.text_id=:textId"; + // Fetch sections and blocks by text ID (joined to their figure assets) + // NB: `layers_data` is a JSON array of layer asset objects + + // TODO: Add `toc_position`, `toc_parent` via json_tree against toc data + $blockQuery = <<_lft = $lft++; $webArticle->_rgt = $lft++; - // TODO: Join toc position via json_tree against toc data $webArticle->position = 0; $webArticle->save(); From 90fae346ddd544e78ce5455a4b473cc72384e178 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Fri, 12 Jul 2024 12:53:48 -0400 Subject: [PATCH 019/346] Clean up uploaded media filenames, media w/h from bytes not data --- .../Commands/MigrateOSCIPublicationOne.php | 49 ++++++++++++------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index edb7e2c107..03494b30cd 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -13,6 +13,7 @@ use App\Models\Vendor\Block; use A17\Twill\Models\Media; + class MigrateOSCIPublicationOne extends Command { /** @@ -29,19 +30,34 @@ class MigrateOSCIPublicationOne extends Command */ protected $description = 'Migrate an OSCI publication from a migration file to a website DigitalPublication'; + /** + * mediaFactory + * + * Fetches asset for this figure layer and registers it as Media, + * applying caption and using OSCI's fallback URL + * + * @param imageData - JSON of image data for this layer + * @param caption_html - HTML of caption data + * @param fallback_url - Fallback image to use for this layer + * + */ private function mediaFactory($imageData, $caption_html, $fallback_url) { - // Media uploads and relations $imageUrl = isset($imageData->static_url) ? $imageData->static_url : $fallback_url ; + // TODO: Load JPEG-converted PTIFF URL from this from db's `assets` table + // TODO: Load 360-zip URL from this from db's `assets` table + + // Construct the UUID for this asset and preserve filename info $imageUuid = (string) Str::uuid(); $imageUrlPath = parse_url($imageUrl, PHP_URL_PATH); - $imageExt = pathinfo($imageUrlPath, PATHINFO_EXTENSION); - $imageFilename = Str::random(10) . $imageExt; + $imageFilename = pathinfo($imageUrlPath, PATHINFO_FILENAME); + $imageFilename = Str::random(10) . '-' . sanitizeFilename($imageFilename); $imageName = $imageUuid . '/' . $imageFilename; + // TODO: Catch error and retry-while $ctx = stream_context_create(array( 'http' => array( @@ -49,14 +65,14 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) ) )); $imageContent = file_get_contents($imageUrl, false, $ctx); + [$width, $height] = getimagesizefromstring($imageContent); Storage::disk('s3')->put($imageName, $imageContent); - // TODO: Use the CMS's onboard h/w helpers $media = new Media([ 'uuid' => $imageName, - 'width' => $imageData->width, - 'height' => $imageData->height, + 'width' => $width, + 'height' => $height, 'filename' => $imageFilename, 'locale' => 'en' ]); @@ -76,7 +92,6 @@ private function configureFigBlock($figure, $block) $layers = isset($figure->layers_data) ? json_decode($figure->layers_data) : []; - // TODO: if html_figure and html_content_src, that's a video block bby switch (true) { // Non-video embeds (HTML, mostly) become media_embed case $figure->figure_type === 'html_figure' && !isset($figure->html_content_src): @@ -107,7 +122,6 @@ private function configureFigBlock($figure, $block) break; // OSCI's layered_image with only one layer should just be an image - // TODO: Move IIP handling to a func and handle iip_asset in this `case` case 'layered_image' && count($layers) === 1: $block->type = 'image'; $block->content = [ @@ -135,8 +149,8 @@ private function configureFigBlock($figure, $block) 'crop' => 'desktop', 'crop_x' => 0, 'crop_y' => 0, - 'crop_w' => $imageData->width, - 'crop_h' => $imageData->height + 'crop_w' => $media->width, + 'crop_h' => $media->height ]); $block->save(); @@ -163,9 +177,11 @@ private function configureFigBlock($figure, $block) $layerBlock = new Block(); $layerBlock->blockable_id = $block->blockable_id; $layerBlock->blockable_type = 'digitalPublicationArticles'; - $layerBlock->position = 1; // TODO: order + $layerBlock->position = 1; $layerBlock->parent_id = $block->id; + // TODO: Use $figure->$options->baseLayerPreset and $figure->$options->annotationPreset to determine the order and kind of this layer + // OSCI doesn't expose overlay vs image data so parse the URL filename $imageUrl = isset($imageData->static_url) ? $imageData->static_url : $figure->fallback_url ; $imageUrlPath = parse_url($imageUrl, PHP_URL_PATH); @@ -199,8 +215,8 @@ private function configureFigBlock($figure, $block) 'crop' => 'desktop', 'crop_x' => 0, 'crop_y' => 0, - 'crop_w' => $imageData->width, - 'crop_h' => $imageData->height + 'crop_w' => $media->width, + 'crop_h' => $media->height ]); $layerBlock->save(); @@ -212,7 +228,6 @@ private function configureFigBlock($figure, $block) break; case 'iip_asset': - // TODO: Properly handle the IIP asset (finally!) $block->type = 'image'; $block->content = [ "is_modal" => false, @@ -241,8 +256,8 @@ private function configureFigBlock($figure, $block) 'crop' => 'desktop', 'crop_x' => 0, 'crop_y' => 0, - 'crop_w' => $imageData->width, - 'crop_h' => $imageData->height + 'crop_w' => $media->width, + 'crop_h' => $media->height ]); $block->save(); @@ -255,7 +270,7 @@ private function configureFigBlock($figure, $block) "caption" => $figure->caption_html ]; - // TODO: Attach media + // TODO: use this->mediaFactory to fetch + attach 360 zip $block->save(); break; From 063d6aba533617def1971062e2cb46d2ce6f24e3 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Fri, 12 Jul 2024 13:05:43 -0500 Subject: [PATCH 020/346] Change block sizes to 'small' --- .../Commands/MigrateOSCIPublicationOne.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 03494b30cd..4bf86fa958 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -32,14 +32,14 @@ class MigrateOSCIPublicationOne extends Command /** * mediaFactory - * - * Fetches asset for this figure layer and registers it as Media, + * + * Fetches asset for this figure layer and registers it as Media, * applying caption and using OSCI's fallback URL - * + * * @param imageData - JSON of image data for this layer * @param caption_html - HTML of caption data * @param fallback_url - Fallback image to use for this layer - * + * */ private function mediaFactory($imageData, $caption_html, $fallback_url) { @@ -97,7 +97,7 @@ private function configureFigBlock($figure, $block) case $figure->figure_type === 'html_figure' && !isset($figure->html_content_src): $block->type = 'media_embed'; $block->content = [ - "size" => "m", + "size" => "s", "embed_type" => "html", "embed_code" => $figure->html_content, "embed_height" => "400px", @@ -113,7 +113,7 @@ private function configureFigBlock($figure, $block) $block->type = 'video'; $block->content = [ - "size" => "m", + "size" => "s", "media_type" => "youtube", "url" => $figure->html_content_src ]; @@ -127,7 +127,7 @@ private function configureFigBlock($figure, $block) $block->content = [ "is_modal" => false, "is_zoomable" => false, - "size" => "m", + "size" => "s", "use_contain" => true, "use_alt_background" => true, "image_link" => null, @@ -160,7 +160,7 @@ private function configureFigBlock($figure, $block) $block->type = 'layered_image_viewer'; $block->editor_name = 'default'; $block->content = [ - "size" => "m", + "size" => "s", "caption" => $figure->caption_html, ]; @@ -232,7 +232,7 @@ private function configureFigBlock($figure, $block) $block->content = [ "is_modal" => false, "is_zoomable" => false, - "size" => "m", + "size" => "s", "use_contain" => true, "use_alt_background" => true, "image_link" => null, @@ -266,7 +266,7 @@ private function configureFigBlock($figure, $block) case '360_slider': $block->type = '360_embed'; $block->content = [ - "size" => "m", + "size" => "s", "caption" => $figure->caption_html ]; From 53db52207825ecf48deb729460c8bc0410c2d137 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Fri, 12 Jul 2024 14:30:51 -0400 Subject: [PATCH 021/346] Clean up linting, switch and order fig layer annotations on fig options --- .../Commands/MigrateOSCIPublicationOne.php | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 4bf86fa958..697b23750a 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -13,7 +13,6 @@ use App\Models\Vendor\Block; use A17\Twill\Models\Media; - class MigrateOSCIPublicationOne extends Command { /** @@ -90,7 +89,7 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) private function configureFigBlock($figure, $block) { - $layers = isset($figure->layers_data) ? json_decode($figure->layers_data) : []; + $layers = isset($figure->layers_data) ? json_decode($figure->layers_data, true) : []; switch (true) { // Non-video embeds (HTML, mostly) become media_embed @@ -166,42 +165,43 @@ private function configureFigBlock($figure, $block) $block->save(); + $figure_opts = json_decode($figure->figure_opts, true); + + $imageLayerIds = $figure_opts->baseLayerPreset ?? []; + $overlayLayerIds = $figure_opts->annotationPreset ?? []; + foreach ($layers as $imageData) { // Each layer (image or overview) is a child block of the layered image viewer block, so: // - Create media record + move the asset (if not moved already) // - Configure a layer block for this layer (image or overview) // - Attach it to the layer viewer block + $layer_id = $imageData; + $media = $this->mediaFactory($imageData, $figure->caption_html, $figure->fallback_url); $layerBlock = new Block(); $layerBlock->blockable_id = $block->blockable_id; $layerBlock->blockable_type = 'digitalPublicationArticles'; - $layerBlock->position = 1; $layerBlock->parent_id = $block->id; - // TODO: Use $figure->$options->baseLayerPreset and $figure->$options->annotationPreset to determine the order and kind of this layer - - // OSCI doesn't expose overlay vs image data so parse the URL filename - $imageUrl = isset($imageData->static_url) ? $imageData->static_url : $figure->fallback_url ; - $imageUrlPath = parse_url($imageUrl, PHP_URL_PATH); - $imageExt = pathinfo($imageUrlPath, PATHINFO_EXTENSION); - - switch ($imageExt) { - case 'svg': - $layerBlock->child_key = 'layered_image_viewer_overlay'; - $layerBlock->type = 'layered_image_viewer_overlay'; - break; - - default: - $layerBlock->child_key = 'layered_image_viewer_img'; - $layerBlock->type = 'layered_image_viewer_img'; - break; + // Configure this as an image or overlay and set position + if (in_array($imageData['layer_id'], $imageLayerIds)) { + $layerBlock->position = array_search($imageData['layer_id'], $imageLayerIds) + 1; + $layerBlock->child_key = 'layered_image_viewer_img'; + $layerBlock->type = 'layered_image_viewer_img'; + } else if (in_array($imageData['layer_id'], $overlayLayerIds)) { + $layerBlock->position = array_search($imageData['layer_id'], $overlayLayerIds) + 1; + $layerBlock->child_key = 'layered_image_viewer_overlay'; + $layerBlock->type = 'layered_image_viewer_overlay'; + } else { + $layerBlock->position = 1; + $layerBlock->child_key = 'layered_image_viewer_img'; + $layerBlock->type = 'layered_image_viewer_img'; } - $layerBlock->content = [ - "label" => $imageData->title + "label" => $imageData['title'] ]; $layerBlock->save(); @@ -316,7 +316,7 @@ public function handle() // NB!: For each of these types in the admin UI it's impossible to validate the save without setting a date! // Fetch this publication's title by its package name (eg, `caillebotte`) - // TODO: Handle italics / etc in the title + // TODO: webPub->header_title_display = italicized OSCI title // TODO: Set publication date metadata $pubs = DB::connection('osci_migration')->select("SELECT json_extract(publications.data,'$._title') as title FROM publications LEFT JOIN tocs ON tocs.package=publications.pub_id WHERE pub_id=:id", ['id' => $pubId]); @@ -341,8 +341,9 @@ public function handle() // TODO: Add `toc_position`, `toc_parent` via json_tree against toc data $blockQuery = << Date: Wed, 17 Jul 2024 18:49:43 -0500 Subject: [PATCH 022/346] Use first image block's image as the hero image on a migrated article [PUB-217] For the purpose of setting a default image for articles in listings on our website, we'll use the first available image in an image block and set it as the article's hero image. --- .../Commands/MigrateOSCIPublicationOne.php | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 697b23750a..af0756a953 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -397,6 +397,9 @@ public function handle() $order = 0; + $heroMedia = false; + $heroMediaArray = []; + foreach ($blocks as $blk) { $block = new Block(); $block->blockable_id = $webArticle->id; @@ -406,12 +409,34 @@ public function handle() $this->configureBlock($blk, $block); + // If this is the first image block, save the image to add as the article hero image later + if ($block->type == 'image' && !$heroMedia) { + $heroMedia = $block->medias->first(); + if ($heroMedia) { + $heroMediaArray['locale'] = 'en'; + $heroMediaArray['role'] = 'hero'; + $heroMediaArray['media_id'] = $heroMedia->pivot->media_id; + $heroMediaArray['metadatas'] = $heroMedia->pivot->metadatas; + $heroMediaArray['crop'] = 'default'; + $heroMediaArray['crop_x'] = $heroMedia->pivot->crop_x; + $heroMediaArray['crop_y'] = $heroMedia->pivot->crop_y; + $heroMediaArray['crop_w'] = $heroMedia->pivot->crop_w; + $heroMediaArray['crop_h'] = $heroMedia->pivot->crop_h; + } + } $webArticle->blocks()->save($block); $order += 1; } $webArticle->save(); + + // If we grabbed an image to use for the hero, save it + if ($heroMedia) { + $webArticle->medias()->attach($heroMedia->id, $heroMediaArray); + $webArticle->save(); + } + $webPub->articles()->save($webArticle); } From 7bfad86bb0e38424711ecb07dcf191c36f2c8eeb Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Fri, 19 Jul 2024 09:32:11 -0400 Subject: [PATCH 023/346] Refine iip, svg overlay, layers handling, image url syntaxes --- .../Commands/MigrateOSCIPublicationOne.php | 60 ++++++++++++++----- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index af0756a953..71709ab16f 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -42,8 +42,25 @@ class MigrateOSCIPublicationOne extends Command */ private function mediaFactory($imageData, $caption_html, $fallback_url) { - // Media uploads and relations - $imageUrl = isset($imageData->static_url) ? $imageData->static_url : $fallback_url ; + $imageUrl; + switch ($imageData["type"]) { + case "iip": + $imageUrl = $imageData["image_url_stem"] . '?fif=' . $imageData["image_ident"] . '&cvt=jpeg' ; + break; + + case "image": + $imageUrl = $imageData["static_url"]; + break; + + case "svg": + $imageUrl = $imageData["svg_path"]; + break; + + default: + $imageUrl = $fallback_url; + break; + + } // TODO: Load JPEG-converted PTIFF URL from this from db's `assets` table // TODO: Load 360-zip URL from this from db's `assets` table @@ -63,8 +80,24 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) 'timeout' => 120, ) )); - $imageContent = file_get_contents($imageUrl, false, $ctx); - [$width, $height] = getimagesizefromstring($imageContent); + + // FIXME: Wrap this try/catch in a while loop and retry N times if it's connex refused or timeout + // $fetched = false; + // $retries = 0; + + try { + $imageContent = file_get_contents($imageUrl, false, $ctx); + } catch (Exception $e) { + var_dump($e); + exit(1); + } + + if ($imageData['type'] == 'svg') { + $width = $imageData['width']; + $height = $imageData['height']; + } else { + [$width, $height] = getimagesizefromstring($imageContent); + } Storage::disk('s3')->put($imageName, $imageContent); @@ -167,11 +200,11 @@ private function configureFigBlock($figure, $block) $figure_opts = json_decode($figure->figure_opts, true); - $imageLayerIds = $figure_opts->baseLayerPreset ?? []; - $overlayLayerIds = $figure_opts->annotationPreset ?? []; + $imageLayerIds = $figure_opts['baseLayerPreset'] ?? []; + $overlayLayerIds = $figure_opts['annotationPreset'] ?? []; foreach ($layers as $imageData) { - // Each layer (image or overview) is a child block of the layered image viewer block, so: + // Each layer (image or overlay) is a child block of the layered image viewer block, so: // - Create media record + move the asset (if not moved already) // - Configure a layer block for this layer (image or overview) // - Attach it to the layer viewer block @@ -186,20 +219,16 @@ private function configureFigBlock($figure, $block) $layerBlock->parent_id = $block->id; // Configure this as an image or overlay and set position - if (in_array($imageData['layer_id'], $imageLayerIds)) { - $layerBlock->position = array_search($imageData['layer_id'], $imageLayerIds) + 1; - $layerBlock->child_key = 'layered_image_viewer_img'; - $layerBlock->type = 'layered_image_viewer_img'; - } else if (in_array($imageData['layer_id'], $overlayLayerIds)) { - $layerBlock->position = array_search($imageData['layer_id'], $overlayLayerIds) + 1; + if($imageData['type'] == 'svg') { $layerBlock->child_key = 'layered_image_viewer_overlay'; $layerBlock->type = 'layered_image_viewer_overlay'; } else { - $layerBlock->position = 1; $layerBlock->child_key = 'layered_image_viewer_img'; $layerBlock->type = 'layered_image_viewer_img'; } + $layerBlock->position = $imageData['layer_num']; + $layerBlock->content = [ "label" => $imageData['title'] ]; @@ -346,8 +375,11 @@ public function handle() coalesce(json_extract(figure_layers.data,'$.options'),'{}') AS figure_opts, json_group_array( json_object( + 'type',json_extract(layers.value,'$._type'), 'layer_id',json_extract(layers.value,'$._layer_id'), + 'layer_num',json_extract(layers.value,'$._layer_num'), 'static_url',json_extract(layers.value,'$._static_url'), + 'svg_path',json_extract(layers.value,'$._svg_path'), 'image_ident',json_extract(layers.value,'$._image_ident'), 'image_url_stem',json_extract(layers.value,'$._image_url_stem'), 'title',coalesce(json_extract(layers.value,'$._title'),''), From ae1070a9fb0ff2a7de47d73c7da3782b7a297cd7 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Fri, 19 Jul 2024 10:21:58 -0400 Subject: [PATCH 024/346] Fix lint errs --- app/Console/Commands/MigrateOSCIPublicationOne.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 71709ab16f..4527c0c433 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -59,7 +59,6 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) default: $imageUrl = $fallback_url; break; - } // TODO: Load JPEG-converted PTIFF URL from this from db's `assets` table @@ -87,7 +86,7 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) try { $imageContent = file_get_contents($imageUrl, false, $ctx); - } catch (Exception $e) { + } catch (ErrorException $e) { var_dump($e); exit(1); } @@ -96,7 +95,7 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) $width = $imageData['width']; $height = $imageData['height']; } else { - [$width, $height] = getimagesizefromstring($imageContent); + [$width, $height] = getimagesizefromstring($imageContent); } Storage::disk('s3')->put($imageName, $imageContent); @@ -219,7 +218,7 @@ private function configureFigBlock($figure, $block) $layerBlock->parent_id = $block->id; // Configure this as an image or overlay and set position - if($imageData['type'] == 'svg') { + if ($imageData['type'] == 'svg') { $layerBlock->child_key = 'layered_image_viewer_overlay'; $layerBlock->type = 'layered_image_viewer_overlay'; } else { From a5f1e5f9382a54f35ef6256e20727c8f2c17486b Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Fri, 19 Jul 2024 13:16:57 -0400 Subject: [PATCH 025/346] Soft-remove IIP protocol handling --- app/Console/Commands/MigrateOSCIPublicationOne.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 4527c0c433..f75cca1411 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -44,9 +44,10 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) { $imageUrl; switch ($imageData["type"]) { - case "iip": - $imageUrl = $imageData["image_url_stem"] . '?fif=' . $imageData["image_ident"] . '&cvt=jpeg' ; - break; + // TODO: Use s3 URLs instead + // case "iip": + // $imageUrl = $imageData["image_url_stem"] . '?fif=' . $imageData["image_ident"] . '&cvt=jpeg' ; + // break; case "image": $imageUrl = $imageData["static_url"]; From 58e018230d402381e42089899eddc0c38a956673 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Fri, 19 Jul 2024 14:30:35 -0400 Subject: [PATCH 026/346] Round svg image h/w, media retry / fail on errors --- .../Commands/MigrateOSCIPublicationOne.php | 79 +++++++++++-------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index f75cca1411..3cecbf664c 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -73,28 +73,30 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) $imageName = $imageUuid . '/' . $imageFilename; - // TODO: Catch error and retry-while - $ctx = stream_context_create(array( - 'http' => - array( - 'timeout' => 120, - ) - )); - - // FIXME: Wrap this try/catch in a while loop and retry N times if it's connex refused or timeout - // $fetched = false; - // $retries = 0; - - try { - $imageContent = file_get_contents($imageUrl, false, $ctx); - } catch (ErrorException $e) { - var_dump($e); - exit(1); + $http_ctx = stream_context_create(array( + 'http' => [ + 'timeout' => 120, + 'ignore_errors' => true, + ] + )); + + $imageContent = false; + $retries = 0; + + while (!$imageContent && $retries < 5) { + $imageContent = file_get_contents($imageUrl, false, $http_ctx); + $retries++; + usleep(20); + } + + if (!$imageContent) { + echo "Error could not fetch {$imageUrl} after {$retries} attempts! This media won't be migrated"; + return null; } if ($imageData['type'] == 'svg') { - $width = $imageData['width']; - $height = $imageData['height']; + $width = ceil($imageData['width']); + $height = ceil($imageData['height']); } else { [$width, $height] = getimagesizefromstring($imageContent); } @@ -170,7 +172,11 @@ private function configureFigBlock($figure, $block) $block->save(); $imageData = Arr::first($layers); + $media = $this->mediaFactory($imageData, $figure->caption_html, $figure->fallback_url); + if ($media === null) { + break; + } // TODO: Use converted crop params $block->medias()->attach($media->id, [ @@ -211,14 +217,13 @@ private function configureFigBlock($figure, $block) $layer_id = $imageData; - $media = $this->mediaFactory($imageData, $figure->caption_html, $figure->fallback_url); - $layerBlock = new Block(); $layerBlock->blockable_id = $block->blockable_id; $layerBlock->blockable_type = 'digitalPublicationArticles'; $layerBlock->parent_id = $block->id; // Configure this as an image or overlay and set position + // TODO: Check the extension as PNGs appear to be overlays as well if ($imageData['type'] == 'svg') { $layerBlock->child_key = 'layered_image_viewer_overlay'; $layerBlock->type = 'layered_image_viewer_overlay'; @@ -235,19 +240,22 @@ private function configureFigBlock($figure, $block) $layerBlock->save(); - // TODO: Use converted crop params - $layerBlock->medias()->attach($media->id, [ - 'locale' => 'en', - 'media_id' => $media->id, - 'metadatas' => '{"caption":null,"captionTitle": null, "altText":null,"video":null}', - 'role' => 'image', - 'crop' => 'desktop', - 'crop_x' => 0, - 'crop_y' => 0, - 'crop_w' => $media->width, - 'crop_h' => $media->height - ]); - $layerBlock->save(); + $media = $this->mediaFactory($imageData, $figure->caption_html, $figure->fallback_url); + if ($media !== null) { + // TODO: Use converted crop params + $layerBlock->medias()->attach($media->id, [ + 'locale' => 'en', + 'media_id' => $media->id, + 'metadatas' => '{"caption":null,"captionTitle": null, "altText":null,"video":null}', + 'role' => 'image', + 'crop' => 'desktop', + 'crop_x' => 0, + 'crop_y' => 0, + 'crop_w' => $media->width, + 'crop_h' => $media->height + ]); + $layerBlock->save(); + } $block->children()->save($layerBlock); $block->save(); @@ -275,6 +283,9 @@ private function configureFigBlock($figure, $block) $imageData = Arr::first($layers); $media = $this->mediaFactory($imageData, $figure->caption_html, $figure->fallback_url); + if ($media === null) { + break; + } // TODO: Use converted crop params $block->medias()->attach($media->id, [ From 0f6b9573c330f2a53d9e334ddd2f84e8b1ba50ec Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Wed, 24 Jul 2024 15:01:53 -0400 Subject: [PATCH 027/346] Add `migrate:osci-media` for iip assets, use assets in digipubarticles --- .../Commands/MigrateOSCIPublicationMedia.php | 98 +++++++++++++++++++ .../Commands/MigrateOSCIPublicationOne.php | 28 ++++-- config/aic.php | 4 + config/filesystems.php | 10 ++ 4 files changed, 130 insertions(+), 10 deletions(-) create mode 100644 app/Console/Commands/MigrateOSCIPublicationMedia.php diff --git a/app/Console/Commands/MigrateOSCIPublicationMedia.php b/app/Console/Commands/MigrateOSCIPublicationMedia.php new file mode 100644 index 0000000000..532c0acc3c --- /dev/null +++ b/app/Console/Commands/MigrateOSCIPublicationMedia.php @@ -0,0 +1,98 @@ +argument('id'); + + # TODO: Query 360s too + $assetsQuery = <<select($assetsQuery, ['pubId' => $pubId]); + + foreach ($assets as $asset) { + // TODO: Check the asset type and handle 360 spins differently + $key = trim($asset->image_ident, '/'); + $asset_key = preg_replace('/^\/?osci\//', '', $asset->image_ident); + $jpg_key = preg_replace('/\.ptif$/', '.jpg', $key); + + if (!Storage::disk('osci_s3')->fileExists($asset_key)) { + echo "OSCI_S3_BUCKET did not contain {$asset_key}!\n"; + continue; + } + + if (Storage::disk('osci_s3')->fileExists($jpg_key)) { + echo "OSCI_S3_BUCKET already contains {$jpg_key}, skipping this asset\n"; + continue; + } + + echo "Compressing {$asset_key}\n"; + + $content = Storage::disk('osci_s3')->get($asset_key); + + $image = new Imagick(); + $image->readImageBlob($content); + + // Iterate zoom layers to find a 10k-pixels-a-side page geometry + while ($image->hasPreviousImage()) { + $size = $image->getImagePage(); + + if ($size['height'] > 10000 && $size['width'] > 10000) { + $image->nextImage(); + break; + } + $image->previousImage(); + } + + $image->setImageFormat('jpeg'); + $compressed = $image->getImageBlob(); + + $res = Storage::disk('osci_s3')->put($jpg_key, $compressed); + + if (!$res) { + echo "There was an error uploading the compressed file to {$jpg_key}\n"; + continue; + } + + echo "Uploaded {$jpg_key}\n"; + } + } +} diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 3cecbf664c..4fb93eefd3 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -43,11 +43,20 @@ class MigrateOSCIPublicationOne extends Command private function mediaFactory($imageData, $caption_html, $fallback_url) { $imageUrl; + $imageContent = false; + switch ($imageData["type"]) { - // TODO: Use s3 URLs instead - // case "iip": - // $imageUrl = $imageData["image_url_stem"] . '?fif=' . $imageData["image_ident"] . '&cvt=jpeg' ; - // break; + case "iip": + $img_ident = trim($imageData["image_ident"], '/'); + $img_key = preg_replace('/\.ptif$/', '.jpg', $img_ident); + + $imageUrl = 's3://osci-web-images.artic.edu/{$img_key}'; + + if (Storage::disk('osci_s3')->fileExists($img_key)) { + $imageContent = Storage::disk('osci_s3')->get($img_key); + } + + break; case "image": $imageUrl = $imageData["static_url"]; @@ -62,8 +71,7 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) break; } - // TODO: Load JPEG-converted PTIFF URL from this from db's `assets` table - // TODO: Load 360-zip URL from this from db's `assets` table + // TODO: Load 360-zip URL from this from disk('osci_s3') // Construct the UUID for this asset and preserve filename info $imageUuid = (string) Str::uuid(); @@ -80,9 +88,7 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) ] )); - $imageContent = false; $retries = 0; - while (!$imageContent && $retries < 5) { $imageContent = file_get_contents($imageUrl, false, $http_ctx); $retries++; @@ -95,6 +101,8 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) } if ($imageData['type'] == 'svg') { + // TODO: Apply converted PNGs from S3? + // Manually apply h/w for SVGs $width = ceil($imageData['width']); $height = ceil($imageData['height']); } else { @@ -394,8 +402,8 @@ public function handle() 'image_ident',json_extract(layers.value,'$._image_ident'), 'image_url_stem',json_extract(layers.value,'$._image_url_stem'), 'title',coalesce(json_extract(layers.value,'$._title'),''), - 'height', json_extract(layers.value,'$._height'), - 'width', json_extract(layers.value,'$._width') + 'height', coalesce(json_extract(layers.value,'$._height'),100), + 'width', coalesce(json_extract(layers.value,'$._width'),100) ) ) AS layers_data FROM figure_layers, diff --git a/config/aic.php b/config/aic.php index c0ad735e7b..5ef63b13a8 100644 --- a/config/aic.php +++ b/config/aic.php @@ -19,6 +19,10 @@ 'pdf_s3_endpoint' => env('PDF_S3_ENDPOINT'), 'pdf_debug' => (bool) env('PDF_DEBUG', false), + 'osci_s3_bucket' => env('OSCI_S3_BUCKET'), + 'osci_s3_endpoint' => env('OSCI_S3_ENDPOINT'), + 'osci_s3_regiont' => env('OSCI_S3_REGION'), + 'disable_extra_scripts' => (bool) env('DISABLE_EXTRA_SCRIPTS', false), 'hide_from_tours' => env('HIDE_FROM_TOURS'), diff --git a/config/filesystems.php b/config/filesystems.php index 46dccf3fd4..fa2ad2573c 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -74,6 +74,16 @@ 'endpoint' => env('PDF_S3_ENDPOINT'), 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), ], + + 'osci_s3' => [ + 'driver' => 's3', + 'key' => env('S3_KEY'), + 'secret' => env('S3_SECRET'), + 'region' => env('OSCI_S3_REGION', env('S3_REGION')), + 'bucket' => env('OSCI_S3_BUCKET'), + 'endpoint' => env('OSCI_S3_ENDPOINT'), + 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), + ], ], /* From 49b667f5f374c5c32c59b6c108711eed17f4bd80 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Wed, 24 Jul 2024 15:56:17 -0400 Subject: [PATCH 028/346] Use config value for s3 urls --- app/Console/Commands/MigrateOSCIPublicationOne.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 4fb93eefd3..0bad7cb49d 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -48,9 +48,10 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) switch ($imageData["type"]) { case "iip": $img_ident = trim($imageData["image_ident"], '/'); - $img_key = preg_replace('/\.ptif$/', '.jpg', $img_ident); - $imageUrl = 's3://osci-web-images.artic.edu/{$img_key}'; + $bucket = config('aic.osci_s3_bucket'); + $img_key = preg_replace('/\.ptif$/', '.jpg', $img_ident); + $imageUrl = "s3://{$bucket}/{$img_key}"; if (Storage::disk('osci_s3')->fileExists($img_key)) { $imageContent = Storage::disk('osci_s3')->get($img_key); From 29da061fa820ec06b92a115445ba6cb73010ff04 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Wed, 24 Jul 2024 17:09:25 -0400 Subject: [PATCH 029/346] Break up figure block configuration info config functions --- .../Commands/MigrateOSCIPublicationOne.php | 387 +++++++++--------- 1 file changed, 197 insertions(+), 190 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 0bad7cb49d..e02ebc7d01 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -48,15 +48,17 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) switch ($imageData["type"]) { case "iip": $img_ident = trim($imageData["image_ident"], '/'); + $img_key = preg_replace('/\.ptif$/', '.jpg', $img_ident); $bucket = config('aic.osci_s3_bucket'); - $img_key = preg_replace('/\.ptif$/', '.jpg', $img_ident); $imageUrl = "s3://{$bucket}/{$img_key}"; - if (Storage::disk('osci_s3')->fileExists($img_key)) { - $imageContent = Storage::disk('osci_s3')->get($img_key); + if (!Storage::disk('osci_s3')->fileExists($img_key)) { + echo "Error -- could not fetch {$imageUrl}. Has `migrate:osci-media` been run for this publication? Skipping this media\n"; + return null; } + $imageContent = Storage::disk('osci_s3')->get($img_key); break; case "image": @@ -91,7 +93,13 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) $retries = 0; while (!$imageContent && $retries < 5) { - $imageContent = file_get_contents($imageUrl, false, $http_ctx); + try { + $imageContent = file_get_contents($imageUrl, false, $http_ctx); + } catch (ErrorException $e) { + echo "Caught error {$e} fetching {$imageUrl}, retrying.\n"; + pass; + } + $retries++; usleep(20); } @@ -125,205 +133,201 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) $media->save(); return $media; - } - /** - * configure $block (a Block model) with $data - * - */ - private function configureFigBlock($figure, $block) - { - - $layers = isset($figure->layers_data) ? json_decode($figure->layers_data, true) : []; - - switch (true) { - // Non-video embeds (HTML, mostly) become media_embed - case $figure->figure_type === 'html_figure' && !isset($figure->html_content_src): - $block->type = 'media_embed'; - $block->content = [ - "size" => "s", - "embed_type" => "html", - "embed_code" => $figure->html_content, - "embed_height" => "400px", - "disable_placeholder" => true, - "caption" => $figure->caption_html - ]; - $block->save(); - - break; - - // HTML embeds with a src are videos - case $figure->figure_type === 'html_figure' && isset($figure->html_content_src): - $block->type = 'video'; - - $block->content = [ - "size" => "s", - "media_type" => "youtube", - "url" => $figure->html_content_src - ]; - $block->save(); - - break; - - // OSCI's layered_image with only one layer should just be an image - case 'layered_image' && count($layers) === 1: - $block->type = 'image'; - $block->content = [ - "is_modal" => false, - "is_zoomable" => false, - "size" => "s", - "use_contain" => true, - "use_alt_background" => true, - "image_link" => null, - "hide_figure_number" => false, - "caption" => $figure->caption_html, - "alt_text" => "" - ]; - $block->save(); - - $imageData = Arr::first($layers); - - $media = $this->mediaFactory($imageData, $figure->caption_html, $figure->fallback_url); - if ($media === null) { - break; - } - - // TODO: Use converted crop params - $block->medias()->attach($media->id, [ - 'locale' => 'en', - 'media_id' => $media->id, - 'metadatas' => '{"caption":null,"captionTitle": null, "altText":null,"video":null}', - 'role' => 'image', - 'crop' => 'desktop', - 'crop_x' => 0, - 'crop_y' => 0, - 'crop_w' => $media->width, - 'crop_h' => $media->height - ]); - - $block->save(); - break; - - case 'layered_image': - $block->type = 'layered_image_viewer'; - $block->editor_name = 'default'; - $block->content = [ - "size" => "s", - "caption" => $figure->caption_html, - ]; - - $block->save(); + } - $figure_opts = json_decode($figure->figure_opts, true); - - $imageLayerIds = $figure_opts['baseLayerPreset'] ?? []; - $overlayLayerIds = $figure_opts['annotationPreset'] ?? []; - - foreach ($layers as $imageData) { - // Each layer (image or overlay) is a child block of the layered image viewer block, so: - // - Create media record + move the asset (if not moved already) - // - Configure a layer block for this layer (image or overview) - // - Attach it to the layer viewer block + private function configureImageFigure($block, $data, $layers) + { + $block->type = 'image'; + $block->content = [ + "is_modal" => false, + "is_zoomable" => false, + "size" => "s", + "use_contain" => true, + "use_alt_background" => true, + "image_link" => null, + "hide_figure_number" => false, + "caption" => $data->caption_html, + "alt_text" => "" + ]; + + $block->save(); + + $imageData = Arr::first($layers); + $media = $this->mediaFactory($imageData, $data->caption_html, $data->fallback_url); + + if ($media === null) { + return; + } - $layer_id = $imageData; + // TODO: Use converted crop params + $block->medias()->attach($media->id, [ + 'locale' => 'en', + 'media_id' => $media->id, + 'metadatas' => '{"caption":null,"captionTitle": null, "altText":null,"video":null}', + 'role' => 'image', + 'crop' => 'desktop', + 'crop_x' => 0, + 'crop_y' => 0, + 'crop_w' => $media->width, + 'crop_h' => $media->height + ]); + + $block->save(); + } - $layerBlock = new Block(); - $layerBlock->blockable_id = $block->blockable_id; - $layerBlock->blockable_type = 'digitalPublicationArticles'; - $layerBlock->parent_id = $block->id; + private function configureVideoFigure($block, $data) + { + $block->type = 'video'; + $block->content = [ + "size" => "s", + "media_type" => "youtube", + "url" => $data->html_content_src + ]; + + $block->save(); + } - // Configure this as an image or overlay and set position - // TODO: Check the extension as PNGs appear to be overlays as well - if ($imageData['type'] == 'svg') { - $layerBlock->child_key = 'layered_image_viewer_overlay'; - $layerBlock->type = 'layered_image_viewer_overlay'; - } else { - $layerBlock->child_key = 'layered_image_viewer_img'; - $layerBlock->type = 'layered_image_viewer_img'; - } + private function configureHTMLFigure($block, $data) + { + $block->type = 'media_embed'; + $block->content = [ + "size" => "s", + "embed_type" => "html", + "embed_code" => $data->html_content, + "embed_height" => "400px", + "disable_placeholder" => true, + "caption" => $data->caption_html + ]; + + $block->save(); + } - $layerBlock->position = $imageData['layer_num']; - - $layerBlock->content = [ - "label" => $imageData['title'] - ]; - - $layerBlock->save(); - - $media = $this->mediaFactory($imageData, $figure->caption_html, $figure->fallback_url); - if ($media !== null) { - // TODO: Use converted crop params - $layerBlock->medias()->attach($media->id, [ - 'locale' => 'en', - 'media_id' => $media->id, - 'metadatas' => '{"caption":null,"captionTitle": null, "altText":null,"video":null}', - 'role' => 'image', - 'crop' => 'desktop', - 'crop_x' => 0, - 'crop_y' => 0, - 'crop_w' => $media->width, - 'crop_h' => $media->height - ]); - $layerBlock->save(); - } + // Attaches a new image layer based on `data` + private function createAttachImageLayer($block, $figure_data, $layer_data) + { + // Each layer (image or overlay) is a child block of the layered image viewer block, so: + // - Create media record + move the asset (if not moved already) + // - Configure a layer block for this layer (image or overview) + // - Attach it to the layer viewer block + + $layerBlock = new Block(); + $layerBlock->blockable_id = $block->blockable_id; + $layerBlock->blockable_type = 'digitalPublicationArticles'; + $layerBlock->parent_id = $block->id; + + // Configure this as an image or overlay and set position + // TODO: Check the extension as PNGs appear to be overlays as well + if ($layer_data['type'] == 'svg') { + $layerBlock->child_key = 'layered_image_viewer_overlay'; + $layerBlock->type = 'layered_image_viewer_overlay'; + } else { + $layerBlock->child_key = 'layered_image_viewer_img'; + $layerBlock->type = 'layered_image_viewer_img'; + } - $block->children()->save($layerBlock); - $block->save(); - } + $layerBlock->position = $layer_data['layer_num']; + $layerBlock->content = [ + "label" => $layer_data['title'] + ]; + + $layerBlock->save(); + + $media = $this->mediaFactory($layer_data, $figure_data->caption_html, $figure_data->fallback_url); + if ($media !== null) { + // TODO: Use converted crop params + $layerBlock->medias()->attach($media->id, [ + 'locale' => 'en', + 'media_id' => $media->id, + 'metadatas' => '{"caption":null,"captionTitle": null, "altText":null,"video":null}', + 'role' => 'image', + 'crop' => 'desktop', + 'crop_x' => 0, + 'crop_y' => 0, + 'crop_w' => $media->width, + 'crop_h' => $media->height + ]); + + $layerBlock->save(); + } - $block->save(); - break; + $block->children()->save($layerBlock); + $block->save(); + } - case 'iip_asset': - $block->type = 'image'; - $block->content = [ - "is_modal" => false, - "is_zoomable" => false, - "size" => "s", - "use_contain" => true, - "use_alt_background" => true, - "image_link" => null, - "hide_figure_number" => false, - "caption" => $figure->caption_html, - "alt_text" => "" - ]; + private function configureLayeredImageFigure($block, $data, $layers) + { + $block->type = 'layered_image_viewer'; + $block->editor_name = 'default'; + $block->content = [ + "size" => "s", + "caption" => $data->caption_html, + ]; - $block->save(); + $block->save(); - $imageData = Arr::first($layers); + $figure_opts = json_decode($data->figure_opts, true); + $imageLayerIds = $figure_opts['baseLayerPreset'] ?? []; + $overlayLayerIds = $figure_opts['annotationPreset'] ?? []; - $media = $this->mediaFactory($imageData, $figure->caption_html, $figure->fallback_url); - if ($media === null) { - break; - } - - // TODO: Use converted crop params - $block->medias()->attach($media->id, [ - 'locale' => 'en', - 'media_id' => $media->id, - 'metadatas' => '{"caption":null,"captionTitle": null, "altText":null,"video":null}', - 'role' => 'image', - 'crop' => 'desktop', - 'crop_x' => 0, - 'crop_y' => 0, - 'crop_w' => $media->width, - 'crop_h' => $media->height - ]); + foreach ($layers as $layerData) { + $this->createAttachImageLayer($block, $data, $layerData); + } + $block->save(); + } - $block->save(); - break; + private function configure360EmbedFigure($block, $data) + { + $block->type = '360_embed'; + $block->content = [ + "size" => "s", + "caption" => $data->caption_html + ]; + + // TODO: use this->mediaFactory to fetch + attach 360 zip + $block->save(); + } - case '360_slider': - $block->type = '360_embed'; - $block->content = [ - "size" => "s", - "caption" => $figure->caption_html - ]; + /** + * configures $block (a Block model) with $figure + * + **/ + private function configureFigureBlock($block, $figure) + { + $layers = isset($figure->layers_data) ? json_decode($figure->layers_data, true) : []; - // TODO: use this->mediaFactory to fetch + attach 360 zip - $block->save(); - break; + // Type-sense the figure and apply the appropriate CMS block type -- each just returns early + switch (true) { + // Non-video embeds (HTML, mostly) become media_embed + case ($figure->figure_type === 'html_figure' && !isset($figure->html_content_src)): + $this->configureHTMLFigure($block, $figure); + return; - case 'rti_viewer': + // HTML embeds with a src are videos + case ($figure->figure_type === 'html_figure' && isset($figure->html_content_src)): + $this->configureVideoFigure($block, $figure); + return; + + // OSCI's layered_image with only one layer should just be an image + case ($figure->figure_type === 'layered_image' && count($layers) === 1): + $this->configureImageFigure($block, $figure, $layers); + return; + + // Layered images are just that + case ($figure->figure_type === 'layered_image'): + $this->configureLayeredImageFigure($block, $figure, $layers); + return; + + // IIP Asset images are also images + case ($figure->figure_type === 'iip_asset'): + $this->configureImageFigure($block, $figure, $layers); + return; + + case ($figure->figure_type === '360_slider'): + $this->configure360EmbedFigure($block, $figure); + return; + + // RTI_Viewers will need other handling, so leave a placeholder.. + case ($figure->figure_type === 'rti_viewer'): // TODO: insert reader_url, figure # for this text + figure $block->type = 'video'; $block->content = [ @@ -331,7 +335,10 @@ private function configureFigBlock($figure, $block) ]; $block->save(); - break; + return; + + default: + return; } } @@ -344,7 +351,7 @@ private function configureBlock($data, $block) { switch ($data->type) { case 'figure': - $this->configureFigBlock($data, $block); + $this->configureFigureBlock($block, $data); break; default: $block->content = [ 'paragraph' => $data->html ]; From f6d0b42792713128aac1f39de9a445757503dcbf Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Mon, 22 Jul 2024 13:46:51 -0500 Subject: [PATCH 030/346] Improve console output while migrating OSCI publications [PUB-217] --- app/Console/Commands/MigrateOSCIPublicationOne.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index e02ebc7d01..885428ef5c 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -378,11 +378,17 @@ public function handle() $pubs = DB::connection('osci_migration')->select("SELECT json_extract(publications.data,'$._title') as title FROM publications LEFT JOIN tocs ON tocs.package=publications.pub_id WHERE pub_id=:id", ['id' => $pubId]); $pub = Arr::first($pubs); + if (!$pub) { + $this->error('No publication with the ID: ' . $pubId); + return; + } + $webPub = new DigitalPublication(); $webPub->title = 'Migrated ' . date('M j, Y') . ' | ' . $pub->title; $webPub->published = false; $webPub->is_dsc_stub = false; $webPub->save(); + $this->comment('Starting ' . $pub->title . '...'); $webPubId = $webPub->id; @@ -497,8 +503,10 @@ public function handle() } $webPub->articles()->save($webArticle); + $this->info($pub->title . ': ' . $webArticle->title); } $webPub->save(); + $this->comment('...' . $pub->title . ' done!'); } } From 575622ef7e3b6499dc40b3bba3c69ad89d8f2c15 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:15:06 -0500 Subject: [PATCH 031/346] Add active styling to TOC [PUB-219] --- frontend/scss/organisms/_o-accordion.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/scss/organisms/_o-accordion.scss b/frontend/scss/organisms/_o-accordion.scss index 861a14d4bc..3053aa20fb 100644 --- a/frontend/scss/organisms/_o-accordion.scss +++ b/frontend/scss/organisms/_o-accordion.scss @@ -442,6 +442,10 @@ &::before { padding-top: 25px !important; } + &.active { + font-weight: 400; + color: $color__black--90 !important; + } } &.o-blocks>:last-child { From 748d613d7ea1e568306aab0e1115c62783da3237 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Thu, 25 Jul 2024 10:15:29 -0500 Subject: [PATCH 032/346] Add migrate all publications commands [PUB-225] --- .../Commands/MigrateOSCIPublication.php | 53 ++++++++++ .../Commands/MigrateOSCIPublicationMedia.php | 91 ++++------------ .../MigrateOSCIPublicationMediaOne.php | 100 ++++++++++++++++++ .../Commands/MigrateOSCIPublicationOne.php | 10 +- 4 files changed, 181 insertions(+), 73 deletions(-) create mode 100644 app/Console/Commands/MigrateOSCIPublication.php create mode 100644 app/Console/Commands/MigrateOSCIPublicationMediaOne.php diff --git a/app/Console/Commands/MigrateOSCIPublication.php b/app/Console/Commands/MigrateOSCIPublication.php new file mode 100644 index 0000000000..053a097eb0 --- /dev/null +++ b/app/Console/Commands/MigrateOSCIPublication.php @@ -0,0 +1,53 @@ +publications as $pub) { + $this->call('migrate:osci-publication-one', ['id' => $pub]); + } + } +} diff --git a/app/Console/Commands/MigrateOSCIPublicationMedia.php b/app/Console/Commands/MigrateOSCIPublicationMedia.php index 532c0acc3c..a22c6d332a 100644 --- a/app/Console/Commands/MigrateOSCIPublicationMedia.php +++ b/app/Console/Commands/MigrateOSCIPublicationMedia.php @@ -2,14 +2,7 @@ namespace App\Console\Commands; -use Imagick; use Illuminate\Console\Command; -use Illuminate\Support\Facades\DB; -use Illuminate\Support\Facades\Storage; -use Illuminate\Support\Arr; -use Illuminate\Support\Str; - -$PTIF_LAYER_MAX = 10000; class MigrateOSCIPublicationMedia extends Command { @@ -18,14 +11,33 @@ class MigrateOSCIPublicationMedia extends Command * * @var string */ - protected $signature = 'migrate:osci-media {id : Publication ID} {--move-assets}'; + protected $signature = 'migrate:osci-media'; /** * The console command description. * * @var string */ - protected $description = 'Migrate an OSCI publications\' IIP and 360º media from OSCI servers to S3'; + protected $description = 'Migrate all OSCI publications\' IIP and 360º media from OSCI servers to S3'; + + protected $publications = [ + 'albright', + 'americansilver', + 'caillebotte', + 'digitalwhistler', + 'ensor', + 'gauguin', + 'manet', + 'matisse', + 'modernseries', + 'modernseries2', + 'monet', + 'pissarro', + 'renoir', + 'romanart', + 'whistler_linkedvisions', + 'whistlerart', + ]; /** * Execute the console command. @@ -34,65 +46,8 @@ class MigrateOSCIPublicationMedia extends Command */ public function handle() { - $pubId = $this->argument('id'); - - # TODO: Query 360s too - $assetsQuery = <<select($assetsQuery, ['pubId' => $pubId]); - - foreach ($assets as $asset) { - // TODO: Check the asset type and handle 360 spins differently - $key = trim($asset->image_ident, '/'); - $asset_key = preg_replace('/^\/?osci\//', '', $asset->image_ident); - $jpg_key = preg_replace('/\.ptif$/', '.jpg', $key); - - if (!Storage::disk('osci_s3')->fileExists($asset_key)) { - echo "OSCI_S3_BUCKET did not contain {$asset_key}!\n"; - continue; - } - - if (Storage::disk('osci_s3')->fileExists($jpg_key)) { - echo "OSCI_S3_BUCKET already contains {$jpg_key}, skipping this asset\n"; - continue; - } - - echo "Compressing {$asset_key}\n"; - - $content = Storage::disk('osci_s3')->get($asset_key); - - $image = new Imagick(); - $image->readImageBlob($content); - - // Iterate zoom layers to find a 10k-pixels-a-side page geometry - while ($image->hasPreviousImage()) { - $size = $image->getImagePage(); - - if ($size['height'] > 10000 && $size['width'] > 10000) { - $image->nextImage(); - break; - } - $image->previousImage(); - } - - $image->setImageFormat('jpeg'); - $compressed = $image->getImageBlob(); - - $res = Storage::disk('osci_s3')->put($jpg_key, $compressed); - - if (!$res) { - echo "There was an error uploading the compressed file to {$jpg_key}\n"; - continue; - } - - echo "Uploaded {$jpg_key}\n"; + foreach ($this->publications as $pub) { + $this->call('migrate:osci-media-one', ['id' => $pub]); } } } diff --git a/app/Console/Commands/MigrateOSCIPublicationMediaOne.php b/app/Console/Commands/MigrateOSCIPublicationMediaOne.php new file mode 100644 index 0000000000..6ca6370b8b --- /dev/null +++ b/app/Console/Commands/MigrateOSCIPublicationMediaOne.php @@ -0,0 +1,100 @@ +argument('id'); + $this->comment('Starting ' . $pubId . '...'); + + # TODO: Query 360s too + $assetsQuery = <<select($assetsQuery, ['pubId' => $pubId]); + + foreach ($assets as $asset) { + // TODO: Check the asset type and handle 360 spins differently + $key = trim($asset->image_ident, '/'); + $asset_key = preg_replace('/^\/?osci\//', '', $asset->image_ident); + $jpg_key = preg_replace('/\.ptif$/', '.jpg', $key); + + if (!Storage::disk('osci_s3')->fileExists($asset_key)) { + $this->info("OSCI_S3_BUCKET did not contain {$asset_key}!"); + continue; + } + + if (Storage::disk('osci_s3')->fileExists($jpg_key)) { + $this->info("OSCI_S3_BUCKET already contains {$jpg_key}, skipping this asset"); + continue; + } + + $this->info("Compressing {$asset_key}"); + + $content = Storage::disk('osci_s3')->get($asset_key); + + $image = new Imagick(); + $image->readImageBlob($content); + + // Iterate zoom layers to find a 10k-pixels-a-side page geometry + while ($image->hasPreviousImage()) { + $size = $image->getImagePage(); + + if ($size['height'] > 10000 && $size['width'] > 10000) { + $image->nextImage(); + break; + } + $image->previousImage(); + } + + $image->setImageFormat('jpeg'); + $compressed = $image->getImageBlob(); + + $res = Storage::disk('osci_s3')->put($jpg_key, $compressed); + + if (!$res) { + $this->info("There was an error uploading the compressed file to {$jpg_key}"); + continue; + } + + echo "Uploaded {$jpg_key}\n"; + } + $this->comment('...' . $pubId . ' done!'); + } +} diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 885428ef5c..04a20db189 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -20,7 +20,7 @@ class MigrateOSCIPublicationOne extends Command * * @var string */ - protected $signature = 'migrate:osci-publication {id : Publication ID}'; + protected $signature = 'migrate:osci-publication-one {id : Publication ID}'; /** * The console command description. @@ -94,7 +94,7 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) $retries = 0; while (!$imageContent && $retries < 5) { try { - $imageContent = file_get_contents($imageUrl, false, $http_ctx); + $imageContent = file_get_contents($imageUrl, false, $http_ctx); } catch (ErrorException $e) { echo "Caught error {$e} fetching {$imageUrl}, retrying.\n"; pass; @@ -133,7 +133,7 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) $media->save(); return $media; - } + } private function configureImageFigure($block, $data, $layers) { @@ -187,7 +187,7 @@ private function configureVideoFigure($block, $data) $block->save(); } - private function configureHTMLFigure($block, $data) + private function configureHTMLFigure($block, $data) { $block->type = 'media_embed'; $block->content = [ @@ -307,7 +307,7 @@ private function configureFigureBlock($block, $figure) $this->configureVideoFigure($block, $figure); return; - // OSCI's layered_image with only one layer should just be an image + // OSCI's layered_image with only one layer should just be an image case ($figure->figure_type === 'layered_image' && count($layers) === 1): $this->configureImageFigure($block, $figure, $layers); return; From 37b64c7142f6b65d53099cc413da93a61c0174dc Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:15:18 -0500 Subject: [PATCH 033/346] Pass currentArticle if set [PUB-219] --- .../_m-article-actions----digital-publication.blade.php | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php b/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php index e72f206cf7..e7e84ec3eb 100644 --- a/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php +++ b/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php @@ -19,6 +19,7 @@ @slot('variation', 'o-accordion--publication-sidebar') @slot('titleFont', 'f-tag-2') @slot('items', $topLevelArticles) + @slot('currentArticle', $currentArticle ?? null) @endcomponent @endif From 54e8378a7b7fb7a3b2d337f3ba897388fe736d9a Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Thu, 25 Jul 2024 10:16:52 -0500 Subject: [PATCH 034/346] Lint code [PUB-225] --- app/Console/Commands/MigrateOSCIPublicationMediaOne.php | 2 -- app/Console/Commands/MigrateOSCIPublicationOne.php | 1 - 2 files changed, 3 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationMediaOne.php b/app/Console/Commands/MigrateOSCIPublicationMediaOne.php index 6ca6370b8b..df75812ec6 100644 --- a/app/Console/Commands/MigrateOSCIPublicationMediaOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationMediaOne.php @@ -6,8 +6,6 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Storage; -use Illuminate\Support\Arr; -use Illuminate\Support\Str; $PTIF_LAYER_MAX = 10000; diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 04a20db189..8f74b8dd79 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -7,7 +7,6 @@ use Illuminate\Support\Facades\Storage; use Illuminate\Support\Arr; use Illuminate\Support\Str; -use App\Repositories\Api\PublicationRepository; use App\Models\DigitalPublication; use App\Models\DigitalPublicationArticle; use App\Models\Vendor\Block; From ea19073db239e34f0acb25802a7c75a627b298f6 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:15:55 -0500 Subject: [PATCH 035/346] Add function to detect current article in tree and open the corresponding panels [PUB-219] --- .../organisms/_o-table-of-contents.blade.php | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/resources/views/components/organisms/_o-table-of-contents.blade.php b/resources/views/components/organisms/_o-table-of-contents.blade.php index 9115508f8a..d87b0a7a7b 100644 --- a/resources/views/components/organisms/_o-table-of-contents.blade.php +++ b/resources/views/components/organisms/_o-table-of-contents.blade.php @@ -1,8 +1,25 @@
@foreach ($items as $item) + @php + $isArticleInTree = function ($items) use (&$isArticleInTree, $currentArticle) { + foreach ($items as $childItem) { + if ($childItem->id === $currentArticle->id) { + return true; + } + if (count($childItem->children) > 0 && $isArticleInTree($childItem->children)) { + return true; + } + } + return false; + }; + + $isInTree = $isArticleInTree($item->children); + $isExpanded = isset($currentArticle) && ($currentArticle->parent === $item || $isInTree); + @endphp + @if (count($item->children) > 0)

-

-
+
@include('components.organisms._o-table-of-contents', ['items' => $item->children->sortBy('position')])
@else - gtmAttributes)) ? ' '.$item->gtmAttributes.'' : '' !!}> + gtmAttributes)) ? ' '.$item->gtmAttributes.'' : '' !!}> {!! $item->title !!} From 4109c82e7856389433a76e08deb7501849a9954d Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Thu, 25 Jul 2024 11:46:55 -0400 Subject: [PATCH 036/346] Use http facade for URL fetching, refine fetch error handling --- .../Commands/MigrateOSCIPublicationOne.php | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 8f74b8dd79..9cfd65d0d9 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -3,8 +3,10 @@ namespace App\Console\Commands; use Illuminate\Console\Command; +use Illuminate\Http\Client\ConnectionException; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Storage; +use Illuminate\Support\Facades\Http; use Illuminate\Support\Arr; use Illuminate\Support\Str; use App\Models\DigitalPublication; @@ -41,7 +43,7 @@ class MigrateOSCIPublicationOne extends Command */ private function mediaFactory($imageData, $caption_html, $fallback_url) { - $imageUrl; + $imageUrl = ""; $imageContent = false; switch ($imageData["type"]) { @@ -91,19 +93,30 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) )); $retries = 0; - while (!$imageContent && $retries < 5) { + while ($imageContent === false && $retries < 5 ) { + // Fetch the URL, retrying if it's not a 404 try { - $imageContent = file_get_contents($imageUrl, false, $http_ctx); - } catch (ErrorException $e) { - echo "Caught error {$e} fetching {$imageUrl}, retrying.\n"; - pass; + $resp = Http::get($imageUrl); + } catch (ConnectionException $e) { + $retries++; + usleep(20); + continue; } - $retries++; - usleep(20); + if ($resp->notFound()) { + break; + } + + if ($resp->serverError()) { + $retries++; + usleep(20); + continue; + } + + $imageContent = $resp->body(); } - if (!$imageContent) { + if ($imageContent === false || $imageContent === "") { echo "Error could not fetch {$imageUrl} after {$retries} attempts! This media won't be migrated"; return null; } @@ -216,7 +229,8 @@ private function createAttachImageLayer($block, $figure_data, $layer_data) // Configure this as an image or overlay and set position // TODO: Check the extension as PNGs appear to be overlays as well - if ($layer_data['type'] == 'svg') { + + if ($layer_data['type'] == 'svg' || pathinfo($layer_data['static_url'], PATHINFO_EXTENSION) === 'png') { $layerBlock->child_key = 'layered_image_viewer_overlay'; $layerBlock->type = 'layered_image_viewer_overlay'; } else { From 5bd99109bbd146ad1fbaedf7e7a7d499d135e15b Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:18:08 -0500 Subject: [PATCH 037/346] Use id's to detect active article [PUB-219] --- .../views/components/organisms/_o-table-of-contents.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/components/organisms/_o-table-of-contents.blade.php b/resources/views/components/organisms/_o-table-of-contents.blade.php index d87b0a7a7b..f781e4f056 100644 --- a/resources/views/components/organisms/_o-table-of-contents.blade.php +++ b/resources/views/components/organisms/_o-table-of-contents.blade.php @@ -32,7 +32,7 @@
@else - gtmAttributes)) ? ' '.$item->gtmAttributes.'' : '' !!}> + gtmAttributes)) ? ' '.$item->gtmAttributes.'' : '' !!}> {!! $item->title !!} From f31cd3ba9527998b59521c7f61ab4150c6c59af6 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Thu, 25 Jul 2024 11:51:31 -0400 Subject: [PATCH 038/346] Remove dead-code http context + fix lint error --- app/Console/Commands/MigrateOSCIPublicationOne.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 9cfd65d0d9..9b23ff99c5 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -85,15 +85,8 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) $imageName = $imageUuid . '/' . $imageFilename; - $http_ctx = stream_context_create(array( - 'http' => [ - 'timeout' => 120, - 'ignore_errors' => true, - ] - )); - $retries = 0; - while ($imageContent === false && $retries < 5 ) { + while ($imageContent === false && $retries < 5) { // Fetch the URL, retrying if it's not a 404 try { $resp = Http::get($imageUrl); From 99f98cc7bbf614ea848bc194ced4383882a8870b Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:38:24 -0500 Subject: [PATCH 039/346] Check if $currentArticle isset and apply default open behavior [PUB-219] --- .../organisms/_o-table-of-contents.blade.php | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/resources/views/components/organisms/_o-table-of-contents.blade.php b/resources/views/components/organisms/_o-table-of-contents.blade.php index f781e4f056..659fd5b725 100644 --- a/resources/views/components/organisms/_o-table-of-contents.blade.php +++ b/resources/views/components/organisms/_o-table-of-contents.blade.php @@ -1,20 +1,26 @@
@foreach ($items as $item) @php - $isArticleInTree = function ($items) use (&$isArticleInTree, $currentArticle) { - foreach ($items as $childItem) { - if ($childItem->id === $currentArticle->id) { - return true; + if (isset($currentArticle)) { + $isArticleInTree = function ($items) use (&$isArticleInTree, $currentArticle) { + foreach ($items as $childItem) { + if ($childItem->id === $currentArticle->id) { + return true; + } + if (count($childItem->children) > 0 && $isArticleInTree($childItem->children)) { + return true; + } } - if (count($childItem->children) > 0 && $isArticleInTree($childItem->children)) { - return true; - } - } - return false; - }; + return false; + }; + + $isInTree = $isArticleInTree($item->children); + $isExpanded = $currentArticle->parent === $item || $isInTree; + } else { + $isExpanded = true; + } - $isInTree = $isArticleInTree($item->children); - $isExpanded = isset($currentArticle) && ($currentArticle->parent === $item || $isInTree); + $isActive = isset($currentArticle) && $item->id === $currentArticle->id; @endphp @if (count($item->children) > 0) @@ -32,7 +38,7 @@
@else - gtmAttributes)) ? ' '.$item->gtmAttributes.'' : '' !!}> + gtmAttributes)) ? ' '.$item->gtmAttributes.'' : '' !!}> {!! $item->title !!} From da5ff3eb6fea1b75b4514d9cdba8c890d1bdbdf9 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Thu, 25 Jul 2024 12:09:35 -0400 Subject: [PATCH 040/346] Housekeeping -- code quality fixes, comments, correct media-one arg sig --- .../MigrateOSCIPublicationMediaOne.php | 2 +- .../Commands/MigrateOSCIPublicationOne.php | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationMediaOne.php b/app/Console/Commands/MigrateOSCIPublicationMediaOne.php index df75812ec6..0c1a7fd59b 100644 --- a/app/Console/Commands/MigrateOSCIPublicationMediaOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationMediaOne.php @@ -16,7 +16,7 @@ class MigrateOSCIPublicationMediaOne extends Command * * @var string */ - protected $signature = 'migrate:osci-media-one {id : Publication ID} {--move-assets}'; + protected $signature = 'migrate:osci-media-one {id : Publication ID}'; /** * The console command description. diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 9b23ff99c5..abee4aa036 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -221,7 +221,6 @@ private function createAttachImageLayer($block, $figure_data, $layer_data) $layerBlock->parent_id = $block->id; // Configure this as an image or overlay and set position - // TODO: Check the extension as PNGs appear to be overlays as well if ($layer_data['type'] == 'svg' || pathinfo($layer_data['static_url'], PATHINFO_EXTENSION) === 'png') { $layerBlock->child_key = 'layered_image_viewer_overlay'; @@ -304,36 +303,39 @@ private function configureFigureBlock($block, $figure) // Type-sense the figure and apply the appropriate CMS block type -- each just returns early switch (true) { // Non-video embeds (HTML, mostly) become media_embed - case ($figure->figure_type === 'html_figure' && !isset($figure->html_content_src)): + case $figure->figure_type === 'html_figure' + && !isset($figure->html_content_src): $this->configureHTMLFigure($block, $figure); return; // HTML embeds with a src are videos - case ($figure->figure_type === 'html_figure' && isset($figure->html_content_src)): + case $figure->figure_type === 'html_figure' + && isset($figure->html_content_src): $this->configureVideoFigure($block, $figure); return; // OSCI's layered_image with only one layer should just be an image - case ($figure->figure_type === 'layered_image' && count($layers) === 1): + case $figure->figure_type === 'layered_image' + && count($layers) === 1: $this->configureImageFigure($block, $figure, $layers); return; // Layered images are just that - case ($figure->figure_type === 'layered_image'): + case $figure->figure_type === 'layered_image': $this->configureLayeredImageFigure($block, $figure, $layers); return; // IIP Asset images are also images - case ($figure->figure_type === 'iip_asset'): + case $figure->figure_type === 'iip_asset': $this->configureImageFigure($block, $figure, $layers); return; - case ($figure->figure_type === '360_slider'): + case $figure->figure_type === '360_slider': $this->configure360EmbedFigure($block, $figure); return; // RTI_Viewers will need other handling, so leave a placeholder.. - case ($figure->figure_type === 'rti_viewer'): + case $figure->figure_type === 'rti_viewer': // TODO: insert reader_url, figure # for this text + figure $block->type = 'video'; $block->content = [ From 4d9afa74baae527899b244698b05ddd62928bd65 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:49:03 -0500 Subject: [PATCH 041/346] Move isArticleInTree method to presenter [PUB-219] --- .../Admin/DigitalPublicationArticlePresenter.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php index f80ddb8cec..d7364af14e 100644 --- a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php +++ b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php @@ -74,4 +74,17 @@ public function citeAs() return $this->addCssClass($this->entity->cite_as, 'f-secondary'); } + + public function isArticleInTree($items, $currentArticle) + { + foreach ($items as $childItem) { + if ($childItem->id === $currentArticle->id) { + return true; + } + if (count($childItem->children) > 0 && $this->isArticleInTree($childItem->children, $currentArticle)) { + return true; + } + } + return false; + } } From a34de4dce424d24306d07b07b66ee03c051d9d16 Mon Sep 17 00:00:00 2001 From: Charlie Butcosk Date: Thu, 25 Jul 2024 12:11:27 -0400 Subject: [PATCH 042/346] More lints --- app/Console/Commands/MigrateOSCIPublicationOne.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index abee4aa036..129047656d 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -303,19 +303,19 @@ private function configureFigureBlock($block, $figure) // Type-sense the figure and apply the appropriate CMS block type -- each just returns early switch (true) { // Non-video embeds (HTML, mostly) become media_embed - case $figure->figure_type === 'html_figure' + case $figure->figure_type === 'html_figure' && !isset($figure->html_content_src): $this->configureHTMLFigure($block, $figure); return; // HTML embeds with a src are videos - case $figure->figure_type === 'html_figure' + case $figure->figure_type === 'html_figure' && isset($figure->html_content_src): $this->configureVideoFigure($block, $figure); return; // OSCI's layered_image with only one layer should just be an image - case $figure->figure_type === 'layered_image' + case $figure->figure_type === 'layered_image' && count($layers) === 1: $this->configureImageFigure($block, $figure, $layers); return; From 9e6408bf90c830a1e03fca27212551cdf084b3d3 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:49:20 -0500 Subject: [PATCH 043/346] Call presenter method for isArticleInTree [PUB-219] --- .../organisms/_o-table-of-contents.blade.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/resources/views/components/organisms/_o-table-of-contents.blade.php b/resources/views/components/organisms/_o-table-of-contents.blade.php index 659fd5b725..0d2b71dfed 100644 --- a/resources/views/components/organisms/_o-table-of-contents.blade.php +++ b/resources/views/components/organisms/_o-table-of-contents.blade.php @@ -2,24 +2,10 @@ @foreach ($items as $item) @php if (isset($currentArticle)) { - $isArticleInTree = function ($items) use (&$isArticleInTree, $currentArticle) { - foreach ($items as $childItem) { - if ($childItem->id === $currentArticle->id) { - return true; - } - if (count($childItem->children) > 0 && $isArticleInTree($childItem->children)) { - return true; - } - } - return false; - }; - - $isInTree = $isArticleInTree($item->children); - $isExpanded = $currentArticle->parent === $item || $isInTree; + $isExpanded = $currentArticle->parent === $item || $item->present()->isArticleInTree($item->children, $currentArticle); } else { $isExpanded = true; } - $isActive = isset($currentArticle) && $item->id === $currentArticle->id; @endphp From f51032c4b96ea1a55d6708f70951ec92dda73786 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 20 Aug 2024 13:49:26 -0500 Subject: [PATCH 044/346] Reference $this in place of $currentArticle [PUB-219] --- app/Presenters/Admin/DigitalPublicationArticlePresenter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php index d7364af14e..8da59204f1 100644 --- a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php +++ b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php @@ -75,13 +75,13 @@ public function citeAs() return $this->addCssClass($this->entity->cite_as, 'f-secondary'); } - public function isArticleInTree($items, $currentArticle) + public function isArticleInTree($items) { foreach ($items as $childItem) { - if ($childItem->id === $currentArticle->id) { + if ($childItem->id === $this->entity->id) { return true; } - if (count($childItem->children) > 0 && $this->isArticleInTree($childItem->children, $currentArticle)) { + if (count($childItem->children) > 0 && $this->isArticleInTree($childItem->children)) { return true; } } From 4561cea8154402add8e9c7333acbc28a809cdbd9 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Mon, 19 Aug 2024 15:59:38 -0500 Subject: [PATCH 045/346] Fix doubled method declaration after merge [PUB-225] --- app/Models/Experience.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/Models/Experience.php b/app/Models/Experience.php index fdea0fbbb9..cce9156480 100644 --- a/app/Models/Experience.php +++ b/app/Models/Experience.php @@ -271,11 +271,6 @@ public function getTitleSlugAttribute() return StringHelpers::getUtf8Slug($this->title); } - public function getTitleSlugAttribute() - { - return StringHelpers::getUtf8Slug($this->title); - } - public $mediasParams = [ 'thumbnail' => [ 'default' => [ From ffb70bdc1c63a5cd2b586409b4b4e8c7a943657e Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 20 Aug 2024 13:32:07 -0500 Subject: [PATCH 046/346] Update hover and text alignment of listing cover component [WEB-2911] --- frontend/scss/molecules/_m-listing.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/scss/molecules/_m-listing.scss b/frontend/scss/molecules/_m-listing.scss index 615e0b1026..e77c8db24e 100644 --- a/frontend/scss/molecules/_m-listing.scss +++ b/frontend/scss/molecules/_m-listing.scss @@ -2183,7 +2183,7 @@ a:focus:hover .btn--magazine { width: colspan(design-cols-to-colspan(3), xlarge) !important; } - .m-listing__link:hover + .title { + a:hover .title { color: rgba($color__white, .8) !important; } @@ -2210,6 +2210,7 @@ a:focus:hover .btn--magazine { display: flex; justify-content: center; align-items: center; + text-align: center; color: $color__white; height: 100%; width: 100%; From c821303dba6decbdd29eebec59171d64f4d8de1b Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 20 Aug 2024 13:35:07 -0500 Subject: [PATCH 047/346] Update detail blade to handle limits for browseAll [WEB-2911] --- .../site/digitalPublicationDetail.blade.php | 353 ++++++++++++------ 1 file changed, 232 insertions(+), 121 deletions(-) diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index b4e4aa58bf..19f4394dae 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -42,84 +42,126 @@ @endif @foreach ($item->present()->topLevelArticles() as $topLevelArticle) - @if (!$topLevelArticle->hide_title) - @component('components.molecules._m-title-bar', [ - 'variation' => 'm-title-bar--compact m-title-bar--light', - ]) - @slot('links', $topLevelArticle->present()->getBrowseMoreLink($showAll)) - {!! $topLevelArticle->title !!} - @endcomponent - @endif - @if (!$topLevelArticle->suppress_listing) @switch($topLevelArticle->listing_display) @case('feature') - @foreach ($topLevelArticle->children->filter(function($item) { - return !$item->suppress_listing; - })->sortBy('position') as $item) - @if ($loop->iteration <= 4 || $showAll == true) - @if($loop->first && $showAll == false) - @component('components.molecules._m-showcase') - @slot('variation', 'showcase--digital-publication') - @slot('tag', $item->present()->type) - @slot('title', $item->present()->title_display ?? $topLevelArticle->present()->title) - @slot('author_display', $item->showAuthors()) - @slot('description', $item->present()->list_description) - @slot('linkLabel', 'Read full ' . Str::singular(Str::lower($item->present()->type))) - @slot('linkUrl', $item->present()->url) - @slot('image', $item->imageFront('hero')) - @slot('imageSettings', array( - 'fit' => 'crop', - 'ratio' => '16:9', - 'srcset' => array(200,400,600), - 'sizes' => ImageHelpers::aic_imageSizes(array( - 'xsmall' => '216px', - 'small' => '216px', - 'medium' => '18', - 'large' => '13', - 'xlarge' => '13', - )), - )) - @endcomponent - @else - @if($loop->first || ($loop->iteration == 2 && $showAll == false)) - @component('components.organisms._o-grid-listing') - @slot('cols_small','2') - @slot('cols_medium','3') - @slot('cols_large','3') - @slot('cols_xlarge','3') - @endif - @component('components.molecules._m-listing----digital-publication-article') - @slot('href', $item->present()->url) - @slot('image', $item->imageFront('hero')) - @slot('type', $item->present()->type) - @slot('title', $item->present()->title) - @slot('title_display', $item->present()->title_display) - @slot('list_description', $item->present()->list_description) - @slot('author_display', $item->showAuthors()) - @slot('imageSettings', array( - 'fit' => 'crop', - 'ratio' => '16:9', - 'srcset' => array(200,400,600), - 'sizes' => ImageHelpers::aic_imageSizes(array( - 'xsmall' => '216px', - 'small' => '216px', - 'medium' => '18', - 'large' => '13', - 'xlarge' => '13', - )), - )) - @endcomponent - @if($loop->last || ($loop->iteration == 4 && $showAll == false)) - @endcomponent + + {{-- Title Component --}} + @if (!$topLevelArticle->hide_title) + @component('components.molecules._m-title-bar', [ + 'variation' => 'm-title-bar--compact m-title-bar--light', + ]) + @slot('links', (count($topLevelArticle->children) > 4) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) + {!! $topLevelArticle->title !!} + @endcomponent + @endif + + {{-- Listing Component --}} + @if (!$topLevelArticle->suppress_listing) + @if(count($topLevelArticle->children) > 0) + @foreach ($topLevelArticle->children->filter(function($item) { + return !$item->suppress_listing; + })->sortBy('position') as $item) + @if ($loop->iteration <= 4 || $showAll == true) + @if($loop->first && $showAll == false) + @component('components.molecules._m-showcase') + @slot('variation', 'showcase--digital-publication') + @slot('tag', $item->present()->type) + @slot('title', $item->present()->title_display ?? $item->present()->title) + @slot('author_display', $item->showAuthors()) + @slot('description', $item->present()->list_description) + @slot('linkLabel', 'Read full ' . Str::singular(Str::lower($item->present()->type))) + @slot('linkUrl', $item->present()->url) + @slot('image', $item->imageFront('hero')) + @slot('imageSettings', array( + 'fit' => 'crop', + 'ratio' => '16:9', + 'srcset' => array(200,400,600), + 'sizes' => ImageHelpers::aic_imageSizes(array( + 'xsmall' => '216px', + 'small' => '216px', + 'medium' => '18', + 'large' => '13', + 'xlarge' => '13', + )), + )) + @endcomponent + @else + @if($loop->first || ($loop->iteration == 2 && $showAll == false)) + @component('components.organisms._o-grid-listing') + @slot('cols_small','2') + @slot('cols_medium','3') + @slot('cols_large','3') + @slot('cols_xlarge','3') + @endif + @component('components.molecules._m-listing----digital-publication-article') + @slot('href', $item->present()->url) + @slot('image', $item->imageFront('hero')) + @slot('type', $item->present()->type) + @slot('title', $item->present()->title) + @slot('title_display', $item->present()->title_display) + @slot('list_description', $item->present()->list_description) + @slot('author_display', $item->showAuthors()) + @slot('imageSettings', array( + 'fit' => 'crop', + 'ratio' => '16:9', + 'srcset' => array(200,400,600), + 'sizes' => ImageHelpers::aic_imageSizes(array( + 'xsmall' => '216px', + 'small' => '216px', + 'medium' => '18', + 'large' => '13', + 'xlarge' => '13', + )), + )) + @endcomponent + @if($loop->last || ($loop->iteration == 4 && $showAll == false)) + @endcomponent + @endif + @endif @endif - @endif + @endforeach + @else + @component('components.molecules._m-showcase') + @slot('variation', 'showcase--digital-publication') + @slot('tag', $topLevelArticle->present()->type) + @slot('title', $topLevelArticle->present()->title_display ?? $topLevelArticle->present()->title) + @slot('author_display', $topLevelArticle->showAuthors()) + @slot('description', $topLevelArticle->present()->list_description) + @slot('linkLabel', 'Read full ' . Str::singular(Str::lower($topLevelArticle->present()->type))) + @slot('linkUrl', $topLevelArticle->present()->url) + @slot('image', $topLevelArticle->imageFront('hero')) + @slot('imageSettings', array( + 'fit' => 'crop', + 'ratio' => '16:9', + 'srcset' => array(200,400,600), + 'sizes' => ImageHelpers::aic_imageSizes(array( + 'xsmall' => '216px', + 'small' => '216px', + 'medium' => '18', + 'large' => '13', + 'xlarge' => '13', + )), + )) + @endcomponent @endif - @endforeach + @endif @break @case('3-across') + + {{-- Title Component --}} + @if (!$topLevelArticle->hide_title) + @component('components.molecules._m-title-bar', [ + 'variation' => 'm-title-bar--compact m-title-bar--light', + ]) + @slot('links', (count($topLevelArticle->children) > 3) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) + {!! $topLevelArticle->title !!} + @endcomponent + @endif + + {{-- Listing Component --}} @component('components.organisms._o-grid-listing') @slot('cols_small','2') @slot('cols_medium','3') @@ -157,6 +199,18 @@ @break @case('entries') + + {{-- Title Component --}} + @if (!$topLevelArticle->hide_title) + @component('components.molecules._m-title-bar', [ + 'variation' => 'm-title-bar--compact m-title-bar--light', + ]) + @slot('links', ((count($topLevelArticle->children) > 4 && count($topLevelArticle->children) < 8) || (count($topLevelArticle->children) > 8)) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) + {!! $topLevelArticle->title !!} + @endcomponent + @endif + + {{-- Listing Component --}} @component('components.organisms._o-grid-listing') @slot('cols_xsmall','2') @slot('cols_small','2') @@ -164,10 +218,10 @@ @slot('cols_large','4') @slot('cols_xlarge','4') - @foreach ($topLevelArticle->children->filter(function($item) { + @foreach ($topLevelArticle->children->filter(function($item) use($topLevelArticle) { return !$item->suppress_listing; - })->sortBy('position') as $item) - @if ($loop->iteration <= 8 || $showAll == true) + })->sortBy('position')->take($showAll ? $topLevelArticle->children->count() : (count($topLevelArticle->children) >= 8 ? 8 : 4)) as $item) + @if (count($topLevelArticle->children) > 0) @component('components.molecules._m-listing----digital-publication-article-entry') @slot('href', $item->present()->url) @slot('image', $item->imageFront('hero')) @@ -194,6 +248,18 @@ @break @case('group_entries') + + {{-- Title Component --}} + @if (!$topLevelArticle->hide_title) + @component('components.molecules._m-title-bar', [ + 'variation' => 'm-title-bar--compact m-title-bar--light', + ]) + @slot('links', (count($topLevelArticle->children) > 9) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) + {!! $topLevelArticle->title !!} + @endcomponent + @endif + + {{-- Listing Component --}} @component('components.organisms._o-grid-listing') @slot('cols_xsmall','1') @slot('cols_small','1') @@ -204,18 +270,33 @@ @foreach ($topLevelArticle->children->filter(function($item) { return !$item->suppress_listing; })->sortBy('position') as $item) - @component('components.molecules._m-listing----cover') - @slot('variation', 'm-listing--cover--digital-publication') - @slot('href', $item->present()->url) - @slot('image', $item->imageFront('hero')) - @slot('title', $item->present()->title) - @endcomponent + @if($loop->iteration <= 9 || $showAll == true) + @component('components.molecules._m-listing----cover') + @slot('variation', 'm-listing--cover--digital-publication') + @slot('href', $item->present()->url) + @slot('image', $item->imageFront('hero')) + @slot('title', $item->present()->title) + @endcomponent + @endif @endforeach + @endcomponent @break @case('list') + + {{-- Title Component --}} + @if (!$topLevelArticle->hide_title) + @component('components.molecules._m-title-bar', [ + 'variation' => 'm-title-bar--compact m-title-bar--light', + ]) + @slot('links', (count($topLevelArticle->children) > 3) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) + {!! $topLevelArticle->title !!} + @endcomponent + @endif + + {{-- Listing Component --}} @component('components.organisms._o-grid-listing') @slot('cols_small','1') @@ -251,57 +332,88 @@ @endcomponent @break @case('simple_list') - @if ($showAll == true) - @component('components.organisms._o-grid-listing') - @slot('cols_small','2') - @slot('cols_medium','3') - @slot('cols_large','3') - @slot('cols_xlarge','3') - @endif - @foreach ($topLevelArticle->children->filter(function($item) { - return !$item->suppress_listing; - })->sortBy('position') as $item) - @if ($showAll !== true) - @component('components.molecules._m-digipub-title-bar', [ - 'variation' => 'm-title-bar--compact m-title-bar--no-hr', + {{-- Title Component --}} + @if (!$topLevelArticle->hide_title) + @component('components.molecules._m-title-bar', [ + 'variation' => 'm-title-bar--compact m-title-bar--light', ]) - @slot('item', $item) - {!! $item->present()->type !!} - @endcomponent - @else - @component('components.molecules._m-listing----digital-publication-article') - @slot('variation', 'm-listing--title-only') - @slot('href', $item->present()->url) - @slot('image', $item->imageFront('hero')) - @slot('type', $item->present()->type) - @slot('title', $item->present()->title) - @slot('title_display', $item->present()->title_display) - @slot('list_description', $item->present()->list_description) - @slot('author_display', $item->showAuthors()) - @slot('imageSettings', array( - 'fit' => 'crop', - 'ratio' => '16:9', - 'srcset' => array(200,400,600), - 'sizes' => ImageHelpers::aic_imageSizes(array( - 'xsmall' => '216px', - 'small' => '216px', - 'medium' => '18', - 'large' => '13', - 'xlarge' => '13', - )), - )) + @slot('links', (count($topLevelArticle->children) > 3) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) + {!! $topLevelArticle->title !!} @endcomponent @endif - @endforeach - @if ($showAll == true) - @endcomponent - @endif + {{-- Listing Component --}} + @if ($showAll == true) + @component('components.organisms._o-grid-listing') + @slot('cols_small','2') + @slot('cols_medium','3') + @slot('cols_large','3') + @slot('cols_xlarge','3') + @endif + + @if(count($topLevelArticle->children) > 0) + @foreach ($topLevelArticle->children->filter(function($item) { + return !$item->suppress_listing; + })->sortBy('position')->take($showAll ? count($topLevelArticle->children) : 3) as $item) + @if ($showAll !== true) + @component('components.molecules._m-digipub-title-bar', [ + 'variation' => 'm-title-bar--compact m-title-bar--no-hr', + ]) + @slot('item', $item) + {!! $item->present()->type !!} + @endcomponent + @else + @component('components.molecules._m-listing----digital-publication-article') + @slot('variation', 'm-listing--title-only') + @slot('href', $item->present()->url) + @slot('image', $item->imageFront('hero')) + @slot('type', $item->present()->type) + @slot('title', $item->present()->title) + @slot('title_display', $item->present()->title_display) + @slot('list_description', $item->present()->list_description) + @slot('author_display', $item->showAuthors()) + @slot('imageSettings', array( + 'fit' => 'crop', + 'ratio' => '16:9', + 'srcset' => array(200,400,600), + 'sizes' => ImageHelpers::aic_imageSizes(array( + 'xsmall' => '216px', + 'small' => '216px', + 'medium' => '18', + 'large' => '13', + 'xlarge' => '13', + )), + )) + @endcomponent + @endif + @endforeach + @else + @component('components.molecules._m-digipub-title-bar', [ + 'variation' => 'm-title-bar--compact m-title-bar--no-hr', + ]) + @slot('item', $topLevelArticle) + {!! $topLevelArticle->present()->type !!} + @endcomponent + @endif + + @if ($showAll == true) + @endcomponent + @endif @break @default + {{-- Title Component --}} + @if (!$topLevelArticle->hide_title) + @component('components.molecules._m-title-bar', [ + 'variation' => 'm-title-bar--compact m-title-bar--light', + ]) + @slot('links', (count($topLevelArticle->children) > 3) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) + {!! $topLevelArticle->title !!} + @endcomponent + @endif + @component('components.organisms._o-grid-listing') @slot('cols_small','2') @slot('cols_medium','3') @@ -338,7 +450,6 @@ @endcomponent @endswitch - @endif @endforeach @if (isset($item->sponsor_display)) From b1cb581203a0fb925e7d8b16acf607822b9c6126 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 20 Aug 2024 13:49:42 -0500 Subject: [PATCH 048/346] Update call for isArticleInTree in TOC [PUB-219] --- .../views/components/organisms/_o-table-of-contents.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/components/organisms/_o-table-of-contents.blade.php b/resources/views/components/organisms/_o-table-of-contents.blade.php index 0d2b71dfed..c6aa791851 100644 --- a/resources/views/components/organisms/_o-table-of-contents.blade.php +++ b/resources/views/components/organisms/_o-table-of-contents.blade.php @@ -2,7 +2,7 @@ @foreach ($items as $item) @php if (isset($currentArticle)) { - $isExpanded = $currentArticle->parent === $item || $item->present()->isArticleInTree($item->children, $currentArticle); + $isExpanded = $currentArticle->parent === $item || $currentArticle->present()->isArticleInTree($item->children); } else { $isExpanded = true; } From 6b51ec7041ea6f28e573ac382a3c1e379345abe4 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:38:19 -0500 Subject: [PATCH 049/346] Check only if count is 0,4, or 8 in entries browseAll variation [WEB-2911] --- resources/views/site/digitalPublicationDetail.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index 19f4394dae..e07654f471 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -205,7 +205,7 @@ @component('components.molecules._m-title-bar', [ 'variation' => 'm-title-bar--compact m-title-bar--light', ]) - @slot('links', ((count($topLevelArticle->children) > 4 && count($topLevelArticle->children) < 8) || (count($topLevelArticle->children) > 8)) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) + @slot('links', (!in_array(count($topLevelArticle->children), [0, 4, 8])) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) {!! $topLevelArticle->title !!} @endcomponent @endif From 87b24aea6aae0a58ebabe42c9ce293b30d38d713 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 31 Jul 2024 18:02:24 -0500 Subject: [PATCH 050/346] Created sticky digipub header [PUB-200] --- frontend/js/behaviors/core/index.js | 1 + .../core/stickyDigitalPublicationHeader.js | 72 +++++++++++++++++++ .../scss/molecules/_m-article-header.scss | 70 +++++++++++------- .../_m-article-header----feature.blade.php | 10 ++- 4 files changed, 126 insertions(+), 27 deletions(-) create mode 100644 frontend/js/behaviors/core/stickyDigitalPublicationHeader.js diff --git a/frontend/js/behaviors/core/index.js b/frontend/js/behaviors/core/index.js index 4676a019cc..3a9016c2ed 100644 --- a/frontend/js/behaviors/core/index.js +++ b/frontend/js/behaviors/core/index.js @@ -64,3 +64,4 @@ export { default as primaryNavigation } from './primaryNavigation'; export { default as editorialHeader } from './editorialHeader'; export { default as loadRelatedSidebar } from './loadRelatedSidebar'; export { default as rangedAccordion } from './rangedAccordion'; +export { default as stickyDigitalPublicationHeader } from './stickyDigitalPublicationHeader'; diff --git a/frontend/js/behaviors/core/stickyDigitalPublicationHeader.js b/frontend/js/behaviors/core/stickyDigitalPublicationHeader.js new file mode 100644 index 0000000000..e7b359b4cb --- /dev/null +++ b/frontend/js/behaviors/core/stickyDigitalPublicationHeader.js @@ -0,0 +1,72 @@ +const stickyDigitalPublicationHeader = function(container) { + const HEADER_STICKY = 's-sticky-digital-publication-header'; + const HEADER_UNSTICKY = 's-unsticky-digital-publication-header'; + + const getOffsetTop = element => { + let offsetTop = 0; + while(element) { + offsetTop += element.offsetTop; + element = element.offsetParent; + } + return offsetTop; + }; + + const setState = targetState => { + let classList = document.documentElement.classList; + let possibleStates = [HEADER_STICKY, HEADER_UNSTICKY]; + possibleStates.forEach(state => { + if (state !== targetState && classList.contains(state)) { + classList.remove(state); + } + }); + + if (targetState && !classList.contains(targetState)) { + classList.add(targetState); + } + + currentState = targetState; + }; + + const resetScroll = () => { + if (currentState == HEADER_STICKY) { + container.scrollTo(0, 0); + } + }; + + let currentState; + let containerTop = getOffsetTop(container) + document.body.scrollTop; + + function handleScroll() { + window.requestAnimationFrame(update); + } + + function update() { + let scrollTop = document.documentElement.scrollTop || document.body.scrollTop; + + if (scrollTop < containerTop) { + setState(HEADER_UNSTICKY); + } else { + setState(HEADER_STICKY); + } + } + + function _init() { + window.addEventListener('scroll', handleScroll); + setState(HEADER_STICKY); + resetScroll(); + handleScroll(); + } + + this.destroy = function() { + window.removeEventListener('scroll', handleScroll); + + // Remove properties of this behavior + A17.Helpers.purgeProperties(this); + } + + this.init = function() { + _init(); + } +} + +export default stickyDigitalPublicationHeader; diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 7977343af2..56526d7ec9 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1099,33 +1099,25 @@ } .title { - margin-top: 20px; + margin-top: 26px; } .subtitle { - text-align: right; color: $color__text--title-contrast; - - margin-top: 75px; - margin-bottom: 24px; + font-size: 18px; + line-height: 25px; + margin-bottom: 26px; + margin-top: 26px; + text-align: left; } @include breakpoint('small') { .m-article-header__img { height: 300px; } - - .title { - margin-top: 36px; - } - - .subtitle { - margin-top: 100px; - margin-bottom: 36px; - } } - @include breakpoint('medium') { + @include breakpoint('medium+') { .m-article-header__text { padding-right: 0; } @@ -1135,20 +1127,34 @@ } .title { - margin-top: 40px; + margin-top: 35px; } .subtitle { - margin-top: 100px; - margin-bottom: 44px; + margin-bottom: 35px; + margin-top: 35px; } } @include breakpoint('large+') { flex-flow: row-reverse nowrap; + .s-sticky-digital-publication-header & { + position: fixed; + top: 0; + width: 100%; + + .subtitle { + display: none; + } + + .m-article-header__img { + height: 180px; + } + } + .m-article-header__text { - flex: 0 0 38%; + flex: 0 0 colspan(14, 'large'); padding-right: initial; padding-left: initial; } @@ -1157,19 +1163,22 @@ left: auto; margin-left: auto; - flex: 0 0 62%; + flex: 0 0 colspan(50, 'large'); height: 75vh; right: 50%; margin-right: -50vw; } + } - .title { - margin-top: 50px; + @include breakpoint('xlarge') { + .m-article-header__text { + max-width: colspan(14, xlarge); + z-index: 1; } - - .subtitle { - margin-top: 100px; - margin-bottom: 60px; + .m-article-header__text::before { + left: -50%; + margin-left: 0; + max-width: colspan(14, xlarge); } } } @@ -1590,3 +1599,12 @@ a.m-article-header__img-credit { .m-article-header__img-thumbs button[disabled] + img { outline: 1px solid $color__black--54; } + +.m-article-header__spacer { + display: none; + .s-sticky-digital-publication-header & { + display: block; + height: 220px; + width: 100vw; + } +} diff --git a/resources/views/components/molecules/_m-article-header----feature.blade.php b/resources/views/components/molecules/_m-article-header----feature.blade.php index f4d38c245f..0770ea0be8 100644 --- a/resources/views/components/molecules/_m-article-header----feature.blade.php +++ b/resources/views/components/molecules/_m-article-header----feature.blade.php @@ -1,11 +1,15 @@ @if ($bgcolor ?? false) @endif -<{{ $tag ?? 'header' }} class="m-article-header m-article-header--feature{{ (isset($variation)) ? ' '.$variation : '' }}" data-behavior="blurMyBackground"> +<{{ $tag ?? 'header' }} + class="m-article-header m-article-header--feature{{ (isset($variation)) ? ' '.$variation : '' }}" + data-behavior="blurMyBackground stickyDigitalPublicationHeader" +>
@if ($img) @component('components.atoms._img') @@ -83,3 +87,7 @@ @endif @endif + +@if (($variation ?? '') == 'm-article-header--digital-publication') +
+@endif From 1d14ae47b0f015f0b5ecf810d1d83d5afd243ceb Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 9 Aug 2024 10:26:51 -0500 Subject: [PATCH 051/346] Adjust digipub subtitle text [PUB-200] --- frontend/scss/pages/_p-issue-show.scss | 8 ++++++++ frontend/scss/pages/_p-issuearticle-show.scss | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/scss/pages/_p-issue-show.scss b/frontend/scss/pages/_p-issue-show.scss index c1bd14bca7..d4d9fc07a8 100644 --- a/frontend/scss/pages/_p-issue-show.scss +++ b/frontend/scss/pages/_p-issue-show.scss @@ -13,6 +13,14 @@ content: none; } + .m-article-header--digital-publication { + .subtitle { + font-size: 18px; + line-height: 25px; + text-align: left; + } + } + .o-article { padding-bottom: 0; diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 47eee63ed0..a896350d53 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -262,7 +262,7 @@ Styling related specifically to digital publications ***/ .p-digitalpublicationarticle-show, .p-digitalpublicationarticle-preview { - .o-blocks { + .o-blocks { .author-links { a { color: $color__link--accent; From 56c0e4bb8695f5fdab2e55360f42b3c7dd64e155 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 9 Aug 2024 15:05:52 -0500 Subject: [PATCH 052/346] Become sticky when 180px of unsticky header is visible [PUB-200] --- frontend/js/behaviors/core/stickyDigitalPublicationHeader.js | 4 +++- frontend/scss/molecules/_m-article-header.scss | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/js/behaviors/core/stickyDigitalPublicationHeader.js b/frontend/js/behaviors/core/stickyDigitalPublicationHeader.js index e7b359b4cb..ae777c93a7 100644 --- a/frontend/js/behaviors/core/stickyDigitalPublicationHeader.js +++ b/frontend/js/behaviors/core/stickyDigitalPublicationHeader.js @@ -1,4 +1,5 @@ const stickyDigitalPublicationHeader = function(container) { + const HEADER_HEIGHT = 180; // in px const HEADER_STICKY = 's-sticky-digital-publication-header'; const HEADER_UNSTICKY = 's-unsticky-digital-publication-header'; @@ -42,8 +43,9 @@ const stickyDigitalPublicationHeader = function(container) { function update() { let scrollTop = document.documentElement.scrollTop || document.body.scrollTop; + let containerHeight = container.offsetHeight; - if (scrollTop < containerTop) { + if (scrollTop < (containerTop + containerHeight - HEADER_HEIGHT)) { setState(HEADER_UNSTICKY); } else { setState(HEADER_STICKY); diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 56526d7ec9..0d45844c22 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1602,9 +1602,9 @@ a.m-article-header__img-credit { .m-article-header__spacer { display: none; - .s-sticky-digital-publication-header & { + .s-sticky-digital-publication-header:not(.s-scroll-direction-up) & { display: block; - height: 220px; + height: 75vh; width: 100vw; } } From 681b9c52ec18624e2f8754ea50cc6360017bdaf0 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 9 Aug 2024 10:24:24 -0500 Subject: [PATCH 053/346] Make sticky sidebar play nice with sticky header [PUB-218] --- frontend/js/behaviors/core/stickySidebar.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index 7ed69a5404..6f8cb98561 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -38,7 +38,7 @@ const stickySidebar = function(container){ } } - let article = document.querySelector('.o-article'); + let article; let logo = document.querySelector('.m-article-actions--publication__logo'); let scrollTop; @@ -48,6 +48,7 @@ const stickySidebar = function(container){ let containerHeight; let navContainer; + let stickyHeader; const sidebarOverlayState = 'is-sidebar-overlay'; let overlayActive = document.documentElement.classList.contains(sidebarOverlayState); @@ -62,7 +63,10 @@ const stickySidebar = function(container){ containerHeight = container.offsetHeight; + article = document.querySelector('.o-article'); navContainer = document.querySelector('.g-header'); + stickyHeader = document.querySelector('.m-article-header--digital-publication'); + containerTop = getOffsetTop(container) + document.body.scrollTop; if (scrollTop < containerTop) { top(); From 1b974f19aae649f73db3b2c99411c01d57069831 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 9 Aug 2024 10:34:51 -0500 Subject: [PATCH 054/346] Remove unused lines [PUB-218] --- frontend/js/behaviors/core/stickySidebar.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index 6f8cb98561..b92dc53153 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -48,7 +48,6 @@ const stickySidebar = function(container){ let containerHeight; let navContainer; - let stickyHeader; const sidebarOverlayState = 'is-sidebar-overlay'; let overlayActive = document.documentElement.classList.contains(sidebarOverlayState); @@ -65,7 +64,6 @@ const stickySidebar = function(container){ article = document.querySelector('.o-article'); navContainer = document.querySelector('.g-header'); - stickyHeader = document.querySelector('.m-article-header--digital-publication'); containerTop = getOffsetTop(container) + document.body.scrollTop; if (scrollTop < containerTop) { From b2f930ad4b143a28edc40cbab9224fd923403d86 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 20 Aug 2024 15:56:46 -0500 Subject: [PATCH 055/346] Remove redeclaration of `containerTop` variable on sticky header update [PUB-200] This header should only be set once when the page loads, so it can be used a marker of the `y` coordinate at which the sidebar should become sticky. Currently this happens in the `handleResize()` method which is called in the `_init()` function. --- frontend/js/behaviors/core/stickySidebar.js | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index b92dc53153..2ba416a7d7 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -64,7 +64,6 @@ const stickySidebar = function(container){ article = document.querySelector('.o-article'); navContainer = document.querySelector('.g-header'); - containerTop = getOffsetTop(container) + document.body.scrollTop; if (scrollTop < containerTop) { top(); From eb2c24f3cbeccf13ed19487a51b07f040367e5db Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 20 Aug 2024 15:57:03 -0500 Subject: [PATCH 056/346] Fix sticky sidebar behavior as user scrolls to top and bottom of page [PUB-200] --- frontend/js/behaviors/core/stickySidebar.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index 2ba416a7d7..399f7e9482 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -48,6 +48,7 @@ const stickySidebar = function(container){ let containerHeight; let navContainer; + let stickyHeaderContainer; const sidebarOverlayState = 'is-sidebar-overlay'; let overlayActive = document.documentElement.classList.contains(sidebarOverlayState); @@ -64,8 +65,9 @@ const stickySidebar = function(container){ article = document.querySelector('.o-article'); navContainer = document.querySelector('.g-header'); + stickyHeaderContainer = document.querySelector('.m-article-header'); - if (scrollTop < containerTop) { + if (scrollTop < containerTop - (document.documentElement.classList.contains('s-sticky-digital-publication-header') ? stickyHeaderContainer.offsetHeight : 0)) { top(); container.style.marginTop = '0px'; } else { @@ -73,7 +75,7 @@ const stickySidebar = function(container){ bottom(); } else { sticky(); - (document.documentElement.classList.contains('s-scroll-direction-up') && !document.documentElement.classList.contains('s-unsticky-header')) ? container.style.marginTop = navContainer.offsetHeight + 'px' : container.style.marginTop = '0px'; + container.style.marginTop = ((!document.documentElement.classList.contains('s-unsticky-header') ? navContainer.clientHeight : 0) + (!document.documentElement.classList.contains('s-unsticky-digital-publication-header') ? stickyHeaderContainer.clientHeight : 0)) + 'px'; } } } From 422ef966dc61dd44fed5bbc3d6941dbdfb95eb24 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:43:38 -0500 Subject: [PATCH 057/346] Update the min-height for entry listings [WEB-2911] --- frontend/scss/molecules/_m-listing.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/scss/molecules/_m-listing.scss b/frontend/scss/molecules/_m-listing.scss index e77c8db24e..3174c7f79b 100644 --- a/frontend/scss/molecules/_m-listing.scss +++ b/frontend/scss/molecules/_m-listing.scss @@ -2284,6 +2284,10 @@ a:focus:hover .btn--magazine { padding: 50% !important; } + .m-listing__meta { + min-height: 118px; + } + .type { font-weight: 400; font-size: 18px !important; From 5c36aa60e526c1ac391a5851002f2319cd5a4985 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 20 Aug 2024 15:57:28 -0500 Subject: [PATCH 058/346] Stretch title color block of header on xlarge screens [PUB-200] --- frontend/scss/molecules/_m-article-header.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 0d45844c22..5cbc6b735f 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1176,7 +1176,7 @@ z-index: 1; } .m-article-header__text::before { - left: -50%; + left: -100%; margin-left: 0; max-width: colspan(14, xlarge); } From c0ae739b3817ef0764def62232588dad0720b521 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:43:55 -0500 Subject: [PATCH 059/346] Add check if topLevelArticle is suppressed [WEB-2911] --- .../site/digitalPublicationDetail.blade.php | 375 +++++++++--------- 1 file changed, 195 insertions(+), 180 deletions(-) diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index e07654f471..f5aaeeb899 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -162,72 +162,25 @@ @endif {{-- Listing Component --}} - @component('components.organisms._o-grid-listing') - @slot('cols_small','2') - @slot('cols_medium','3') - @slot('cols_large','3') - @slot('cols_xlarge','3') - - @foreach ($topLevelArticle->children->filter(function($item) { - return !$item->suppress_listing; - })->sortBy('position') as $item) - @if ($loop->iteration <= 3 || $showAll == true) - @component('components.molecules._m-listing----digital-publication-article') - @slot('href', $item->present()->url) - @slot('image', $item->imageFront('hero')) - @slot('type', $item->present()->type) - @slot('title', $item->present()->title) - @slot('title_display', $item->present()->title_display) - @slot('list_description', $item->present()->list_description) - @slot('author_display', $item->showAuthors()) - @slot('imageSettings', array( - 'fit' => 'crop', - 'ratio' => '16:9', - 'srcset' => array(200,400,600), - 'sizes' => ImageHelpers::aic_imageSizes(array( - 'xsmall' => '216px', - 'small' => '216px', - 'medium' => '18', - 'large' => '13', - 'xlarge' => '13', - )), - )) - @endcomponent - @endif - @endforeach - @endcomponent - @break - - @case('entries') - - {{-- Title Component --}} - @if (!$topLevelArticle->hide_title) - @component('components.molecules._m-title-bar', [ - 'variation' => 'm-title-bar--compact m-title-bar--light', - ]) - @slot('links', (!in_array(count($topLevelArticle->children), [0, 4, 8])) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) - {!! $topLevelArticle->title !!} - @endcomponent - @endif - - {{-- Listing Component --}} - @component('components.organisms._o-grid-listing') - @slot('cols_xsmall','2') - @slot('cols_small','2') - @slot('cols_medium','4') - @slot('cols_large','4') - @slot('cols_xlarge','4') + @if (!$topLevelArticle->suppress_listing) + @component('components.organisms._o-grid-listing') + @slot('cols_small','2') + @slot('cols_medium','3') + @slot('cols_large','3') + @slot('cols_xlarge','3') - @foreach ($topLevelArticle->children->filter(function($item) use($topLevelArticle) { - return !$item->suppress_listing; - })->sortBy('position')->take($showAll ? $topLevelArticle->children->count() : (count($topLevelArticle->children) >= 8 ? 8 : 4)) as $item) - @if (count($topLevelArticle->children) > 0) - @component('components.molecules._m-listing----digital-publication-article-entry') + @foreach ($topLevelArticle->children->filter(function($item) { + return !$item->suppress_listing; + })->sortBy('position') as $item) + @if ($loop->iteration <= 3 || $showAll == true) + @component('components.molecules._m-listing----digital-publication-article') @slot('href', $item->present()->url) @slot('image', $item->imageFront('hero')) + @slot('type', $item->present()->type) @slot('title', $item->present()->title) @slot('title_display', $item->present()->title_display) - @slot('label', $item->present()->label) + @slot('list_description', $item->present()->list_description) + @slot('author_display', $item->showAuthors()) @slot('imageSettings', array( 'fit' => 'crop', 'ratio' => '16:9', @@ -241,97 +194,103 @@ )), )) @endcomponent - @endif - @endforeach - - @endcomponent + @endif + @endforeach + @endcomponent + @endif @break - @case('group_entries') + @case('entries') {{-- Title Component --}} @if (!$topLevelArticle->hide_title) @component('components.molecules._m-title-bar', [ 'variation' => 'm-title-bar--compact m-title-bar--light', ]) - @slot('links', (count($topLevelArticle->children) > 9) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) + @slot('links', (!in_array(count($topLevelArticle->children), [0, 4, 8])) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) {!! $topLevelArticle->title !!} @endcomponent @endif {{-- Listing Component --}} - @component('components.organisms._o-grid-listing') - @slot('cols_xsmall','1') - @slot('cols_small','1') - @slot('cols_medium','3') - @slot('cols_large','3') - @slot('cols_xlarge','3') - - @foreach ($topLevelArticle->children->filter(function($item) { - return !$item->suppress_listing; - })->sortBy('position') as $item) - @if($loop->iteration <= 9 || $showAll == true) - @component('components.molecules._m-listing----cover') - @slot('variation', 'm-listing--cover--digital-publication') - @slot('href', $item->present()->url) - @slot('image', $item->imageFront('hero')) - @slot('title', $item->present()->title) - @endcomponent - @endif - @endforeach + @if (!$topLevelArticle->suppress_listing) + @component('components.organisms._o-grid-listing') + @slot('cols_xsmall','2') + @slot('cols_small','2') + @slot('cols_medium','4') + @slot('cols_large','4') + @slot('cols_xlarge','4') + @foreach ($topLevelArticle->children->filter(function($item) use($topLevelArticle) { + return !$item->suppress_listing; + })->sortBy('position')->take($showAll ? $topLevelArticle->children->count() : (count($topLevelArticle->children) >= 8 ? 8 : 4)) as $item) + @if (count($topLevelArticle->children) > 0) + @component('components.molecules._m-listing----digital-publication-article-entry') + @slot('href', $item->present()->url) + @slot('image', $item->imageFront('hero')) + @slot('title', $item->present()->title) + @slot('title_display', $item->present()->title_display) + @slot('label', $item->present()->label) + @slot('imageSettings', array( + 'fit' => 'crop', + 'ratio' => '16:9', + 'srcset' => array(200,400,600), + 'sizes' => ImageHelpers::aic_imageSizes(array( + 'xsmall' => '216px', + 'small' => '216px', + 'medium' => '18', + 'large' => '13', + 'xlarge' => '13', + )), + )) + @endcomponent + @endif + @endforeach - @endcomponent + @endcomponent + @endif @break - @case('list') + @case('group_entries') {{-- Title Component --}} @if (!$topLevelArticle->hide_title) @component('components.molecules._m-title-bar', [ 'variation' => 'm-title-bar--compact m-title-bar--light', ]) - @slot('links', (count($topLevelArticle->children) > 3) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) + @slot('links', (count($topLevelArticle->children) > 9) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) {!! $topLevelArticle->title !!} @endcomponent @endif {{-- Listing Component --}} - @component('components.organisms._o-grid-listing') - @slot('cols_small','1') + @if (!$topLevelArticle->suppress_listing) + @component('components.organisms._o-grid-listing') + @slot('cols_xsmall','1') + @slot('cols_small','1') + @slot('cols_medium','3') + @slot('cols_large','3') + @slot('cols_xlarge','3') - @foreach ($topLevelArticle->children->filter(function($item) { - return !$item->suppress_listing; - })->sortBy('position') as $item) - @if ($loop->iteration <= 3 || $showAll == true) - @component('components.molecules._m-listing----digital-publication-article') - @slot('variation', 'm-listing--seventy-thirty') - @slot('href', $item->present()->url) - @slot('image', $item->imageFront('hero')) - @slot('type', $item->present()->type) - @slot('title', $item->present()->title) - @slot('title_display', $item->present()->title_display) - @slot('list_description', $item->present()->list_description) - @slot('author_display', $item->showAuthors()) - @slot('imageSettings', array( - 'fit' => 'crop', - 'ratio' => '16:9', - 'srcset' => array(200,400,600), - 'sizes' => ImageHelpers::aic_imageSizes(array( - 'xsmall' => '216px', - 'small' => '216px', - 'medium' => '18', - 'large' => '13', - 'xlarge' => '13', - )), - )) - @endcomponent - @endif - @endforeach + @foreach ($topLevelArticle->children->filter(function($item) { + return !$item->suppress_listing; + })->sortBy('position') as $item) + @if($loop->iteration <= 9 || $showAll == true) + @component('components.molecules._m-listing----cover') + @slot('variation', 'm-listing--cover--digital-publication') + @slot('href', $item->present()->url) + @slot('image', $item->imageFront('hero')) + @slot('title', $item->present()->title) + @endcomponent + @endif + @endforeach - @endcomponent + + @endcomponent + @endif @break - @case('simple_list') + + @case('list') {{-- Title Component --}} @if (!$topLevelArticle->hide_title) @@ -344,28 +303,16 @@ @endif {{-- Listing Component --}} - @if ($showAll == true) + @if (!$topLevelArticle->suppress_listing) @component('components.organisms._o-grid-listing') - @slot('cols_small','2') - @slot('cols_medium','3') - @slot('cols_large','3') - @slot('cols_xlarge','3') - @endif + @slot('cols_small','1') - @if(count($topLevelArticle->children) > 0) @foreach ($topLevelArticle->children->filter(function($item) { return !$item->suppress_listing; - })->sortBy('position')->take($showAll ? count($topLevelArticle->children) : 3) as $item) - @if ($showAll !== true) - @component('components.molecules._m-digipub-title-bar', [ - 'variation' => 'm-title-bar--compact m-title-bar--no-hr', - ]) - @slot('item', $item) - {!! $item->present()->type !!} - @endcomponent - @else + })->sortBy('position') as $item) + @if ($loop->iteration <= 3 || $showAll == true) @component('components.molecules._m-listing----digital-publication-article') - @slot('variation', 'm-listing--title-only') + @slot('variation', 'm-listing--seventy-thirty') @slot('href', $item->present()->url) @slot('image', $item->imageFront('hero')) @slot('type', $item->present()->type) @@ -388,17 +335,82 @@ @endcomponent @endif @endforeach - @else - @component('components.molecules._m-digipub-title-bar', [ - 'variation' => 'm-title-bar--compact m-title-bar--no-hr', - ]) - @slot('item', $topLevelArticle) - {!! $topLevelArticle->present()->type !!} + + @endcomponent + @endif + @break + @case('simple_list') + + {{-- Title Component --}} + @if (!$topLevelArticle->hide_title) + @component('components.molecules._m-title-bar', [ + 'variation' => 'm-title-bar--compact m-title-bar--light', + ]) + @slot('links', (count($topLevelArticle->children) > 3) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) + {!! $topLevelArticle->title !!} + @endcomponent + @endif + + {{-- Listing Component --}} + @if (!$topLevelArticle->suppress_listing) + + @if ($showAll == true) + @component('components.organisms._o-grid-listing') + @slot('cols_small','2') + @slot('cols_medium','3') + @slot('cols_large','3') + @slot('cols_xlarge','3') + @endif + + @if(count($topLevelArticle->children) > 0) + @foreach ($topLevelArticle->children->filter(function($item) { + return !$item->suppress_listing; + })->sortBy('position')->take($showAll ? count($topLevelArticle->children) : 3) as $item) + @if ($showAll !== true) + @component('components.molecules._m-digipub-title-bar', [ + 'variation' => 'm-title-bar--compact m-title-bar--no-hr', + ]) + @slot('item', $item) + {!! $item->present()->type !!} + @endcomponent + @else + @component('components.molecules._m-listing----digital-publication-article') + @slot('variation', 'm-listing--title-only') + @slot('href', $item->present()->url) + @slot('image', $item->imageFront('hero')) + @slot('type', $item->present()->type) + @slot('title', $item->present()->title) + @slot('title_display', $item->present()->title_display) + @slot('list_description', $item->present()->list_description) + @slot('author_display', $item->showAuthors()) + @slot('imageSettings', array( + 'fit' => 'crop', + 'ratio' => '16:9', + 'srcset' => array(200,400,600), + 'sizes' => ImageHelpers::aic_imageSizes(array( + 'xsmall' => '216px', + 'small' => '216px', + 'medium' => '18', + 'large' => '13', + 'xlarge' => '13', + )), + )) + @endcomponent + @endif + @endforeach + @else + @component('components.molecules._m-digipub-title-bar', [ + 'variation' => 'm-title-bar--compact m-title-bar--no-hr', + ]) + @slot('item', $topLevelArticle) + {!! $topLevelArticle->present()->type !!} + @endcomponent + @endif + + @if ($showAll == true) @endcomponent @endif - @if ($showAll == true) - @endcomponent @endif @break @@ -414,40 +426,43 @@ @endcomponent @endif - @component('components.organisms._o-grid-listing') - @slot('cols_small','2') - @slot('cols_medium','3') - @slot('cols_large','3') - @slot('cols_xlarge','3') - - @foreach ($topLevelArticle->children->filter(function($item) { - return !$item->suppress_listing; - })->sortBy('position') as $item) - @if ($loop->iteration <= 3 || $showAll == true) - @component('components.molecules._m-listing----digital-publication-article') - @slot('href', $item->present()->url) - @slot('image', $item->imageFront('hero')) - @slot('type', $item->present()->type) - @slot('title', $item->present()->title) - @slot('title_display', $item->present()->title_display) - @slot('list_description', $item->present()->list_description) - @slot('author_display', $item->showAuthors()) - @slot('imageSettings', array( - 'fit' => 'crop', - 'ratio' => '16:9', - 'srcset' => array(200,400,600), - 'sizes' => ImageHelpers::aic_imageSizes(array( - 'xsmall' => '216px', - 'small' => '216px', - 'medium' => '18', - 'large' => '13', - 'xlarge' => '13', - )), - )) - @endcomponent - @endif - @endforeach - @endcomponent + {{-- Listing Component --}} + @if (!$topLevelArticle->suppress_listing) + @component('components.organisms._o-grid-listing') + @slot('cols_small','2') + @slot('cols_medium','3') + @slot('cols_large','3') + @slot('cols_xlarge','3') + + @foreach ($topLevelArticle->children->filter(function($item) { + return !$item->suppress_listing; + })->sortBy('position') as $item) + @if ($loop->iteration <= 3 || $showAll == true) + @component('components.molecules._m-listing----digital-publication-article') + @slot('href', $item->present()->url) + @slot('image', $item->imageFront('hero')) + @slot('type', $item->present()->type) + @slot('title', $item->present()->title) + @slot('title_display', $item->present()->title_display) + @slot('list_description', $item->present()->list_description) + @slot('author_display', $item->showAuthors()) + @slot('imageSettings', array( + 'fit' => 'crop', + 'ratio' => '16:9', + 'srcset' => array(200,400,600), + 'sizes' => ImageHelpers::aic_imageSizes(array( + 'xsmall' => '216px', + 'small' => '216px', + 'medium' => '18', + 'large' => '13', + 'xlarge' => '13', + )), + )) + @endcomponent + @endif + @endforeach + @endcomponent + @endif @endswitch @endforeach From dd125a1a145b682ea45fffa714b013dcebacb61a Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 21 Aug 2024 09:16:30 -0500 Subject: [PATCH 060/346] Finish sticky digipub header [PUB-200] --- .../core/stickyDigitalPublicationHeader.js | 44 ++++++++---- .../scss/molecules/_m-article-header.scss | 69 +++++++++++++++++-- 2 files changed, 94 insertions(+), 19 deletions(-) diff --git a/frontend/js/behaviors/core/stickyDigitalPublicationHeader.js b/frontend/js/behaviors/core/stickyDigitalPublicationHeader.js index ae777c93a7..8580be6a1e 100644 --- a/frontend/js/behaviors/core/stickyDigitalPublicationHeader.js +++ b/frontend/js/behaviors/core/stickyDigitalPublicationHeader.js @@ -1,7 +1,8 @@ const stickyDigitalPublicationHeader = function(container) { - const HEADER_HEIGHT = 180; // in px - const HEADER_STICKY = 's-sticky-digital-publication-header'; - const HEADER_UNSTICKY = 's-unsticky-digital-publication-header'; + const MIN_CONTAINER_HEIGHT = 180; // in px + const HEADER_IS_STICKY = 's-sticky-digital-publication-header'; + const HEADER_IS_SHRINKING = 's-shrinking-digital-publication-header'; + const HEADER_AT_MIN_HEIGHT = 's-min-height-digital-publication-header'; const getOffsetTop = element => { let offsetTop = 0; @@ -14,7 +15,7 @@ const stickyDigitalPublicationHeader = function(container) { const setState = targetState => { let classList = document.documentElement.classList; - let possibleStates = [HEADER_STICKY, HEADER_UNSTICKY]; + let possibleStates = [HEADER_IS_STICKY, HEADER_IS_SHRINKING, HEADER_AT_MIN_HEIGHT]; possibleStates.forEach(state => { if (state !== targetState && classList.contains(state)) { classList.remove(state); @@ -29,32 +30,51 @@ const stickyDigitalPublicationHeader = function(container) { }; const resetScroll = () => { - if (currentState == HEADER_STICKY) { + if (currentState == HEADER_IS_STICKY) { container.scrollTo(0, 0); } }; let currentState; - let containerTop = getOffsetTop(container) + document.body.scrollTop; + let containerOffsetHeight; + let scrollTop; function handleScroll() { window.requestAnimationFrame(update); } + function handleResize() { + containerOffsetHeight = getOffsetTop(container) + container.offsetHeight; + handleScroll(); + } + function update() { - let scrollTop = document.documentElement.scrollTop || document.body.scrollTop; - let containerHeight = container.offsetHeight; + let navContainerHeight = document.querySelector('.g-header').clientHeight; + scrollTop = document.documentElement.scrollTop || document.body.scrollTop; - if (scrollTop < (containerTop + containerHeight - HEADER_HEIGHT)) { - setState(HEADER_UNSTICKY); + if (scrollTop < navContainerHeight) { + // If user has not scrolled past nav container to the digital publication + // header, unset state + setState(null); + } else if (scrollTop < (containerOffsetHeight - MIN_CONTAINER_HEIGHT)) { + // If user has not scrolled to the container's minimum height, header is + // "shrinking down to the minimum size" + setState(HEADER_IS_SHRINKING); + } else if (scrollTop < containerOffsetHeight) { + // If user has not scrolled to the container offset height, display the + // header at its mininum height + setState(HEADER_AT_MIN_HEIGHT); } else { - setState(HEADER_STICKY); + // As user continues to scroll down the page, keep the header stuck to the + // top of the page + setState(HEADER_IS_STICKY); } } function _init() { + window.addEventListener('resized', handleResize); window.addEventListener('scroll', handleScroll); - setState(HEADER_STICKY); + handleResize(); resetScroll(); handleScroll(); } diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 5cbc6b735f..30200b315e 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1099,6 +1099,8 @@ } .title { + font-size: 28px; + line-height: 34px; margin-top: 26px; } @@ -1135,14 +1137,61 @@ margin-top: 35px; } } + @include breakpoint('medium-') { + .s-sticky-digital-publication-header &~.m-sidebar-toggle { + position: fixed; + top: 0; + width: 100vw; + z-index: map-get($zindexs, 'header'); + + &::before { + left: 0; + width: 150vw; + } + } + } @include breakpoint('large+') { flex-flow: row-reverse nowrap; + .title { + opacity: 1; + } + + .subtitle { + opacity: 1; + } + + .s-shrinking-digital-publication-header.s-scroll-direction-down & { + .title { + opacity: 0; + transition: opacity 1s; + } + + .subtitle { + opacity: 0; + transition: opacity 1s; + } + } + + .s-min-height-digital-publication-header & { + .title { + opacity: 1; + transition: opacity 2s; + } + } + + .s-min-height-digital-publication-header &, .s-sticky-digital-publication-header & { position: fixed; top: 0; width: 100%; + z-index: map-get($zindexs, 'header'); + + .title { + margin-bottom: auto; + margin-top: auto; + } .subtitle { display: none; @@ -1176,10 +1225,13 @@ z-index: 1; } .m-article-header__text::before { - left: -100%; + left: -50%; margin-left: 0; max-width: colspan(14, xlarge); } + .m-article-header__img { + flex: 0 0 auto; + } } } @@ -1600,11 +1652,14 @@ a.m-article-header__img-credit { outline: 1px solid $color__black--54; } -.m-article-header__spacer { - display: none; - .s-sticky-digital-publication-header:not(.s-scroll-direction-up) & { - display: block; - height: 75vh; - width: 100vw; +@include breakpoint('large+') { + .m-article-header__spacer { + display: none; + .s-min-height-digital-publication-header.s-scroll-direction-down &, + .s-sticky-digital-publication-header.s-scroll-direction-down & { + display: block; + height: 75vh; + width: 100vw; + } } } From ace9cfb9a95ff00542feaba5d676c9a4e46c2d96 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:50:30 -0500 Subject: [PATCH 061/346] Update digipub entries variation count for browseAll logic [WEB-2911] --- resources/views/site/digitalPublicationDetail.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index f5aaeeb899..01e45cf282 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -207,7 +207,7 @@ @component('components.molecules._m-title-bar', [ 'variation' => 'm-title-bar--compact m-title-bar--light', ]) - @slot('links', (!in_array(count($topLevelArticle->children), [0, 4, 8])) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) + @slot('links', (count($topLevelArticle->children) > 4 && count($topLevelArticle->children) != 8) ? $topLevelArticle->present()->getBrowseMoreLink($showAll) : []) {!! $topLevelArticle->title !!} @endcomponent @endif From ca1fa3c4d6fe3ff4193eedb537ad4f70103c9ce8 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 21 Aug 2024 16:31:50 -0500 Subject: [PATCH 062/346] Hide sidebar title on publication landing page [PUB-218] --- frontend/scss/organisms/_o-article__primary-actions.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index c8f4e10785..847c89633e 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -269,6 +269,12 @@ margin-bottom: 40px; white-space: nowrap; + @include breakpoint('large+') { + .p-digitalpublications-show & { + display: none !important; + } + } + @include font-styles-untuck(generate-font-obj( ( font-family: $serif-font, From 38e20417a23d2592f2579b8723b2e7e0957fbe0a Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 21 Aug 2024 16:32:01 -0500 Subject: [PATCH 063/346] Remove `sidebar_title_display` and use `header_title_display` to display publication title [PUB-218] --- app/Models/DigitalPublication.php | 1 - ...2309_drop_sidebar_title_display_column.php | 22 +++++++++++++++++++ ...e-actions----digital-publication.blade.php | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 database/migrations/2024_08_21_162309_drop_sidebar_title_display_column.php diff --git a/app/Models/DigitalPublication.php b/app/Models/DigitalPublication.php index 7ba7365a69..7a5d3f84fb 100644 --- a/app/Models/DigitalPublication.php +++ b/app/Models/DigitalPublication.php @@ -42,7 +42,6 @@ class DigitalPublication extends AbstractModel 'cite_as', 'header_title_display', 'header_subtitle_display', - 'sidebar_title_display', 'bgcolor', 'toggle_autorelated', ]; diff --git a/database/migrations/2024_08_21_162309_drop_sidebar_title_display_column.php b/database/migrations/2024_08_21_162309_drop_sidebar_title_display_column.php new file mode 100644 index 0000000000..b0f9a7adab --- /dev/null +++ b/database/migrations/2024_08_21_162309_drop_sidebar_title_display_column.php @@ -0,0 +1,22 @@ +dropColumn('sidebar_title_display'); + }); + } + + public function down(): void + { + Schema::table('digital_publications', function (Blueprint $table) { + $table->text('sidebar_title_display')->nullable(); + }); + } +}; diff --git a/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php b/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php index e7e84ec3eb..89e76318c4 100644 --- a/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php +++ b/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php @@ -6,7 +6,7 @@ From ff23f3d19e12e1ac87d45133a2736504dd5a1be6 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 21 Aug 2024 15:26:40 -0500 Subject: [PATCH 064/346] Ensure edge of header is flush with xlarge screen sizes [PUB-200] --- frontend/scss/molecules/_m-article-header.scss | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 30200b315e..1db1c58eca 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1221,16 +1221,18 @@ @include breakpoint('xlarge') { .m-article-header__text { - max-width: colspan(14, xlarge); + max-width: colspan(14, 'xlarge'); z-index: 1; } .m-article-header__text::before { - left: -50%; + left: -300%; margin-left: 0; - max-width: colspan(14, xlarge); + max-width: colspan(50, 'xlarge'); } .m-article-header__img { - flex: 0 0 auto; + height: 75vh; + right: 50%; + margin-right: -50vw; } } } From bb84950405c1e1b345a5e717bda71d59059e97fc Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Thu, 22 Aug 2024 10:03:44 -0500 Subject: [PATCH 065/346] Make main nav in digital publication articles not sticky [PUB-218] --- app/Http/Controllers/DigitalPublicationArticleController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/DigitalPublicationArticleController.php b/app/Http/Controllers/DigitalPublicationArticleController.php index 3c1749fa4c..1b0f53eb8c 100644 --- a/app/Http/Controllers/DigitalPublicationArticleController.php +++ b/app/Http/Controllers/DigitalPublicationArticleController.php @@ -49,7 +49,7 @@ public function show($pubId, $pubSlug, $id, $slug = null) 'item' => $item, 'contrastHeader' => false, 'borderlessHeader' => false, - 'unstickyHeader' => false, + 'unstickyHeader' => true, 'canonicalUrl' => $canonicalPath, ]); } From 9dba04b6cfbe7ca9519a6bb50439db94b3cd38e8 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 21 Aug 2024 16:34:24 -0500 Subject: [PATCH 066/346] Hide sidebar title on publication listing page [PUB-218] --- frontend/scss/organisms/_o-article__primary-actions.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index 847c89633e..03a05d4c7e 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -270,7 +270,8 @@ white-space: nowrap; @include breakpoint('large+') { - .p-digitalpublications-show & { + .p-digitalpublications-show &, + .p-digitalpublications-showlisting & { display: none !important; } } From 6485cdcd85d21e8a6d84513541981bf12acc4d2b Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 22 Aug 2024 14:33:50 -0500 Subject: [PATCH 067/346] Fade between full and min header image [PUB-200] --- .../scss/molecules/_m-article-header.scss | 24 +++++++++++++------ .../_m-article-header----feature.blade.php | 1 + 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 1db1c58eca..1b09df9786 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1163,14 +1163,19 @@ } .s-shrinking-digital-publication-header.s-scroll-direction-down & { + .m-article-header__img img { + opacity: 0; + transition: opacity 2s; + } + .title { opacity: 0; - transition: opacity 1s; + transition: opacity 2s; } .subtitle { opacity: 0; - transition: opacity 1s; + transition: opacity 2s; } } @@ -1198,7 +1203,13 @@ } .m-article-header__img { + flex: 0 0 auto; height: 180px; + + img { + opacity: 1; + transition: opacity 2s; + } } } @@ -1216,6 +1227,10 @@ height: 75vh; right: 50%; margin-right: -50vw; + + &::before { + z-index: -1; + } } } @@ -1229,11 +1244,6 @@ margin-left: 0; max-width: colspan(50, 'xlarge'); } - .m-article-header__img { - height: 75vh; - right: 50%; - margin-right: -50vw; - } } } diff --git a/resources/views/components/molecules/_m-article-header----feature.blade.php b/resources/views/components/molecules/_m-article-header----feature.blade.php index 0770ea0be8..5b8bf314ef 100644 --- a/resources/views/components/molecules/_m-article-header----feature.blade.php +++ b/resources/views/components/molecules/_m-article-header----feature.blade.php @@ -1,5 +1,6 @@ @if ($bgcolor ?? false) +@endif +
@if ($item->type == DigitalPublicationArticleType::Contributions) @component('components.molecules._m-article-header----digital-publication-article') From 7aca9d8ee48e475d11660fa9c596c4a0e4a2b1e4 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 23 Aug 2024 16:25:39 -0500 Subject: [PATCH 081/346] Trim down listing page header from landing page [PUB-216] --- .../scss/molecules/_m-article-header.scss | 130 ++++++++++++------ .../_m-article-header----feature.blade.php | 4 +- 2 files changed, 87 insertions(+), 47 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index b1dd97cc10..4baac4a18e 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1137,6 +1137,7 @@ margin-top: 35px; } } + @include breakpoint('medium-') { .s-sticky-digital-publication-header { &~.m-sidebar-toggle { @@ -1167,24 +1168,85 @@ opacity: 1; } - .s-shrinking-digital-publication-header.s-scroll-direction-down & { - .m-article-header__img img { - opacity: 0; - transition: opacity 2s; + .m-article-header__text { + flex: 0 0 colspan(14, 'large'); + padding-right: initial; + padding-left: initial; + } + + .m-article-header__img { + left: auto; + margin-left: auto; + + flex: 0 0 colspan(50, 'large'); + height: 75vh; + right: 50%; + margin-right: -50vw; + + &::before { + z-index: -1; + } + } + } + + @include breakpoint('xlarge') { + .m-article-header__text { + max-width: colspan(14, 'xlarge'); + z-index: 1; + } + .m-article-header__text::before { + left: -300%; + margin-left: 0; + max-width: colspan(50, 'xlarge'); + } + } + + .p-digitalpublications-showlisting & { + @include breakpoint('large+') { + .m-article-header__img { + height: 180px; + + img { + display: none; + } } .title { - opacity: 0; - transition: opacity 2s; + margin-bottom: auto; + margin-top: auto; } .subtitle { - opacity: 0; - transition: opacity 2s; + display: none; } + + } + } +} + +// TODO Isolate the following to a _s-sticky-digital-publication-header.scss file? +.s-shrinking-digital-publication-header.s-scroll-direction-down { + @include breakpoint('large+') { + .m-article-header__img img { + opacity: 0; + transition: opacity 2s; } - .s-sticky-digital-publication-header & { + .title { + opacity: 0; + transition: opacity 2s; + } + + .subtitle { + opacity: 0; + transition: opacity 2s; + } + } +} + +.s-sticky-digital-publication-header { + @include breakpoint('large+') { + .m-article-header--digital-publication { position: fixed; top: 0; width: 100%; @@ -1212,40 +1274,29 @@ } } - .m-article-header__text { - flex: 0 0 colspan(14, 'large'); - padding-right: initial; - padding-left: initial; + .m-article-header__spacer { + display: block; + width: 100vw; } - .m-article-header__img { - left: auto; - margin-left: auto; - - flex: 0 0 colspan(50, 'large'); - height: 75vh; - right: 50%; - margin-right: -50vw; - - &::before { - z-index: -1; + &.p-digitalpublications-show { + .m-article-header__spacer { + height: 75vh; } } - } - @include breakpoint('xlarge') { - .m-article-header__text { - max-width: colspan(14, 'xlarge'); - z-index: 1; - } - .m-article-header__text::before { - left: -300%; - margin-left: 0; - max-width: colspan(50, 'xlarge'); + &.p-digitalpublications-showlisting { + .m-article-header__spacer { + height: 180px; + } } } } +.m-article-header__spacer { + display: none; +} + .m-article-header--generic { padding-top: 0; @@ -1662,14 +1713,3 @@ a.m-article-header__img-credit { .m-article-header__img-thumbs button[disabled] + img { outline: 1px solid $color__black--54; } - -@include breakpoint('large+') { - .m-article-header__spacer { - display: none; - .s-sticky-digital-publication-header & { - display: block; - height: 75vh; - width: 100vw; - } - } -} diff --git a/resources/views/components/molecules/_m-article-header----feature.blade.php b/resources/views/components/molecules/_m-article-header----feature.blade.php index 5b8bf314ef..2786864c9a 100644 --- a/resources/views/components/molecules/_m-article-header----feature.blade.php +++ b/resources/views/components/molecules/_m-article-header----feature.blade.php @@ -1,8 +1,8 @@ @if ($bgcolor ?? false) From c3325c05d4ab6a98436da32e809a22453dce6965 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:41:06 -0500 Subject: [PATCH 082/346] Add id for targeting [PUB-233] --- .../_m-listing----digital-publication-article-entry.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/components/molecules/_m-listing----digital-publication-article-entry.blade.php b/resources/views/components/molecules/_m-listing----digital-publication-article-entry.blade.php index dc50d500aa..e7ac155f44 100644 --- a/resources/views/components/molecules/_m-listing----digital-publication-article-entry.blade.php +++ b/resources/views/components/molecules/_m-listing----digital-publication-article-entry.blade.php @@ -1,5 +1,5 @@ <{{ $tag ?? 'li' }} class="m-listing m-listing--digital-publication-article-entry m-listing--w-meta-bottom{{ (isset($variation)) ? ' '.$variation : '' }}"> - + @if ($image) @component('components.atoms._img') From 64b070c252720869500974fd2c149f3e7f4c749c Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Fri, 23 Aug 2024 17:12:29 -0500 Subject: [PATCH 083/346] Style medium and small contribution header [PUB-231] --- frontend/scss/pages/_p-issuearticle-show.scss | 41 +++++++++++++++++++ ...r----digital-publication-article.blade.php | 12 ++++++ .../digitalPublicationArticleDetail.blade.php | 3 +- 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index ef78d64c1c..4ca650531b 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -101,6 +101,47 @@ } } + .m-article-actions--publication__logo { + height: 110px; + padding-bottom: 40px; + color: $color__white; + @include breakpoint('medium-') { + padding-top: 40px; + width: 100vw; + } + + &::before { + content: ""; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: -1; + width: 200vw; + margin-left: calc(-600px + 50%); + @each $name in ('large', 'xlarge') { + @include breakpoint('#{$name}') { + width: calc(#{colspan(14, '#{$name}')} * 2 + (#{colspan(1, '#{$name}')} * 2)); + padding-right: calc(#{colspan(1, '#{$name}')} * 2); + margin-left: calc((#{colspan(14, '#{$name}')} * -1) + (#{colspan(1, '#{$name}')} * -1)); + margin-right: colspan(2, #{$name}); + } + } + } + + @include font-styles-untuck(generate-font-obj( + ( + font-family: $serif-font, + font-family-loaded: $serif-font--loaded, + font-loaded-class: $serif-font-loaded-class, + settings: ( + 'xsmall': (font-size: 22, line-height: 23, push: 0), + ) + ) + )); + } + .o-article { padding-bottom: 0; diff --git a/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php b/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php index 97c82bcb33..382856fa25 100644 --- a/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php +++ b/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php @@ -1,3 +1,12 @@ +@if ($bgcolor ?? false) + +@endif +
@if ($img) @@ -19,4 +28,7 @@ @endcomponent @endif
+
diff --git a/resources/views/site/digitalPublicationArticleDetail.blade.php b/resources/views/site/digitalPublicationArticleDetail.blade.php index 20610a9265..95f805e685 100644 --- a/resources/views/site/digitalPublicationArticleDetail.blade.php +++ b/resources/views/site/digitalPublicationArticleDetail.blade.php @@ -9,6 +9,7 @@ @if ($bgcolor ?? false) @endif diff --git a/resources/views/site/digitalPublicationArticleDetail.blade.php b/resources/views/site/digitalPublicationArticleDetail.blade.php index 0b5ddf1eaf..0a855efae0 100644 --- a/resources/views/site/digitalPublicationArticleDetail.blade.php +++ b/resources/views/site/digitalPublicationArticleDetail.blade.php @@ -12,6 +12,7 @@ .m-article-actions--publication__logo, .m-article-actions--publication__logo::before { background-color: {{ $bgcolor }}; + transition: background-color 1s; } @endif From 48d2bef033cfc22b652b2278cd170aba6447353b Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 29 Aug 2024 12:56:55 -0500 Subject: [PATCH 116/346] Remove left value to cover the top of page [PUB-241] --- frontend/scss/molecules/_m-article-header.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index d275ec3670..3239b61330 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1323,7 +1323,6 @@ margin-left: calc(-600px + 50%); @each $name in ('large', 'xlarge') { @include breakpoint('#{$name}') { - left: calc(#{colspan(14, '#{$name}')} * 2 + (#{colspan(1, '#{$name}')} * 2)); margin-left: calc((#{colspan(14, '#{$name}')} * -1) + (#{colspan(1, '#{$name}')} * -1)); } } From 20a5d6b0222fe839034417636a9ea8abfef5e928 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 29 Aug 2024 12:57:11 -0500 Subject: [PATCH 117/346] Make sure background is transparent to prevent color blocks [PUB-241] --- frontend/scss/pages/_p-issuearticle-show.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 2d521c6e38..8b4b56139e 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -398,7 +398,7 @@ Styling related specifically to digital publications .o-article__primary-actions--digital-publication { .m-article-actions--publication__logo, .m-article-actions--publication__logo::before { - background: $color__white;; + background: transparent !important; } .m-article-actions--publication__logo { From 37259ddd40cb9b46bb8ba0c23c776e0c38b42289 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 29 Aug 2024 12:57:42 -0500 Subject: [PATCH 118/346] Catch case of if sidebar is open don't change color [PUB-241] --- frontend/scss/state/_s-sticky-sidebar.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/scss/state/_s-sticky-sidebar.scss b/frontend/scss/state/_s-sticky-sidebar.scss index 6d4d79b288..89eceae603 100644 --- a/frontend/scss/state/_s-sticky-sidebar.scss +++ b/frontend/scss/state/_s-sticky-sidebar.scss @@ -13,6 +13,11 @@ For _p-issuearticle-show.scss and _p-issue-show.scss } &.is-sidebar-overlay { + .m-article-actions--publication__logo a { + color: $color__text--title !important; + transition: color 1s; + } + @include breakpoint('medium-') { .g-mask { right: 0; From 79d73beb994b7f3bd3b5f4a8a2c32fa34f73f3d9 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 29 Aug 2024 12:57:51 -0500 Subject: [PATCH 119/346] Ensure background color is transparent [PUB-241] --- frontend/scss/state/_s-sticky-sidebar.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/scss/state/_s-sticky-sidebar.scss b/frontend/scss/state/_s-sticky-sidebar.scss index 89eceae603..a54ac81402 100644 --- a/frontend/scss/state/_s-sticky-sidebar.scss +++ b/frontend/scss/state/_s-sticky-sidebar.scss @@ -118,7 +118,7 @@ For _p-issuearticle-show.scss and _p-issue-show.scss .m-article-actions--publication__logo, .m-article-actions--publication__logo::before { - background-color: $color__white; + background-color: transparent; transition: background-color 1s; } @@ -129,7 +129,7 @@ For _p-issuearticle-show.scss and _p-issue-show.scss } .m-article-header--digital-publication-article ~ .m-article-header__text::before { - background-color: $color__white; + background-color: transparent; transition: background-color 1s; } } From 9f46e2010b96b3fee6d12f037cb733c7b38e0f97 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 29 Aug 2024 12:58:43 -0500 Subject: [PATCH 120/346] Color the logo background at medium- sizes [PUB-241] --- resources/views/site/digitalPublicationArticleDetail.blade.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/views/site/digitalPublicationArticleDetail.blade.php b/resources/views/site/digitalPublicationArticleDetail.blade.php index 0a855efae0..1ef950add5 100644 --- a/resources/views/site/digitalPublicationArticleDetail.blade.php +++ b/resources/views/site/digitalPublicationArticleDetail.blade.php @@ -9,8 +9,7 @@ @if ($bgcolor ?? false) From c47c7f998dee5c2a3f7fd7f7f3305b2bf106d189 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Fri, 30 Aug 2024 12:37:16 -0500 Subject: [PATCH 129/346] Add local override of MediaLibrary.vue [PUB-227] --- app/Console/Commands/TwillCopy.php | 19 + .../media-library/MediaLibrary.vue | 668 ++++++++++++++++++ 2 files changed, 687 insertions(+) create mode 100644 app/Console/Commands/TwillCopy.php create mode 100644 resources/assets/js/twill-components/media-library/MediaLibrary.vue diff --git a/app/Console/Commands/TwillCopy.php b/app/Console/Commands/TwillCopy.php new file mode 100644 index 0000000000..41f9bb37d4 --- /dev/null +++ b/app/Console/Commands/TwillCopy.php @@ -0,0 +1,19 @@ + + +
+
+
+ + + +
+ + + {{ selectedType.text }}{{ selectedType.total }} + + + +
+ +
+ + +
+ +
+
+
+ +
+ {{ btnLabel }} + {{ btnLabel }} +
+
+ +
+ + + Loading… +
+
+
+
+
+
+ + + + + + + + From d0f18edd0ee6df424700149af5f52995b7711412 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 3 Sep 2024 16:23:02 -0500 Subject: [PATCH 130/346] Add support for `withTag` and `withoutTag` parameters for media library [PUB-227] --- .../Admin/Vendor/MediaLibraryController.php | 32 +++++++++++++++++++ app/Repositories/MediaRepository.php | 19 +++++++++++ routes/admin.php | 7 ++++ 3 files changed, 58 insertions(+) create mode 100644 app/Http/Controllers/Admin/Vendor/MediaLibraryController.php create mode 100644 app/Repositories/MediaRepository.php diff --git a/app/Http/Controllers/Admin/Vendor/MediaLibraryController.php b/app/Http/Controllers/Admin/Vendor/MediaLibraryController.php new file mode 100644 index 0000000000..20c51df4e6 --- /dev/null +++ b/app/Http/Controllers/Admin/Vendor/MediaLibraryController.php @@ -0,0 +1,32 @@ +request->has('except')) { + $prependScope['exceptIds'] = $this->request->get('except'); + } + if ($this->request->has('withTag')) { + $prependScope['withTag'] = $this->request->get('withTag'); + } + if ($this->request->has('withoutTag')) { + $prependScope['withoutTag'] = $this->request->get('withoutTag'); + } + + return $this->getIndexData($prependScope ?? []); + } + + protected function getNamespace() + { + return 'App'; + } +} diff --git a/app/Repositories/MediaRepository.php b/app/Repositories/MediaRepository.php new file mode 100644 index 0000000000..c08408bfbf --- /dev/null +++ b/app/Repositories/MediaRepository.php @@ -0,0 +1,19 @@ +$column($scopes[$column]); + unset($scopes[$column]); + } + } + return parent::filter($query, $scopes); + } +} diff --git a/routes/admin.php b/routes/admin.php index e955dcf3b1..f685cb041c 100644 --- a/routes/admin.php +++ b/routes/admin.php @@ -10,6 +10,7 @@ use App\Http\Controllers\Admin\FeeController; use App\Http\Controllers\Admin\GalleryController; use App\Http\Controllers\Admin\PageController; +use App\Http\Controllers\Admin\Vendor\MediaLibraryController; Route::module('pages'); @@ -120,3 +121,9 @@ Route::module('tourStops'); Route::module('vanityRedirects'); }); + +if (config('twill.enabled.media-library')) { + Route::group(['prefix' => 'media-library', 'as' => 'media-library.'], function () { + Route::resource('medias', MediaLibraryController::class, ['only' => ['index']]); + }); +} From fc166e1a3100fe824b751bbc587af3c97854643f Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 4 Sep 2024 10:00:06 -0500 Subject: [PATCH 131/346] Replace `article_type` with `category` [PUB-226] --- ...php => DigitalPublicationArticleCategory.php} | 2 +- .../DigitalPublicationArticleController.php | 11 +++++------ app/Models/DigitalPublicationArticle.php | 14 +++++++------- .../Admin/DigitalPublicationArticlePresenter.php | 10 +++++----- .../Admin/DigitalPublicationPresenter.php | 1 - .../DigitalPublicationArticleRepository.php | 7 +++---- .../DigitalPublicationArticleFactory.php | 4 ++-- ...umn_to_digital_publication_articles_table.php | 14 +++++++------- .../articles/create.blade.php | 8 ++++---- .../digitalPublications/articles/form.blade.php | 10 +++++----- .../admin/digitalPublications/form.blade.php | 2 +- .../organisms/_o-table-of-contents.blade.php | 4 ++-- .../digitalPublicationArticleDetail.blade.php | 16 ++++++++-------- .../site/digitalPublicationDetail.blade.php | 5 +---- 14 files changed, 51 insertions(+), 57 deletions(-) rename app/Enums/{DigitalPublicationArticleType.php => DigitalPublicationArticleCategory.php} (78%) diff --git a/app/Enums/DigitalPublicationArticleType.php b/app/Enums/DigitalPublicationArticleCategory.php similarity index 78% rename from app/Enums/DigitalPublicationArticleType.php rename to app/Enums/DigitalPublicationArticleCategory.php index ee1396db5b..0d2024e47f 100644 --- a/app/Enums/DigitalPublicationArticleType.php +++ b/app/Enums/DigitalPublicationArticleCategory.php @@ -2,7 +2,7 @@ namespace App\Enums; -enum DigitalPublicationArticleType: string +enum DigitalPublicationArticleCategory: string { case About = 'about'; case Contributions = 'text'; diff --git a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php index bb6793f16c..704fc0da25 100644 --- a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php +++ b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php @@ -5,7 +5,6 @@ use A17\Twill\Http\Controllers\Admin\NestedModuleController; use App\Repositories\DigitalPublicationRepository; use App\Http\Controllers\Admin\Behaviors\IsNestedModule; -use Illuminate\Support\Collection; class DigitalPublicationArticleController extends NestedModuleController { @@ -28,9 +27,9 @@ class DigitalPublicationArticleController extends NestedModuleController 'edit_link' => true, 'field' => 'title', ], - 'article_type' => [ - 'title' => 'Type', - 'field' => 'articleType', + 'category' => [ + 'title' => 'Category', + 'field' => 'category', 'present' => true, ], ]; @@ -57,7 +56,7 @@ protected function indexData($request) [ 'nested' => true, 'nestedDepth' => 2, - 'types' => $this->repository->getTypes(), + 'categories' => $this->repository->getCategories(), 'articles' => $articlesList, 'breadcrumb' => [ [ @@ -122,7 +121,7 @@ protected function formData($request) $baseUrl = '//' . config('app.url') . '/' . $this->permalinkBase . $digPub->id . '/' . $digPub->getSlug() . '/' . $item->id . '/'; return [ - 'types' => $this->repository->getTypes(), + 'categories' => $this->repository->getCategories(), 'baseUrl' => $baseUrl, 'breadcrumb' => [ [ diff --git a/app/Models/DigitalPublicationArticle.php b/app/Models/DigitalPublicationArticle.php index 83afa72bb0..cb292192c6 100644 --- a/app/Models/DigitalPublicationArticle.php +++ b/app/Models/DigitalPublicationArticle.php @@ -7,7 +7,7 @@ use A17\Twill\Models\Behaviors\HasRevisions; use A17\Twill\Models\Behaviors\HasPosition; use A17\Twill\Models\Behaviors\Sortable; -use App\Enums\DigitalPublicationArticleType; +use App\Enums\DigitalPublicationArticleCategory; use App\Models\Behaviors\HasAuthors; use App\Models\Behaviors\HasMedias; use App\Models\Behaviors\HasMediasEloquent; @@ -37,7 +37,7 @@ class DigitalPublicationArticle extends AbstractModel implements Sortable 'hide_title', 'list_description', 'date', - 'article_type', + 'category', 'listing_display', 'suppress_listing', 'heading', @@ -59,15 +59,15 @@ class DigitalPublicationArticle extends AbstractModel implements Sortable ]; public $casts = [ + 'category' => DigitalPublicationArticleCategory::class, 'date' => 'date', 'publish_start_date' => 'date', 'published' => 'boolean', - 'article_type' => DigitalPublicationArticleType::class, ]; public $attributes = [ + 'category' => 'text', 'published' => false, - 'article_type' => 'entry', ]; public $mediasParams = [ @@ -211,11 +211,11 @@ protected function transformMappingInternal() } ], [ - 'name' => 'article_type', - 'doc' => 'Type of Article', + 'name' => 'category', + 'doc' => 'Category', 'type' => 'string', 'value' => function () { - return $this->present()->articleType; + return $this->present()->category; }, ], [ diff --git a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php index 0025c82005..8b5f9691b9 100644 --- a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php +++ b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php @@ -4,13 +4,13 @@ use Illuminate\Support\Str; use App\Presenters\BasePresenter; -use App\Enums\DigitalPublicationArticleType; +use App\Enums\DigitalPublicationArticleCategory; class DigitalPublicationArticlePresenter extends BasePresenter { public function getCanonicalUrl() { - if ($this->entity->type === DigitalPublicationArticleType::Grouping) { + if ($this->entity->type === DigitalPublicationArticleCategory::Grouping) { return route( 'collection.publications.digital-publications.showListing', [ @@ -23,9 +23,9 @@ public function getCanonicalUrl() } } - public function articleType() + public function category() { - return $this->entity->article_type->name; + return $this->entity->category->name; } public function pdfDownloadPath() @@ -74,7 +74,7 @@ public function countAllChildren($entity) $descendants = $entity->descendants; $filteredDescendants = $descendants->filter(function ($descendant) { - return $descendant->type !== DigitalPublicationArticleType::Grouping; + return $descendant->type !== DigitalPublicationArticleCategory::Grouping; }); return $filteredDescendants->count(); diff --git a/app/Presenters/Admin/DigitalPublicationPresenter.php b/app/Presenters/Admin/DigitalPublicationPresenter.php index 67c6146b6c..adac0f9a69 100644 --- a/app/Presenters/Admin/DigitalPublicationPresenter.php +++ b/app/Presenters/Admin/DigitalPublicationPresenter.php @@ -2,7 +2,6 @@ namespace App\Presenters\Admin; -use App\Enums\DigitalPublicationArticleType; use App\Presenters\BasePresenter; class DigitalPublicationPresenter extends BasePresenter diff --git a/app/Repositories/DigitalPublicationArticleRepository.php b/app/Repositories/DigitalPublicationArticleRepository.php index f67f0fd37d..f27f2baecc 100644 --- a/app/Repositories/DigitalPublicationArticleRepository.php +++ b/app/Repositories/DigitalPublicationArticleRepository.php @@ -8,13 +8,12 @@ use A17\Twill\Repositories\Behaviors\HandleRevisions; use A17\Twill\Repositories\Behaviors\HandleNesting; use A17\Twill\Repositories\ModuleRepository; -use App\Enums\DigitalPublicationArticleType; +use App\Enums\DigitalPublicationArticleCategory; use App\Jobs\GeneratePdf; use App\Models\DigitalPublicationArticle; use App\Models\Api\Search; use App\Repositories\Behaviors\HandleApiBlocks; use App\Repositories\Behaviors\HandleAuthors; -use A17\Twill\Jobs\ReorderNestedModuleItems; class DigitalPublicationArticleRepository extends ModuleRepository { @@ -27,9 +26,9 @@ public function __construct(DigitalPublicationArticle $model) $this->model = $model; } - public function getTypes() + public function getCategories() { - return collect(DigitalPublicationArticleType::cases()) + return collect(DigitalPublicationArticleCategory::cases()) ->mapWithKeys(fn ($type) => [$type->value => $type->name]); } diff --git a/database/factories/DigitalPublicationArticleFactory.php b/database/factories/DigitalPublicationArticleFactory.php index fe6dc71503..14c8dbf983 100644 --- a/database/factories/DigitalPublicationArticleFactory.php +++ b/database/factories/DigitalPublicationArticleFactory.php @@ -2,7 +2,7 @@ namespace Database\Factories; -use App\Enums\DigitalPublicationArticleType; +use App\Enums\DigitalPublicationArticleCategory; use App\Models\DigitalPublicationArticle; use Illuminate\Database\Eloquent\Factories\Factory; @@ -16,7 +16,7 @@ public function definition(): array 'title' => $this->faker->words(5, true), 'article_type' => $this->faker->randomElement(array_map( fn ($type) => $type->value, - DigitalPublicationArticleType::cases() + DigitalPublicationArticleCategory::cases() )), ]; } diff --git a/database/migrations/2024_08_30_142048_add_article_type_column_to_digital_publication_articles_table.php b/database/migrations/2024_08_30_142048_add_article_type_column_to_digital_publication_articles_table.php index e9387453a4..22897a4593 100644 --- a/database/migrations/2024_08_30_142048_add_article_type_column_to_digital_publication_articles_table.php +++ b/database/migrations/2024_08_30_142048_add_article_type_column_to_digital_publication_articles_table.php @@ -1,6 +1,6 @@ $enum->value, DigitalPublicationArticleType::cases()); - Schema::table('digital_publication_articles', function (Blueprint $table) use ($types) { - $table->enum('article_type', $types)->default('text'); + $categories = array_map(fn ($category) => $category->value, DigitalPublicationArticleCategory::cases()); + Schema::table('digital_publication_articles', function (Blueprint $table) use ($categories) { + $table->enum('category', $categories)->nullable(false)->default('text'); }); foreach (DigitalPublicationArticle::withTrashed()->get() as $article) { - $article->article_type = $article->type; + $article->category = $article->type; $article->save(); } Schema::table('digital_publication_articles', function (Blueprint $table) { @@ -29,11 +29,11 @@ public function down(): void $table->string('type')->nullable(false)->default('text'); }); foreach (DigitalPublicationArticle::withTrashed()->get() as $article) { - $article->type = $article->article_type; + $article->type = $article->category; $article->save(); } Schema::table('digital_publication_articles', function (Blueprint $table) { - $table->dropColumn('article_type'); + $table->dropColumn('category'); }); } }; diff --git a/resources/views/admin/digitalPublications/articles/create.blade.php b/resources/views/admin/digitalPublications/articles/create.blade.php index 82f813fd8b..d97b4f7266 100644 --- a/resources/views/admin/digitalPublications/articles/create.blade.php +++ b/resources/views/admin/digitalPublications/articles/create.blade.php @@ -1,8 +1,8 @@ @include('twill::partials.create') @formField('select', [ - 'name' => 'article_type', - 'label' => 'Type', - 'placeholder' => 'Select a type', - 'options' => $types, + 'name' => 'category', + 'label' => 'Category', + 'placeholder' => 'Select a category', + 'options' => $categories, ]) diff --git a/resources/views/admin/digitalPublications/articles/form.blade.php b/resources/views/admin/digitalPublications/articles/form.blade.php index 6ee62a6156..8a6c9c47dc 100644 --- a/resources/views/admin/digitalPublications/articles/form.blade.php +++ b/resources/views/admin/digitalPublications/articles/form.blade.php @@ -32,11 +32,11 @@ ]) @formField('select', [ - 'name' => 'article_type', - 'label' => 'Type', - 'placeholder' => 'Select a type', + 'name' => 'category', + 'label' => 'Category', + 'placeholder' => 'Select a category', 'default' => 'text', - 'options' => $types, + 'options' => $categories, ]) @component('twill::partials.form.utils._columns') @@ -153,7 +153,7 @@ @section('fieldsets') @formConnectedFields([ - 'fieldName' => 'article_type', + 'fieldName' => 'category', 'fieldValues' => 'grouping', 'renderForBlocks' => false, ]) diff --git a/resources/views/admin/digitalPublications/form.blade.php b/resources/views/admin/digitalPublications/form.blade.php index cf04b60bc8..07b3f1e80c 100644 --- a/resources/views/admin/digitalPublications/form.blade.php +++ b/resources/views/admin/digitalPublications/form.blade.php @@ -154,7 +154,7 @@ 'italic', ], ]) - @endformConnectedFields + @endformFieldset @include('admin.partials.related') diff --git a/resources/views/components/organisms/_o-table-of-contents.blade.php b/resources/views/components/organisms/_o-table-of-contents.blade.php index cbf46c8dec..88762a1c25 100644 --- a/resources/views/components/organisms/_o-table-of-contents.blade.php +++ b/resources/views/components/organisms/_o-table-of-contents.blade.php @@ -4,10 +4,10 @@ if (isset($currentArticle)) { $isExpanded = $currentArticle->parent === $item || $currentArticle->present()->isArticleInTree($item->children); } else { - if ($item->type === App\Enums\DigitalPublicationArticleType::Grouping) { + if ($item->type === App\Enums\DigitalPublicationArticleCategory::Grouping) { $hasGroupingAncestor = $item->ancestors->contains(function ($ancestor) { - return $ancestor->type === App\Enums\DigitalPublicationArticleType::Grouping; + return $ancestor->type === App\Enums\DigitalPublicationArticleCategory::Grouping; }); $isExpanded = !$hasGroupingAncestor; } else { diff --git a/resources/views/site/digitalPublicationArticleDetail.blade.php b/resources/views/site/digitalPublicationArticleDetail.blade.php index 1ef950add5..62e7ddc1c0 100644 --- a/resources/views/site/digitalPublicationArticleDetail.blade.php +++ b/resources/views/site/digitalPublicationArticleDetail.blade.php @@ -1,5 +1,5 @@ @php - use App\Enums\DigitalPublicationArticleType; + use App\Enums\DigitalPublicationArticleCategory; @endphp @extends('layouts.app') @@ -17,7 +17,7 @@ @endif
- @if ($item->type == DigitalPublicationArticleType::Contributions) + @if ($item->type == DigitalPublicationArticleCategory::Contributions) @component('components.molecules._m-article-header----digital-publication-article') @slot('title', $item->present()->title) @slot('title_display', $item->present()->title_display) @@ -39,7 +39,7 @@ @endcomponent
- @if ($item->type != DigitalPublicationArticleType::Contributions && $item->type != DigitalPublicationArticleType::Entry) + @if ($item->type != DigitalPublicationArticleCategory::Contributions && $item->type != DigitalPublicationArticleCategory::Entry) @component('components.molecules._m-article-header') @slot('headerType', 'generic') @slot('title', $item->present()->title) @@ -51,7 +51,7 @@ {{-- Intentionally left blank for layout --}}
- @if ($item->type !== DigitalPublicationArticleType::Entry) + @if ($item->type !== DigitalPublicationArticleCategory::Entry)
@component('components.atoms._title') @slot('tag', 'h1') @@ -75,8 +75,8 @@
@switch ($item->type) - @case (DigitalPublicationArticleType::Contributions) - @case (DigitalPublicationArticleType::Entry) + @case (DigitalPublicationArticleCategory::Contributions) + @case (DigitalPublicationArticleCategory::Entry) @if ($item->showAuthorsWithLinks()) @component('components.blocks._text') @slot('font', 'f-tag-2') @@ -90,8 +90,8 @@ @php switch ($item->type) { - case DigitalPublicationArticleType::Contributions: - case DigitalPublicationArticleType::Entry: + case DigitalPublicationArticleCategory::Contributions: + case DigitalPublicationArticleCategory::Entry: global $_collectedReferences; $_collectedReferences = []; diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index f08f148309..0ea51fd9ec 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -1,6 +1,3 @@ -@php - use App\Enums\DigitalPublicationArticleType; -@endphp @extends('layouts.app') @@ -287,7 +284,7 @@ @slot('cols_medium','4') @slot('cols_large','4') @slot('cols_xlarge','4') - + @foreach ($item->children as $child) @component('components.molecules._m-listing----digital-publication-article-entry') @slot('href', $child->present()->url) From 59ad9b896b1395dbe78fd1ca1b51b71fa74adb97 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 3 Sep 2024 16:23:21 -0500 Subject: [PATCH 132/346] Add "Publication Images" bucket to media library UI [PUB-227] --- .../media-library/MediaLibrary.vue | 20 ++- .../views/vendor/twill/layouts/main.blade.php | 152 ++++++++++++++++++ 2 files changed, 170 insertions(+), 2 deletions(-) create mode 100644 resources/views/vendor/twill/layouts/main.blade.php diff --git a/resources/assets/js/twill-components/media-library/MediaLibrary.vue b/resources/assets/js/twill-components/media-library/MediaLibrary.vue index 444ad5bcc2..3f19f77f89 100644 --- a/resources/assets/js/twill-components/media-library/MediaLibrary.vue +++ b/resources/assets/js/twill-components/media-library/MediaLibrary.vue @@ -154,7 +154,10 @@ page: this.initialPage, tags: [], lastScrollTop: 0, - gridLoaded: false + gridLoaded: false, + /* Create Publications bucket in media library [PUB-227] */ + typeFilter: 'withoutTag=publication-image' + /* /Create Publications bucket in media library [PUB-227] */ } }, computed: { @@ -255,7 +258,13 @@ updateType: function (newType) { if (this.loading) return if (this.strict) return - if (this.type === newType) return + /* Create Publications bucket in media library [PUB-227] */ + if (newType === 'image') { + this.typeFilter = 'withoutTag=publication-image' + } else if (newType === 'publication-image') { + this.typeFilter = 'withTag=publication-image' + } + /* /Create Publications bucket in media library [PUB-227] */ this.$store.commit(MEDIA_LIBRARY.UPDATE_MEDIA_TYPE, newType) this.submitFilter() @@ -365,6 +374,13 @@ data.type = this.type + /* Create Publications bucket in media library [PUB-227] */ + if (this.typeFilter) { + const [key, value] = this.typeFilter.split('=', 2) + data[key] = value + } + /* /Create Publications bucket in media library [PUB-227] */ + if (Array.isArray(data.unused) && data.unused.length) { data.unused = data.unused[0] } diff --git a/resources/views/vendor/twill/layouts/main.blade.php b/resources/views/vendor/twill/layouts/main.blade.php new file mode 100644 index 0000000000..6c221404c9 --- /dev/null +++ b/resources/views/vendor/twill/layouts/main.blade.php @@ -0,0 +1,152 @@ + + + + @include('twill::partials.head') + + + @include('twill::partials.icons.svg-sprite') + @if(config('twill.enabled.search', false)) + @partialView(($moduleName ?? null), 'navigation._overlay_navigation', ['search' => true]) + @else + @partialView(($moduleName ?? null), 'navigation._overlay_navigation') + @endif +
+
+
+ @partialView(($moduleName ?? null), 'navigation._title') + @partialView(($moduleName ?? null), 'navigation._global_navigation') +
+ @partialView(($moduleName ?? null), 'navigation._user') +
+ @if(config('twill.enabled.search', false) && !($isDashboard ?? false)) +
+ + + + + +
+
+ +
+
+
+ @endif +
+
+ @hasSection('primaryNavigation') + @yield('primaryNavigation') + @else + @partialView(($moduleName ?? null), 'navigation._primary_navigation') + @partialView(($moduleName ?? null), 'navigation._secondary_navigation') + @partialView(($moduleName ?? null), 'navigation._breadcrumb') + @endif +
+
+ @yield('content') + @if (config('twill.enabled.media-library') || config('twill.enabled.file-library')) + + + +

{!! twillTrans("twill::lang.media-library.dialogs.delete.delete-media-desc") !!}

+
+ + +

{!! twillTrans("twill::lang.media-library.dialogs.replace.replace-media-desc") !!}

+
+ @endif + + + + +
+
+ + + +
+ @include('twill::partials.footer') +
+
+ +
+ @csrf +
+ + + + + @stack('extra_js') + + From a1696450953ceb3e61207834516eb43807619201 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:15:04 -0500 Subject: [PATCH 133/346] Add getBrowserItems override [PUB-228] --- .../DigitalPublicationArticleController.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php index bb6793f16c..ba39324087 100644 --- a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php +++ b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php @@ -99,6 +99,23 @@ protected function getSubbrowserItems($digitalPublicationId) return ['data' => $formattedArticles->toArray()]; } + protected function getBrowserItems($scopes = []) { + $articles = $this->repository->withDepth()->defaultOrder()->get(); + + $formattedArticles = $articles->map(function ($article) { + return [ + 'id' => $article->id, + 'name' => $article->title, + 'edit' => route('admin.collection.articles_publications.digitalPublications.articles.edit', [ + 'digitalPublication' => $article->digital_publication_id, + 'article' => $article->id + ]), + 'endpointType' => 'digitalPublicationArticles', + 'thumbnail' => $article->defaultCmsImage(['w' => 100, 'h' => 100]), + ]; + }); + + return ['data' => $formattedArticles->values()->toArray()]; protected function transformIndexItems($items) { // If we're in the browser, don't transform the items From 6f3b6964114552bfb86de39d39e50177960f57a1 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 4 Sep 2024 16:26:48 -0500 Subject: [PATCH 134/346] Update digipub article factory [PUB-226] --- database/factories/DigitalPublicationArticleFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/factories/DigitalPublicationArticleFactory.php b/database/factories/DigitalPublicationArticleFactory.php index 14c8dbf983..c6756d330e 100644 --- a/database/factories/DigitalPublicationArticleFactory.php +++ b/database/factories/DigitalPublicationArticleFactory.php @@ -14,7 +14,7 @@ public function definition(): array { return [ 'title' => $this->faker->words(5, true), - 'article_type' => $this->faker->randomElement(array_map( + 'category' => $this->faker->randomElement(array_map( fn ($type) => $type->value, DigitalPublicationArticleCategory::cases() )), From 7380d55a793facb882190e3d8e61e3251baf7f0d Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 3 Sep 2024 16:23:41 -0500 Subject: [PATCH 135/346] Add "Publication Image" tag to imported OSCI images [PUB-227] --- app/Console/Commands/MigrateOSCIPublicationOne.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Console/Commands/MigrateOSCIPublicationOne.php b/app/Console/Commands/MigrateOSCIPublicationOne.php index 129047656d..60c680e1c0 100644 --- a/app/Console/Commands/MigrateOSCIPublicationOne.php +++ b/app/Console/Commands/MigrateOSCIPublicationOne.php @@ -136,6 +136,8 @@ private function mediaFactory($imageData, $caption_html, $fallback_url) $media->alt_text = 'Alt text for the image'; $media->caption = $caption_html; $media->save(); + $media->addTag('Publication Image'); + $media->save(); return $media; } From 750a45e367aa05f67eb05ccbcb56302208b2487e Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:15:44 -0500 Subject: [PATCH 136/346] Register artworks in autorelated block search [PUB-228] --- app/Models/Behaviors/HasAutoRelated.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Models/Behaviors/HasAutoRelated.php b/app/Models/Behaviors/HasAutoRelated.php index 6286c628de..cbff998a43 100644 --- a/app/Models/Behaviors/HasAutoRelated.php +++ b/app/Models/Behaviors/HasAutoRelated.php @@ -27,6 +27,7 @@ public function related($item) 'genericPages', 'events', 'exhibitions', + 'artworks', ]; // Get all blocks that have this model as a related item From 2c304eaceb221354a7bd1e315e539e7d8a0ee857 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 4 Sep 2024 16:10:34 -0500 Subject: [PATCH 137/346] Add Square crop to digital publication article hero image [PUB-240] --- app/Models/DigitalPublicationArticle.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Models/DigitalPublicationArticle.php b/app/Models/DigitalPublicationArticle.php index cb292192c6..f6cf411cd0 100644 --- a/app/Models/DigitalPublicationArticle.php +++ b/app/Models/DigitalPublicationArticle.php @@ -78,6 +78,12 @@ class DigitalPublicationArticle extends AbstractModel implements Sortable 'ratio' => 16 / 9, ], ], + 'square' => [ + [ + 'name' => 'default', + 'ratio' => 1, + ], + ], 'special' => [ [ 'name' => 'default', From 7cd861433ac2d6aab90997b9f576384eb5aba5df Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 4 Sep 2024 16:30:01 -0500 Subject: [PATCH 138/346] Revert field name to 'Type' [PUB-226] --- .../views/admin/digitalPublications/articles/create.blade.php | 4 ++-- .../views/admin/digitalPublications/articles/form.blade.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/views/admin/digitalPublications/articles/create.blade.php b/resources/views/admin/digitalPublications/articles/create.blade.php index d97b4f7266..2b2fb1aec8 100644 --- a/resources/views/admin/digitalPublications/articles/create.blade.php +++ b/resources/views/admin/digitalPublications/articles/create.blade.php @@ -2,7 +2,7 @@ @formField('select', [ 'name' => 'category', - 'label' => 'Category', - 'placeholder' => 'Select a category', + 'label' => 'Type', + 'placeholder' => 'Select a type', 'options' => $categories, ]) diff --git a/resources/views/admin/digitalPublications/articles/form.blade.php b/resources/views/admin/digitalPublications/articles/form.blade.php index 8a6c9c47dc..75590ccc49 100644 --- a/resources/views/admin/digitalPublications/articles/form.blade.php +++ b/resources/views/admin/digitalPublications/articles/form.blade.php @@ -33,8 +33,8 @@ @formField('select', [ 'name' => 'category', - 'label' => 'Category', - 'placeholder' => 'Select a category', + 'label' => 'Type', + 'placeholder' => 'Select a type', 'default' => 'text', 'options' => $categories, ]) From ebd78af4e56d71e53cec45f89ae53c9db53e9591 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:16:14 -0500 Subject: [PATCH 139/346] Add digitalPublicationArticles to search for autorelated [PUB-228] --- app/Models/Behaviors/HasAutoRelated.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Models/Behaviors/HasAutoRelated.php b/app/Models/Behaviors/HasAutoRelated.php index cbff998a43..3a359633ec 100644 --- a/app/Models/Behaviors/HasAutoRelated.php +++ b/app/Models/Behaviors/HasAutoRelated.php @@ -56,7 +56,8 @@ public function related($item) 'exhibitions', 'experiences', 'digitalPublications', - 'videos' + 'digitalPublicationsArticles', + 'videos', ]; // Set scope to only include sidebar items that can be related to From 2e53ac74c6ef53b00c8b6bf8a1a8c3260d885b66 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 4 Sep 2024 16:11:02 -0500 Subject: [PATCH 140/346] Use square crop on `entries` listing type [PUB-240] --- resources/views/site/digitalPublicationDetail.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index 0ea51fd9ec..51c2d4ad66 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -224,7 +224,7 @@ @if (count($topLevelArticle->children) > 0) @component('components.molecules._m-listing----digital-publication-article-entry') @slot('href', $item->present()->url) - @slot('image', $item->imageFront('hero')) + @slot('image', $item->imageFront('hero', 'square') ?? $item->imageFront('hero')) @slot('title', $item->present()->title) @slot('title_display', $item->present()->title_display) @slot('label', $item->present()->label) From 8b708566ee04874ce0208d76e7a86a3d85b558de Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:16:38 -0500 Subject: [PATCH 141/346] Update digitalPublicationArticle mappings for HasFeaturedRelated [PUB-228] --- app/Models/Behaviors/HasFeaturedRelated.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Models/Behaviors/HasFeaturedRelated.php b/app/Models/Behaviors/HasFeaturedRelated.php index 852f3fa252..6bd978c7fa 100644 --- a/app/Models/Behaviors/HasFeaturedRelated.php +++ b/app/Models/Behaviors/HasFeaturedRelated.php @@ -8,6 +8,7 @@ use App\Models\Api\Exhibition; use App\Models\Experience; use App\Models\DigitalPublication; +use App\Models\DigitalPublicationArticle; use App\Models\Video; use Illuminate\Support\Facades\Cache; use Carbon\Carbon; @@ -72,6 +73,7 @@ public function getCustomRelatedItems() 'exhibitions' => true, // API! 'experiences' => false, 'digitalPublications' => false, + 'digitalPublicationArticles' => false, 'videos' => false, ]) ?? collect([]); @@ -185,6 +187,12 @@ private function getLabeledRelatedItems($relatedItems) $label = 'Digital Publication'; $type = 'generic'; + break; + case DigitalPublicationArticle::class: + // No tag + $label = 'Digital Publication Article'; + $type = 'generic'; + break; case Video::class: // Tag is "Video" From ff7f14e24a824fb6f1896fe68368e52de2270ac5 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:17:06 -0500 Subject: [PATCH 142/346] Create getUrlWithoutSlugAttr method for autorelated [PUB-228] --- app/Models/DigitalPublicationArticle.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Models/DigitalPublicationArticle.php b/app/Models/DigitalPublicationArticle.php index 740cd83ae7..cb548d0a2e 100644 --- a/app/Models/DigitalPublicationArticle.php +++ b/app/Models/DigitalPublicationArticle.php @@ -157,6 +157,15 @@ public function getUrlAttribute() return $this->present()->getCanonicalUrl(); } + public function getUrlWithoutSlugAttribute() + { + return route('collection.publications.digital-publications-articles.show', [ + 'pubId' => $this->digital_publication_id, + 'pubSlug' => $this->digitalPublication->slug, + 'id' => $this->id, + ]); + } + protected function transformMappingInternal() { return [ From 99edca1401bce0ca7a26f87f2b91299728f98425 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 5 Sep 2024 09:07:51 -0500 Subject: [PATCH 143/346] Revert "Merge pull request #512 from art-institute-of-chicago/fix/digipub-article-type" This reverts commit 6274c6959fb8b0ce4e70440d4d24681cb0088b87, reversing changes made to 46ad577c7d14f7c0714f8ba43f8e5d8dcd58721c. --- ...ory.php => DigitalPublicationArticleType.php} | 2 +- .../DigitalPublicationArticleController.php | 11 ++++++----- app/Models/DigitalPublicationArticle.php | 14 +++++++------- .../Admin/DigitalPublicationArticlePresenter.php | 10 +++++----- .../Admin/DigitalPublicationPresenter.php | 1 + .../DigitalPublicationArticleRepository.php | 7 ++++--- .../DigitalPublicationArticleFactory.php | 6 +++--- ...umn_to_digital_publication_articles_table.php | 14 +++++++------- .../articles/create.blade.php | 4 ++-- .../digitalPublications/articles/form.blade.php | 6 +++--- .../admin/digitalPublications/form.blade.php | 2 +- .../organisms/_o-table-of-contents.blade.php | 4 ++-- .../digitalPublicationArticleDetail.blade.php | 16 ++++++++-------- .../site/digitalPublicationDetail.blade.php | 5 ++++- 14 files changed, 54 insertions(+), 48 deletions(-) rename app/Enums/{DigitalPublicationArticleCategory.php => DigitalPublicationArticleType.php} (78%) diff --git a/app/Enums/DigitalPublicationArticleCategory.php b/app/Enums/DigitalPublicationArticleType.php similarity index 78% rename from app/Enums/DigitalPublicationArticleCategory.php rename to app/Enums/DigitalPublicationArticleType.php index 0d2024e47f..ee1396db5b 100644 --- a/app/Enums/DigitalPublicationArticleCategory.php +++ b/app/Enums/DigitalPublicationArticleType.php @@ -2,7 +2,7 @@ namespace App\Enums; -enum DigitalPublicationArticleCategory: string +enum DigitalPublicationArticleType: string { case About = 'about'; case Contributions = 'text'; diff --git a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php index 704fc0da25..bb6793f16c 100644 --- a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php +++ b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php @@ -5,6 +5,7 @@ use A17\Twill\Http\Controllers\Admin\NestedModuleController; use App\Repositories\DigitalPublicationRepository; use App\Http\Controllers\Admin\Behaviors\IsNestedModule; +use Illuminate\Support\Collection; class DigitalPublicationArticleController extends NestedModuleController { @@ -27,9 +28,9 @@ class DigitalPublicationArticleController extends NestedModuleController 'edit_link' => true, 'field' => 'title', ], - 'category' => [ - 'title' => 'Category', - 'field' => 'category', + 'article_type' => [ + 'title' => 'Type', + 'field' => 'articleType', 'present' => true, ], ]; @@ -56,7 +57,7 @@ protected function indexData($request) [ 'nested' => true, 'nestedDepth' => 2, - 'categories' => $this->repository->getCategories(), + 'types' => $this->repository->getTypes(), 'articles' => $articlesList, 'breadcrumb' => [ [ @@ -121,7 +122,7 @@ protected function formData($request) $baseUrl = '//' . config('app.url') . '/' . $this->permalinkBase . $digPub->id . '/' . $digPub->getSlug() . '/' . $item->id . '/'; return [ - 'categories' => $this->repository->getCategories(), + 'types' => $this->repository->getTypes(), 'baseUrl' => $baseUrl, 'breadcrumb' => [ [ diff --git a/app/Models/DigitalPublicationArticle.php b/app/Models/DigitalPublicationArticle.php index f6cf411cd0..740cd83ae7 100644 --- a/app/Models/DigitalPublicationArticle.php +++ b/app/Models/DigitalPublicationArticle.php @@ -7,7 +7,7 @@ use A17\Twill\Models\Behaviors\HasRevisions; use A17\Twill\Models\Behaviors\HasPosition; use A17\Twill\Models\Behaviors\Sortable; -use App\Enums\DigitalPublicationArticleCategory; +use App\Enums\DigitalPublicationArticleType; use App\Models\Behaviors\HasAuthors; use App\Models\Behaviors\HasMedias; use App\Models\Behaviors\HasMediasEloquent; @@ -37,7 +37,7 @@ class DigitalPublicationArticle extends AbstractModel implements Sortable 'hide_title', 'list_description', 'date', - 'category', + 'article_type', 'listing_display', 'suppress_listing', 'heading', @@ -59,15 +59,15 @@ class DigitalPublicationArticle extends AbstractModel implements Sortable ]; public $casts = [ - 'category' => DigitalPublicationArticleCategory::class, 'date' => 'date', 'publish_start_date' => 'date', 'published' => 'boolean', + 'article_type' => DigitalPublicationArticleType::class, ]; public $attributes = [ - 'category' => 'text', 'published' => false, + 'article_type' => 'entry', ]; public $mediasParams = [ @@ -217,11 +217,11 @@ protected function transformMappingInternal() } ], [ - 'name' => 'category', - 'doc' => 'Category', + 'name' => 'article_type', + 'doc' => 'Type of Article', 'type' => 'string', 'value' => function () { - return $this->present()->category; + return $this->present()->articleType; }, ], [ diff --git a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php index 8b5f9691b9..0025c82005 100644 --- a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php +++ b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php @@ -4,13 +4,13 @@ use Illuminate\Support\Str; use App\Presenters\BasePresenter; -use App\Enums\DigitalPublicationArticleCategory; +use App\Enums\DigitalPublicationArticleType; class DigitalPublicationArticlePresenter extends BasePresenter { public function getCanonicalUrl() { - if ($this->entity->type === DigitalPublicationArticleCategory::Grouping) { + if ($this->entity->type === DigitalPublicationArticleType::Grouping) { return route( 'collection.publications.digital-publications.showListing', [ @@ -23,9 +23,9 @@ public function getCanonicalUrl() } } - public function category() + public function articleType() { - return $this->entity->category->name; + return $this->entity->article_type->name; } public function pdfDownloadPath() @@ -74,7 +74,7 @@ public function countAllChildren($entity) $descendants = $entity->descendants; $filteredDescendants = $descendants->filter(function ($descendant) { - return $descendant->type !== DigitalPublicationArticleCategory::Grouping; + return $descendant->type !== DigitalPublicationArticleType::Grouping; }); return $filteredDescendants->count(); diff --git a/app/Presenters/Admin/DigitalPublicationPresenter.php b/app/Presenters/Admin/DigitalPublicationPresenter.php index adac0f9a69..67c6146b6c 100644 --- a/app/Presenters/Admin/DigitalPublicationPresenter.php +++ b/app/Presenters/Admin/DigitalPublicationPresenter.php @@ -2,6 +2,7 @@ namespace App\Presenters\Admin; +use App\Enums\DigitalPublicationArticleType; use App\Presenters\BasePresenter; class DigitalPublicationPresenter extends BasePresenter diff --git a/app/Repositories/DigitalPublicationArticleRepository.php b/app/Repositories/DigitalPublicationArticleRepository.php index f27f2baecc..f67f0fd37d 100644 --- a/app/Repositories/DigitalPublicationArticleRepository.php +++ b/app/Repositories/DigitalPublicationArticleRepository.php @@ -8,12 +8,13 @@ use A17\Twill\Repositories\Behaviors\HandleRevisions; use A17\Twill\Repositories\Behaviors\HandleNesting; use A17\Twill\Repositories\ModuleRepository; -use App\Enums\DigitalPublicationArticleCategory; +use App\Enums\DigitalPublicationArticleType; use App\Jobs\GeneratePdf; use App\Models\DigitalPublicationArticle; use App\Models\Api\Search; use App\Repositories\Behaviors\HandleApiBlocks; use App\Repositories\Behaviors\HandleAuthors; +use A17\Twill\Jobs\ReorderNestedModuleItems; class DigitalPublicationArticleRepository extends ModuleRepository { @@ -26,9 +27,9 @@ public function __construct(DigitalPublicationArticle $model) $this->model = $model; } - public function getCategories() + public function getTypes() { - return collect(DigitalPublicationArticleCategory::cases()) + return collect(DigitalPublicationArticleType::cases()) ->mapWithKeys(fn ($type) => [$type->value => $type->name]); } diff --git a/database/factories/DigitalPublicationArticleFactory.php b/database/factories/DigitalPublicationArticleFactory.php index c6756d330e..fe6dc71503 100644 --- a/database/factories/DigitalPublicationArticleFactory.php +++ b/database/factories/DigitalPublicationArticleFactory.php @@ -2,7 +2,7 @@ namespace Database\Factories; -use App\Enums\DigitalPublicationArticleCategory; +use App\Enums\DigitalPublicationArticleType; use App\Models\DigitalPublicationArticle; use Illuminate\Database\Eloquent\Factories\Factory; @@ -14,9 +14,9 @@ public function definition(): array { return [ 'title' => $this->faker->words(5, true), - 'category' => $this->faker->randomElement(array_map( + 'article_type' => $this->faker->randomElement(array_map( fn ($type) => $type->value, - DigitalPublicationArticleCategory::cases() + DigitalPublicationArticleType::cases() )), ]; } diff --git a/database/migrations/2024_08_30_142048_add_article_type_column_to_digital_publication_articles_table.php b/database/migrations/2024_08_30_142048_add_article_type_column_to_digital_publication_articles_table.php index 22897a4593..e9387453a4 100644 --- a/database/migrations/2024_08_30_142048_add_article_type_column_to_digital_publication_articles_table.php +++ b/database/migrations/2024_08_30_142048_add_article_type_column_to_digital_publication_articles_table.php @@ -1,6 +1,6 @@ $category->value, DigitalPublicationArticleCategory::cases()); - Schema::table('digital_publication_articles', function (Blueprint $table) use ($categories) { - $table->enum('category', $categories)->nullable(false)->default('text'); + $types = array_map(fn($enum) => $enum->value, DigitalPublicationArticleType::cases()); + Schema::table('digital_publication_articles', function (Blueprint $table) use ($types) { + $table->enum('article_type', $types)->default('text'); }); foreach (DigitalPublicationArticle::withTrashed()->get() as $article) { - $article->category = $article->type; + $article->article_type = $article->type; $article->save(); } Schema::table('digital_publication_articles', function (Blueprint $table) { @@ -29,11 +29,11 @@ public function down(): void $table->string('type')->nullable(false)->default('text'); }); foreach (DigitalPublicationArticle::withTrashed()->get() as $article) { - $article->type = $article->category; + $article->type = $article->article_type; $article->save(); } Schema::table('digital_publication_articles', function (Blueprint $table) { - $table->dropColumn('category'); + $table->dropColumn('article_type'); }); } }; diff --git a/resources/views/admin/digitalPublications/articles/create.blade.php b/resources/views/admin/digitalPublications/articles/create.blade.php index 2b2fb1aec8..82f813fd8b 100644 --- a/resources/views/admin/digitalPublications/articles/create.blade.php +++ b/resources/views/admin/digitalPublications/articles/create.blade.php @@ -1,8 +1,8 @@ @include('twill::partials.create') @formField('select', [ - 'name' => 'category', + 'name' => 'article_type', 'label' => 'Type', 'placeholder' => 'Select a type', - 'options' => $categories, + 'options' => $types, ]) diff --git a/resources/views/admin/digitalPublications/articles/form.blade.php b/resources/views/admin/digitalPublications/articles/form.blade.php index 75590ccc49..6ee62a6156 100644 --- a/resources/views/admin/digitalPublications/articles/form.blade.php +++ b/resources/views/admin/digitalPublications/articles/form.blade.php @@ -32,11 +32,11 @@ ]) @formField('select', [ - 'name' => 'category', + 'name' => 'article_type', 'label' => 'Type', 'placeholder' => 'Select a type', 'default' => 'text', - 'options' => $categories, + 'options' => $types, ]) @component('twill::partials.form.utils._columns') @@ -153,7 +153,7 @@ @section('fieldsets') @formConnectedFields([ - 'fieldName' => 'category', + 'fieldName' => 'article_type', 'fieldValues' => 'grouping', 'renderForBlocks' => false, ]) diff --git a/resources/views/admin/digitalPublications/form.blade.php b/resources/views/admin/digitalPublications/form.blade.php index 07b3f1e80c..cf04b60bc8 100644 --- a/resources/views/admin/digitalPublications/form.blade.php +++ b/resources/views/admin/digitalPublications/form.blade.php @@ -154,7 +154,7 @@ 'italic', ], ]) - @endformFieldset + @endformConnectedFields @include('admin.partials.related') diff --git a/resources/views/components/organisms/_o-table-of-contents.blade.php b/resources/views/components/organisms/_o-table-of-contents.blade.php index 88762a1c25..cbf46c8dec 100644 --- a/resources/views/components/organisms/_o-table-of-contents.blade.php +++ b/resources/views/components/organisms/_o-table-of-contents.blade.php @@ -4,10 +4,10 @@ if (isset($currentArticle)) { $isExpanded = $currentArticle->parent === $item || $currentArticle->present()->isArticleInTree($item->children); } else { - if ($item->type === App\Enums\DigitalPublicationArticleCategory::Grouping) { + if ($item->type === App\Enums\DigitalPublicationArticleType::Grouping) { $hasGroupingAncestor = $item->ancestors->contains(function ($ancestor) { - return $ancestor->type === App\Enums\DigitalPublicationArticleCategory::Grouping; + return $ancestor->type === App\Enums\DigitalPublicationArticleType::Grouping; }); $isExpanded = !$hasGroupingAncestor; } else { diff --git a/resources/views/site/digitalPublicationArticleDetail.blade.php b/resources/views/site/digitalPublicationArticleDetail.blade.php index 62e7ddc1c0..1ef950add5 100644 --- a/resources/views/site/digitalPublicationArticleDetail.blade.php +++ b/resources/views/site/digitalPublicationArticleDetail.blade.php @@ -1,5 +1,5 @@ @php - use App\Enums\DigitalPublicationArticleCategory; + use App\Enums\DigitalPublicationArticleType; @endphp @extends('layouts.app') @@ -17,7 +17,7 @@ @endif
- @if ($item->type == DigitalPublicationArticleCategory::Contributions) + @if ($item->type == DigitalPublicationArticleType::Contributions) @component('components.molecules._m-article-header----digital-publication-article') @slot('title', $item->present()->title) @slot('title_display', $item->present()->title_display) @@ -39,7 +39,7 @@ @endcomponent
- @if ($item->type != DigitalPublicationArticleCategory::Contributions && $item->type != DigitalPublicationArticleCategory::Entry) + @if ($item->type != DigitalPublicationArticleType::Contributions && $item->type != DigitalPublicationArticleType::Entry) @component('components.molecules._m-article-header') @slot('headerType', 'generic') @slot('title', $item->present()->title) @@ -51,7 +51,7 @@ {{-- Intentionally left blank for layout --}}
- @if ($item->type !== DigitalPublicationArticleCategory::Entry) + @if ($item->type !== DigitalPublicationArticleType::Entry)
@component('components.atoms._title') @slot('tag', 'h1') @@ -75,8 +75,8 @@
@switch ($item->type) - @case (DigitalPublicationArticleCategory::Contributions) - @case (DigitalPublicationArticleCategory::Entry) + @case (DigitalPublicationArticleType::Contributions) + @case (DigitalPublicationArticleType::Entry) @if ($item->showAuthorsWithLinks()) @component('components.blocks._text') @slot('font', 'f-tag-2') @@ -90,8 +90,8 @@ @php switch ($item->type) { - case DigitalPublicationArticleCategory::Contributions: - case DigitalPublicationArticleCategory::Entry: + case DigitalPublicationArticleType::Contributions: + case DigitalPublicationArticleType::Entry: global $_collectedReferences; $_collectedReferences = []; diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index 51c2d4ad66..380fd6de38 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -1,3 +1,6 @@ +@php + use App\Enums\DigitalPublicationArticleType; +@endphp @extends('layouts.app') @@ -284,7 +287,7 @@ @slot('cols_medium','4') @slot('cols_large','4') @slot('cols_xlarge','4') - + @foreach ($item->children as $child) @component('components.molecules._m-listing----digital-publication-article-entry') @slot('href', $child->present()->url) From 730981c5d4ec6ab2acf1b4e3e9da40f2a8fe69fb Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:17:20 -0500 Subject: [PATCH 144/346] Create subtype presenter method for auto-related blade [PUB-228] --- app/Presenters/Admin/DigitalPublicationArticlePresenter.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php index 0025c82005..e14b2c50fe 100644 --- a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php +++ b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php @@ -28,6 +28,11 @@ public function articleType() return $this->entity->article_type->name; } + public function subtype() + { + return 'Digital Publication Article'; + } + public function pdfDownloadPath() { if (!isset($this->entity->pdf_download_path)) { From f696724e5482787b86d2d75a25ad776018813680 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:17:36 -0500 Subject: [PATCH 145/346] Register digitalPublicationArticles in featuredRelated [PUB-228] --- app/Repositories/Behaviors/HandleFeaturedRelated.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Repositories/Behaviors/HandleFeaturedRelated.php b/app/Repositories/Behaviors/HandleFeaturedRelated.php index 79a7e22462..a788c64e49 100644 --- a/app/Repositories/Behaviors/HandleFeaturedRelated.php +++ b/app/Repositories/Behaviors/HandleFeaturedRelated.php @@ -15,6 +15,7 @@ public function afterSaveHandleFeaturedRelated($object, $fields) 'events' => false, 'experiences' => false, 'digitalPublications' => false, + 'digitalPublicationArticles' => false, 'videos' => false, 'exhibitions' => true, ]); @@ -34,6 +35,7 @@ public function getFormFieldsHandleFeaturedRelated($object, $fields) 'events' => false, 'experiences' => false, 'digitalPublications' => false, + 'digitalPublicationArticles' => false, 'videos' => false, 'exhibitions' => true, ]); From 1e5ff2e464fc0f9959e444b52f0c754f35da8b4e Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:17:53 -0500 Subject: [PATCH 146/346] Add Digital Publication Articles to featured-related browser [PUB-228] --- resources/views/admin/partials/featured-related.blade.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/views/admin/partials/featured-related.blade.php b/resources/views/admin/partials/featured-related.blade.php index 6e766f0170..8b97cd9ca2 100644 --- a/resources/views/admin/partials/featured-related.blade.php +++ b/resources/views/admin/partials/featured-related.blade.php @@ -30,6 +30,10 @@ 'label' => 'Digital Publication', 'value' => moduleRoute('digitalPublications', 'collection.articles_publications', 'browser'), ], + [ + 'label' => 'Digital Publication Article', + 'value' => moduleRoute('digitalPublications.articles', 'collection.articles_publications', 'browser'), + ], [ 'label' => 'Video', 'value' => moduleRoute('videos', 'collection.articles_publications', 'browser'), From f252037eb309d1c64d71c1c4875953761928dac5 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:18:07 -0500 Subject: [PATCH 147/346] Update fallbacks for subtype and type [PUB-228] --- .../components/molecules/_m-listing----auto-related.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/components/molecules/_m-listing----auto-related.blade.php b/resources/views/components/molecules/_m-listing----auto-related.blade.php index 7f54919376..368037e82d 100644 --- a/resources/views/components/molecules/_m-listing----auto-related.blade.php +++ b/resources/views/components/molecules/_m-listing----auto-related.blade.php @@ -59,7 +59,7 @@ @endif
-1) ? ' data-blur-clip-to' : '' }}> - {!! $item->subtype ? $item->present()->subtype : $item->type !!} + {!! $item->present()->subtype ?? $item->present()->type !!} @if ($item->exclusive) @component('components.atoms._type') @slot('variation', 'type--membership') From 26eb8f1c02692e105db899b89bc20521028aedb1 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:18:25 -0500 Subject: [PATCH 148/346] Register default browser route for digitalPublication.articles [PUB-228] --- routes/admin.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/routes/admin.php b/routes/admin.php index f685cb041c..6a56280bbf 100644 --- a/routes/admin.php +++ b/routes/admin.php @@ -91,6 +91,8 @@ // WEB-1963: Browser for nested modules must be implemented manually Route::get('digitalPublicationsFoo/{digitalPublication}/articles/browser', [DigitalPublicationArticleController::class, 'getSubbrowserItems'])->name('collection.articles_publications.digitalPublications.articles.subbrowser'); + Route::get('/digitalPublications/articles/browser', [DigitalPublicationArticleController::class, 'getBrowserItems'])->name('collection.articles_publications.digitalPublications.articles.browser'); + }); Route::module('galleries'); From e9ae7ca254a4cc31b467bcd14008cea6beb2f99f Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:19:39 -0500 Subject: [PATCH 149/346] Lint code [PUB-228] --- .../Admin/DigitalPublicationArticleController.php | 8 +++++--- routes/admin.php | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php index ba39324087..5eb041bbda 100644 --- a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php +++ b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php @@ -99,9 +99,10 @@ protected function getSubbrowserItems($digitalPublicationId) return ['data' => $formattedArticles->toArray()]; } - protected function getBrowserItems($scopes = []) { + protected function getBrowserItems($scopes = []) + { $articles = $this->repository->withDepth()->defaultOrder()->get(); - + $formattedArticles = $articles->map(function ($article) { return [ 'id' => $article->id, @@ -114,8 +115,9 @@ protected function getBrowserItems($scopes = []) { 'thumbnail' => $article->defaultCmsImage(['w' => 100, 'h' => 100]), ]; }); - + return ['data' => $formattedArticles->values()->toArray()]; + } protected function transformIndexItems($items) { // If we're in the browser, don't transform the items diff --git a/routes/admin.php b/routes/admin.php index 6a56280bbf..3e9f4fe1a0 100644 --- a/routes/admin.php +++ b/routes/admin.php @@ -92,7 +92,6 @@ // WEB-1963: Browser for nested modules must be implemented manually Route::get('digitalPublicationsFoo/{digitalPublication}/articles/browser', [DigitalPublicationArticleController::class, 'getSubbrowserItems'])->name('collection.articles_publications.digitalPublications.articles.subbrowser'); Route::get('/digitalPublications/articles/browser', [DigitalPublicationArticleController::class, 'getBrowserItems'])->name('collection.articles_publications.digitalPublications.articles.browser'); - }); Route::module('galleries'); From d2d2d3210e5f75e4c96eeba4c5eb30019487b58a Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:38:06 -0500 Subject: [PATCH 150/346] Refactor browser methods into one getBrowserData method [PUB-228] --- .../DigitalPublicationArticleController.php | 37 +++++++------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php index 5eb041bbda..8cf1831613 100644 --- a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php +++ b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php @@ -76,37 +76,26 @@ protected function indexData($request) ); } - protected function getSubbrowserItems($digitalPublicationId) + protected function getBrowserData($prependScope = []) { - $articles = $this->repository->where('digital_publication_id', $digitalPublicationId) - ->withDepth() - ->defaultOrder() - ->get(); + $query = $this->repository->withDepth()->defaultOrder(); - $formattedArticles = $articles->map(function ($article) use ($digitalPublicationId) { - return [ - 'id' => $article->id, - 'name' => $article->title, - 'edit' => route('admin.collection.articles_publications.digitalPublications.articles.edit', [ - 'digitalPublication' => $digitalPublicationId, - 'article' => $article->id - ]), - 'endpointType' => 'digitalPublicationArticles', - 'thumbnail' => $article->defaultCmsImage(['w' => 100, 'h' => 100]), - ]; - }); + $search = $this->request->get('search', $prependScope['search'] ?? null); + if ($search) { + $query->where('title', 'like', '%' . $search . '%'); + } - return ['data' => $formattedArticles->toArray()]; - } + $digitalPublicationId = $this->request->get('digitalPublication', $prependScope['digitalPublication'] ?? null); + if ($digitalPublicationId) { + $query->where('digital_publication_id', $digitalPublicationId); + } - protected function getBrowserItems($scopes = []) - { - $articles = $this->repository->withDepth()->defaultOrder()->get(); + $articles = $query->get(); - $formattedArticles = $articles->map(function ($article) { + $formattedArticles = $articles->map(function ($article) use ($digitalPublicationId) { return [ 'id' => $article->id, - 'name' => $article->title, + 'name' => $digitalPublicationId ? $article->title : ($article->digitalPublication ? $article->digitalPublication->title : $article->title) . ' - ' . $article->title, 'edit' => route('admin.collection.articles_publications.digitalPublications.articles.edit', [ 'digitalPublication' => $article->digital_publication_id, 'article' => $article->id From d9af1b1e53cf5661049cf18d0afb4a2e35edba8f Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:38:35 -0500 Subject: [PATCH 151/346] Update digipub article routes to reflect context on where they're used [PUB-228] --- routes/admin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/admin.php b/routes/admin.php index 3e9f4fe1a0..bbaa927693 100644 --- a/routes/admin.php +++ b/routes/admin.php @@ -90,8 +90,8 @@ Route::module('digitalPublications.articles'); // WEB-1963: Browser for nested modules must be implemented manually - Route::get('digitalPublicationsFoo/{digitalPublication}/articles/browser', [DigitalPublicationArticleController::class, 'getSubbrowserItems'])->name('collection.articles_publications.digitalPublications.articles.subbrowser'); - Route::get('/digitalPublications/articles/browser', [DigitalPublicationArticleController::class, 'getBrowserItems'])->name('collection.articles_publications.digitalPublications.articles.browser'); + Route::get('/digitalPublicationsBrowser/articles/browser?digitalPublication={digitalPublication}', [DigitalPublicationArticleController::class, 'browser'])->name('collection.articles_publications.digitalPublications.articles.subbrowser'); + Route::get('/digitalPublicationsBrowser/articles/browser', [DigitalPublicationArticleController::class, 'browser'])->name('collection.articles_publications.digitalPublications.articles.browser'); }); Route::module('galleries'); From 2dd5fb2c25ba884aa4f6d9725ee4bd8cdbc2b4f7 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:41:12 -0500 Subject: [PATCH 152/346] Fix title redundancy issue [PUB-228] --- .../Controllers/Admin/DigitalPublicationArticleController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php index 8cf1831613..fa6ae5cc92 100644 --- a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php +++ b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php @@ -95,8 +95,7 @@ protected function getBrowserData($prependScope = []) $formattedArticles = $articles->map(function ($article) use ($digitalPublicationId) { return [ 'id' => $article->id, - 'name' => $digitalPublicationId ? $article->title : ($article->digitalPublication ? $article->digitalPublication->title : $article->title) . ' - ' . $article->title, - 'edit' => route('admin.collection.articles_publications.digitalPublications.articles.edit', [ + 'name' => $digitalPublicationId ? $article->title : ($article->digitalPublication ? $article->digitalPublication->title . ' - ' . $article->title : $article->title), 'edit' => route('admin.collection.articles_publications.digitalPublications.articles.edit', [ 'digitalPublication' => $article->digital_publication_id, 'article' => $article->id ]), From b8546d83bcf5e477dffc3085f881d59eee95c61e Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 5 Sep 2024 09:59:34 -0500 Subject: [PATCH 153/346] Update query to be insensitive [PUB-228] --- .../Controllers/Admin/DigitalPublicationArticleController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php index fa6ae5cc92..859bfc5680 100644 --- a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php +++ b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php @@ -82,7 +82,7 @@ protected function getBrowserData($prependScope = []) $search = $this->request->get('search', $prependScope['search'] ?? null); if ($search) { - $query->where('title', 'like', '%' . $search . '%'); + $query->whereRaw('LOWER(title) LIKE ?', ['%' . strtolower($search) . '%']); } $digitalPublicationId = $this->request->get('digitalPublication', $prependScope['digitalPublication'] ?? null); From a31899be332c82b1a72e939503f4f84f1295a53e Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:26:52 -0500 Subject: [PATCH 154/346] Omit groupings from browser data [PUB-228] --- .../Controllers/Admin/DigitalPublicationArticleController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php index 859bfc5680..9822af4e54 100644 --- a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php +++ b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php @@ -78,7 +78,7 @@ protected function indexData($request) protected function getBrowserData($prependScope = []) { - $query = $this->repository->withDepth()->defaultOrder(); + $query = $this->repository->withDepth()->defaultOrder()->where('article_type', '!=', 'grouping'); $search = $this->request->get('search', $prependScope['search'] ?? null); if ($search) { From 9f5bb72d456d7d8743eb8b01d64cba1f32849db2 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:27:13 -0500 Subject: [PATCH 155/346] Register digitalPublicationArticles for autorelated [PUB-228] --- app/Models/Behaviors/HasAutoRelated.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Models/Behaviors/HasAutoRelated.php b/app/Models/Behaviors/HasAutoRelated.php index 3a359633ec..9fc6cdee66 100644 --- a/app/Models/Behaviors/HasAutoRelated.php +++ b/app/Models/Behaviors/HasAutoRelated.php @@ -28,6 +28,7 @@ public function related($item) 'events', 'exhibitions', 'artworks', + 'digitalPublicationArticles' ]; // Get all blocks that have this model as a related item From 6a94eb58013ed6f1700e2a04355ae98a93efe50a Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:28:02 -0500 Subject: [PATCH 156/346] Prevent false null relatedBlockable value from happening [PUB-228] --- app/Models/Behaviors/HasAutoRelated.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Models/Behaviors/HasAutoRelated.php b/app/Models/Behaviors/HasAutoRelated.php index 9fc6cdee66..b95aac9701 100644 --- a/app/Models/Behaviors/HasAutoRelated.php +++ b/app/Models/Behaviors/HasAutoRelated.php @@ -42,8 +42,15 @@ public function related($item) }); foreach ($relatedBlockItems as $relatedBlockItem) { - if ($relatedBlockItem->blockable && method_exists($relatedBlockItem->blockable, "getApiModel") && $relatedBlockItem->blockable->getApiModel()) { - $relatedBlockable = $relatedBlockItem->blockable->getApiModelFilledCached(); + $relatedBlockable = null; + + if ($relatedBlockItem->blockable) { + if (method_exists($relatedBlockItem->blockable, "getApiModel")) { + $apiModel = $relatedBlockItem->blockable->getApiModel(); + if ($apiModel) { + $relatedBlockable = $relatedBlockItem->blockable->getApiModelFilledCached(); + } + } } $relatedItems[] = $relatedBlockable ?? $relatedBlockItem->blockable; From 6f6e6b515b9b1bdf6f2d67064094271fb44b589b Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:28:20 -0500 Subject: [PATCH 157/346] Add type to digiPubArticle presenter [PUB-228] --- app/Presenters/Admin/DigitalPublicationArticlePresenter.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php index e14b2c50fe..999a55f371 100644 --- a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php +++ b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php @@ -28,6 +28,11 @@ public function articleType() return $this->entity->article_type->name; } + public function type() + { + return 'Digital Publication Article'; + } + public function subtype() { return 'Digital Publication Article'; From d6de9430fe3fabb7270c103e2f03c3199a2781ad Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:28:46 -0500 Subject: [PATCH 158/346] Use presenter methods by default in CMS autorelated list [PUB-228] --- resources/views/admin/partials/featured-related.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/admin/partials/featured-related.blade.php b/resources/views/admin/partials/featured-related.blade.php index 8b97cd9ca2..da049bfbba 100644 --- a/resources/views/admin/partials/featured-related.blade.php +++ b/resources/views/admin/partials/featured-related.blade.php @@ -61,7 +61,7 @@
    @foreach($autoRelated as $related)
  1. - {!! Str::title($related->type) . (Str::title($related->type) ? ":" : "") !!} {{ $related->title }} + {!! Str::title($related->present()->type) . (Str::title($related->present()->type) ? ":" : "") !!} {{ $related->title }}
  2. @endforeach
From 10af95a155153e958045dd1b847237a9bf76cb0b Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Mon, 9 Sep 2024 10:19:17 -0500 Subject: [PATCH 159/346] Move entry type article authorship to bottom [PUB-246] --- frontend/scss/pages/_p-issuearticle-show.scss | 2 + .../articles/form.blade.php | 2 + .../digitalPublicationArticleDetail.blade.php | 37 +++++++++---------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index f4231b3aed..b5825f9113 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -316,6 +316,8 @@ Styling related specifically to digital publications .p-digitalpublicationarticle-preview { .o-blocks { .author-links { + margin: 60px 0 28px; + a { color: $color__link--accent; } diff --git a/resources/views/admin/digitalPublications/articles/form.blade.php b/resources/views/admin/digitalPublications/articles/form.blade.php index 6ee62a6156..fd3a870285 100644 --- a/resources/views/admin/digitalPublications/articles/form.blade.php +++ b/resources/views/admin/digitalPublications/articles/form.blade.php @@ -89,6 +89,7 @@ @formField('input', [ 'name' => 'author_display', 'label' => 'Author display', + 'note' => 'On Entry type articles, authorship is prepended with "Entry by"', ]) @formField('browser', [ @@ -97,6 +98,7 @@ 'name' => 'authors', 'label' => 'Authors', 'max' => 10 + 'note' => 'On Entry type articles, authorship is prepended with "Entry by"', ]) @formField('wysiwyg', [ diff --git a/resources/views/site/digitalPublicationArticleDetail.blade.php b/resources/views/site/digitalPublicationArticleDetail.blade.php index 752c19a23d..c76b20d475 100644 --- a/resources/views/site/digitalPublicationArticleDetail.blade.php +++ b/resources/views/site/digitalPublicationArticleDetail.blade.php @@ -7,13 +7,6 @@ @section('content') @if ($bgcolor ?? false) - @endif
@@ -74,19 +67,14 @@ @endif
- @switch ($item->article_type) - @case (DigitalPublicationArticleType::Contributions) - @case (DigitalPublicationArticleType::Entry) - @if ($item->showAuthorsWithLinks()) - @component('components.blocks._text') - @slot('font', 'f-tag-2') - @slot('variation', 'author-links') - @slot('tag', 'div') - {!! $item->showAuthorsWithLinks() !!} - @endcomponent - @endif - @break - @endswitch + @if ($item->showAuthorsWithLinks() && $item->article_type == DigitalPublicationArticleType::Contributions) + @component('components.blocks._text') + @slot('font', 'f-tag-2') + @slot('variation', 'author-links') + @slot('tag', 'div') + {!! $item->showAuthorsWithLinks() !!} + @endcomponent + @endif @php switch ($item->article_type) { @@ -109,6 +97,15 @@ 'pageTitle' => $item->meta_title ?: $item->title, ]) !!} + @if ($item->showAuthorsWithLinks() && $item->article_type == DigitalPublicationArticleType::Entry) + @component('components.blocks._text') + @slot('font', 'f-tag-2') + @slot('variation', 'author-links') + @slot('tag', 'div') + Entry by {!! $item->showAuthorsWithLinks() !!} + @endcomponent + @endif + @component('partials._bibliography') @slot('notes', $_collectedReferences ?? null) @slot('references', $item->present()->references()) From f87e58ca19cca2a21b715915036bb68b683a94c4 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 5 Sep 2024 16:05:27 -0500 Subject: [PATCH 160/346] Replace instances of `type` with `article_type` [PUB-226] --- .../DigitalPublicationArticleRequest.php | 1 + .../DigitalPublicationArticlePresenter.php | 4 ++-- .../Admin/DigitalPublicationPresenter.php | 2 +- .../admin/partials/featured-related.blade.php | 2 +- .../molecules/_m-digipub-title-bar.blade.php | 2 +- .../organisms/_o-table-of-contents.blade.php | 4 ++-- resources/views/layouts/app.blade.php | 4 ++-- .../digitalPublicationArticleDetail.blade.php | 10 ++++----- .../site/digitalPublicationDetail.blade.php | 22 ++++++++----------- 9 files changed, 24 insertions(+), 27 deletions(-) diff --git a/app/Http/Requests/Admin/DigitalPublicationArticleRequest.php b/app/Http/Requests/Admin/DigitalPublicationArticleRequest.php index 6ada31959a..28dff938f4 100644 --- a/app/Http/Requests/Admin/DigitalPublicationArticleRequest.php +++ b/app/Http/Requests/Admin/DigitalPublicationArticleRequest.php @@ -14,6 +14,7 @@ public function rulesForCreate() public function rulesForUpdate() { return [ + 'article_type' => 'required', 'date' => 'required', ]; } diff --git a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php index 999a55f371..e5e3d7e9a3 100644 --- a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php +++ b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php @@ -10,7 +10,7 @@ class DigitalPublicationArticlePresenter extends BasePresenter { public function getCanonicalUrl() { - if ($this->entity->type === DigitalPublicationArticleType::Grouping) { + if ($this->entity->article_type === DigitalPublicationArticleType::Grouping) { return route( 'collection.publications.digital-publications.showListing', [ @@ -84,7 +84,7 @@ public function countAllChildren($entity) $descendants = $entity->descendants; $filteredDescendants = $descendants->filter(function ($descendant) { - return $descendant->type !== DigitalPublicationArticleType::Grouping; + return $descendant->article_type !== DigitalPublicationArticleType::Grouping; }); return $filteredDescendants->count(); diff --git a/app/Presenters/Admin/DigitalPublicationPresenter.php b/app/Presenters/Admin/DigitalPublicationPresenter.php index 67c6146b6c..7162871a26 100644 --- a/app/Presenters/Admin/DigitalPublicationPresenter.php +++ b/app/Presenters/Admin/DigitalPublicationPresenter.php @@ -51,7 +51,7 @@ public function getArticles($type = null) if (!isset($this->articles[$type])) { $this->articles[$type] = $this->articles['all'] ->filter(function ($article) use ($type) { - return $article->type->value === $type; + return $article->article_type->value === $type; }) ->values(); } diff --git a/resources/views/admin/partials/featured-related.blade.php b/resources/views/admin/partials/featured-related.blade.php index da049bfbba..2369e005c6 100644 --- a/resources/views/admin/partials/featured-related.blade.php +++ b/resources/views/admin/partials/featured-related.blade.php @@ -61,7 +61,7 @@
    @foreach($autoRelated as $related)
  1. - {!! Str::title($related->present()->type) . (Str::title($related->present()->type) ? ":" : "") !!} {{ $related->title }} + {!! Str::title($related->present()->articleType) . (Str::title($related->present()->articleType) ? ":" : "") !!} {{ $related->title }}
  2. @endforeach
diff --git a/resources/views/components/molecules/_m-digipub-title-bar.blade.php b/resources/views/components/molecules/_m-digipub-title-bar.blade.php index c0149d8099..08ee2feb9e 100644 --- a/resources/views/components/molecules/_m-digipub-title-bar.blade.php +++ b/resources/views/components/molecules/_m-digipub-title-bar.blade.php @@ -6,7 +6,7 @@ @if ($item->children && count($item->children) >= 1)

{!! $item->present()->title !!}

- {{ 'View all ' . $item->present()->type }} + {{ 'View all ' . $item->present()->articleType }}
diff --git a/resources/views/components/organisms/_o-table-of-contents.blade.php b/resources/views/components/organisms/_o-table-of-contents.blade.php index cbf46c8dec..127328896c 100644 --- a/resources/views/components/organisms/_o-table-of-contents.blade.php +++ b/resources/views/components/organisms/_o-table-of-contents.blade.php @@ -4,10 +4,10 @@ if (isset($currentArticle)) { $isExpanded = $currentArticle->parent === $item || $currentArticle->present()->isArticleInTree($item->children); } else { - if ($item->type === App\Enums\DigitalPublicationArticleType::Grouping) { + if ($item->article_type === App\Enums\DigitalPublicationArticleType::Grouping) { $hasGroupingAncestor = $item->ancestors->contains(function ($ancestor) { - return $ancestor->type === App\Enums\DigitalPublicationArticleType::Grouping; + return $ancestor->article_type === App\Enums\DigitalPublicationArticleType::Grouping; }); $isExpanded = !$hasGroupingAncestor; } else { diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 309bb0b717..f36f48a912 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -13,8 +13,8 @@ $pClass = strtolower(preg_replace('/@/i','-',$pClass)); $pType = ''; -if (isset($item) && isset($item->type) && isset($item->type->name)) { - $pType = 'p-t-' . Str::kebab($item->type->name); +if (isset($item) && isset($item->article_type) && isset($item->article_type->name)) { + $pType = 'p-t-' . Str::kebab($item->article_type->name); } @endphp diff --git a/resources/views/site/digitalPublicationArticleDetail.blade.php b/resources/views/site/digitalPublicationArticleDetail.blade.php index 1ef950add5..752c19a23d 100644 --- a/resources/views/site/digitalPublicationArticleDetail.blade.php +++ b/resources/views/site/digitalPublicationArticleDetail.blade.php @@ -17,7 +17,7 @@ @endif
- @if ($item->type == DigitalPublicationArticleType::Contributions) + @if ($item->article_type == DigitalPublicationArticleType::Contributions) @component('components.molecules._m-article-header----digital-publication-article') @slot('title', $item->present()->title) @slot('title_display', $item->present()->title_display) @@ -39,7 +39,7 @@ @endcomponent
- @if ($item->type != DigitalPublicationArticleType::Contributions && $item->type != DigitalPublicationArticleType::Entry) + @if ($item->article_type != DigitalPublicationArticleType::Contributions && $item->article_type != DigitalPublicationArticleType::Entry) @component('components.molecules._m-article-header') @slot('headerType', 'generic') @slot('title', $item->present()->title) @@ -51,7 +51,7 @@ {{-- Intentionally left blank for layout --}}
- @if ($item->type !== DigitalPublicationArticleType::Entry) + @if ($item->article_type !== DigitalPublicationArticleType::Entry)
@component('components.atoms._title') @slot('tag', 'h1') @@ -74,7 +74,7 @@ @endif
- @switch ($item->type) + @switch ($item->article_type) @case (DigitalPublicationArticleType::Contributions) @case (DigitalPublicationArticleType::Entry) @if ($item->showAuthorsWithLinks()) @@ -89,7 +89,7 @@ @endswitch @php - switch ($item->type) { + switch ($item->article_type) { case DigitalPublicationArticleType::Contributions: case DigitalPublicationArticleType::Entry: global $_collectedReferences; diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index 380fd6de38..ff6a46d3ed 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -1,7 +1,3 @@ -@php - use App\Enums\DigitalPublicationArticleType; -@endphp - @extends('layouts.app') @section('content') @@ -98,7 +94,7 @@ @component('components.molecules._m-listing----digital-publication-article') @slot('href', $item->present()->url) @slot('image', $item->imageFront('hero')) - @slot('type', $item->present()->type) + @slot('type', $item->present()->articleType) @slot('title', $item->present()->title) @slot('title_display', $item->present()->title_display) @slot('list_description', $item->present()->list_description) @@ -125,7 +121,7 @@ @else @component('components.molecules._m-showcase') @slot('variation', 'showcase--digital-publication') - @slot('tag', $topLevelArticle->present()->type) + @slot('tag', $topLevelArticle->present()->articleType) @slot('title', $topLevelArticle->present()->title_display ?? $topLevelArticle->present()->title) @slot('author_display', $topLevelArticle->showAuthors()) @slot('description', $topLevelArticle->present()->list_description) @@ -176,7 +172,7 @@ @component('components.molecules._m-listing----digital-publication-article') @slot('href', $item->present()->url) @slot('image', $item->imageFront('hero')) - @slot('type', $item->present()->type) + @slot('type', $item->present()->articleType) @slot('title', $item->present()->title) @slot('title_display', $item->present()->title_display) @slot('list_description', $item->present()->list_description) @@ -287,7 +283,7 @@ @slot('cols_medium','4') @slot('cols_large','4') @slot('cols_xlarge','4') - + @foreach ($item->children as $child) @component('components.molecules._m-listing----digital-publication-article-entry') @slot('href', $child->present()->url) @@ -371,7 +367,7 @@ @slot('variation', 'm-listing--seventy-thirty') @slot('href', $item->present()->url) @slot('image', $item->imageFront('hero')) - @slot('type', $item->present()->type) + @slot('type', $item->present()->articleType) @slot('title', $item->present()->title) @slot('title_display', $item->present()->title_display) @slot('list_description', $item->present()->list_description) @@ -427,14 +423,14 @@ 'variation' => 'm-title-bar--compact m-title-bar--no-hr', ]) @slot('item', $item) - {!! $item->present()->type !!} + {!! $item->present()->articleType !!} @endcomponent @else @component('components.molecules._m-listing----digital-publication-article') @slot('variation', 'm-listing--title-only') @slot('href', $item->present()->url) @slot('image', $item->imageFront('hero')) - @slot('type', $item->present()->type) + @slot('type', $item->present()->articleType) @slot('title', $item->present()->title) @slot('title_display', $item->present()->title_display) @slot('list_description', $item->present()->list_description) @@ -459,7 +455,7 @@ 'variation' => 'm-title-bar--compact m-title-bar--no-hr', ]) @slot('item', $topLevelArticle) - {!! $topLevelArticle->present()->type !!} + {!! $topLevelArticle->present()->articleType !!} @endcomponent @endif @@ -497,7 +493,7 @@ @component('components.molecules._m-listing----digital-publication-article') @slot('href', $item->present()->url) @slot('image', $item->imageFront('hero')) - @slot('type', $item->present()->type) + @slot('type', $item->present()->articleType) @slot('title', $item->present()->title) @slot('title_display', $item->present()->title_display) @slot('list_description', $item->present()->list_description) From 260a19c5fdf683f46d7697c7dfb558086ff92369 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 5 Sep 2024 15:14:12 -0500 Subject: [PATCH 161/346] Lint code [PUB-228] --- .../Controllers/Admin/DigitalPublicationArticleController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php index 9822af4e54..8b175b0387 100644 --- a/app/Http/Controllers/Admin/DigitalPublicationArticleController.php +++ b/app/Http/Controllers/Admin/DigitalPublicationArticleController.php @@ -95,7 +95,8 @@ protected function getBrowserData($prependScope = []) $formattedArticles = $articles->map(function ($article) use ($digitalPublicationId) { return [ 'id' => $article->id, - 'name' => $digitalPublicationId ? $article->title : ($article->digitalPublication ? $article->digitalPublication->title . ' - ' . $article->title : $article->title), 'edit' => route('admin.collection.articles_publications.digitalPublications.articles.edit', [ + 'name' => $digitalPublicationId ? $article->title : ($article->digitalPublication ? $article->digitalPublication->title . ' - ' . $article->title : $article->title), + 'edit' => route('admin.collection.articles_publications.digitalPublications.articles.edit', [ 'digitalPublication' => $article->digital_publication_id, 'article' => $article->id ]), From dd25fe171ab3033479b6ecc354f254a4cc025c81 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Mon, 9 Sep 2024 13:11:00 -0500 Subject: [PATCH 162/346] Reinstate accidentally removed code [PUB-246] --- .../views/site/digitalPublicationArticleDetail.blade.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resources/views/site/digitalPublicationArticleDetail.blade.php b/resources/views/site/digitalPublicationArticleDetail.blade.php index c76b20d475..60b8b8615e 100644 --- a/resources/views/site/digitalPublicationArticleDetail.blade.php +++ b/resources/views/site/digitalPublicationArticleDetail.blade.php @@ -7,6 +7,13 @@ @section('content') @if ($bgcolor ?? false) + @endif
From 8c71a8a82dbbc2f7841debd75d550fd9c64f0e68 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 5 Sep 2024 16:06:17 -0500 Subject: [PATCH 163/346] Remove article create form [PUB-226] --- .../admin/digitalPublications/articles/create.blade.php | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 resources/views/admin/digitalPublications/articles/create.blade.php diff --git a/resources/views/admin/digitalPublications/articles/create.blade.php b/resources/views/admin/digitalPublications/articles/create.blade.php deleted file mode 100644 index 82f813fd8b..0000000000 --- a/resources/views/admin/digitalPublications/articles/create.blade.php +++ /dev/null @@ -1,8 +0,0 @@ -@include('twill::partials.create') - -@formField('select', [ - 'name' => 'article_type', - 'label' => 'Type', - 'placeholder' => 'Select a type', - 'options' => $types, -]) From f1a12cb340db0d05e1cd0d5e9d9a8655da6882cd Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 10 Sep 2024 09:22:24 -0500 Subject: [PATCH 164/346] Fix missing comma [PUB-246] --- .../views/admin/digitalPublications/articles/form.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/admin/digitalPublications/articles/form.blade.php b/resources/views/admin/digitalPublications/articles/form.blade.php index fd3a870285..0792f5007d 100644 --- a/resources/views/admin/digitalPublications/articles/form.blade.php +++ b/resources/views/admin/digitalPublications/articles/form.blade.php @@ -97,7 +97,7 @@ 'moduleName' => 'authors', 'name' => 'authors', 'label' => 'Authors', - 'max' => 10 + 'max' => 10, 'note' => 'On Entry type articles, authorship is prepended with "Entry by"', ]) From 056e2e8e2da229ee8d855a4a72017b949a83e1fd Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:52:57 -0500 Subject: [PATCH 165/346] Remove header_title_display for DigitalPublication model [PUB-249] --- app/Models/DigitalPublication.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Models/DigitalPublication.php b/app/Models/DigitalPublication.php index 7a5d3f84fb..70aeef218b 100644 --- a/app/Models/DigitalPublication.php +++ b/app/Models/DigitalPublication.php @@ -40,7 +40,6 @@ class DigitalPublication extends AbstractModel 'sponsor_display', 'welcome_note_display', 'cite_as', - 'header_title_display', 'header_subtitle_display', 'bgcolor', 'toggle_autorelated', From 712d5c634d8bb11d70a668a956b6f19f94e7778c Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:31:38 -0500 Subject: [PATCH 166/346] Register headerAwareScroll globally [PUB-251] --- frontend/js/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/js/app.js b/frontend/js/app.js index ae992335aa..fe27bc1c49 100755 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -1,6 +1,6 @@ import { manageBehaviors, resized, getCurrentMediaQuery, forEach, lazyLoad } from '@area17/a17-helpers'; import * as Behaviors from './behaviors/core'; -import { lockBody, focusTrap, focusDisplayHandler, ajaxPageLoad, ajaxPageLoadMaskToggle, historyProxy, loadProgressBar, setScrollDirection, anchorLinksScroll, fontObservers, modals, collectionFilters, googleTagManager, accessibleContent, headerHeight, roadblock } from './functions/core'; +import { lockBody, focusTrap, focusDisplayHandler, ajaxPageLoad, ajaxPageLoadMaskToggle, historyProxy, loadProgressBar, setScrollDirection, anchorLinksScroll, headerAwareScroll, fontObservers, modals, collectionFilters, googleTagManager, accessibleContent, headerHeight, roadblock } from './functions/core'; /** * A17 * @see Doc: https://code.area17.com/a17/fe-boilerplate/wikis/js-app @@ -57,6 +57,8 @@ document.addEventListener('DOMContentLoaded', function(){ focusDisplayHandler(); // Scroll anchor links anchorLinksScroll(); + // Scroll to hash and adjust for header + headerAwareScroll(); // Listen for modal open/close requests modals(); // Listen for modal open/close requests From 3edf09374c56982cece63f5e7e7e45c268d5c674 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:53:19 -0500 Subject: [PATCH 167/346] Replace reference to header_title_display with just title [PUB-249] --- app/Presenters/Admin/DigitalPublicationPresenter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Presenters/Admin/DigitalPublicationPresenter.php b/app/Presenters/Admin/DigitalPublicationPresenter.php index 7162871a26..f526fd639c 100644 --- a/app/Presenters/Admin/DigitalPublicationPresenter.php +++ b/app/Presenters/Admin/DigitalPublicationPresenter.php @@ -71,7 +71,7 @@ public function topLevelArticles() public function headerTitle() { - return $this->entity->header_title_display ?? $this->entity->title_display; + return $this->entity->title_display ?? $this->entity->title; } public function headerSubtitle() From 42c547e4bf404ec7bdcddf35f754a46a7077e125 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:33:23 -0500 Subject: [PATCH 168/346] Create headerAwareScroll behavior [PUB-251] --- .../js/functions/core/headerAwareScroll.js | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 frontend/js/functions/core/headerAwareScroll.js diff --git a/frontend/js/functions/core/headerAwareScroll.js b/frontend/js/functions/core/headerAwareScroll.js new file mode 100644 index 0000000000..3b5099c0a7 --- /dev/null +++ b/frontend/js/functions/core/headerAwareScroll.js @@ -0,0 +1,43 @@ +const headerAwareScroll = function(container) { + + // Function to get the scroll position of an element + function getOffsetTop(element) { + let offsetTop = 0; + while (element) { + offsetTop += element.offsetTop; + element = element.offsetParent; + } + return offsetTop; + } + + // Get the current URL hash + const hash = window.location.hash; + + if (hash) { + // Find the target element by ID + const targetElement = document.getElementById(hash.substring(1)); + + if (targetElement) { + // Get the scroll position of the target element + let scrollPosition = getOffsetTop(targetElement); + + const headerFeature = document.querySelectorAll('.m-article-header--digital-publication')[0]; + if (headerFeature) { + const headerHeight = headerFeature.getBoundingClientRect().height; + // Add the height to the scroll position + scrollPosition -= headerHeight + 30; + } + + + // Scroll to the target element + window.requestAnimationFrame(() => { + window.scrollTo({ + top: scrollPosition, + behavior: 'smooth' + }); + }); + } + } +} + +export default headerAwareScroll; \ No newline at end of file From 2d4cf246e4edcc6ef78d6d84a5bb1636c57350c7 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:53:33 -0500 Subject: [PATCH 169/346] Create migration to remove header_title_display column [PUB-249] --- ...splay_column_from_digital_publications.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 database/migrations/2024_09_10_135205_drop_header_title_display_column_from_digital_publications.php diff --git a/database/migrations/2024_09_10_135205_drop_header_title_display_column_from_digital_publications.php b/database/migrations/2024_09_10_135205_drop_header_title_display_column_from_digital_publications.php new file mode 100644 index 0000000000..4ddd2f4cd3 --- /dev/null +++ b/database/migrations/2024_09_10_135205_drop_header_title_display_column_from_digital_publications.php @@ -0,0 +1,22 @@ +dropColumn('header_title_display'); + }); + } + + public function down(): void + { + Schema::table('digital_publications', function (Blueprint $table) { + $table->string('header_title_display')->nullable(); + }); + } +}; From e529ce884db77a7d0d234685ad5c73e4d11e8099 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:33:49 -0500 Subject: [PATCH 170/346] Register headerAwareScroll [PUB-251] --- frontend/js/functions/core/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/js/functions/core/index.js b/frontend/js/functions/core/index.js index 06ae528a71..e51e81864a 100644 --- a/frontend/js/functions/core/index.js +++ b/frontend/js/functions/core/index.js @@ -11,6 +11,7 @@ export { default as ajaxableHref } from './ajaxableHref'; export { default as loadProgressBar } from './loadProgressBar'; export { default as setScrollDirection } from './setScrollDirection'; export { default as anchorLinksScroll } from './anchorLinksScroll'; +export { default as headerAwareScroll } from './headerAwareScroll'; export { default as fontObservers } from './fontObservers'; export { default as modals } from './modals'; export { default as mediaQuery } from './mediaQuery'; From 037299007a72f143d8b345a4654020475025ae94 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:54:05 -0500 Subject: [PATCH 171/346] Update header to wrap text and remove persistent sticky header image [PUB-249] --- .../scss/molecules/_m-article-header.scss | 58 +++++++++++++++++-- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 1c06d35d77..d1211a6a05 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1076,7 +1076,7 @@ min-height: initial; z-index: auto; - white-space: nowrap; + white-space: normal; .f-headline-editorial { @include untuck(); @@ -1099,8 +1099,8 @@ } .title { - font-size: 28px; - line-height: 34px; + font-size: 38px; + line-height: 44px; margin-top: 26px; } @@ -1211,7 +1211,7 @@ // TODO Isolate the following to a _s-sticky-digital-publication-header.scss file? .s-shrinking-digital-publication-header.s-scroll-direction-down { - @include breakpoint('large+') { + @include breakpoint('medium+') { .m-article-header__img img { opacity: 0; transition: opacity 1s; @@ -1229,7 +1229,45 @@ } } +.s-shrinking-digital-publication-header.is-sidebar-top { + @include breakpoint('medium+') { + .m-article-header__img img { + opacity: 1; + transition: opacity 1s; + } + + .m-article-header__text .title { + opacity: 1; + transition: opacity 1s; + } + + .m-article-header__text .subtitle { + opacity: 1; + transition: opacity 1s; + } + } +} + .s-sticky-digital-publication-header { + &.is-sidebar-fixed, &.is-sidebar-bottom { + @include breakpoint('medium+') { + .m-article-header__img img { + opacity: 0; + transition: opacity 1s; + } + + .m-article-header__text .title { + opacity: 0; + transition: opacity 1s; + } + + .m-article-header__text .subtitle { + opacity: 0; + transition: opacity 1s; + } + } + + } @include breakpoint('medium-') { .m-sidebar-toggle { position: fixed; @@ -1255,11 +1293,19 @@ width: 100%; z-index: map-get($zindexs, 'header'); + .m-article-header__text::before { + left: -10vw; + margin-left: 0; + max-width: 110vw; + } + .m-article-header__text .title { margin-bottom: auto; margin-top: auto; opacity: 1; transition: opacity 1s; + font-size: 20px; + line-height: 24px; } .m-article-header__text .subtitle { @@ -1267,11 +1313,11 @@ } .m-article-header__img { - flex: 0 0 auto; height: 180px; + flex: 0 0 colspan(56, 'large'); img { - opacity: 1; + object-position: bottom; transition: opacity 1s; } } From 7ee3c2ad228072ceabc110c69de04bed749901d2 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:58:26 -0500 Subject: [PATCH 172/346] Add hover only if the title is a link [PUB-251] --- frontend/scss/molecules/_m-article-header.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 1c06d35d77..0f0c3f4997 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1078,7 +1078,17 @@ white-space: nowrap; + >a { + color: $color__white !important; + + &:hover { + color: $color__white !important; + text-decoration: underline !important; + } + } + .f-headline-editorial { + color: $color__white !important; @include untuck(); } } From 3093c6857b4893b32c55574bf7417e478e647580 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:54:32 -0500 Subject: [PATCH 173/346] Remove input for header_title_display [PUB-249] --- resources/views/admin/digitalPublications/form.blade.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/resources/views/admin/digitalPublications/form.blade.php b/resources/views/admin/digitalPublications/form.blade.php index cf04b60bc8..c3645e654c 100644 --- a/resources/views/admin/digitalPublications/form.blade.php +++ b/resources/views/admin/digitalPublications/form.blade.php @@ -16,15 +16,6 @@
- @formField('wysiwyg', [ - 'name' => 'header_title_display', - 'label' => 'Title lockup for header', - 'note' => 'Use Shift+Enter to add linebreak instead of starting a new paragraph', - 'toolbarOptions' => [ - 'italic', - ], - ]) - @formField('wysiwyg', [ 'name' => 'header_subtitle_display', 'label' => 'Subtitle lockup for header', From 50e2ba50ccc88af46044b7a8fb94afaa10d61cfb Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:58:52 -0500 Subject: [PATCH 174/346] Fix scrollTo bug for header [PUB-251] --- frontend/scss/molecules/_m-article-header.scss | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 0f0c3f4997..eb75653f85 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1239,7 +1239,19 @@ } } -.s-sticky-digital-publication-header { +.s-sticky-digital-publication-header.is-sidebar-top.s-scroll-direction-up { + .m-article-header--digital-publication { + position: absolute !important; + } +} + +.s-sticky-digital-publication-header, .p-digitalpublications-showlisting { + .m-article-header--digital-publication { + .m-article-header__text { + justify-content: center; + } + } + @include breakpoint('medium-') { .m-sidebar-toggle { position: fixed; From 8fb4a405828df33696fc9f020baa8b7f449f055b Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:55:04 -0500 Subject: [PATCH 175/346] Remove "lockup" references from form [PUB-249] --- resources/views/admin/digitalPublications/form.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/admin/digitalPublications/form.blade.php b/resources/views/admin/digitalPublications/form.blade.php index c3645e654c..d576b7fb40 100644 --- a/resources/views/admin/digitalPublications/form.blade.php +++ b/resources/views/admin/digitalPublications/form.blade.php @@ -18,7 +18,7 @@ @formField('wysiwyg', [ 'name' => 'header_subtitle_display', - 'label' => 'Subtitle lockup for header', + 'label' => 'Subtitle for header', 'toolbarOptions' => [ 'italic', ], From d74cfbd300b6ba8a980b434ebe27a9ae822ce48e Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 10 Sep 2024 13:16:48 -0500 Subject: [PATCH 176/346] Apply correct aspect ration to entry listing image crop [PUB-240] --- resources/views/site/digitalPublicationDetail.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index ff6a46d3ed..6493c9d33c 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -229,7 +229,7 @@ @slot('label', $item->present()->label) @slot('imageSettings', array( 'fit' => 'crop', - 'ratio' => '16:9', + 'ratio' => $item->imageFront('hero', 'square') ? '1' : '16:9', 'srcset' => array(200,400,600), 'sizes' => ImageHelpers::aic_imageSizes(array( 'xsmall' => '216px', From 907e951fedfc733c8341363b904f8b73954c3b31 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:59:40 -0500 Subject: [PATCH 177/346] Link title to landing page if not on it [PUB-251] --- .../_m-article-header----feature.blade.php | 20 ++++++++++++------- .../site/digitalPublicationDetail.blade.php | 2 ++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/resources/views/components/molecules/_m-article-header----feature.blade.php b/resources/views/components/molecules/_m-article-header----feature.blade.php index 2786864c9a..2736ed66cf 100644 --- a/resources/views/components/molecules/_m-article-header----feature.blade.php +++ b/resources/views/components/molecules/_m-article-header----feature.blade.php @@ -33,13 +33,19 @@ class="m-article-header m-article-header--feature{{ (isset($variation)) ? ' '.$v
@if (isset($title)) - @component('components.atoms._title') - @slot('tag','h1') - @slot('font', (isset($editorial) && $editorial) ? 'f-headline-editorial' : 'f-headline') - @slot('itemprop','name') - @slot('title', $title) - @slot('title_display', $title_display ?? null) - @endcomponent + @if (isset($title_href)) + + @endif + @component('components.atoms._title') + @slot('tag', 'h1') + @slot('font', (isset($editorial) && $editorial) ? 'f-headline-editorial' : 'f-headline') + @slot('itemprop','name') + @slot('title', $title) + @slot('title_display', $title_display ?? null) + @endcomponent + @if (isset($title_href)) + + @endif @if (isset($subtitle_display))

{!! $subtitle_display !!} diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index 6493c9d33c..028ac1d2e5 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -6,7 +6,9 @@ @component('components.molecules._m-article-header----feature') @slot('variation', 'm-article-header--digital-publication') @slot('title', $item->present()->title) + @slot('title_href', (request()->url() !== $item->present()->url) ? $item->present()->url : null) @slot('title_display', $item->present()->headerTitle()) + @slot('title_tag', (request()->url() !== $item->present()->url) ? 'a' : 'h1') @slot('subtitle_display', $item->present()->headerSubtitle()) @slot('img', $item->imageFront('listing')) @slot('imgMobile', $item->imageFront('mobile_listing')) From f7d9030b3d31bdf0a2a1324b43f3f08e61c44b05 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 10:55:13 -0500 Subject: [PATCH 178/346] Show and style header with image on medium+ [PUB-248] --- frontend/scss/molecules/_m-article-header.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index e0444b3eac..1c06d35d77 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1121,7 +1121,7 @@ @include breakpoint('medium+') { .m-article-header__text { - padding-right: 0; + padding-right: 4.875vw !important; } .m-article-header__img { @@ -1138,7 +1138,7 @@ } } - @include breakpoint('large+') { + @include breakpoint('medium+') { flex-flow: row-reverse nowrap; .title { From d2b2e70f276ad0cfef00222160603bfdc15c9312 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:56:17 -0500 Subject: [PATCH 179/346] Remove references of header_title_display [PUB-249] --- .../_m-article-actions----digital-publication.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php b/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php index b1dfdb2c54..cd43e3a7a2 100644 --- a/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php +++ b/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php @@ -6,7 +6,7 @@ From 4cd20dec0bfea8dbcd9da12ecce5d460ec5bdf63 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:59:54 -0500 Subject: [PATCH 180/346] Only render welcome note on the landing page [PUB-251] --- resources/views/site/digitalPublicationDetail.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index 028ac1d2e5..2ddc5de16f 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -30,7 +30,7 @@

- @if ($item->welcome_note_display && $welcomeNote) + @if ($item->welcome_note_display && $welcomeNote && $showAll == false)
@component('components.organisms._o-editors-note----publication') @slot('description', $item->welcome_note_display) From ed5ed7c2de705ae0cd7eb0731b02d60d8e4eb1d2 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:53:33 -0500 Subject: [PATCH 181/346] Maintain title font-size only in listing view [PUB-251] --- frontend/scss/molecules/_m-article-header.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 8a37fd2a80..0c6c88d9ca 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1249,6 +1249,10 @@ .m-article-header--digital-publication { .m-article-header__text { justify-content: center; + + .title { + font-size: 26px !important; + } } } } @@ -1321,7 +1325,7 @@ margin-top: auto; opacity: 1; transition: opacity 1s; - font-size: 20px; + font-size: 26px; line-height: 24px; } From a0596ebd24d0f74026c96b16b836de2c915999f0 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 10 Sep 2024 15:04:20 -0500 Subject: [PATCH 182/346] Move branding colors into config file [PUB-256] --- .../Admin/DigitalPublicationController.php | 13 ++-------- config/aic.php | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/Admin/DigitalPublicationController.php b/app/Http/Controllers/Admin/DigitalPublicationController.php index 35dd2aeebc..954bba6f4e 100644 --- a/app/Http/Controllers/Admin/DigitalPublicationController.php +++ b/app/Http/Controllers/Admin/DigitalPublicationController.php @@ -30,17 +30,8 @@ protected function formData($request) { $item = $this->repository->getById(request('digitalPublication') ?? request('id')); $baseUrl = '//' . config('app.url') . '/digital-publications/' . $item->id . '/'; - $heroBackgroundColors = collect([ - '#282829', - '#422E22', - '#284725', - '#1E3F49', - '#1C2454', - '#35295A', - '#711F2A', - '#983820', - '#E19E26', - ])->mapWithKeys(fn ($hexColor) => [$hexColor => $hexColor]); + $heroBackgroundColors = collect(config('aic.branding.colors')) + ->mapWithKeys(fn ($hexColor) => [$hexColor => $hexColor]); return [ 'baseUrl' => $baseUrl, diff --git a/config/aic.php b/config/aic.php index 5ef63b13a8..1e4edaec8b 100644 --- a/config/aic.php +++ b/config/aic.php @@ -39,4 +39,28 @@ 'show_hours_in_footer' => (bool) env('SHOW_HOURS_IN_FOOTER', false), 'disable_captcha' => (bool) env('DISABLE_CAPTCHA', false), 'show_default_related_items' => (bool) env('SHOW_DEFAULT_RELATED_ITEMS', true), + + // Branding + 'branding' => [ + 'colors' => [ + '#282829', + '#422E22', + '#284725', + '#1E3F49', + '#1C2454', + '#35295A', + '#711F2A', + '#983820', + '#E19E26', + '#9D9FA2', + '#A39282', + '#A1B981', + '#75B4BA', + '#77A8D5', + '#8C8FBE', + '#D58FA2', + '#EC9E6C', + '#F8EB83', + ], + ], ]; From 65b33ebdb2cc898aaa6f1db4d1a38753d64f9806 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 10 Sep 2024 11:53:50 -0500 Subject: [PATCH 183/346] Make fields conditional on article_type [PUB-207] --- .../articles/form.blade.php | 396 ++++++++++++------ 1 file changed, 265 insertions(+), 131 deletions(-) diff --git a/resources/views/admin/digitalPublications/articles/form.blade.php b/resources/views/admin/digitalPublications/articles/form.blade.php index 0792f5007d..75304968d3 100644 --- a/resources/views/admin/digitalPublications/articles/form.blade.php +++ b/resources/views/admin/digitalPublications/articles/form.blade.php @@ -15,22 +15,6 @@ 'note' => 'Required', ]) - @formField('medias', [ - 'with_multiple' => false, - 'no_crop' => false, - 'label' => 'Hero image', - 'name' => 'hero', - 'note' => 'Minimum image width 3000px' - ]) - - @formField('medias', [ - 'with_multiple' => false, - 'no_crop' => false, - 'label' => 'Mobile hero image', - 'name' => 'mobile_hero', - 'note' => 'Minimum image width 2000px' - ]) - @formField('select', [ 'name' => 'article_type', 'label' => 'Type', @@ -38,119 +22,6 @@ 'default' => 'text', 'options' => $types, ]) - - @component('twill::partials.form.utils._columns') - @slot('left') - @formField('checkbox', [ - 'name' => 'hide_title', - 'label' => 'Hide title in listing view', - ]) - @endslot - - @slot('right') - @formField('checkbox', [ - 'name' => 'suppress_listing', - 'label' => 'Hide from listing view', - ]) - @endslot - @endcomponent - - @formField('select', [ - 'name' => 'listing_display', - 'label' => 'Listing display', - 'placeholder' => 'Select a listing display', - 'default' => 'default', - 'options' => [ - ['value' => 'feature', 'label' => 'Feature'], - ['value' => '3-across', 'label' => '3-Across'], - ['value' => 'entries', 'label' => 'Entries'], - ['value' => 'group_entries', 'label' => 'Group of Entries'], - ['value' => 'list', 'label' => 'List view'], - ['value' => 'simple_list', 'label' => 'Text list view'], - ], - ]) - - @formField('input', [ - 'name' => 'label', - 'label' => 'Article label', - 'note' => 'Used in the "eyebrow" of cards on the publication page', - ]) - - @formField('wysiwyg', [ - 'name' => 'list_description', - 'label' => 'List description', - 'maxlength' => 255, - 'note' => 'Max 255 characters. Will be used on the main landing, search, and social media.', - 'toolbarOptions' => [ - 'italic', - ], - ]) - - @formField('input', [ - 'name' => 'author_display', - 'label' => 'Author display', - 'note' => 'On Entry type articles, authorship is prepended with "Entry by"', - ]) - - @formField('browser', [ - 'routePrefix' => 'collection', - 'moduleName' => 'authors', - 'name' => 'authors', - 'label' => 'Authors', - 'max' => 10, - 'note' => 'On Entry type articles, authorship is prepended with "Entry by"', - ]) - - @formField('wysiwyg', [ - 'name' => 'cite_as', - 'label' => 'How to Cite', - 'toolbarOptions' => [ - 'italic', - ], - ]) - - @formField('wysiwyg', [ - 'name' => 'references', - 'label' => 'References', - 'toolbarOptions' => [ - 'italic', 'link', 'list-ordered', 'list-unordered', - ], - ]) - - @formField('block_editor', [ - 'blocks' => BlockHelpers::getBlocksForEditor([ - '360_embed', - '360_modal', - '3d_embed', - '3d_model', - '3d_tour', - 'ranged_accordion', - 'artwork', - 'audio_player', - 'button', - 'citation', - 'digital_label', - 'gallery_new', - 'hr', - 'image', - 'image_slider', - 'layered_image_viewer', - 'links-bar', - 'list', - 'media_embed', - 'membership_banner', - 'mirador_embed', - 'mirador_modal', - 'mobile_app', - 'paragraph', - 'quote', - 'split_block', - 'table', - 'tombstone', - 'tour_stop', - 'video', - ]) - ]) @stop @section('fieldsets') @@ -163,6 +34,21 @@ 'id' => 'fields-for-type-grouping', 'title' => 'Grouping fields', ]) + @formField('select', [ + 'name' => 'listing_display', + 'label' => 'Listing display', + 'placeholder' => 'Select a listing display', + 'default' => 'default', + 'options' => [ + ['value' => 'feature', 'label' => 'Feature'], + ['value' => '3-across', 'label' => '3-Across'], + ['value' => 'entries', 'label' => 'Entries'], + ['value' => 'group_entries', 'label' => 'Group of Entries'], + ['value' => 'list', 'label' => 'List view'], + ['value' => 'simple_list', 'label' => 'Text list view'], + ], + ]) + @formField('wysiwyg', [ 'name' => 'grouping_description', 'label' => 'Description', @@ -176,7 +62,7 @@ @formField('medias', [ 'with_multiple' => false, 'no_crop' => false, - 'label' => 'Hero image', + 'label' => 'Grouping image', 'name' => 'grouping_hero', 'note' => 'Minimum image width 3000px' ]) @@ -184,12 +70,260 @@ @formField('medias', [ 'with_multiple' => false, 'no_crop' => false, - 'label' => 'Mobile hero image', + 'label' => 'Mobile grouping image', 'name' => 'grouping_mobile_hero', 'note' => 'Minimum image width 2000px' ]) @endformFieldset @endformConnectedFields + @formConnectedFields([ + 'fieldName' => 'article_type', + 'fieldValues' => 'entry', + 'renderForBlocks' => false, + ]) + @formFieldset([ + 'id' => 'fields-for-type-entry', + 'title' => 'Entry fields', + ]) + @formField('medias', [ + 'with_multiple' => false, + 'no_crop' => false, + 'label' => 'Listing image', + 'name' => 'hero', + 'note' => 'Minimum image width 3000px' + ]) + + @formField('medias', [ + 'with_multiple' => false, + 'no_crop' => false, + 'label' => 'Mobile listing image', + 'name' => 'mobile_hero', + 'note' => 'Minimum image width 2000px' + ]) + + @component('twill::partials.form.utils._columns') + @slot('left') + @formField('checkbox', [ + 'name' => 'hide_title', + 'label' => 'Hide title in listing view', + ]) + @endslot + + @slot('right') + @formField('checkbox', [ + 'name' => 'suppress_listing', + 'label' => 'Hide from listing view', + ]) + @endslot + @endcomponent + + @formField('input', [ + 'name' => 'label', + 'label' => 'Article label', + 'note' => 'Used in the "eyebrow" of cards on the publication page', + ]) + + @formField('wysiwyg', [ + 'name' => 'list_description', + 'label' => 'List description', + 'maxlength' => 255, + 'note' => 'Max 255 characters. Will be used on the main landing, search, and social media.', + 'toolbarOptions' => [ + 'italic', + ], + ]) + + @formField('input', [ + 'name' => 'author_display', + 'label' => 'Author display', + 'note' => 'On Entry type articles, authorship is prepended with "Entry by"', + ]) + + @formField('browser', [ + 'routePrefix' => 'collection', + 'moduleName' => 'authors', + 'name' => 'authors', + 'label' => 'Authors', + 'max' => 10, + 'note' => 'On Entry type articles, authorship is prepended with "Entry by"', + ]) + + @formField('wysiwyg', [ + 'name' => 'cite_as', + 'label' => 'How to Cite', + 'toolbarOptions' => [ + 'italic', + ], + ]) + + @formField('wysiwyg', [ + 'name' => 'references', + 'label' => 'References', + 'toolbarOptions' => [ + 'italic', 'link', 'list-ordered', 'list-unordered', + ], + ]) + + @formField('block_editor', [ + 'blocks' => BlockHelpers::getBlocksForEditor([ + '360_embed', + '360_modal', + '3d_embed', + '3d_model', + '3d_tour', + 'ranged_accordion', + 'artwork', + 'audio_player', + 'button', + 'citation', + 'digital_label', + 'gallery_new', + 'hr', + 'image', + 'image_slider', + 'layered_image_viewer', + 'links-bar', + 'list', + 'media_embed', + 'membership_banner', + 'mirador_embed', + 'mirador_modal', + 'mobile_app', + 'paragraph', + 'quote', + 'split_block', + 'table', + 'tombstone', + 'tour_stop', + 'video', + ]) + ]) + @endformFieldset + @endformConnectedFields + + @formConnectedFields([ + 'fieldName' => 'article_type', + 'fieldValues' => ['about', 'text', 'work'], + 'renderForBlocks' => false, + ]) + @formFieldset([ + 'id' => 'fields-for-type-other', + 'title' => 'Article fields', + ]) + @formField('medias', [ + 'with_multiple' => false, + 'no_crop' => false, + 'label' => 'Hero image', + 'name' => 'hero', + 'note' => 'Minimum image width 3000px' + ]) + + @formField('medias', [ + 'with_multiple' => false, + 'no_crop' => false, + 'label' => 'Mobile hero image', + 'name' => 'mobile_hero', + 'note' => 'Minimum image width 2000px' + ]) + + @component('twill::partials.form.utils._columns') + @slot('left') + @formField('checkbox', [ + 'name' => 'hide_title', + 'label' => 'Hide title in listing view', + ]) + @endslot + + @slot('right') + @formField('checkbox', [ + 'name' => 'suppress_listing', + 'label' => 'Hide from listing view', + ]) + @endslot + @endcomponent + + @formField('input', [ + 'name' => 'label', + 'label' => 'Article label', + 'note' => 'Used in the "eyebrow" of cards on the publication page', + ]) + + @formField('wysiwyg', [ + 'name' => 'list_description', + 'label' => 'List description', + 'maxlength' => 255, + 'note' => 'Max 255 characters. Will be used on the main landing, search, and social media.', + 'toolbarOptions' => [ + 'italic', + ], + ]) + + @formField('input', [ + 'name' => 'author_display', + 'label' => 'Author display', + ]) + + @formField('browser', [ + 'routePrefix' => 'collection', + 'moduleName' => 'authors', + 'name' => 'authors', + 'label' => 'Authors', + 'max' => 10, + ]) + + @formField('wysiwyg', [ + 'name' => 'cite_as', + 'label' => 'How to Cite', + 'toolbarOptions' => [ + 'italic', + ], + ]) + + @formField('wysiwyg', [ + 'name' => 'references', + 'label' => 'References', + 'toolbarOptions' => [ + 'italic', 'link', 'list-ordered', 'list-unordered', + ], + ]) + + @formField('block_editor', [ + 'blocks' => BlockHelpers::getBlocksForEditor([ + '360_embed', + '360_modal', + '3d_embed', + '3d_model', + '3d_tour', + 'ranged_accordion', + 'artwork', + 'audio_player', + 'button', + 'citation', + 'digital_label', + 'gallery_new', + 'hr', + 'image', + 'image_slider', + 'layered_image_viewer', + 'links-bar', + 'list', + 'media_embed', + 'membership_banner', + 'mirador_embed', + 'mirador_modal', + 'mobile_app', + 'paragraph', + 'quote', + 'split_block', + 'table', + 'tombstone', + 'tour_stop', + 'video', + ]) + ]) + @endformFieldset + @endformConnectedFields + @include('admin.partials.meta') @stop From ea5466eb823d88b75bd671cf655a358c66d1a0d4 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:53:58 -0500 Subject: [PATCH 184/346] Fix header bar whitespace issue on larger screens [PUB-251] --- frontend/scss/molecules/_m-article-header.scss | 4 ++-- frontend/scss/pages/_p-issuearticle-show.scss | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 0c6c88d9ca..b23185ddbd 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1186,7 +1186,7 @@ z-index: 1; } .m-article-header__text::before { - left: -300%; + left: -36vw; margin-left: 0; max-width: colspan(50, 'xlarge'); } @@ -1315,7 +1315,7 @@ z-index: map-get($zindexs, 'header'); .m-article-header__text::before { - left: -10vw; + left: -40vw; margin-left: 0; max-width: 110vw; } diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index b5825f9113..d95614872c 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -124,9 +124,9 @@ margin-left: calc(-600px + 50%); @each $name in ('large', 'xlarge') { @include breakpoint('#{$name}') { - width: calc(#{colspan(14, '#{$name}')} * 2 + (#{colspan(1, '#{$name}')} * 2) + 14vw); + width: calc(#{colspan(14, '#{$name}')} * 2 + (#{colspan(1, '#{$name}')} * 2) + 18vw); padding-right: calc(#{colspan(1, '#{$name}')} * 2); - margin-left: calc((#{colspan(14, '#{$name}')} * -1) + (#{colspan(1, '#{$name}')} * -1) - 14vw); + margin-left: calc((#{colspan(14, '#{$name}')} * -1) + (#{colspan(1, '#{$name}')} * -1) - 18vw); margin-right: colspan(2, #{$name}); } } From d6f5111827a278729709a05b0b31050712b3042f Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 10 Sep 2024 15:07:15 -0500 Subject: [PATCH 185/346] Set background color select to have 3 columns [PUB-256] --- resources/views/admin/digitalPublications/form.blade.php | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/views/admin/digitalPublications/form.blade.php b/resources/views/admin/digitalPublications/form.blade.php index d576b7fb40..9d3301503a 100644 --- a/resources/views/admin/digitalPublications/form.blade.php +++ b/resources/views/admin/digitalPublications/form.blade.php @@ -42,6 +42,7 @@ 'name' => 'bgcolor', 'label' => 'Hero background color', 'options' => $heroBackgroundColors, + 'columns' => 3, ]) @formField('wysiwyg', [ From dcec9f842630c9e2d35066e0ca60d9fa108bbd16 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 10 Sep 2024 14:38:16 -0500 Subject: [PATCH 186/346] Rearrange conditional fields [PUB-207] --- .../articles/form.blade.php | 164 +++++------------- 1 file changed, 39 insertions(+), 125 deletions(-) diff --git a/resources/views/admin/digitalPublications/articles/form.blade.php b/resources/views/admin/digitalPublications/articles/form.blade.php index 75304968d3..314e7d00d2 100644 --- a/resources/views/admin/digitalPublications/articles/form.blade.php +++ b/resources/views/admin/digitalPublications/articles/form.blade.php @@ -25,14 +25,14 @@ @stop @section('fieldsets') - @formConnectedFields([ - 'fieldName' => 'article_type', - 'fieldValues' => 'grouping', - 'renderForBlocks' => false, + @formFieldset([ + 'id' => 'article-type-fields', + 'title' => 'Article type fields', ]) - @formFieldset([ - 'id' => 'fields-for-type-grouping', - 'title' => 'Grouping fields', + @formConnectedFields([ + 'fieldName' => 'article_type', + 'fieldValues' => 'grouping', + 'renderForBlocks' => false, ]) @formField('select', [ 'name' => 'listing_display', @@ -74,17 +74,12 @@ 'name' => 'grouping_mobile_hero', 'note' => 'Minimum image width 2000px' ]) - @endformFieldset - @endformConnectedFields + @endformConnectedFields - @formConnectedFields([ - 'fieldName' => 'article_type', - 'fieldValues' => 'entry', - 'renderForBlocks' => false, - ]) - @formFieldset([ - 'id' => 'fields-for-type-entry', - 'title' => 'Entry fields', + @formConnectedFields([ + 'fieldName' => 'article_type', + 'fieldValues' => 'entry', + 'renderForBlocks' => false, ]) @formField('medias', [ 'with_multiple' => false, @@ -102,38 +97,6 @@ 'note' => 'Minimum image width 2000px' ]) - @component('twill::partials.form.utils._columns') - @slot('left') - @formField('checkbox', [ - 'name' => 'hide_title', - 'label' => 'Hide title in listing view', - ]) - @endslot - - @slot('right') - @formField('checkbox', [ - 'name' => 'suppress_listing', - 'label' => 'Hide from listing view', - ]) - @endslot - @endcomponent - - @formField('input', [ - 'name' => 'label', - 'label' => 'Article label', - 'note' => 'Used in the "eyebrow" of cards on the publication page', - ]) - - @formField('wysiwyg', [ - 'name' => 'list_description', - 'label' => 'List description', - 'maxlength' => 255, - 'note' => 'Max 255 characters. Will be used on the main landing, search, and social media.', - 'toolbarOptions' => [ - 'italic', - ], - ]) - @formField('input', [ 'name' => 'author_display', 'label' => 'Author display', @@ -148,68 +111,12 @@ 'max' => 10, 'note' => 'On Entry type articles, authorship is prepended with "Entry by"', ]) + @endformConnectedFields - @formField('wysiwyg', [ - 'name' => 'cite_as', - 'label' => 'How to Cite', - 'toolbarOptions' => [ - 'italic', - ], - ]) - - @formField('wysiwyg', [ - 'name' => 'references', - 'label' => 'References', - 'toolbarOptions' => [ - 'italic', 'link', 'list-ordered', 'list-unordered', - ], - ]) - - @formField('block_editor', [ - 'blocks' => BlockHelpers::getBlocksForEditor([ - '360_embed', - '360_modal', - '3d_embed', - '3d_model', - '3d_tour', - 'ranged_accordion', - 'artwork', - 'audio_player', - 'button', - 'citation', - 'digital_label', - 'gallery_new', - 'hr', - 'image', - 'image_slider', - 'layered_image_viewer', - 'links-bar', - 'list', - 'media_embed', - 'membership_banner', - 'mirador_embed', - 'mirador_modal', - 'mobile_app', - 'paragraph', - 'quote', - 'split_block', - 'table', - 'tombstone', - 'tour_stop', - 'video', - ]) - ]) - @endformFieldset - @endformConnectedFields - - @formConnectedFields([ - 'fieldName' => 'article_type', - 'fieldValues' => ['about', 'text', 'work'], - 'renderForBlocks' => false, - ]) - @formFieldset([ - 'id' => 'fields-for-type-other', - 'title' => 'Article fields', + @formConnectedFields([ + 'fieldName' => 'article_type', + 'fieldValues' => ['about', 'text', 'work'], + 'renderForBlocks' => false, ]) @formField('medias', [ 'with_multiple' => false, @@ -227,6 +134,26 @@ 'note' => 'Minimum image width 2000px' ]) + @formField('input', [ + 'name' => 'author_display', + 'label' => 'Author display', + ]) + + @formField('browser', [ + 'routePrefix' => 'collection', + 'moduleName' => 'authors', + 'name' => 'authors', + 'label' => 'Authors', + 'max' => 10, + ]) + @endformConnectedFields + + @formConnectedFields([ + 'fieldName' => 'article_type', + 'fieldValues' => 'grouping', + 'isEqual' => false, + 'renderForBlocks' => false, + ]) @component('twill::partials.form.utils._columns') @slot('left') @formField('checkbox', [ @@ -259,19 +186,6 @@ ], ]) - @formField('input', [ - 'name' => 'author_display', - 'label' => 'Author display', - ]) - - @formField('browser', [ - 'routePrefix' => 'collection', - 'moduleName' => 'authors', - 'name' => 'authors', - 'label' => 'Authors', - 'max' => 10, - ]) - @formField('wysiwyg', [ 'name' => 'cite_as', 'label' => 'How to Cite', @@ -322,8 +236,8 @@ 'video', ]) ]) - @endformFieldset - @endformConnectedFields + @endformConnectedFields + @endformFieldset @include('admin.partials.meta') @stop From 1fab2a51ea0db295dc23f67eeb187401b9c0e05b Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 11 Sep 2024 10:56:09 -0500 Subject: [PATCH 187/346] Restructure config data [PUB-256] --- .../Admin/DigitalPublicationController.php | 2 +- config/aic.php | 42 ++++++++++--------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/app/Http/Controllers/Admin/DigitalPublicationController.php b/app/Http/Controllers/Admin/DigitalPublicationController.php index 954bba6f4e..56af88f4df 100644 --- a/app/Http/Controllers/Admin/DigitalPublicationController.php +++ b/app/Http/Controllers/Admin/DigitalPublicationController.php @@ -30,7 +30,7 @@ protected function formData($request) { $item = $this->repository->getById(request('digitalPublication') ?? request('id')); $baseUrl = '//' . config('app.url') . '/digital-publications/' . $item->id . '/'; - $heroBackgroundColors = collect(config('aic.branding.colors')) + $heroBackgroundColors = collect(config('aic.branding.digital_publications.colors')) ->mapWithKeys(fn ($hexColor) => [$hexColor => $hexColor]); return [ diff --git a/config/aic.php b/config/aic.php index 1e4edaec8b..c6de20228a 100644 --- a/config/aic.php +++ b/config/aic.php @@ -42,25 +42,27 @@ // Branding 'branding' => [ - 'colors' => [ - '#282829', - '#422E22', - '#284725', - '#1E3F49', - '#1C2454', - '#35295A', - '#711F2A', - '#983820', - '#E19E26', - '#9D9FA2', - '#A39282', - '#A1B981', - '#75B4BA', - '#77A8D5', - '#8C8FBE', - '#D58FA2', - '#EC9E6C', - '#F8EB83', - ], + 'digital_publications' => [ + 'colors' => [ + '#282829', + '#422E22', + '#284725', + '#1E3F49', + '#1C2454', + '#35295A', + '#711F2A', + '#983820', + '#E19E26', + '#9D9FA2', + '#A39282', + '#A1B981', + '#75B4BA', + '#77A8D5', + '#8C8FBE', + '#D58FA2', + '#EC9E6C', + '#F8EB83', + ], + ] ], ]; From 9b031089d98400a459d70a6cde6ba39fb844f1e8 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:47:18 -0500 Subject: [PATCH 188/346] Adjust spacing on elements of entry-articles [PUB-252] --- frontend/scss/molecules/_m-listing.scss | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/scss/molecules/_m-listing.scss b/frontend/scss/molecules/_m-listing.scss index 3174c7f79b..17890eab52 100644 --- a/frontend/scss/molecules/_m-listing.scss +++ b/frontend/scss/molecules/_m-listing.scss @@ -2266,18 +2266,22 @@ a:focus:hover .btn--magazine { @include breakpoint('small+') { width: colspan(28, small) !important; + margin-left: colspan(2, small) !important; } @include breakpoint('medium+') { width: colspan(13, medium) !important; + margin-left: colspan(2, medium) !important; } @include breakpoint('large+') { width: colspan(9, large) !important; + margin-left: colspan(2.2, large) !important; } @include breakpoint('xlarge') { width: colspan(9, xlarge) !important; + margin-left: colspan(2.2, xlarge) !important; } .m-listing__img { @@ -2285,7 +2289,7 @@ a:focus:hover .btn--magazine { } .m-listing__meta { - min-height: 118px; + min-height: 76px; } .type { @@ -2295,8 +2299,9 @@ a:focus:hover .btn--magazine { .title { @include untuck; + padding-top: 10px; line-height: 1.25em; - font-size: 22px; + font-size: 19px; } } From 0cdf2203dea9b54c987b2d9ffed35e70d6b84cdd Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:47:37 -0500 Subject: [PATCH 189/346] Adjust title bar size and spacing for digipub entries [PUB-252] --- frontend/scss/molecules/_m-title-bar.scss | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/scss/molecules/_m-title-bar.scss b/frontend/scss/molecules/_m-title-bar.scss index 9007f8667a..8bd2daa933 100644 --- a/frontend/scss/molecules/_m-title-bar.scss +++ b/frontend/scss/molecules/_m-title-bar.scss @@ -99,6 +99,21 @@ display: none !important; } } + + &.m-digipub-grouping-title-bar { + .title { + font-size: 26px; + letter-spacing: 3px !important; + } + } + + &.m-digipub-subgrouping-title-bar { + margin-top: 20px; + + .title { + font-size: 24px; + } + } } .m-title-bar::before { From 433f25d8357824ea0fb79df012634cbc6a77e8a4 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:24:28 -0500 Subject: [PATCH 190/346] Remove welcome link note and carat [PUB-250] --- .../organisms/_o-editors-note----publication.blade.php | 3 +-- resources/views/site/digitalPublicationDetail.blade.php | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/resources/views/components/organisms/_o-editors-note----publication.blade.php b/resources/views/components/organisms/_o-editors-note----publication.blade.php index d1a9aa02af..cc523ff118 100644 --- a/resources/views/components/organisms/_o-editors-note----publication.blade.php +++ b/resources/views/components/organisms/_o-editors-note----publication.blade.php @@ -1,11 +1,10 @@
@component('components.atoms._link') @slot('font', '') - @slot('href', $articleLink)
- {!! $description !!} + {!! $description !!}
@endcomponent diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index 2ddc5de16f..d9a850e9e7 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -34,7 +34,6 @@
@component('components.organisms._o-editors-note----publication') @slot('description', $item->welcome_note_display) - @slot('articleLink', $welcomeNote->present()->getArticleUrl($item)) @endcomponent
@endif From 8be3ae3827101cdefe96670c6d46851eae713b2e Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:32:15 -0500 Subject: [PATCH 191/346] Fix small image block display [PUB-259] --- frontend/scss/pages/_p-issuearticle-show.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 0f622b0d5d..0b73a06997 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -270,7 +270,8 @@ } .m-media--s.o-blocks__block .m-media__img { - max-width: 450px; + max-height: 450px; + max-width: 100%; } .m-media.o-blocks__block .m-media__img img { From b243f841f42aa167b2344ff6e5fbcbe6e79488c0 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:47:51 -0500 Subject: [PATCH 192/346] Update class references for digipub title bars [PUB-252] --- resources/views/site/digitalPublicationDetail.blade.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index d9a850e9e7..34674023e8 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -253,13 +253,13 @@ {{-- Title Component --}} @if (!$topLevelArticle->hide_title) @component('components.molecules._m-title-bar', [ - 'variation' => 'm-title-bar--compact m-title-bar--light', + 'variation' => 'm-title-bar--compact m-title-bar--light m-digipub-grouping-title-bar', ]) @slot('links', $topLevelArticle->present()->getBrowseMoreLink($showAll)) {!! $topLevelArticle->title !!} @endcomponent @endif -
+
{{-- Listing Component --}} @if (!$topLevelArticle->suppress_listing) @@ -272,8 +272,8 @@ @if ($item->children && $item->children->count() > 0) @component('components.molecules._m-title-bar', [ - 'variation' => 'm-title-bar--no-hr', - 'titleFont' => 'f-list-3', + 'variation' => 'm-title-bar--no-hr m-digipub-subgrouping-title-bar', + 'titleFont' => 'f-list-2', ]) {!! $item->title !!} @endcomponent From 798107c33199d070a4730d06bd8f524b09aa1743 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:51:45 -0500 Subject: [PATCH 193/346] Add margin only if welcome note is present [PUB-251] --- frontend/scss/pages/_p-issue-show.scss | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/scss/pages/_p-issue-show.scss b/frontend/scss/pages/_p-issue-show.scss index f1d102fa34..02b007c869 100644 --- a/frontend/scss/pages/_p-issue-show.scss +++ b/frontend/scss/pages/_p-issue-show.scss @@ -71,9 +71,15 @@ } } -.p-digitalpublications-show, .p-digitalpublications-showlisting { .o-article__body { + margin-top: 40px !important; + } +} + +.p-digitalpublications-show, +.p-digitalpublications-showlisting { + .o-article__body:has(.o-issue__intro) { margin-top: 40px; } From 98f8cb234c85b6a7535569e8990f6d98b681cddb Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:08:42 -0500 Subject: [PATCH 194/346] Adjust margin sizes for entries [PUB-252] --- frontend/scss/molecules/_m-listing.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/scss/molecules/_m-listing.scss b/frontend/scss/molecules/_m-listing.scss index 17890eab52..d67ac2ed24 100644 --- a/frontend/scss/molecules/_m-listing.scss +++ b/frontend/scss/molecules/_m-listing.scss @@ -2275,13 +2275,13 @@ a:focus:hover .btn--magazine { } @include breakpoint('large+') { - width: colspan(9, large) !important; - margin-left: colspan(2.2, large) !important; + width: colspan(9.2, large) !important; + margin-left: colspan(2.04, large) !important; } @include breakpoint('xlarge') { - width: colspan(9, xlarge) !important; - margin-left: colspan(2.2, xlarge) !important; + width: colspan(9.2, xlarge) !important; + margin-left: colspan(2.04, xlarge) !important; } .m-listing__img { From b83b3ccb474a13d1aae52ce8f1b96dd5c323a84c Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:01:58 -0500 Subject: [PATCH 195/346] Fix contribution banner width on large screens [PUB-251] --- frontend/scss/pages/_p-issuearticle-show.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index d95614872c..0f622b0d5d 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -124,9 +124,9 @@ margin-left: calc(-600px + 50%); @each $name in ('large', 'xlarge') { @include breakpoint('#{$name}') { - width: calc(#{colspan(14, '#{$name}')} * 2 + (#{colspan(1, '#{$name}')} * 2) + 18vw); + width: calc(#{colspan(14, '#{$name}')} * 2 + (#{colspan(1, '#{$name}')} * 2) + 30vw); padding-right: calc(#{colspan(1, '#{$name}')} * 2); - margin-left: calc((#{colspan(14, '#{$name}')} * -1) + (#{colspan(1, '#{$name}')} * -1) - 18vw); + margin-left: calc((#{colspan(14, '#{$name}')} * -1) + (#{colspan(1, '#{$name}')} * -1) - 30vw); margin-right: colspan(2, #{$name}); } } From 77dd4bd6d6165231e896b222c4b4092ec4e22a2d Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:01:36 -0500 Subject: [PATCH 196/346] Fix header image and banner length [PUB-251] --- .../scss/molecules/_m-article-header.scss | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index b23185ddbd..a0910f6ce5 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1124,8 +1124,13 @@ } @include breakpoint('small') { + .m-article-header__img { height: 300px; + + img { + z-index: map-get($zindexs, 'header'); + } } } @@ -1186,9 +1191,9 @@ z-index: 1; } .m-article-header__text::before { - left: -36vw; - margin-left: 0; - max-width: colspan(50, 'xlarge'); + left: 0; + margin-left: -100vw; + max-width: 100vw; } } @@ -1245,6 +1250,18 @@ } } +.s-sticky-digital-publication-header:not(.s-allow-top-link) { + .m-sidebar-toggle { + position: relative !important; + } +} + +.s-sticky-digital-publication-header.s-allow-top-link { + .m-sidebar-toggle { + position: fixed !important; + } +} + .s-sticky-digital-publication-header, .p-digitalpublications-showlisting { .m-article-header--digital-publication { .m-article-header__text { @@ -1291,7 +1308,6 @@ @include breakpoint('medium-') { .m-sidebar-toggle { - position: fixed; top: 0; width: 100vw; z-index: map-get($zindexs, 'header'); @@ -1317,7 +1333,7 @@ .m-article-header__text::before { left: -40vw; margin-left: 0; - max-width: 110vw; + max-width: 150vw; } .m-article-header__text .title { @@ -1387,10 +1403,9 @@ z-index: -1; height: 150px; width: 200vw; - margin-left: calc(-600px + 50%); + margin-left: -100vw; @each $name in ('large', 'xlarge') { @include breakpoint('#{$name}') { - margin-left: calc((#{colspan(14, '#{$name}')} * -1) + (#{colspan(1, '#{$name}')} * -1)); z-index: 3; } } From a19a272694617b7438ca0a5a87b92517b31a043f Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:55:34 -0500 Subject: [PATCH 197/346] Fix line-height on listing header [PUB-251] --- frontend/scss/molecules/_m-article-header.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index a0910f6ce5..5e634d4232 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1269,6 +1269,7 @@ .title { font-size: 26px !important; + line-height: 24px !important; } } } From d0848653fc2df8e28d10da2fa6f3fa5db8f807bb Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 10 Sep 2024 13:23:46 -0500 Subject: [PATCH 198/346] Stretch title background color of header on xlarge screens [PUB-253] --- .../scss/molecules/_m-article-header.scss | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 5e634d4232..ab6f19edcf 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1294,19 +1294,26 @@ } } -.s-sticky-digital-publication-header.is-sidebar-top.s-scroll-direction-up { - .m-article-header--digital-publication { - position: absolute !important; - } -} +.s-sticky-digital-publication-header { + &.is-sidebar-fixed, &.is-sidebar-bottom { + @include breakpoint('medium+') { + .m-article-header__img img { + opacity: 0; + transition: opacity 1s; + } -.s-sticky-digital-publication-header, .p-digitalpublications-showlisting { - .m-article-header--digital-publication { - .m-article-header__text { - justify-content: center; + .m-article-header__text .title { + opacity: 0; + transition: opacity 1s; + } + + .m-article-header__text .subtitle { + opacity: 0; + transition: opacity 1s; + } } - } + } @include breakpoint('medium-') { .m-sidebar-toggle { top: 0; From f65ed0d39888fbc0a39b0abea7fce5a9f28a8bf0 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 11 Sep 2024 11:12:49 -0500 Subject: [PATCH 199/346] Center vertical align publication title card [PUB-253] --- frontend/scss/organisms/_o-article__primary-actions.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index da35f03d34..7be0d48bd4 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -272,7 +272,8 @@ white-space: nowrap; color: $color__white; transition: display 1s, background-color 1s; - + display: flex; + align-items: center; &::before { content: ""; From 6553e0d84d7082abbd4e8056e00c26855f4c9090 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 11 Sep 2024 13:19:43 -0500 Subject: [PATCH 200/346] Correct margin below title card on non-contribution pages [PUB-253] --- frontend/scss/organisms/_o-article__primary-actions.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index 7be0d48bd4..df8c0ea2f5 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -268,13 +268,17 @@ .m-article-actions--publication__logo { height: 110px; - margin-bottom: 40px; + margin-bottom: 0px; white-space: nowrap; color: $color__white; transition: display 1s, background-color 1s; display: flex; align-items: center; + .p-digitalpublicationarticle-show.p-t-contributions & { + margin-bottom: 40px; + } + &::before { content: ""; position: absolute; From fde873744e68be60a62ee31099ef38d06171d33b Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 11 Sep 2024 13:21:42 -0500 Subject: [PATCH 201/346] Vertically align title card in sticky sidebar [PUB-253] --- .../_o-article__primary-actions.scss | 5 +++ frontend/scss/state/_s-sticky-sidebar.scss | 40 +++++++++---------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index df8c0ea2f5..395ff5021d 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -275,6 +275,11 @@ display: flex; align-items: center; + .is-sidebar-fixed & { + display: block; + align-items: normal; + } + .p-digitalpublicationarticle-show.p-t-contributions & { margin-bottom: 40px; } diff --git a/frontend/scss/state/_s-sticky-sidebar.scss b/frontend/scss/state/_s-sticky-sidebar.scss index a54ac81402..65b9859b63 100644 --- a/frontend/scss/state/_s-sticky-sidebar.scss +++ b/frontend/scss/state/_s-sticky-sidebar.scss @@ -101,36 +101,36 @@ For _p-issuearticle-show.scss and _p-issue-show.scss &.is-sidebar-grabbed, &.is-sidebar-fixed, &.is-sidebar-bottom { - .o-sticky-sidebar__sticker { - - &[data-sticky-animated-logo] { + .o-article__primary-actions { + .o-sticky-sidebar__sticker { .m-article-actions--publication__logo { display: block; + align-items: normal; + } + + @each $name in ('large', 'xlarge') { + @include breakpoint('#{$name}') { + width: #{colspan(14, '#{$name}')}; + padding-right: #{colspan(1, '#{$name}')}; + } } - } - @each $name in ('large', 'xlarge') { - @include breakpoint('#{$name}') { - width: #{colspan(14, '#{$name}')}; - padding-right: #{colspan(1, '#{$name}')}; + .m-article-actions--publication__logo, + .m-article-actions--publication__logo::before { + background-color: transparent; + transition: background-color 1s; + } + + .m-article-actions--publication__logo a { + color: $color__text--title; + transition: color 1s; } } - .m-article-actions--publication__logo, - .m-article-actions--publication__logo::before { + .m-article-header--digital-publication-article ~ .m-article-header__text::before { background-color: transparent; transition: background-color 1s; } - - .m-article-actions--publication__logo a { - color: $color__text--title; - transition: color 1s; - } - } - - .m-article-header--digital-publication-article ~ .m-article-header__text::before { - background-color: transparent; - transition: background-color 1s; } } From 2b724a9800d27892db21acc993599026fd0e2871 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 11 Sep 2024 17:00:46 -0500 Subject: [PATCH 202/346] Rip out all fades [PUB-253] --- frontend/scss/molecules/_m-article-header.scss | 11 ----------- .../scss/organisms/_o-article__primary-actions.scss | 6 ------ frontend/scss/state/_s-sticky-sidebar.scss | 4 ---- ...le-header----digital-publication-article.blade.php | 1 - .../site/digitalPublicationArticleDetail.blade.php | 1 - 5 files changed, 23 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index ab6f19edcf..9302279114 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1229,17 +1229,14 @@ @include breakpoint('medium+') { .m-article-header__img img { opacity: 0; - transition: opacity 1s; } .m-article-header__text .title { opacity: 0; - transition: opacity 1s; } .m-article-header__text .subtitle { opacity: 0; - transition: opacity 1s; } } } @@ -1279,17 +1276,14 @@ @include breakpoint('medium+') { .m-article-header__img img { opacity: 1; - transition: opacity 1s; } .m-article-header__text .title { opacity: 1; - transition: opacity 1s; } .m-article-header__text .subtitle { opacity: 1; - transition: opacity 1s; } } } @@ -1299,17 +1293,14 @@ @include breakpoint('medium+') { .m-article-header__img img { opacity: 0; - transition: opacity 1s; } .m-article-header__text .title { opacity: 0; - transition: opacity 1s; } .m-article-header__text .subtitle { opacity: 0; - transition: opacity 1s; } } @@ -1348,7 +1339,6 @@ margin-bottom: auto; margin-top: auto; opacity: 1; - transition: opacity 1s; font-size: 26px; line-height: 24px; } @@ -1363,7 +1353,6 @@ img { object-position: bottom; - transition: opacity 1s; } } } diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index 395ff5021d..6c8e8a3e2c 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -271,7 +271,6 @@ margin-bottom: 0px; white-space: nowrap; color: $color__white; - transition: display 1s, background-color 1s; display: flex; align-items: center; @@ -307,7 +306,6 @@ a { color: $color__link--publications; - transition: color 1s; } a:hover, @@ -342,10 +340,6 @@ } } - .m-article-header__text { - transition: background-color 1s, display 1s; - } - .m-article-header__text::before { content: ""; position: absolute; diff --git a/frontend/scss/state/_s-sticky-sidebar.scss b/frontend/scss/state/_s-sticky-sidebar.scss index 65b9859b63..644ea6345f 100644 --- a/frontend/scss/state/_s-sticky-sidebar.scss +++ b/frontend/scss/state/_s-sticky-sidebar.scss @@ -15,7 +15,6 @@ For _p-issuearticle-show.scss and _p-issue-show.scss &.is-sidebar-overlay { .m-article-actions--publication__logo a { color: $color__text--title !important; - transition: color 1s; } @include breakpoint('medium-') { @@ -118,18 +117,15 @@ For _p-issuearticle-show.scss and _p-issue-show.scss .m-article-actions--publication__logo, .m-article-actions--publication__logo::before { background-color: transparent; - transition: background-color 1s; } .m-article-actions--publication__logo a { color: $color__text--title; - transition: color 1s; } } .m-article-header--digital-publication-article ~ .m-article-header__text::before { background-color: transparent; - transition: background-color 1s; } } } diff --git a/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php b/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php index 941156da81..7204f23879 100644 --- a/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php +++ b/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php @@ -3,7 +3,6 @@ .m-article-header--digital-publication-article ~ .m-article-header__text::before, .m-article-actions--publication__logo { background-color: {{ $bgcolor }}; - transition: background-color 1s; } @endif diff --git a/resources/views/site/digitalPublicationArticleDetail.blade.php b/resources/views/site/digitalPublicationArticleDetail.blade.php index 60b8b8615e..fe19957849 100644 --- a/resources/views/site/digitalPublicationArticleDetail.blade.php +++ b/resources/views/site/digitalPublicationArticleDetail.blade.php @@ -11,7 +11,6 @@ .m-article-header--digital-publication-article ~ .m-article-header__text::before, .m-article-actions--publication__logo.u-show\@medium-::before { background-color: {{ $bgcolor }}; - transition: background-color 1s; } @endif From b629bad10279c7fc10206056770c9c84fafdaaf4 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Thu, 12 Sep 2024 09:59:10 -0500 Subject: [PATCH 203/346] Let contribution header scroll off screen before jumping to sticky sidebar [PUB-253] --- frontend/js/behaviors/core/stickySidebar.js | 20 +++++++++++++++++-- .../_o-article__primary-actions.scss | 1 - frontend/scss/pages/_p-issuearticle-show.scss | 3 +-- frontend/scss/state/_s-sticky-sidebar.scss | 3 ++- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index 0425347bc0..ce6c1cb3ba 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -49,6 +49,7 @@ const stickySidebar = function(container){ let navContainer; let stickyHeaderContainer; + let contributionHeaderHeight; const sidebarOverlayState = 'is-sidebar-overlay'; let overlayActive = document.documentElement.classList.contains(sidebarOverlayState); @@ -67,11 +68,12 @@ const stickySidebar = function(container){ navContainer = document.querySelector('.g-header'); stickyHeaderContainer = document.querySelector('.m-article-header'); - if (scrollTop < containerTop - (document.documentElement.classList.contains('s-sticky-digital-publication-header') ? stickyHeaderContainer.offsetHeight : 0)) { + // `containerToo` is caluclated in the `handleResize` method + if (scrollTop < containerTop) { top(); container.style.marginTop = '0px'; } else { - if (scrollTop + containerHeight > article.offsetHeight) { + if (scrollTop + containerHeight > article.offsetHeight + (document.documentElement.classList.contains('s-unsticky-header') ? navContainer.clientHeight : 0)) { bottom(); } else { sticky(); @@ -106,7 +108,21 @@ const stickySidebar = function(container){ function handleResize() { top(); windowHeight = window.innerHeight || document.documentElement.clientHeight; + stickyHeaderContainer = document.querySelector('.m-article-header'); + + contributionHeaderHeight = 0; + let logoList = document.querySelectorAll('.m-article-actions--publication__logo'); + for (let i = 0; i < logoList.length; i++) { + contributionHeaderHeight += logoList[i].clientHeight; + } + containerTop = getOffsetTop(container) + document.body.scrollTop; + if (document.documentElement.classList.contains('s-sticky-digital-publication-header')) { + containerTop -= stickyHeaderContainer.offsetHeight; + } + if (document.documentElement.classList.contains('p-digitalpublicationarticle-show') && document.documentElement.classList.contains('p-t-contributions')) { + containerTop += contributionHeaderHeight; + } logo.setAttribute('style', 'display: block'); logo.removeAttribute('style'); diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index 6c8e8a3e2c..4aadc3e262 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -262,7 +262,6 @@ z-index: 4; .o-sticky-sidebar__sticker { - padding-top: 40px; padding-bottom: 60px; } diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 0b73a06997..85a60eff29 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -102,8 +102,7 @@ } .m-article-actions--publication__logo { - height: 110px; - padding-bottom: 40px; + height: 150px; color: $color__white; @include breakpoint('medium-') { padding-top: 40px; diff --git a/frontend/scss/state/_s-sticky-sidebar.scss b/frontend/scss/state/_s-sticky-sidebar.scss index 644ea6345f..d4c66915b7 100644 --- a/frontend/scss/state/_s-sticky-sidebar.scss +++ b/frontend/scss/state/_s-sticky-sidebar.scss @@ -105,6 +105,8 @@ For _p-issuearticle-show.scss and _p-issue-show.scss .m-article-actions--publication__logo { display: block; align-items: normal; + height: auto; + margin-top: 40px; } @each $name in ('large', 'xlarge') { @@ -139,7 +141,6 @@ For _p-issuearticle-show.scss and _p-issue-show.scss } } - height: 100vh; overflow-y: auto; } } From d35063d35c35b9e91baa567848498045989ba66c Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Thu, 12 Sep 2024 10:04:12 -0500 Subject: [PATCH 204/346] Align contribution text on smaller screens [PUB-253] --- frontend/scss/pages/_p-issuearticle-show.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 85a60eff29..d32064c0b6 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -105,7 +105,6 @@ height: 150px; color: $color__white; @include breakpoint('medium-') { - padding-top: 40px; width: 100%; display: flex; align-items: center; From 2bb8b3f08888d262361f9b2ad33d58408fb7c9a4 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Thu, 12 Sep 2024 10:16:30 -0500 Subject: [PATCH 205/346] Adjust margin of pub logo on non-contribution pages [PUB-253] --- .../scss/organisms/_o-article__primary-actions.scss | 3 +-- frontend/scss/pages/_p-issuearticle-show.scss | 10 +++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index 4aadc3e262..8bf79e2f8e 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -266,8 +266,7 @@ } .m-article-actions--publication__logo { - height: 110px; - margin-bottom: 0px; + margin-bottom: 40px; white-space: nowrap; color: $color__white; display: flex; diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index d32064c0b6..ab8b575b88 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -102,7 +102,7 @@ } .m-article-actions--publication__logo { - height: 150px; + margin-top: 15px; color: $color__white; @include breakpoint('medium-') { width: 100%; @@ -410,3 +410,11 @@ Styling related specifically to digital publications } } + +.p-digitalpublicationarticle-show.p-t-contributions { + .m-article-actions--publication__logo { + height: 150px; + margin-bottom: 0; + margin-top: 0; + } +} From 80244bacd585d1407495ff28b8b8fed9dbf5934e Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 12 Sep 2024 12:04:44 -0500 Subject: [PATCH 206/346] Remove condition of welcomeNote item [PUB-250] --- resources/views/site/digitalPublicationDetail.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/site/digitalPublicationDetail.blade.php b/resources/views/site/digitalPublicationDetail.blade.php index 34674023e8..fe1f18ffd2 100644 --- a/resources/views/site/digitalPublicationDetail.blade.php +++ b/resources/views/site/digitalPublicationDetail.blade.php @@ -30,7 +30,7 @@
- @if ($item->welcome_note_display && $welcomeNote && $showAll == false) + @if ($item->welcome_note_display && $showAll == false)
@component('components.organisms._o-editors-note----publication') @slot('description', $item->welcome_note_display) From 0868f273b38222d60ebcfb38fff569379d690646 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Thu, 12 Sep 2024 10:28:17 -0500 Subject: [PATCH 207/346] Add article title to controbution page on mobile [PUB-253] --- ...header----digital-publication-article.blade.php | 2 +- .../site/digitalPublicationArticleDetail.blade.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php b/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php index 7204f23879..4fe1951783 100644 --- a/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php +++ b/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php @@ -29,6 +29,6 @@ @endif
diff --git a/resources/views/site/digitalPublicationArticleDetail.blade.php b/resources/views/site/digitalPublicationArticleDetail.blade.php index fe19957849..38799be1ef 100644 --- a/resources/views/site/digitalPublicationArticleDetail.blade.php +++ b/resources/views/site/digitalPublicationArticleDetail.blade.php @@ -20,6 +20,8 @@ @component('components.molecules._m-article-header----digital-publication-article') @slot('title', $item->present()->title) @slot('title_display', $item->present()->title_display) + @slot('pub_title', $item->digitalPublication->present()->title) + @slot('pub_title_display', $item->digitalPublication->present()->title_display) @slot('img', $item->imageFront('hero')) @slot('imgMobile', $item->imageFront('mobile_hero')) @endcomponent @@ -73,6 +75,18 @@ @endif
+ @if ($item->article_type !== DigitalPublicationArticleType::Entry) +
+ @component('components.atoms._title') + @slot('tag', 'h1') + @slot('font', 'f-headline-editorial') + @slot('itemprop', 'name') + @slot('title', $item->present()->title) + @slot('title_display', $item->present()->title_display ?? null) + @endcomponent +
+ @endif + @if ($item->showAuthorsWithLinks() && $item->article_type == DigitalPublicationArticleType::Contributions) @component('components.blocks._text') @slot('font', 'f-tag-2') From 9403bb7b6aa32dbdd797c70981341bf2cee1b59b Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 12 Sep 2024 12:05:13 -0500 Subject: [PATCH 208/346] Don't add hover effect if it is a digipub welcome note [PUB-250] --- frontend/scss/organisms/_o-editors-note.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/scss/organisms/_o-editors-note.scss b/frontend/scss/organisms/_o-editors-note.scss index 5b36e9b4a5..6f95e34c28 100644 --- a/frontend/scss/organisms/_o-editors-note.scss +++ b/frontend/scss/organisms/_o-editors-note.scss @@ -17,7 +17,9 @@ a:focus .f-deck, a:hover .f-body-editorial, a:focus .f-body-editorial { - color: $color__black--61; + &:not(.o-editors-note__title-lockup) { + color: $color__black--61; + } } a .icon--arrow { From 56f6434c7dda16ecc2a55c53e64169b9c8b1db2e Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:10:42 -0500 Subject: [PATCH 209/346] Fix small image block in digipub [PUB-259] Fix small image blocks in digipubs [PUB-259] --- frontend/scss/pages/_p-issuearticle-show.scss | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index ab8b575b88..478e53c7bf 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -268,10 +268,20 @@ } .m-media--s.o-blocks__block .m-media__img { - max-height: 450px; + width: 100%; max-width: 100%; + overflow: hidden; + text-align: left; + + img { + max-height: 450px !important; + width: auto; + object-fit: contain; + display: block; + } } + .m-media.o-blocks__block .m-media__img img { margin-left: 0; max-height: 100%; From bb48276c479d489eea25cc6a6dfa49580d699466 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 12 Sep 2024 16:42:11 -0500 Subject: [PATCH 210/346] Install text-contrast package from npm [PUB-256] --- package-lock.json | 5 +++++ package.json | 1 + 2 files changed, 6 insertions(+) diff --git a/package-lock.json b/package-lock.json index d998edcc75..31e5ee061a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11962,6 +11962,11 @@ } } }, + "text-contrast": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/text-contrast/-/text-contrast-1.0.2.tgz", + "integrity": "sha512-tTWdDxZavzt7sPaKG7bR4RfXmyaWJodNhg1vzQVxzpXfmGSa4DIG9zYJ1PYuUObyae7ErSrPiUA8hRlwafmbow==" + }, "text-hex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", diff --git a/package.json b/package.json index d2b70c3060..bbb317110b 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "read-pkg-up": "^3.0.0", "readline-sync": "^1.4.10", "sass": "^1.42.1", + "text-contrast": "^1.0.2", "video.js": "^7.14.3", "videojs-event-tracking": "^1.0.2", "webpack": "^4.39.3", From 708f21572775e5f2df1a9457c998f5b20dacd43f Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:46:56 -0500 Subject: [PATCH 211/346] Render background placeholder behind image when in context of digipub [PUB-259] --- frontend/scss/pages/_p-issuearticle-show.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 478e53c7bf..74f0a88d48 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -272,12 +272,17 @@ max-width: 100%; overflow: hidden; text-align: left; + background-image: unset !important; img { max-height: 450px !important; width: auto; object-fit: contain; display: block; + background-color: #f3f3f3; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='56' viewBox='0 0 80 56'%3E%3Cpath fill='%23ccc' d='M4 52l28-28 28 28H4z'/%3E%3Cpath fill='%23ccc' d='M44 52l16-16 16 16H44z'/%3E%3Ccircle cx='58' cy='18' r='6' fill='%23ccc'/%3E%3Cpath fill='%23ccc' d='M79 1v54H1V1h78m1-1H0v56h80V0z'/%3E%3C/svg%3E"); + background-repeat: no-repeat; + background-position: 50% 50%; } } From f57bf1ad00b5818c544ff9db4f4efc94423becfc Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 12 Sep 2024 11:54:32 -0500 Subject: [PATCH 212/346] Show image on all breakpoints [PUB-248] --- frontend/scss/molecules/_m-article-header.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 9302279114..d46b3fe9fb 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1123,7 +1123,7 @@ text-align: left; } - @include breakpoint('small') { + @include breakpoint('small-') { .m-article-header__img { height: 300px; From 07e38f6c8f9847423bf8f40e4a6eb85c741abcd6 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 12 Sep 2024 16:42:59 -0500 Subject: [PATCH 213/346] Create contrastText behavior [PUB-256] --- frontend/js/behaviors/core/contrastText.js | 14 ++++++++++++++ frontend/js/behaviors/core/index.js | 1 + 2 files changed, 15 insertions(+) create mode 100644 frontend/js/behaviors/core/contrastText.js diff --git a/frontend/js/behaviors/core/contrastText.js b/frontend/js/behaviors/core/contrastText.js new file mode 100644 index 0000000000..6f1afaa581 --- /dev/null +++ b/frontend/js/behaviors/core/contrastText.js @@ -0,0 +1,14 @@ +import { textContrast } from "text-contrast" + +const contrastText = function(container) { + function _init() { + let lightOrDark = textContrast.isLightOrDark(container.dataset.backgroundColor); + container.classList.add(`s-${lightOrDark}-background`); + } + + this.init = function() { + _init(); + } +} + +export default contrastText; diff --git a/frontend/js/behaviors/core/index.js b/frontend/js/behaviors/core/index.js index 3a9016c2ed..7e9237c628 100644 --- a/frontend/js/behaviors/core/index.js +++ b/frontend/js/behaviors/core/index.js @@ -65,3 +65,4 @@ export { default as editorialHeader } from './editorialHeader'; export { default as loadRelatedSidebar } from './loadRelatedSidebar'; export { default as rangedAccordion } from './rangedAccordion'; export { default as stickyDigitalPublicationHeader } from './stickyDigitalPublicationHeader'; +export { default as contrastText } from './contrastText'; From a56fb07e9643da280b4bdfc5d9c69270410bbebe Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:58:44 -0500 Subject: [PATCH 214/346] Exclude layered image viewer from having a placeholder set [PUB-259] --- frontend/scss/pages/_p-issuearticle-show.scss | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 74f0a88d48..1422fe7d5e 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -267,6 +267,15 @@ margin-bottom: 50px; } + .m-media--s.o-blocks__block:not(.o-layered-image-viewer) { + .m-media__img img { + background-color: #f3f3f3; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='56' viewBox='0 0 80 56'%3E%3Cpath fill='%23ccc' d='M4 52l28-28 28 28H4z'/%3E%3Cpath fill='%23ccc' d='M44 52l16-16 16 16H44z'/%3E%3Ccircle cx='58' cy='18' r='6' fill='%23ccc'/%3E%3Cpath fill='%23ccc' d='M79 1v54H1V1h78m1-1H0v56h80V0z'/%3E%3C/svg%3E"); + background-repeat: no-repeat; + background-position: 50% 50%; + } + } + .m-media--s.o-blocks__block .m-media__img { width: 100%; max-width: 100%; @@ -279,10 +288,6 @@ width: auto; object-fit: contain; display: block; - background-color: #f3f3f3; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='56' viewBox='0 0 80 56'%3E%3Cpath fill='%23ccc' d='M4 52l28-28 28 28H4z'/%3E%3Cpath fill='%23ccc' d='M44 52l16-16 16 16H44z'/%3E%3Ccircle cx='58' cy='18' r='6' fill='%23ccc'/%3E%3Cpath fill='%23ccc' d='M79 1v54H1V1h78m1-1H0v56h80V0z'/%3E%3C/svg%3E"); - background-repeat: no-repeat; - background-position: 50% 50%; } } From d689fc517918398e253c83309443931a12cde0c9 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Thu, 12 Sep 2024 12:58:33 -0500 Subject: [PATCH 215/346] Let publication title text wrap [PUB-253] --- frontend/scss/organisms/_o-article__primary-actions.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index 8bf79e2f8e..73dfdd95cf 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -267,7 +267,6 @@ .m-article-actions--publication__logo { margin-bottom: 40px; - white-space: nowrap; color: $color__white; display: flex; align-items: center; From 873580ab77582544ed8ed060718540df04ebd237 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 12 Sep 2024 16:43:47 -0500 Subject: [PATCH 216/346] Create style for .contrast-text [PUB-256] --- frontend/scss/_importsCore.scss | 1 + frontend/scss/state/_s-contrast-text.scss | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 frontend/scss/state/_s-contrast-text.scss diff --git a/frontend/scss/_importsCore.scss b/frontend/scss/_importsCore.scss index 83cd8b82d5..4b22cc1fea 100755 --- a/frontend/scss/_importsCore.scss +++ b/frontend/scss/_importsCore.scss @@ -194,3 +194,4 @@ @import 'state/s-closer-look-scroll-blocked'; @import 'state/s-closer-look-footer-stuck'; @import 'state/s-layered-image-viewer-active'; +@import 'state/s-contrast-text'; diff --git a/frontend/scss/state/_s-contrast-text.scss b/frontend/scss/state/_s-contrast-text.scss new file mode 100644 index 0000000000..3569592509 --- /dev/null +++ b/frontend/scss/state/_s-contrast-text.scss @@ -0,0 +1,11 @@ +.contrast-text { + .s-light-background ~ * &, + .s-light-background & { + color: $color__black !important; + } + + .s-dark-background ~ * &, + .s-dark-background & { + color: $color__white !important; + } +} From 564c7f2a70fabe4c901372fe38648d239669a42e Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Thu, 12 Sep 2024 16:11:11 -0500 Subject: [PATCH 217/346] Remove background placeholder image from layered image viewer [PUB-259] --- frontend/scss/pages/_p-issuearticle-show.scss | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 1422fe7d5e..69da73cdea 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -267,12 +267,12 @@ margin-bottom: 50px; } - .m-media--s.o-blocks__block:not(.o-layered-image-viewer) { - .m-media__img img { - background-color: #f3f3f3; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='56' viewBox='0 0 80 56'%3E%3Cpath fill='%23ccc' d='M4 52l28-28 28 28H4z'/%3E%3Cpath fill='%23ccc' d='M44 52l16-16 16 16H44z'/%3E%3Ccircle cx='58' cy='18' r='6' fill='%23ccc'/%3E%3Cpath fill='%23ccc' d='M79 1v54H1V1h78m1-1H0v56h80V0z'/%3E%3C/svg%3E"); - background-repeat: no-repeat; - background-position: 50% 50%; + .o-layered-image-viewer { + .m-media.o-blocks__block { + .m-media__img img { + background-color: transparent; + background-image: none; + } } } @@ -282,7 +282,7 @@ overflow: hidden; text-align: left; background-image: unset !important; - + img { max-height: 450px !important; width: auto; From c5eefd671ee279a13185705bc92a9abf18473351 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 12 Sep 2024 16:44:58 -0500 Subject: [PATCH 218/346] Add contrastText behavior to templates [PUB-256] --- .../_m-article-actions----digital-publication.blade.php | 2 +- ...-article-header----digital-publication-article.blade.php | 6 +++++- .../molecules/_m-article-header----feature.blade.php | 6 ++++-- .../views/site/digitalPublicationArticleDetail.blade.php | 2 ++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php b/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php index cd43e3a7a2..ecd8bd47cb 100644 --- a/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php +++ b/resources/views/components/molecules/_m-article-actions----digital-publication.blade.php @@ -5,7 +5,7 @@ diff --git a/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php b/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php index 4fe1951783..d09ea1eacd 100644 --- a/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php +++ b/resources/views/components/molecules/_m-article-header----digital-publication-article.blade.php @@ -7,7 +7,11 @@ @endif -
+
@if ($img) @component('components.atoms._img') diff --git a/resources/views/components/molecules/_m-article-header----feature.blade.php b/resources/views/components/molecules/_m-article-header----feature.blade.php index 2736ed66cf..9a8b955ef6 100644 --- a/resources/views/components/molecules/_m-article-header----feature.blade.php +++ b/resources/views/components/molecules/_m-article-header----feature.blade.php @@ -9,7 +9,8 @@ @endif <{{ $tag ?? 'header' }} class="m-article-header m-article-header--feature{{ (isset($variation)) ? ' '.$variation : '' }}" - data-behavior="blurMyBackground stickyDigitalPublicationHeader" + data-behavior="blurMyBackground stickyDigitalPublicationHeader contrastText" + data-background-color="{{ $bgcolor }}" >
@if ($img) @@ -42,12 +43,13 @@ class="m-article-header m-article-header--feature{{ (isset($variation)) ? ' '.$v @slot('itemprop','name') @slot('title', $title) @slot('title_display', $title_display ?? null) + @slot('variation', 'contrast-text') @endcomponent @if (isset($title_href)) @endif @if (isset($subtitle_display)) -

+

{!! $subtitle_display !!}

@endif diff --git a/resources/views/site/digitalPublicationArticleDetail.blade.php b/resources/views/site/digitalPublicationArticleDetail.blade.php index 38799be1ef..ab95bee26a 100644 --- a/resources/views/site/digitalPublicationArticleDetail.blade.php +++ b/resources/views/site/digitalPublicationArticleDetail.blade.php @@ -18,6 +18,7 @@
@if ($item->article_type == DigitalPublicationArticleType::Contributions) @component('components.molecules._m-article-header----digital-publication-article') + @slot('bgcolor', $bgcolor) @slot('title', $item->present()->title) @slot('title_display', $item->present()->title_display) @slot('pub_title', $item->digitalPublication->present()->title) @@ -60,6 +61,7 @@ @slot('itemprop', 'name') @slot('title', $item->present()->title) @slot('title_display', $item->present()->title_display ?? null) + @slot('variation', 'contrast-text') @endcomponent
@endif From 92e4bb82e097502116a6c1f574137408f9b0f5cc Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 12 Sep 2024 11:55:17 -0500 Subject: [PATCH 219/346] Set correct default article_type in digipub article model [PUB-226] --- app/Models/DigitalPublicationArticle.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/DigitalPublicationArticle.php b/app/Models/DigitalPublicationArticle.php index cb548d0a2e..a16a6bfd67 100644 --- a/app/Models/DigitalPublicationArticle.php +++ b/app/Models/DigitalPublicationArticle.php @@ -67,7 +67,7 @@ class DigitalPublicationArticle extends AbstractModel implements Sortable public $attributes = [ 'published' => false, - 'article_type' => 'entry', + 'article_type' => 'text', ]; public $mediasParams = [ From d85320411d532e32254a682475a9dbc45496ad73 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 12 Sep 2024 16:45:29 -0500 Subject: [PATCH 220/346] Updated existing styles [PUB-256] --- frontend/scss/molecules/_m-article-header.scss | 11 ++--------- .../scss/organisms/_o-article__primary-actions.scss | 6 +++++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index d46b3fe9fb..5c80995096 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1078,17 +1078,11 @@ white-space: normal; - >a { - color: $color__white !important; - - &:hover { - color: $color__white !important; - text-decoration: underline !important; - } + >a:hover { + text-decoration: underline !important; } .f-headline-editorial { - color: $color__white !important; @include untuck(); } } @@ -1409,7 +1403,6 @@ } .title { - color: $color__white; z-index: 4; } } diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index 73dfdd95cf..098f7c31a5 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -302,7 +302,11 @@ } a { - color: $color__link--publications; + transition: color 1s; + + .is-sidebar-fixed & { + color: $color__black !important; + } } a:hover, From 3c747a49a815b6939ace0d5a38b6097c3b3572ba Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 11 Sep 2024 11:13:56 -0500 Subject: [PATCH 221/346] Widen sidebar TOC [PUB-257] --- frontend/scss/organisms/_o-article.scss | 1 + frontend/scss/organisms/_o-article__primary-actions.scss | 4 ++-- frontend/scss/state/_s-sticky-sidebar.scss | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/scss/organisms/_o-article.scss b/frontend/scss/organisms/_o-article.scss index 397da47192..d151084a31 100644 --- a/frontend/scss/organisms/_o-article.scss +++ b/frontend/scss/organisms/_o-article.scss @@ -370,6 +370,7 @@ @include breakpoint('large+') { float: none; width: colspan(28, large); + margin-left: colspan(18, large); } @include breakpoint('xlarge') { diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index da35f03d34..1218b0d6db 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -17,7 +17,7 @@ @include breakpoint('large+') { float: left; - width: colspan(13, large); + width: colspan(16, large); margin-top: 0; margin-right: colspan(2, large); @@ -28,7 +28,7 @@ } @include breakpoint('xlarge') { - width: colspan(13, xlarge); + width: colspan(16, xlarge); margin-right: colspan(2, xlarge); } diff --git a/frontend/scss/state/_s-sticky-sidebar.scss b/frontend/scss/state/_s-sticky-sidebar.scss index a54ac81402..b966162487 100644 --- a/frontend/scss/state/_s-sticky-sidebar.scss +++ b/frontend/scss/state/_s-sticky-sidebar.scss @@ -111,7 +111,7 @@ For _p-issuearticle-show.scss and _p-issue-show.scss @each $name in ('large', 'xlarge') { @include breakpoint('#{$name}') { - width: #{colspan(14, '#{$name}')}; + width: #{colspan(17, '#{$name}')}; padding-right: #{colspan(1, '#{$name}')}; } } From b5a1bc195dfb92696a07bdc02a24d00e561810ee Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 11 Sep 2024 14:54:00 -0500 Subject: [PATCH 222/346] Undo global changes [PUB-257] --- frontend/scss/organisms/_o-article.scss | 1 - frontend/scss/organisms/_o-article__primary-actions.scss | 4 ++-- frontend/scss/state/_s-sticky-sidebar.scss | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/scss/organisms/_o-article.scss b/frontend/scss/organisms/_o-article.scss index d151084a31..397da47192 100644 --- a/frontend/scss/organisms/_o-article.scss +++ b/frontend/scss/organisms/_o-article.scss @@ -370,7 +370,6 @@ @include breakpoint('large+') { float: none; width: colspan(28, large); - margin-left: colspan(18, large); } @include breakpoint('xlarge') { diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index 1218b0d6db..da35f03d34 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -17,7 +17,7 @@ @include breakpoint('large+') { float: left; - width: colspan(16, large); + width: colspan(13, large); margin-top: 0; margin-right: colspan(2, large); @@ -28,7 +28,7 @@ } @include breakpoint('xlarge') { - width: colspan(16, xlarge); + width: colspan(13, xlarge); margin-right: colspan(2, xlarge); } diff --git a/frontend/scss/state/_s-sticky-sidebar.scss b/frontend/scss/state/_s-sticky-sidebar.scss index b966162487..a54ac81402 100644 --- a/frontend/scss/state/_s-sticky-sidebar.scss +++ b/frontend/scss/state/_s-sticky-sidebar.scss @@ -111,7 +111,7 @@ For _p-issuearticle-show.scss and _p-issue-show.scss @each $name in ('large', 'xlarge') { @include breakpoint('#{$name}') { - width: #{colspan(17, '#{$name}')}; + width: #{colspan(14, '#{$name}')}; padding-right: #{colspan(1, '#{$name}')}; } } From 3427a1478b9500f26ed93b2d602eab2e27df41e8 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 11 Sep 2024 14:55:24 -0500 Subject: [PATCH 223/346] Set article body to 75% [PUB-257] --- frontend/scss/pages/_p-issuearticle-show.scss | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 0f622b0d5d..117347ba0a 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -181,6 +181,30 @@ .o-article__body { padding-top: 0; margin-top: 60px; + + @include breakpoint('large+') { + margin-left: calc(300px + colspan(2, large)); + max-width: 900px; + width: colspan(46, large); + } + } + + .o-article__body .p--linked { + margin-right: 1em; + padding-right: 1em; + } + + .o-article__primary-actions--digital-publication { + @include breakpoint('large+') { + max-width: 300px; + width: colspan(16, large); + } + + .o-sticky-sidebar__sticker { + max-width: 300px; + padding-right: 0; + width: colspan(16, large); + } } .o-article__secondary-actions { From af4a17aeb92a0e09b99887d8e9f80c3e7ac962dc Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 11 Sep 2024 14:55:59 -0500 Subject: [PATCH 224/346] Limit article width to 1200px on large+ [PUB-257] --- frontend/scss/pages/_p-issuearticle-show.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 117347ba0a..1a4d0bb752 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -15,6 +15,16 @@ } } } + @each $name in ('large', 'xlarge') { + @include breakpoint('#{$name}') { + #a17 { + max-width: 1200px; + margin-left: auto; + margin-right: auto; + + } + } + } .o-article__body::before { position: absolute; From 991be9dfd766541eedfbfc0c317924b194897385 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 11 Sep 2024 15:03:05 -0500 Subject: [PATCH 225/346] Remove unwanted border [PUB-257] --- frontend/scss/organisms/_o-article__primary-actions.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index da35f03d34..a48a56fbad 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -361,7 +361,6 @@ margin-top: 50px; margin-bottom: 50px; padding-top: 8px; - border-top: 1px solid $color__rules--primary; } } From 34e4720ba83cbfd370677231e4875729287d93a3 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 13 Sep 2024 14:48:01 -0500 Subject: [PATCH 226/346] Bump right margin on paragraph links [PUB-257] --- frontend/scss/pages/_p-issuearticle-show.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 1a4d0bb752..26cff2dc46 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -200,7 +200,7 @@ } .o-article__body .p--linked { - margin-right: 1em; + margin-right: 1.5em; padding-right: 1em; } From 50943cf5854696bff9dcffa4c6d145bf53079f33 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Fri, 13 Sep 2024 14:31:48 -0500 Subject: [PATCH 227/346] Fix scroll behavior for RangedAccordion [PUB-195] --- frontend/js/behaviors/core/rangedAccordion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/js/behaviors/core/rangedAccordion.js b/frontend/js/behaviors/core/rangedAccordion.js index 0f6414eca3..5e27074289 100644 --- a/frontend/js/behaviors/core/rangedAccordion.js +++ b/frontend/js/behaviors/core/rangedAccordion.js @@ -72,4 +72,4 @@ const rangedAccordion = function(container) { }; } -export default rangedAccordion; \ No newline at end of file +export default rangedAccordion; From 751794c1856ddedc361cc01b6bf20319d50a1860 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Mon, 16 Sep 2024 15:52:54 -0500 Subject: [PATCH 228/346] Match h2, h3, h4 style from font treament page [PUB-254] --- frontend/scss/pages/_p-issuearticle-show.scss | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 3344b041d9..80b6d69574 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -401,10 +401,25 @@ Styling related specifically to digital publications } .o-article__body.o-blocks { - & > h2, h3, h4 { + & > h2 { + font-family: $sans-serif-font--loaded; + font-size: 21px; + font-weight: 400; + letter-spacing: .08rem; + line-height: 28px; + text-transform: uppercase; + } + & > h3 { font-family: $serif-font--loaded; - font-size: 24px; - text-transform: none; + font-size: 22px; + font-weight: 400; + line-height: 28px; + } + & > h4 { + font-family: $sans-serif-font--loaded; + font-size: 18px; + font-weight: 500; + line-height: 28px; } } From cc4a9b98d8089c53e6bb4d7d877fb7d485418a6b Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:04:30 -0500 Subject: [PATCH 229/346] Fix image block overlay on digipubs [PUB-260] --- frontend/scss/pages/_p-issuearticle-show.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 80b6d69574..8caca511fb 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -311,7 +311,7 @@ } .m-media--s.o-blocks__block .m-media__img { - width: 100%; + width: max-content; max-width: 100%; overflow: hidden; text-align: left; From 57dabd0108a33425bf8d91a7cd0b2c406f84c9e1 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:08:28 -0500 Subject: [PATCH 230/346] Explicitly set width of article titles [PUB-261] --- frontend/scss/pages/_p-issuearticle-show.scss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 8caca511fb..6f8ffe28a6 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -26,6 +26,14 @@ } } + .m-article-header__text { + width: 70% !important; + + @include breakpoint('medium-') { + width: 100% !important; + } + } + .o-article__body::before { position: absolute; background-color: $color__rules--primary; From 2b47cab55955ae3d92da067c93e7925812bfb403 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 17 Sep 2024 10:54:43 -0500 Subject: [PATCH 231/346] Rearrange listing-related fields [PUB-207] --- .../articles/form.blade.php | 65 +++++++++---------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/resources/views/admin/digitalPublications/articles/form.blade.php b/resources/views/admin/digitalPublications/articles/form.blade.php index 314e7d00d2..98c96b7136 100644 --- a/resources/views/admin/digitalPublications/articles/form.blade.php +++ b/resources/views/admin/digitalPublications/articles/form.blade.php @@ -22,33 +22,48 @@ 'default' => 'text', 'options' => $types, ]) + @formField('select', [ + 'name' => 'listing_display', + 'label' => 'Listing display', + 'placeholder' => 'Select a listing display', + 'default' => 'default', + 'options' => [ + ['value' => 'feature', 'label' => 'Feature'], + ['value' => '3-across', 'label' => '3-Across'], + ['value' => 'entries', 'label' => 'Entries'], + ['value' => 'group_entries', 'label' => 'Group of Entries'], + ['value' => 'list', 'label' => 'List view'], + ['value' => 'simple_list', 'label' => 'Text list view'], + ], + ]) + + @component('twill::partials.form.utils._columns') + @slot('left') + @formField('checkbox', [ + 'name' => 'hide_title', + 'label' => 'Hide title in listing view', + ]) + @endslot + + @slot('right') + @formField('checkbox', [ + 'name' => 'suppress_listing', + 'label' => 'Hide from listing view', + ]) + @endslot + @endcomponent @stop @section('fieldsets') @formFieldset([ - 'id' => 'article-type-fields', - 'title' => 'Article type fields', + 'id' => 'editorial-content', + 'title' => 'Editorial Content', ]) @formConnectedFields([ 'fieldName' => 'article_type', 'fieldValues' => 'grouping', 'renderForBlocks' => false, ]) - @formField('select', [ - 'name' => 'listing_display', - 'label' => 'Listing display', - 'placeholder' => 'Select a listing display', - 'default' => 'default', - 'options' => [ - ['value' => 'feature', 'label' => 'Feature'], - ['value' => '3-across', 'label' => '3-Across'], - ['value' => 'entries', 'label' => 'Entries'], - ['value' => 'group_entries', 'label' => 'Group of Entries'], - ['value' => 'list', 'label' => 'List view'], - ['value' => 'simple_list', 'label' => 'Text list view'], - ], - ]) - @formField('wysiwyg', [ 'name' => 'grouping_description', 'label' => 'Description', @@ -154,22 +169,6 @@ 'isEqual' => false, 'renderForBlocks' => false, ]) - @component('twill::partials.form.utils._columns') - @slot('left') - @formField('checkbox', [ - 'name' => 'hide_title', - 'label' => 'Hide title in listing view', - ]) - @endslot - - @slot('right') - @formField('checkbox', [ - 'name' => 'suppress_listing', - 'label' => 'Hide from listing view', - ]) - @endslot - @endcomponent - @formField('input', [ 'name' => 'label', 'label' => 'Article label', From f6c55eec4cd409bff94b8d1f9e668b898b9b0f0f Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 17 Sep 2024 12:34:12 -0500 Subject: [PATCH 232/346] Update styling for ranged_accordion [PUB-255] --- frontend/scss/organisms/_o-accordion.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/scss/organisms/_o-accordion.scss b/frontend/scss/organisms/_o-accordion.scss index 3053aa20fb..f4e0cf7453 100644 --- a/frontend/scss/organisms/_o-accordion.scss +++ b/frontend/scss/organisms/_o-accordion.scss @@ -3,7 +3,7 @@ h3 { padding: 25px 0; } - + .o-article + & { margin-top: 40px; } @@ -489,4 +489,4 @@ } } } -} \ No newline at end of file +} From 81ed3309b885f1da635d750bf9c937bd0b90db6e Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:26:25 -0500 Subject: [PATCH 233/346] Update subtype for auto-related of digiPub articles [PUB-228] --- app/Presenters/Admin/DigitalPublicationArticlePresenter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php index e5e3d7e9a3..b1da0d847a 100644 --- a/app/Presenters/Admin/DigitalPublicationArticlePresenter.php +++ b/app/Presenters/Admin/DigitalPublicationArticlePresenter.php @@ -35,7 +35,7 @@ public function type() public function subtype() { - return 'Digital Publication Article'; + return 'From The Digital Publication'; } public function pdfDownloadPath() From 3dc3792096c8b8a3f8afbf78af3d6fecfdf6f33f Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 26 Sep 2024 12:30:54 -0500 Subject: [PATCH 234/346] Set MMT version to `^1.0.0` [WEB-2905] ...in order to install the latest version (up to `2.0.0`) on compile --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 31e5ee061a..1be97eb2d7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8575,8 +8575,8 @@ } }, "my-museum-tour-builder": { - "version": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#cb9560febc9e0eadea02decb690b5a5dd2c2cb0e", - "from": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#semver:^1.15", + "version": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#561741128694d3b0a3ab98a2e1b2bf24b6077f07", + "from": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#semver:^1.0.0", "requires": { "@area17/a17-helpers": "^0.6.7", "classnames": "^2.3.2", diff --git a/package.json b/package.json index bbb317110b..3850b129ce 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "lodash": "^4.17.15", "minimist": "^1.2.0", "mirador": "^3.0.0", - "my-museum-tour-builder": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#semver:^1.15", + "my-museum-tour-builder": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#semver:^1.0.0", "prettier": "^1.7.4", "react": "^16.9.0", "react-app-polyfill": "^0.2.0", From ee01cfcace25d5b5349ccbd50510020548583dc1 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 2 Oct 2024 14:50:00 -0500 Subject: [PATCH 235/346] Replace missing bracket [PUB-265] --- frontend/scss/pages/_p-issuearticle-show.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 60cd3db875..e5ba9b7f61 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -197,7 +197,7 @@ .o-article__body { padding-top: 0; margin-top: 60px; - + } .o-article__body .p--linked { @include breakpoint('small-') { From ebef21de8c76561914ff5ab0c62d3173bbdbfa8d Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 1 Oct 2024 10:46:52 -0500 Subject: [PATCH 236/346] Remove paragraph number style [PUB-267] --- frontend/scss/pages/_p-issuearticle-show.scss | 5 ----- 1 file changed, 5 deletions(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 6f8ffe28a6..ea7573d6c7 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -205,11 +205,6 @@ } } - .o-article__body .p--linked { - margin-right: 1.5em; - padding-right: 1em; - } - .o-article__primary-actions--digital-publication { @include breakpoint('large+') { max-width: 300px; From 467a34af68f0f5d561c527de5d9496a9fe3eda35 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 2 Oct 2024 13:54:34 -0500 Subject: [PATCH 237/346] Adjust sidebar and main content widths [PUB-265] --- .../scss/molecules/_m-article-header.scss | 13 ++++--- frontend/scss/pages/_p-issue-show.scss | 19 +++++++++++ frontend/scss/pages/_p-issuearticle-show.scss | 34 +++++++++---------- 3 files changed, 45 insertions(+), 21 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 5c80995096..7f26ca7c49 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1159,7 +1159,7 @@ } .m-article-header__text { - flex: 0 0 colspan(14, 'large'); + flex: 0 0 colspan(19, 'large'); padding-right: initial; padding-left: initial; } @@ -1179,16 +1179,21 @@ } } - @include breakpoint('xlarge') { + @include breakpoint('large') { .m-article-header__text { - max-width: colspan(14, 'xlarge'); - z-index: 1; + flex: 0 0 colspan(19, 'large'); } + } + + @include breakpoint('xlarge') { .m-article-header__text::before { left: 0; margin-left: -100vw; max-width: 100vw; } + .m-article-header__text { + flex: 0 0 colspan(19, 'xlarge'); + } } .p-digitalpublications-showlisting & { diff --git a/frontend/scss/pages/_p-issue-show.scss b/frontend/scss/pages/_p-issue-show.scss index 02b007c869..bc9e407577 100644 --- a/frontend/scss/pages/_p-issue-show.scss +++ b/frontend/scss/pages/_p-issue-show.scss @@ -13,6 +13,15 @@ content: none; } + .m-article-header~.o-article__primary-actions { + @each $name in ('large', 'xlarge') { + @include breakpoint('#{$name}') { + width: colspan(18, '#{$name}'); + margin-right: colspan(2, '#{$name}'); + } + } + } + .m-article-header--digital-publication { .subtitle { font-size: 18px; @@ -56,6 +65,16 @@ } } } + + .o-article__body { + float: none; + @each $name in ('large', 'xlarge') { + @include breakpoint('#{$name}') { + margin-left: colspan(20, '#{$name}'); + width: colspan(38, '#{$name}'); + } + } + } } // Top margin is different for digital publications vs. everything else diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index e5ba9b7f61..6eff175970 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -15,20 +15,8 @@ } } } - @each $name in ('large', 'xlarge') { - @include breakpoint('#{$name}') { - #a17 { - max-width: 1200px; - margin-left: auto; - margin-right: auto; - - } - } - } .m-article-header__text { - width: 70% !important; - @include breakpoint('medium-') { width: 100% !important; } @@ -197,6 +185,18 @@ .o-article__body { padding-top: 0; margin-top: 60px; + + @include breakpoint('medium') { + width: colspan(58, 'medium'); + } + @include breakpoint('large') { + margin-left: colspan(20, 'large'); + width: colspan(38, 'large'); + } + @include breakpoint('xlarge') { + margin-left: colspan(20, 'xlarge'); + width: colspan(38, 'xlarge'); + } } .o-article__body .p--linked { @@ -227,15 +227,15 @@ } .o-article__primary-actions--digital-publication { - @include breakpoint('large+') { - max-width: 300px; - width: colspan(16, large); + @include breakpoint('large') { + width: colspan(18, 'large'); + } + @include breakpoint('xlarge') { + width: colspan(18, 'xlarge'); } .o-sticky-sidebar__sticker { - max-width: 300px; padding-right: 0; - width: colspan(16, large); } } From 496dbea842730cb1d887c28c49a1ea539fda9d2d Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 1 Oct 2024 10:47:50 -0500 Subject: [PATCH 238/346] Set paragraph block width to 33 columns [PUB-267] --- frontend/scss/pages/_p-issuearticle-show.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index ea7573d6c7..f2f2bbde3c 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -59,6 +59,12 @@ .o-blocks > p { @include untuck(); + + @each $name in ('large', 'xlarge') { + @include breakpoint('#{$name}') { + width: colspan(33, '#{$name}'); + } + } } &.s-sans-serif-loaded .o-blocks>p:not([class*=f-]), From a1038be5c54ba8f867717c8f78540aafdbcf4c52 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 26 Sep 2024 16:03:04 -0500 Subject: [PATCH 239/346] Bump My Museum Tour version [WEB-2905] --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 1be97eb2d7..c99e383a9d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8575,7 +8575,7 @@ } }, "my-museum-tour-builder": { - "version": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#561741128694d3b0a3ab98a2e1b2bf24b6077f07", + "version": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#bef1cdbb2db2c65b912cfb6a93290935864c47bf", "from": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#semver:^1.0.0", "requires": { "@area17/a17-helpers": "^0.6.7", From cc676a1fddb6f383dc445929d6fcbbfda5d27c7a Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 2 Oct 2024 13:59:11 -0500 Subject: [PATCH 240/346] Fix sidebar width on scroll [PUB-265] --- frontend/scss/state/_s-sticky-sidebar.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/scss/state/_s-sticky-sidebar.scss b/frontend/scss/state/_s-sticky-sidebar.scss index d4c66915b7..565fba7162 100644 --- a/frontend/scss/state/_s-sticky-sidebar.scss +++ b/frontend/scss/state/_s-sticky-sidebar.scss @@ -111,7 +111,7 @@ For _p-issuearticle-show.scss and _p-issue-show.scss @each $name in ('large', 'xlarge') { @include breakpoint('#{$name}') { - width: #{colspan(14, '#{$name}')}; + width: #{colspan(19, '#{$name}')}; padding-right: #{colspan(1, '#{$name}')}; } } From b177f78c1c756b5d27ce96e4eac85ef8445a9cd6 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 1 Oct 2024 14:34:09 -0500 Subject: [PATCH 241/346] Set paragraph widths based on breakpoints [PUB-267] Also, hide paragraph numbers on small/xs screen sizes. --- frontend/scss/pages/_p-issuearticle-show.scss | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index f2f2bbde3c..60cd3db875 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -59,12 +59,6 @@ .o-blocks > p { @include untuck(); - - @each $name in ('large', 'xlarge') { - @include breakpoint('#{$name}') { - width: colspan(33, '#{$name}'); - } - } } &.s-sans-serif-loaded .o-blocks>p:not([class*=f-]), @@ -204,10 +198,31 @@ padding-top: 0; margin-top: 60px; - @include breakpoint('large+') { - margin-left: calc(300px + colspan(2, large)); - max-width: 900px; - width: colspan(46, large); + + .o-article__body .p--linked { + @include breakpoint('small-') { + padding-right: 0; + .p--linked__text { + width: 100%; + } + .p--linked__ref { + display: none; + } + } + @include breakpoint('medium') { + .p--linked__text { + width: 88%; + } + } + @include breakpoint('large') { + .p--linked__text { + width: colspan(33, 'large'); + } + } + @include breakpoint('xlarge') { + .p--linked__text { + width: 73.5% + } } } From d92c9b5111179cae61446dfa29d5a661d4b052b2 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 2 Oct 2024 14:14:47 -0500 Subject: [PATCH 242/346] Consolidate duplicate selectors [PUB-265] --- frontend/scss/pages/_p-issue-show.scss | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/frontend/scss/pages/_p-issue-show.scss b/frontend/scss/pages/_p-issue-show.scss index bc9e407577..8a79742a4a 100644 --- a/frontend/scss/pages/_p-issue-show.scss +++ b/frontend/scss/pages/_p-issue-show.scss @@ -7,6 +7,13 @@ .o-article__body { border-top: none; + float: none; + @each $name in ('large', 'xlarge') { + @include breakpoint('#{$name}') { + margin-left: colspan(20, '#{$name}'); + width: colspan(38, '#{$name}'); + } + } } .m-article-header~.o-article__primary-actions::before { @@ -65,16 +72,6 @@ } } } - - .o-article__body { - float: none; - @each $name in ('large', 'xlarge') { - @include breakpoint('#{$name}') { - margin-left: colspan(20, '#{$name}'); - width: colspan(38, '#{$name}'); - } - } - } } // Top margin is different for digital publications vs. everything else From 2db4ce42c84f12d574971d26bae7b777566e299d Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:37:10 -0500 Subject: [PATCH 243/346] Fix stickySidebar behavior to respect stickyHeader [PUB-266] --- frontend/js/behaviors/core/stickySidebar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index ce6c1cb3ba..afba8d37eb 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -69,7 +69,7 @@ const stickySidebar = function(container){ stickyHeaderContainer = document.querySelector('.m-article-header'); // `containerToo` is caluclated in the `handleResize` method - if (scrollTop < containerTop) { + if (scrollTop < containerTop - (document.documentElement.classList.contains('s-sticky-digital-publication-header') ? stickyHeaderContainer.clientHeight : 0)) { top(); container.style.marginTop = '0px'; } else { From 6ba93934d31f8e8bd181cab1ff5b4a895ee71d0e Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:37:46 -0500 Subject: [PATCH 244/346] Fix bad header image placement and behavior when sticky [PUB-266] --- frontend/scss/molecules/_m-article-header.scss | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 7f26ca7c49..04663f9714 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1240,12 +1240,6 @@ } } -.s-sticky-digital-publication-header.is-sidebar-top.s-scroll-direction-up { - .m-article-header--digital-publication { - position: absolute !important; - } -} - .s-sticky-digital-publication-header:not(.s-allow-top-link) { .m-sidebar-toggle { position: relative !important; @@ -1351,7 +1345,7 @@ flex: 0 0 colspan(56, 'large'); img { - object-position: bottom; + opacity: 0; } } } From b2a3b3b7905acb9ba8e5c039535ccf19ad444cc4 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:38:24 -0500 Subject: [PATCH 245/346] Update listing displays for digiPub components [PUB-266] --- frontend/scss/molecules/_m-listing.scss | 157 +++++++++++------- frontend/scss/molecules/_m-showcase.scss | 33 +++- .../molecules/_m-showcase.blade.php | 2 +- 3 files changed, 126 insertions(+), 66 deletions(-) diff --git a/frontend/scss/molecules/_m-listing.scss b/frontend/scss/molecules/_m-listing.scss index d67ac2ed24..7e77cc62d5 100644 --- a/frontend/scss/molecules/_m-listing.scss +++ b/frontend/scss/molecules/_m-listing.scss @@ -2156,65 +2156,70 @@ a:focus:hover .btn--magazine { } .m-listing----cover { - @include breakpoint('xsmall') { - margin-bottom: 20px; - height: 80px; - width: colspan(design-cols-to-colspan(12), xsmall) !important; - } + &.m-listing { - @include breakpoint('small+') { - margin-bottom: 20px; - height: 80px; - width: colspan(design-cols-to-colspan(12), small) !important; - } + @include breakpoint('xsmall') { + margin-bottom: 20px; + height: 80px; + width: colspan(design-cols-to-colspan(12), xsmall) !important; + } - @include breakpoint('medium+') { - height: auto; - width: colspan(design-cols-to-colspan(4), medium) !important; - } + @include breakpoint('small+') { + margin-bottom: 20px; + height: 80px; + width: colspan(design-cols-to-colspan(12), small) !important; + } - @include breakpoint('large+') { - height: auto; - width: colspan(design-cols-to-colspan(3), large) !important; - } + @include breakpoint('medium+') { + height: auto; + width: colspan(design-cols-to-colspan(4), medium) !important; + } - @include breakpoint('xlarge') { - height: auto; - width: colspan(design-cols-to-colspan(3), xlarge) !important; - } + @include breakpoint('large+') { + height: auto; + width: colspan(11.25, large) !important; + margin-left: colspan(2, large) !important; + } - a:hover .title { - color: rgba($color__white, .8) !important; - } + @include breakpoint('xlarge') { + height: auto; + width: colspan(11.33, xlarge) !important; + margin-left: colspan(2, xlarge) !important; + } - .m-listing__img { - aspect-ratio: 5/6; - height: 100%; - width: 100%; - position: relative; + a:hover .title { + color: rgba($color__white, .8) !important; + } - &::after { - content: ''; - position: absolute; - top: 0; - left: 0; - width: 100%; + .m-listing__img { + aspect-ratio: 5/6; height: 100%; - background: rgba($color__black, .4); - z-index: 1; + width: 100%; + position: relative; + + &::after { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba($color__black, .4); + z-index: 1; + } } - } - .m-listing----cover-title { - position: absolute; - display: flex; - justify-content: center; - align-items: center; - text-align: center; - color: $color__white; - height: 100%; - width: 100%; - z-index: 2; + .m-listing----cover-title { + position: absolute; + display: flex; + justify-content: center; + align-items: center; + text-align: center; + color: $color__white; + height: 100%; + width: 100%; + z-index: 2; + } } } @@ -2222,19 +2227,24 @@ a:focus:hover .btn--magazine { &.m-listing { @include breakpoint('small+') { - width: colspan(design-cols-to-colspan(12), small) !important; + width: colspan(58, small) !important; + margin-left: colspan(2, small) !important; + margin-top: colspan(map-get($grid-padding-tops, 'small'), 'small') !important; } - + @include breakpoint('medium+') { - width: colspan(design-cols-to-colspan(4), medium) !important; + width: colspan(18, medium) !important; + margin-left: colspan(2, medium) !important; } - + @include breakpoint('large+') { - width: colspan(design-cols-to-colspan(3), large) !important; + width: colspan(11.33, large) !important; + margin-left: colspan(2, large) !important; } - + @include breakpoint('xlarge') { - width: colspan(design-cols-to-colspan(3), xlarge) !important; + width: colspan(11.33, xlarge) !important; + margin-left: colspan(2, xlarge) !important; } .short-description { @@ -2252,6 +2262,7 @@ a:focus:hover .btn--magazine { display: none; } } + .link { display: none } @@ -2275,13 +2286,13 @@ a:focus:hover .btn--magazine { } @include breakpoint('large+') { - width: colspan(9.2, large) !important; - margin-left: colspan(2.04, large) !important; + width: colspan(8, large) !important; + margin-left: colspan(2, large) !important; } @include breakpoint('xlarge') { - width: colspan(9.2, xlarge) !important; - margin-left: colspan(2.04, xlarge) !important; + width: colspan(8, xlarge) !important; + margin-left: colspan(2, xlarge) !important; } .m-listing__img { @@ -2307,8 +2318,27 @@ a:focus:hover .btn--magazine { .m-listing--seventy-thirty { &.m-listing { - width: 100% !important; - margin: 24px 0 !important; + @include breakpoint('small') { + margin-left: 0 !important + } + + @include breakpoint('medium') { + margin-left: 0 !important + } + + @include breakpoint('large') { + margin-left: 0 !important; + } + + @include breakpoint('xlarge') { + margin-left: 0 !important; + } + + & { + width: 100% !important; + margin-top: 24px!important; + margin-bottom: 24px!important; + } >.link { display: none !important; @@ -2565,5 +2595,4 @@ a:focus:hover .btn--magazine { .o-grid-listing--feature-4x .m-listing__meta { min-height: 128px; -} - +} \ No newline at end of file diff --git a/frontend/scss/molecules/_m-showcase.scss b/frontend/scss/molecules/_m-showcase.scss index 0b1d1c0bc6..f0b932820e 100644 --- a/frontend/scss/molecules/_m-showcase.scss +++ b/frontend/scss/molecules/_m-showcase.scss @@ -115,14 +115,45 @@ background-color: unset !important; + + .m-showcase-wrapper { + @include breakpoint('small-') { + flex-direction: column; + gap: 16px; + } + } + + .showcase-tag { + @include breakpoint('small-') { + font-size: 12px; + } + } + .showcase-title { - margin-top: 12px !important; + @include breakpoint('small-') { + @include untuck; + & { + font-size: 19px !important; + line-height: 4px !important; + } + } + & { + font-size: 28px; + margin-top: 12px !important; + } + } + + .showcase-author { + font-size: 15px; } .showcase-description { * { color: $color__black !important; } + & { + margin: 0 !important; + } } } diff --git a/resources/views/components/molecules/_m-showcase.blade.php b/resources/views/components/molecules/_m-showcase.blade.php index aeab669d0a..ec70fc0bd9 100644 --- a/resources/views/components/molecules/_m-showcase.blade.php +++ b/resources/views/components/molecules/_m-showcase.blade.php @@ -29,7 +29,7 @@ @endif @if ($author_display) - by {{ $author_display }} + by {{ $author_display }} @endif @if ($description) From bc035c233b0130179db43353e160d694d8b2adc1 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:05:38 -0500 Subject: [PATCH 246/346] Update all image block values for digipubArticles [PUB-258] --- ...gital_publication_article_image_blocks.php | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php diff --git a/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php b/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php new file mode 100644 index 0000000000..7fd4d96f41 --- /dev/null +++ b/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php @@ -0,0 +1,37 @@ +where(column: 'type', operator: 'image') + ->where(column: 'blockable_type', operator: 'digitalPublicationArticles') + ->get(); + + // Update the size in the content JSON column to 'l' + foreach ($digiPubImageBlocks as $block) { + $content = json_decode($block->content, associative: true); + + $content['size'] = 'l'; + $content['use_alt_background'] = true; + $content['use_contain'] = true; + + // Update the block with the new JSON + DB::table(table: 'blocks') + ->where(column: 'id', operator: $block->id) + ->update(values: ['content' => json_encode(value: $content)]); + } + } + + public function down(): void + { + // There's no going back... + } +}; \ No newline at end of file From d9f833f7279f2b4e7c20b463554ec92b7c9ca03f Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:05:54 -0500 Subject: [PATCH 247/346] Update styling for the image block in digipubArticles [PUB-258] --- frontend/scss/pages/_p-issuearticle-show.scss | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 6eff175970..5ce4f07569 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -334,18 +334,33 @@ } } - .m-media--s.o-blocks__block .m-media__img { - width: max-content; + .m-media--s.o-blocks__block, + .m-media--l.o-blocks__block { + width: max-content !important; max-width: 100%; - overflow: hidden; - text-align: left; - background-image: unset !important; + min-width: unset !important; - img { + .m-media__contain--spacer { + display: none !important; + } + + .m-media__img { + & { + width: 100%!important; + max-width: 100% !important; + max-height: 450px; + overflow: hidden !important; + text-align: left !important; + background-image: unset !important; + } + + img { + position: relative !important; max-height: 450px !important; - width: auto; - object-fit: contain; - display: block; + width: auto !important; + object-fit: contain !important; + display: block !important; + } } } From 14091e1128dbf7e5e8fa070e7c3b0cbecec932de Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:06:49 -0500 Subject: [PATCH 248/346] Add hard-coded values for size, use_contain, and use_alt_background if in digiPub [PUB-258] --- resources/views/admin/blocks/image.blade.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/views/admin/blocks/image.blade.php b/resources/views/admin/blocks/image.blade.php index 08c2b496ad..eb31df8265 100644 --- a/resources/views/admin/blocks/image.blade.php +++ b/resources/views/admin/blocks/image.blade.php @@ -18,7 +18,8 @@ 'name' => 'size', 'label' => 'Size', 'placeholder' => 'Select size', - 'default' => 'm', + 'default' => ($type === 'digitalPublications' ? 'l' : 'm'), + 'disabled' => ($type === 'digitalPublications' ? true : false), 'options' => [ [ 'value' => 's', @@ -38,11 +39,15 @@ @formField('checkbox', [ 'name' => 'use_contain', 'label' => 'Always show the whole image instead of cropping to the container', + 'default' => ($type === 'digitalPublications' ? true : false), + 'disabled' => ($type === 'digitalPublications' ? true : false), ]) @formField('checkbox', [ 'name' => 'use_alt_background', 'label' => 'Use white instead of gray to pillarbox the image', + 'default' => ($type === 'digitalPublications' ? true : false), + 'disabled' => ($type === 'digitalPublications' ? true : false), ]) @formField('checkbox', [ From 186fb3982cf4fe4deb527d4e0d405c554b81272d Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:08:57 -0500 Subject: [PATCH 249/346] Lint code [PUB-258] --- ...4028_update_digital_publication_article_image_blocks.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php b/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php index 7fd4d96f41..63b6234ba0 100644 --- a/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php +++ b/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php @@ -18,11 +18,11 @@ public function up(): void // Update the size in the content JSON column to 'l' foreach ($digiPubImageBlocks as $block) { $content = json_decode($block->content, associative: true); - + $content['size'] = 'l'; $content['use_alt_background'] = true; $content['use_contain'] = true; - + // Update the block with the new JSON DB::table(table: 'blocks') ->where(column: 'id', operator: $block->id) @@ -34,4 +34,4 @@ public function down(): void { // There's no going back... } -}; \ No newline at end of file +}; From aabc5876c04556e10b1a965e5c82c1204ba3b649 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:33:27 -0500 Subject: [PATCH 250/346] Fix mobile TOC sticky behavior [PUB-264] --- frontend/scss/molecules/_m-article-header.scss | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 04663f9714..50ac636f74 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1240,15 +1240,29 @@ } } -.s-sticky-digital-publication-header:not(.s-allow-top-link) { +.s-sticky-digital-publication-header:not(.s-allow-top-link), +.p-t-entry:not(.s-allow-top-link), +.p-t-contributions:not(.s-allow-top-link), +.p-t-about:not(.s-allow-top-link) { .m-sidebar-toggle { position: relative !important; } } -.s-sticky-digital-publication-header.s-allow-top-link { +.s-sticky-digital-publication-header.s-allow-top-link, +.p-t-entry.s-allow-top-link, +.p-t-contributions.s-allow-top-link, +.p-t-about.s-allow-top-link { .m-sidebar-toggle { position: fixed !important; + top: 0; + width: 100vw; + z-index: map-get($zindexs, 'header'); + + &::before { + left: 0; + width: 150vw; + } } } From df0a6bdb0e6813c6f288c005d30cf98d79cd7bbb Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Fri, 4 Oct 2024 16:13:32 -0500 Subject: [PATCH 251/346] Fix color of info tooltip on artworks [WEB-2935] --- frontend/scss/molecules/_m-info-trigger.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/scss/molecules/_m-info-trigger.scss b/frontend/scss/molecules/_m-info-trigger.scss index 6ee1310318..76921898d7 100644 --- a/frontend/scss/molecules/_m-info-trigger.scss +++ b/frontend/scss/molecules/_m-info-trigger.scss @@ -64,6 +64,7 @@ padding: 12px 16px 16px; border: 0 none; border-radius: $border-radius; + color: $color__white; background-color: rgba($color__black, .7); transition: opacity .15s; overflow: hidden; From 8f0196632a51e679810209b54aa5a670e9617ce5 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Mon, 14 Oct 2024 16:41:02 -0500 Subject: [PATCH 252/346] Adjust width of TOC on small/med screens [PUB-265] --- frontend/scss/state/_s-sticky-sidebar.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/scss/state/_s-sticky-sidebar.scss b/frontend/scss/state/_s-sticky-sidebar.scss index 565fba7162..443b016daa 100644 --- a/frontend/scss/state/_s-sticky-sidebar.scss +++ b/frontend/scss/state/_s-sticky-sidebar.scss @@ -86,6 +86,16 @@ For _p-issuearticle-show.scss and _p-issue-show.scss width: 100vw; } } + @include breakpoint('small') { + .o-sticky-sidebar__sticker { + width: calc(colspan(19, 'small') + map-get($outer-gutters, 'small')); + } + } + @include breakpoint('medium') { + .o-sticky-sidebar__sticker { + width: calc(colspan(19, 'medium') + map-get($outer-gutters, 'medium')); + } + } } @include breakpoint('large+') { From e70bf8c9a7039b1fc2ad3ab291511cfb9a128505 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Mon, 14 Oct 2024 16:42:49 -0500 Subject: [PATCH 253/346] Add margin to top of TOC [PUB-265] --- frontend/scss/organisms/_o-article__primary-actions.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index 3cf8977a2c..40a564c092 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -258,6 +258,7 @@ // Styles specific to digital publications and their sections: .o-article__primary-actions--digital-publication { @extend %o-article__primary-actions--toggleable; + margin-top: 40px; padding-top: 0px; z-index: 4; @@ -318,6 +319,10 @@ color: $color__link--publications-active; } + @include breakpoint('medium-') { + margin-top: 40px; + } + @include breakpoint('large+') { .p-digitalpublications-show &, .p-digitalpublications-showlisting & { From 037c1f1f4b0e398c6cb199b000f65889d0e94915 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 15 Oct 2024 11:55:27 -0500 Subject: [PATCH 254/346] Add margin to TOC on listing & landing pages [PUB-265] --- frontend/scss/organisms/_o-article__primary-actions.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index 40a564c092..6ed325d398 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -258,10 +258,14 @@ // Styles specific to digital publications and their sections: .o-article__primary-actions--digital-publication { @extend %o-article__primary-actions--toggleable; - margin-top: 40px; padding-top: 0px; z-index: 4; + .p-digitalpublications-show &, + .p-digitalpublications-showlisting & { + margin-top: 40px; + } + .o-sticky-sidebar__sticker { padding-bottom: 60px; } From b4076b4a1bf85cdf01bdb1ee915e0c6c6165a28e Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 15 Oct 2024 15:31:48 -0500 Subject: [PATCH 255/346] Disallow horizontal scroll in TOC [PUB-265] --- frontend/scss/organisms/_o-article__primary-actions.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index 6ed325d398..a566c7676b 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -266,7 +266,8 @@ margin-top: 40px; } - .o-sticky-sidebar__sticker { + .is-sidebar-overlay & .o-sticky-sidebar__sticker { + overflow-y: unset; padding-bottom: 60px; } From 8bfdca84eb8121b656bfd7bcf11fd0a238268334 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 15 Oct 2024 15:32:49 -0500 Subject: [PATCH 256/346] Apply the same dimensions/margins to entry & contributions [PUB-265] --- frontend/scss/organisms/_o-article__primary-actions.scss | 5 +++-- frontend/scss/pages/_p-issuearticle-show.scss | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index a566c7676b..57b5a63509 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -277,12 +277,13 @@ display: flex; align-items: center; - .is-sidebar-fixed & { + .is-sidebar-fixed:not(.is-sidebar-overlay) & { display: block; align-items: normal; } - .p-digitalpublicationarticle-show.p-t-contributions & { + .p-digitalpublicationarticle-show.p-t-contributions:not(.is-sidebar-overlay) &, + .p-digitalpublicationarticle-show.p-t-entry:not(.is-sidebar-overlay) & { margin-bottom: 40px; } diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 3998c3c7b7..32817452b7 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -519,7 +519,8 @@ Styling related specifically to digital publications } } -.p-digitalpublicationarticle-show.p-t-contributions { +.p-digitalpublicationarticle-show.p-t-contributions, +.p-digitalpublicationarticle-show.p-t-entry { .m-article-actions--publication__logo { height: 150px; margin-bottom: 0; From 0ab61e693c6f6a62a31dcd500588759e564102c2 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 8 Oct 2024 14:51:54 -0500 Subject: [PATCH 257/346] Fix overflowing images on block [PUB-258] --- frontend/scss/pages/_p-issuearticle-show.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 5ce4f07569..3998c3c7b7 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -346,7 +346,7 @@ .m-media__img { & { - width: 100%!important; + width: max-content !important; max-width: 100% !important; max-height: 450px; overflow: hidden !important; @@ -357,7 +357,7 @@ img { position: relative !important; max-height: 450px !important; - width: auto !important; + width: 100% !important; object-fit: contain !important; display: block !important; } From bfdb5d475dd556a6986085a569f4f190585ac435 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 15 Oct 2024 15:43:17 -0500 Subject: [PATCH 258/346] Unset TOC logo bg color on sidebar overlay [PUB-265] --- frontend/scss/organisms/_o-article__primary-actions.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index 57b5a63509..8831048bd5 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -282,6 +282,11 @@ align-items: normal; } + .p-digitalpublicationarticle-show.p-t-contributions &, + .p-digitalpublicationarticle-show.p-t-entry & { + background-color: unset; + } + .p-digitalpublicationarticle-show.p-t-contributions:not(.is-sidebar-overlay) &, .p-digitalpublicationarticle-show.p-t-entry:not(.is-sidebar-overlay) & { margin-bottom: 40px; From 6ff687c2dd8d4d0465a8f0c513ae38d36b1e5f72 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:53:08 -0500 Subject: [PATCH 259/346] Remove 'clearfix' to prevent unintended margin's [PUB-275] --- frontend/scss/setup/mixins/_other.scss | 12 ------------ .../organisms/_o-gallery----slider.blade.php | 1 - 2 files changed, 13 deletions(-) diff --git a/frontend/scss/setup/mixins/_other.scss b/frontend/scss/setup/mixins/_other.scss index 110ba9107c..905982f3d5 100755 --- a/frontend/scss/setup/mixins/_other.scss +++ b/frontend/scss/setup/mixins/_other.scss @@ -120,18 +120,6 @@ Creates a load spinner. @return $string; } -// To fix collapsing margins -.clearfix { - &:before,&:after { - display:table; - content:""; - line-height:0; - } - &:after { - clear:both; - } -} - @mixin tucked-margin-top($font-obj, $distances, $single-bp: false) { $settings: false; $line-height: 0; diff --git a/resources/views/components/organisms/_o-gallery----slider.blade.php b/resources/views/components/organisms/_o-gallery----slider.blade.php index 296bbda947..0075198597 100644 --- a/resources/views/components/organisms/_o-gallery----slider.blade.php +++ b/resources/views/components/organisms/_o-gallery----slider.blade.php @@ -1,5 +1,4 @@ @endif From 666d53806b9ef1da5a42ad886792f8fa5f1deeeb Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 1 Nov 2024 10:27:47 -0500 Subject: [PATCH 284/346] Made sticky sidebar scrollable again [PUB-277] --- frontend/scss/state/_s-sticky-sidebar.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/scss/state/_s-sticky-sidebar.scss b/frontend/scss/state/_s-sticky-sidebar.scss index 443b016daa..34e421d485 100644 --- a/frontend/scss/state/_s-sticky-sidebar.scss +++ b/frontend/scss/state/_s-sticky-sidebar.scss @@ -12,6 +12,10 @@ For _p-issuearticle-show.scss and _p-issue-show.scss display: none; } + .o-sticky-sidebar__sticker { + height: 100vh; + } + &.is-sidebar-overlay { .m-article-actions--publication__logo a { color: $color__text--title !important; @@ -44,7 +48,6 @@ For _p-issuearticle-show.scss and _p-issue-show.scss left: 0; width: 300px; - height: 100vh; overflow-y: auto; // Gutters are always about the same as on xsmall From b6188c6ed58910054a8a015f4a65185bac03df81 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Thu, 7 Nov 2024 11:59:11 -0600 Subject: [PATCH 285/346] Cache navigation menu contents [WEB-2952] --- app/Providers/AppServiceProvider.php | 474 ++++++++++++++------------- 1 file changed, 238 insertions(+), 236 deletions(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index b91fd82dae..2dbf9f307c 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -167,260 +167,262 @@ function. // WEB-2269: Consider moving some of this to a config? view()->composer('*', function ($view) use ($hour) { - $view->with([ - 'hour' => $hour, - '_pages' => [ - 'visit' => route('pages.slug', ['slug' => 'visit']), - 'hours' => route('pages.slug', ['slug' => 'visit']) . '#hours', - 'directions' => route('pages.slug', ['slug' => 'visit']) . '#directions', - 'buy' => 'https://sales.artic.edu/admissions', - 'become-a-member' => 'https://sales.artic.edu/memberships', - 'shop' => 'https://shop.artic.edu/', - 'collection' => route('collection'), - 'exhibitions' => route('exhibitions'), - 'events' => route('events'), 'about-us' => '/about-us', - 'about-us-mission-and-history' => '/about-us/mission-and-history', - 'about-us-leadership' => '/about-us/leadership', - 'about-us-departments' => '/about-us/departments', - 'about-us-financial-reporting' => '/about-us/financial-reporting', - 'support-us' => '/support-us', - 'support-us-membership' => '/support-us/membership', - 'support-us-luminary' => '/support-us/membership/luminary-levels', - 'support-us-planned-giving' => '/support-us/ways-to-give/planned-giving', - 'support-us-corporate-sponsorship' => '/support-us/ways-to-give/corporate-sponsorship', - 'learn' => '/learn-with-us', - 'learn-families' => '/learn-with-us/families', - 'learn-teens' => '/learn-with-us/teens', - 'learn-adults' => '/visit/whos-visiting/college-and-university-groups-2', - 'learn-educators' => '/learn-with-us/educators', - 'learn-rlc' => '/ryan-learning-center', - 'follow-facebook' => 'https://www.facebook.com/artic', - 'follow-twitter' => 'https://twitter.com/artinstitutechi', - 'follow-instagram' => 'https://www.instagram.com/artinstitutechi/', - 'follow-youtube' => 'https://www.youtube.com/user/ArtInstituteChicago', - 'legal-articles' => route('articles'), - 'legal-employment' => '/employment', - 'legal-venue-rental' => '/venue-rental', - 'legal-contact' => '/contact', 'legal-press' => '/press', - 'legal-terms' => '/terms', - 'legal-image-licensing' => '/image-licensing', - 'legal-saic' => 'https://www.saic.edu', - ], - 'primaryNav' => [ - [ - 'name' => 'Visit', - 'description' => 'Find all the information you need—plus helpful tips—to plan your visit', - 'cta' => 'Start planning', - 'image' => 'https://artic-web.imgix.net/b55a24a5-ab1c-453e-9ecd-e30ee5473f6e/navigation-thumbnail-visit.jpg', - 'url' => route('pages.slug', ['slug' => 'visit']), - 'children' => [ - [ - 'name' => 'Hours', - 'url' => route('pages.slug', ['slug' => 'visit']) . '#hours', - ], - [ - 'name' => 'Admission', - 'url' => route('pages.slug', ['slug' => 'visit']) . '#admission', - ], - [ - 'name' => 'Plan Your Visit', - 'url' => route('pages.slug', ['slug' => 'visit']) . '#plan-your-visit', - 'children' => [ - [ - 'name' => 'Museum Map', - 'url' => '/visit/explore-on-your-own/museum-floor-plan', - ], - [ - 'name' => 'Free Daily Tours', - 'url' => route('events', ['audience' => 3, 'type' => 6]), - ], - [ - 'name' => 'My Museum Tour', - 'url' => route('pages.slug', ['slug' => 'my-museum-tour']), - ], - [ - 'name' => 'What to See in an Hour', - 'url' => route('highlights.show', ['id' => 3, 'slug' => 'what-to-see-in-an-hour']), - ], - [ - 'name' => 'Shopping and Dining', - 'url' => '/visit/dining-and-shopping', - ], - [ - 'name' => 'Accessibility', - 'url' => '/visit/accessibility', - ], + $view->with(\Cache::remember('navArray', 3600, function () use ($hour) { + return [ + 'hour' => $hour, + '_pages' => [ + 'visit' => route('pages.slug', ['slug' => 'visit']), + 'hours' => route('pages.slug', ['slug' => 'visit']) . '#hours', + 'directions' => route('pages.slug', ['slug' => 'visit']) . '#directions', + 'buy' => 'https://sales.artic.edu/admissions', + 'become-a-member' => 'https://sales.artic.edu/memberships', + 'shop' => 'https://shop.artic.edu/', + 'collection' => route('collection'), + 'exhibitions' => route('exhibitions'), + 'events' => route('events'), 'about-us' => '/about-us', + 'about-us-mission-and-history' => '/about-us/mission-and-history', + 'about-us-leadership' => '/about-us/leadership', + 'about-us-departments' => '/about-us/departments', + 'about-us-financial-reporting' => '/about-us/financial-reporting', + 'support-us' => '/support-us', + 'support-us-membership' => '/support-us/membership', + 'support-us-luminary' => '/support-us/membership/luminary-levels', + 'support-us-planned-giving' => '/support-us/ways-to-give/planned-giving', + 'support-us-corporate-sponsorship' => '/support-us/ways-to-give/corporate-sponsorship', + 'learn' => '/learn-with-us', + 'learn-families' => '/learn-with-us/families', + 'learn-teens' => '/learn-with-us/teens', + 'learn-adults' => '/visit/whos-visiting/college-and-university-groups-2', + 'learn-educators' => '/learn-with-us/educators', + 'learn-rlc' => '/ryan-learning-center', + 'follow-facebook' => 'https://www.facebook.com/artic', + 'follow-twitter' => 'https://twitter.com/artinstitutechi', + 'follow-instagram' => 'https://www.instagram.com/artinstitutechi/', + 'follow-youtube' => 'https://www.youtube.com/user/ArtInstituteChicago', + 'legal-articles' => route('articles'), + 'legal-employment' => '/employment', + 'legal-venue-rental' => '/venue-rental', + 'legal-contact' => '/contact', 'legal-press' => '/press', + 'legal-terms' => '/terms', + 'legal-image-licensing' => '/image-licensing', + 'legal-saic' => 'https://www.saic.edu', + ], + 'primaryNav' => [ + [ + 'name' => 'Visit', + 'description' => 'Find all the information you need—plus helpful tips—to plan your visit', + 'cta' => 'Start planning', + 'image' => 'https://artic-web.imgix.net/b55a24a5-ab1c-453e-9ecd-e30ee5473f6e/navigation-thumbnail-visit.jpg', + 'url' => route('pages.slug', ['slug' => 'visit']), + 'children' => [ + [ + 'name' => 'Hours', + 'url' => route('pages.slug', ['slug' => 'visit']) . '#hours', ], - ], - [ - 'name' => 'Who's Visiting?', - 'url' => route('pages.slug', ['slug' => 'visit']) . '#whos-visiting', - 'children' => [ - [ - 'name' => 'First-Time Visitors', - 'url' => '/visit/whos-visiting/first-time-visitors', - ], - [ - 'name' => 'Families', - 'url' => '/visit/whos-visiting/families-2', - ], - [ - 'name' => 'Members', - 'url' => '/visit/whos-visiting/members', - ], - [ - 'name' => 'Teens', - 'url' => '/visit/whos-visiting/teens-2', - ], - [ - 'name' => 'Educators', - 'url' => '/visit/whos-visiting/educators-2', + [ + 'name' => 'Admission', + 'url' => route('pages.slug', ['slug' => 'visit']) . '#admission', + ], + [ + 'name' => 'Plan Your Visit', + 'url' => route('pages.slug', ['slug' => 'visit']) . '#plan-your-visit', + 'children' => [ + [ + 'name' => 'Museum Map', + 'url' => '/visit/explore-on-your-own/museum-floor-plan', + ], + [ + 'name' => 'Free Daily Tours', + 'url' => route('events', ['audience' => 3, 'type' => 6]), + ], + [ + 'name' => 'My Museum Tour', + 'url' => route('pages.slug', ['slug' => 'my-museum-tour']), + ], + [ + 'name' => 'What to See in an Hour', + 'url' => route('highlights.show', ['id' => 3, 'slug' => 'what-to-see-in-an-hour']), + ], + [ + 'name' => 'Shopping and Dining', + 'url' => '/visit/dining-and-shopping', + ], + [ + 'name' => 'Accessibility', + 'url' => '/visit/accessibility', + ], ], - [ - 'name' => 'Group Visits', - 'url' => '/visit/whos-visiting/adult-groups-2', + ], + [ + 'name' => 'Who's Visiting?', + 'url' => route('pages.slug', ['slug' => 'visit']) . '#whos-visiting', + 'children' => [ + [ + 'name' => 'First-Time Visitors', + 'url' => '/visit/whos-visiting/first-time-visitors', + ], + [ + 'name' => 'Families', + 'url' => '/visit/whos-visiting/families-2', + ], + [ + 'name' => 'Members', + 'url' => '/visit/whos-visiting/members', + ], + [ + 'name' => 'Teens', + 'url' => '/visit/whos-visiting/teens-2', + ], + [ + 'name' => 'Educators', + 'url' => '/visit/whos-visiting/educators-2', + ], + [ + 'name' => 'Group Visits', + 'url' => '/visit/whos-visiting/adult-groups-2', + ], ], ], - ], - [ - 'name' => 'Mobile App', - 'url' => '/visit/explore-on-your-own/mobile-app-audio-tours', - ], - [ - 'name' => 'Ryan Learning Center', - 'url' => '/ryan-learning-center', + [ + 'name' => 'Mobile App', + 'url' => '/visit/explore-on-your-own/mobile-app-audio-tours', + ], + [ + 'name' => 'Ryan Learning Center', + 'url' => '/ryan-learning-center', + ], ], ], - ], - [ - 'name' => 'Exhibitions', - 'url' => route('exhibitions'), - 'class' => 'exhibitions', - 'children' => [ - [ - 'name' => 'Current', - 'url' => route('exhibitions'), - ], - [ - 'name' => 'Upcoming', - 'url' => route('exhibitions.upcoming'), - ], - [ - 'name' => 'Archive', - 'url' => route('exhibitions.history'), + [ + 'name' => 'Exhibitions', + 'url' => route('exhibitions'), + 'class' => 'exhibitions', + 'children' => [ + [ + 'name' => 'Current', + 'url' => route('exhibitions'), + ], + [ + 'name' => 'Upcoming', + 'url' => route('exhibitions.upcoming'), + ], + [ + 'name' => 'Archive', + 'url' => route('exhibitions.history'), + ], ], ], - ], - [ - 'name' => 'Art & Artists', - 'description' => 'Explore the works in our collection and delve deeper into their stories.', - 'cta' => 'Start your discovery', - 'image' => 'https://artic-web.imgix.net/fd36787d-a4f7-480c-8e34-11115a9d240a/navigation-thumbnail-art-and-artists.jpg', - 'url' => route('collection'), - 'children' => [ - [ - 'name' => 'Artworks', - 'url' => route('collection'), - ], - [ - 'name' => 'Articles & Videos', - 'url' => route('pages.slug', ['slug' => 'articles-and-videos']), - ], - [ - 'name' => 'Research', - 'url' => route('collection.research_resources'), - 'children' => [ - [ - 'name' => 'Library', - 'url' => '/library', - ], - [ - 'name' => 'Archival Collections', - 'url' => '/archival-collections', - ], - [ - 'name' => 'Collection Information', - 'url' => '/collection-information', - ], - [ - 'name' => 'Conservation and Science', - 'url' => '/about-us/departments/conservation-and-science-2', - ], + [ + 'name' => 'Art & Artists', + 'description' => 'Explore the works in our collection and delve deeper into their stories.', + 'cta' => 'Start your discovery', + 'image' => 'https://artic-web.imgix.net/fd36787d-a4f7-480c-8e34-11115a9d240a/navigation-thumbnail-art-and-artists.jpg', + 'url' => route('collection'), + 'children' => [ + [ + 'name' => 'Artworks', + 'url' => route('collection'), ], - ], - [ - 'name' => 'Publications', - 'url' => route('articles_publications'), - 'children' => [ - [ - 'name' => 'Print Catalogues', - 'url' => route('collection.publications.printed-publications'), + [ + 'name' => 'Articles & Videos', + 'url' => route('pages.slug', ['slug' => 'articles-and-videos']), + ], + [ + 'name' => 'Research', + 'url' => route('collection.research_resources'), + 'children' => [ + [ + 'name' => 'Library', + 'url' => '/library', + ], + [ + 'name' => 'Archival Collections', + 'url' => '/archival-collections', + ], + [ + 'name' => 'Collection Information', + 'url' => '/collection-information', + ], + [ + 'name' => 'Conservation and Science', + 'url' => '/about-us/departments/conservation-and-science-2', + ], ], - [ - 'name' => 'Digital Publications', - 'url' => route('collection.publications.digital-publications'), + ], + [ + 'name' => 'Publications', + 'url' => route('articles_publications'), + 'children' => [ + [ + 'name' => 'Print Catalogues', + 'url' => route('collection.publications.printed-publications'), + ], + [ + 'name' => 'Digital Publications', + 'url' => route('collection.publications.digital-publications'), + ], ], ], ], ], - ], - [ - 'name' => 'Events', - 'description' => 'Join us for a wide range of programs—there's something for visitors of all ages.', - 'cta' => 'Check out the calendar', - 'image' => 'https://artic-web.imgix.net/d335c986-7075-4753-a84f-9cb11876ac77/navigation-thumbnail-events.jpg', - 'url' => route('events'), - 'children' => [ - [ - 'name' => 'Calendar', - 'url' => route('events'), - ], - [ - 'name' => 'Daily Tours', - 'url' => route('events', ['type' => 6]), - ], - [ - 'name' => 'Talks', - 'url' => route('events', ['type' => 5]), - ], - [ - 'name' => 'Art Making', - 'url' => route('events', ['type' => 1]), - ], - [ - 'name' => 'Member Programs', - 'url' => route('events', ['audience' => 2]), + [ + 'name' => 'Events', + 'description' => 'Join us for a wide range of programs—there's something for visitors of all ages.', + 'cta' => 'Check out the calendar', + 'image' => 'https://artic-web.imgix.net/d335c986-7075-4753-a84f-9cb11876ac77/navigation-thumbnail-events.jpg', + 'url' => route('events'), + 'children' => [ + [ + 'name' => 'Calendar', + 'url' => route('events'), + ], + [ + 'name' => 'Daily Tours', + 'url' => route('events', ['type' => 6]), + ], + [ + 'name' => 'Talks', + 'url' => route('events', ['type' => 5]), + ], + [ + 'name' => 'Art Making', + 'url' => route('events', ['type' => 1]), + ], + [ + 'name' => 'Member Programs', + 'url' => route('events', ['audience' => 2]), + ], ], ], + [ + 'name' => 'Become a Member', + 'class' => 'u-hide@small+', + 'url' => 'https://sales.artic.edu/memberships', + ], ], - [ - 'name' => 'Become a Member', - 'class' => 'u-hide@small+', - 'url' => 'https://sales.artic.edu/memberships', - ], - ], - 'secondaryNav' => [ - [ - 'name' => 'Buy Tickets', - 'url' => 'https://sales.artic.edu/admissions', - ], - [ - 'name' => 'Become a Member', - 'class' => 'u-show@small+', - 'url' => 'https://sales.artic.edu/memberships', - ], - [ - 'name' => 'Shop', - 'class' => 'u-show@small+', - 'url' => 'https://shop.artic.edu/', - ], - [ - 'name' => 'Visit', - 'class' => 'u-hide@small+', - 'url' => route('pages.slug', ['slug' => 'visit']), + 'secondaryNav' => [ + [ + 'name' => 'Buy Tickets', + 'url' => 'https://sales.artic.edu/admissions', + ], + [ + 'name' => 'Become a Member', + 'class' => 'u-show@small+', + 'url' => 'https://sales.artic.edu/memberships', + ], + [ + 'name' => 'Shop', + 'class' => 'u-show@small+', + 'url' => 'https://shop.artic.edu/', + ], + [ + 'name' => 'Visit', + 'class' => 'u-hide@small+', + 'url' => route('pages.slug', ['slug' => 'visit']), + ], ], - ], - ]); + ]; + })); }); } } From 6e5fe8841438c38c05caa866e604cbfd06126ce5 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Fri, 1 Nov 2024 13:43:52 -0500 Subject: [PATCH 286/346] Adjust line spacing on digital publication titles [PUB-281] --- frontend/scss/molecules/_m-article-header.scss | 4 ++-- frontend/scss/pages/_p-issuearticle-show.scss | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 07938fa583..62830d8f5b 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1104,7 +1104,7 @@ .title { font-size: 38px; - line-height: 44px; + line-height: 46px; margin-right: 35px; margin-top: 35px; } @@ -1151,7 +1151,7 @@ .title { font-size: 28px; - line-height: 32px; + line-height: 34px; margin-top: 35px; } diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index a6afdf31e5..2c9f9aec2c 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -143,11 +143,11 @@ font-family-loaded: $serif-font--loaded, font-loaded-class: $serif-font-loaded-class, settings: ( - 'xlarge': (font-size: 20, line-height: 24, push: 0), - 'large': (font-size: 20, line-height: 24, push: 0), - 'medium': (font-size: 28, line-height: 32, push: 0), - 'small': (font-size: 22, line-height: 38, push: 0), - 'xsmall': (font-size: 22, line-height: 38, push: 0), + 'xlarge': (font-size: 20, line-height: 26, push: 0), + 'large': (font-size: 20, line-height: 26, push: 0), + 'medium': (font-size: 28, line-height: 34, push: 0), + 'small': (font-size: 22, line-height: 28, push: 0), + 'xsmall': (font-size: 22, line-height: 28, push: 0), ) ) )); From 47ced79e70908141c6501ed2050c8e2915ba8f30 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 5 Nov 2024 10:01:51 -0600 Subject: [PATCH 287/346] Add fallback route to kiosk routes [WEB-2955] --- routes/kiosk.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/routes/kiosk.php b/routes/kiosk.php index 163fabb8ad..acb19d80ca 100644 --- a/routes/kiosk.php +++ b/routes/kiosk.php @@ -3,4 +3,10 @@ use Illuminate\Support\Facades\Route; use App\Http\Controllers\InteractiveFeatureExperiencesController; -Route::get('/interactive-features/{slug}', [InteractiveFeatureExperiencesController::class, 'showKiosk'])->name('interactiveFeatures.showKiosk'); +Route::get( + '/interactive-features/{slug}', + [InteractiveFeatureExperiencesController::class, 'showKiosk'] +)->name('interactiveFeatures.showKiosk'); + +// Only needed so that the kiosk doesn't fallback to the web routes. +Route::fallback(fn() => null); From bf8b36ff00f9202cbd2e74d17bd133d076bdab49 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Thu, 7 Nov 2024 12:00:27 -0600 Subject: [PATCH 288/346] Remove `hour` value from primary nav as it's no longer used [WEB-2952] --- app/Providers/AppServiceProvider.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 2dbf9f307c..7f14514f75 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -155,21 +155,10 @@ public function register(): void private function composeTemplatesViews() { - if (!\Schema::hasTable('hours')) { - /* - If the project is being initialized or not all of the migrations - have been run yet, the `hours` table may not exist, so skip this - function. - */ - return; - } - $hour = app()->environment() === 'testing' ? null : Hour::today()->first(); - // WEB-2269: Consider moving some of this to a config? - view()->composer('*', function ($view) use ($hour) { - $view->with(\Cache::remember('navArray', 3600, function () use ($hour) { + view()->composer('*', function ($view) { + $view->with(\Cache::remember('navArray', 3600, function () { return [ - 'hour' => $hour, '_pages' => [ 'visit' => route('pages.slug', ['slug' => 'visit']), 'hours' => route('pages.slug', ['slug' => 'visit']) . '#hours', From a88db516e3cb4dce7260b926d3fb5d76a825c7fc Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 5 Nov 2024 14:55:46 -0600 Subject: [PATCH 289/346] Attempt to add tests for kiosk route [WEB-2955] --- ...nteractiveFeatureExperiencesController.php | 6 +-- app/Models/Experience.php | 2 + app/Models/InteractiveFeature.php | 2 + database/factories/ExperienceFactory.php | 22 ++++++++++ .../factories/InteractiveFeatureFactory.php | 20 +++++++++ resources/views/layouts/app.blade.php | 2 +- routes/kiosk.php | 2 +- tests/Feature/KioskTest.php | 43 +++++++++++++++++++ 8 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 database/factories/ExperienceFactory.php create mode 100644 database/factories/InteractiveFeatureFactory.php create mode 100644 tests/Feature/KioskTest.php diff --git a/app/Http/Controllers/InteractiveFeatureExperiencesController.php b/app/Http/Controllers/InteractiveFeatureExperiencesController.php index 85889be3b5..c6a1673a1e 100644 --- a/app/Http/Controllers/InteractiveFeatureExperiencesController.php +++ b/app/Http/Controllers/InteractiveFeatureExperiencesController.php @@ -85,7 +85,7 @@ protected function show($slug) { if (in_array('kiosk', request()->segments())) { return redirect()->action( - 'InteractiveFeatureExperiencesController@showKiosk', + [self::class, 'showKiosk'], ['slug' => $slug] ); } @@ -132,9 +132,7 @@ protected function showKiosk($slug) $this->seo->setTitle($experience->title); - $view = 'site.experienceDetailKiosk'; - - return view($view, [ + return view('site.experienceDetailKiosk', [ 'contrastHeader' => true, 'experience' => $experience ]); diff --git a/app/Models/Experience.php b/app/Models/Experience.php index cce9156480..c116fc534e 100644 --- a/app/Models/Experience.php +++ b/app/Models/Experience.php @@ -15,12 +15,14 @@ use App\Models\Behaviors\HasUnlisted; use App\Helpers\ImageHelpers; use App\Helpers\StringHelpers; +use Illuminate\Database\Eloquent\Factories\HasFactory; class Experience extends AbstractModel implements Sortable { use HasBlocks; use HasSlug; use HasMedias; + use HasFactory; use HasFiles; use HasRevisions; use HasPosition; diff --git a/app/Models/InteractiveFeature.php b/app/Models/InteractiveFeature.php index 943fd1b8c7..397072619b 100644 --- a/app/Models/InteractiveFeature.php +++ b/app/Models/InteractiveFeature.php @@ -9,9 +9,11 @@ use App\Models\Behaviors\HasMediasEloquent; use App\Models\Behaviors\HasApiRelations; use App\Models\Behaviors\HasRelated; +use Illuminate\Database\Eloquent\Factories\HasFactory; class InteractiveFeature extends AbstractModel { + use HasFactory; use HasRevisions; use HasSlug; use HasMedias; diff --git a/database/factories/ExperienceFactory.php b/database/factories/ExperienceFactory.php new file mode 100644 index 0000000000..a952b691f0 --- /dev/null +++ b/database/factories/ExperienceFactory.php @@ -0,0 +1,22 @@ + false, + 'interactive_feature_id' => InteractiveFeature::factory(), + 'published' => true, + 'title' => ucfirst(fake()->words(3, asText: true)), + ]; + } +} diff --git a/database/factories/InteractiveFeatureFactory.php b/database/factories/InteractiveFeatureFactory.php new file mode 100644 index 0000000000..da47ef11fd --- /dev/null +++ b/database/factories/InteractiveFeatureFactory.php @@ -0,0 +1,20 @@ + false, + 'published' => true, + 'title' => ucfirst(fake()->words(3, asText: true)), + ]; + } +} diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index f36f48a912..b05360eff6 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -2,7 +2,7 @@ $print = app('printservice')->isPrintMode(); $pClass = 'App\Http\Controllers\GenericPagesController'; if (env('APP_ENV') != 'testing') { - $action = request()->route()->getAction(); + $action = request()->route()?->getAction(); if (is_array($action) && $action['controller']) { $pClass = $action['controller']; } diff --git a/routes/kiosk.php b/routes/kiosk.php index acb19d80ca..428e238605 100644 --- a/routes/kiosk.php +++ b/routes/kiosk.php @@ -9,4 +9,4 @@ )->name('interactiveFeatures.showKiosk'); // Only needed so that the kiosk doesn't fallback to the web routes. -Route::fallback(fn() => null); +Route::fallback(fn() => abort(404)); diff --git a/tests/Feature/KioskTest.php b/tests/Feature/KioskTest.php new file mode 100644 index 0000000000..b21f5b1b7c --- /dev/null +++ b/tests/Feature/KioskTest.php @@ -0,0 +1,43 @@ +markTestIncomplete(); + $experience = Experience::factory()->create(); + $response = $this->get(config('app.kiosk_domain')[0] . "/interactive-features/$experience->slug"); + $response->assertStatus(200); + + $response = $this->get(config('app.kiosk_domain')[0] . '/interactive-features/non-existent-slug'); + $response->assertStatus(404); + } + + public function test_route_on_website_domain_with_kiosk_path(): void + { + $this->markTestIncomplete(); + $experience = Experience::factory()->create(); + $response = $this->get("/interactive-features/kiosk/$experience->slug"); + $response->assertStatus(200); + + $response = $this->get("/interactive-features/kiosk/non-existent-slug"); + $response->assertStatus(404); + } + + public function test_route_on_website(): void + { + $this->markTestIncomplete(); + $experience = Experience::factory()->create(); + $response = $this->get("/interactive-features/$experience->slug"); + $response->assertStatus(200); + + $response = $this->get("/interactive-features/non-existent-slug"); + $response->assertStatus(404); + } +} From 3e149bb43a1dc618b825e8530336933556093e5d Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Fri, 8 Nov 2024 15:44:21 -0600 Subject: [PATCH 290/346] Update digital publication migration to only update medium size image blocks [PUB-285] --- ...gital_publication_article_image_blocks.php | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php b/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php index 63b6234ba0..e23dd1ae10 100644 --- a/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php +++ b/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php @@ -1,32 +1,30 @@ where(column: 'type', operator: 'image') - ->where(column: 'blockable_type', operator: 'digitalPublicationArticles') + $digiPubImageBlocks = Block::where('type', 'image') + ->where('blockable_type', 'digitalPublicationArticles') ->get(); // Update the size in the content JSON column to 'l' foreach ($digiPubImageBlocks as $block) { - $content = json_decode($block->content, associative: true); - - $content['size'] = 'l'; + $content = $block->content; + if ($content['size'] == 'm') { + $content['size'] = 's'; + } $content['use_alt_background'] = true; $content['use_contain'] = true; // Update the block with the new JSON - DB::table(table: 'blocks') - ->where(column: 'id', operator: $block->id) - ->update(values: ['content' => json_encode(value: $content)]); + $block->content = $content; + $block->save(); } } From 195f0894fb5e5a468fe8850fbe08416604f37844 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 1 Nov 2024 16:46:48 -0500 Subject: [PATCH 291/346] Update to the latest version of Sentry Laravel [WEB-2954] --- composer.json | 9 +- composer.lock | 1095 ++++++++----------------------------------------- 2 files changed, 180 insertions(+), 924 deletions(-) diff --git a/composer.json b/composer.json index 658e7127d4..f0fa46dffe 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,12 @@ { "name": "aic/website", "description": "Art Institute of Chicago website – artic.edu", - "keywords": ["website", "museum", "musetech", "art institute of chicago"], + "keywords": [ + "website", + "museum", + "musetech", + "art institute of chicago" + ], "license": "AGPL-3.0-or-later", "type": "project", "repositories": [ @@ -62,7 +67,7 @@ "rlanvin/php-rrule": "^2.0", "salesforce-mc/fuel-sdk-php": "dev-master", "sendgrid/sendgrid": "^8.1", - "sentry/sentry-laravel": "^3.0", + "sentry/sentry-laravel": "^4.9", "spatie/calendar-links": "^1.0", "spatie/laravel-feed": "^4.0", "spatie/laravel-sitemap": "^6.0", diff --git a/composer.lock b/composer.lock index 7cd915695a..632667e5b0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "88847d619228317bb5f01d90db331862", + "content-hash": "c13a1e04af07a01db29d089d834f4067", "packages": [ { "name": "aic/data-hub-foundation", @@ -694,72 +694,6 @@ ], "time": "2024-01-05T23:55:20+00:00" }, - { - "name": "clue/stream-filter", - "version": "v1.6.0", - "source": { - "type": "git", - "url": "https://github.com/clue/stream-filter.git", - "reference": "d6169430c7731d8509da7aecd0af756a5747b78e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/clue/stream-filter/zipball/d6169430c7731d8509da7aecd0af756a5747b78e", - "reference": "d6169430c7731d8509da7aecd0af756a5747b78e", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "Clue\\StreamFilter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering" - } - ], - "description": "A simple and modern approach to stream filtering in PHP", - "homepage": "https://github.com/clue/php-stream-filter", - "keywords": [ - "bucket brigade", - "callback", - "filter", - "php_user_filter", - "stream", - "stream_filter_append", - "stream_filter_register" - ], - "support": { - "issues": "https://github.com/clue/stream-filter/issues", - "source": "https://github.com/clue/stream-filter/tree/v1.6.0" - }, - "funding": [ - { - "url": "https://clue.engineering/support", - "type": "custom" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2022-02-21T13:15:14+00:00" - }, { "name": "composer/pcre", "version": "3.1.0", @@ -2753,64 +2687,6 @@ ], "time": "2021-10-07T12:57:01+00:00" }, - { - "name": "http-interop/http-factory-guzzle", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/http-interop/http-factory-guzzle.git", - "reference": "8f06e92b95405216b237521cc64c804dd44c4a81" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/http-interop/http-factory-guzzle/zipball/8f06e92b95405216b237521cc64c804dd44c4a81", - "reference": "8f06e92b95405216b237521cc64c804dd44c4a81", - "shasum": "" - }, - "require": { - "guzzlehttp/psr7": "^1.7||^2.0", - "php": ">=7.3", - "psr/http-factory": "^1.0" - }, - "provide": { - "psr/http-factory-implementation": "^1.0" - }, - "require-dev": { - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^9.5" - }, - "suggest": { - "guzzlehttp/psr7": "Includes an HTTP factory starting in version 2.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Http\\Factory\\Guzzle\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "An HTTP Factory using Guzzle PSR7", - "keywords": [ - "factory", - "http", - "psr-17", - "psr-7" - ], - "support": { - "issues": "https://github.com/http-interop/http-factory-guzzle/issues", - "source": "https://github.com/http-interop/http-factory-guzzle/tree/1.2.0" - }, - "time": "2021-07-21T13:50:14+00:00" - }, { "name": "imgix/imgix-php", "version": "3.3.1", @@ -5782,123 +5658,117 @@ "time": "2020-10-15T08:29:30+00:00" }, { - "name": "php-http/client-common", - "version": "2.7.0", + "name": "phpoption/phpoption", + "version": "1.9.1", "source": { "type": "git", - "url": "https://github.com/php-http/client-common.git", - "reference": "880509727a447474d2a71b7d7fa5d268ddd3db4b" + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "dd3a383e599f49777d8b628dadbb90cae435b87e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/880509727a447474d2a71b7d7fa5d268ddd3db4b", - "reference": "880509727a447474d2a71b7d7fa5d268ddd3db4b", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dd3a383e599f49777d8b628dadbb90cae435b87e", + "reference": "dd3a383e599f49777d8b628dadbb90cae435b87e", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0", - "php-http/httplug": "^2.0", - "php-http/message": "^1.6", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0 || ^2.0", - "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.17" + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "doctrine/instantiator": "^1.1", - "guzzlehttp/psr7": "^1.4", - "nyholm/psr7": "^1.2", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "phpspec/prophecy": "^1.10.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.7" - }, - "suggest": { - "ext-json": "To detect JSON responses with the ContentTypePlugin", - "ext-libxml": "To detect XML responses with the ContentTypePlugin", - "php-http/cache-plugin": "PSR-6 Cache plugin", - "php-http/logger-plugin": "PSR-3 Logger plugin", - "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.32 || ^9.6.3 || ^10.0.12" }, "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": true + }, + "branch-alias": { + "dev-master": "1.9-dev" + } + }, "autoload": { "psr-4": { - "Http\\Client\\Common\\": "src/" + "PhpOption\\": "src/PhpOption/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "Apache-2.0" ], "authors": [ { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh" + }, + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" } ], - "description": "Common HTTP Client implementations and tools for HTTPlug", - "homepage": "http://httplug.io", + "description": "Option Type for PHP", "keywords": [ - "client", - "common", - "http", - "httplug" + "language", + "option", + "php", + "type" ], "support": { - "issues": "https://github.com/php-http/client-common/issues", - "source": "https://github.com/php-http/client-common/tree/2.7.0" + "issues": "https://github.com/schmittjoh/php-option/issues", + "source": "https://github.com/schmittjoh/php-option/tree/1.9.1" }, - "time": "2023-05-17T06:46:59+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } + ], + "time": "2023-02-25T19:38:58+00:00" }, { - "name": "php-http/discovery", - "version": "1.19.1", + "name": "phpseclib/phpseclib", + "version": "3.0.21", "source": { "type": "git", - "url": "https://github.com/php-http/discovery.git", - "reference": "57f3de01d32085fea20865f9b16fb0e69347c39e" + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "4580645d3fc05c189024eb3b834c6c1e4f0f30a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/57f3de01d32085fea20865f9b16fb0e69347c39e", - "reference": "57f3de01d32085fea20865f9b16fb0e69347c39e", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/4580645d3fc05c189024eb3b834c6c1e4f0f30a1", + "reference": "4580645d3fc05c189024eb3b834c6c1e4f0f30a1", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0|^2.0", - "php": "^7.1 || ^8.0" - }, - "conflict": { - "nyholm/psr7": "<1.0", - "zendframework/zend-diactoros": "*" - }, - "provide": { - "php-http/async-client-implementation": "*", - "php-http/client-implementation": "*", - "psr/http-client-implementation": "*", - "psr/http-factory-implementation": "*", - "psr/http-message-implementation": "*" + "paragonie/constant_time_encoding": "^1|^2", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": ">=5.6.1" }, "require-dev": { - "composer/composer": "^1.0.2|^2.0", - "graham-campbell/phpspec-skip-example-extension": "^5.0", - "php-http/httplug": "^1.0 || ^2.0", - "php-http/message-factory": "^1.0", - "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", - "symfony/phpunit-bridge": "^6.2" + "phpunit/phpunit": "*" }, - "type": "composer-plugin", - "extra": { - "class": "Http\\Discovery\\Composer\\Plugin", - "plugin-optional": true + "suggest": { + "ext-dom": "Install the DOM extension to load XML formatted public keys.", + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." }, + "type": "library", "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], "psr-4": { - "Http\\Discovery\\": "src/" - }, - "exclude-from-classmap": [ - "src/Composer/Plugin.php" - ] + "phpseclib3\\": "phpseclib/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5906,472 +5776,93 @@ ], "authors": [ { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-Jürgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" } ], - "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations", - "homepage": "http://php-http.org", + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "homepage": "http://phpseclib.sourceforge.net", "keywords": [ - "adapter", - "client", - "discovery", - "factory", - "http", - "message", - "psr17", - "psr7" + "BigInteger", + "aes", + "asn.1", + "asn1", + "blowfish", + "crypto", + "cryptography", + "encryption", + "rsa", + "security", + "sftp", + "signature", + "signing", + "ssh", + "twofish", + "x.509", + "x509" ], "support": { - "issues": "https://github.com/php-http/discovery/issues", - "source": "https://github.com/php-http/discovery/tree/1.19.1" + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.21" }, - "time": "2023-07-11T07:02:26+00:00" + "funding": [ + { + "url": "https://github.com/terrafrost", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpseclib", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", + "type": "tidelift" + } + ], + "time": "2023-07-09T15:24:48+00:00" }, { - "name": "php-http/httplug", - "version": "2.4.0", + "name": "pragmarx/google2fa", + "version": "v8.0.1", "source": { "type": "git", - "url": "https://github.com/php-http/httplug.git", - "reference": "625ad742c360c8ac580fcc647a1541d29e257f67" + "url": "https://github.com/antonioribeiro/google2fa.git", + "reference": "80c3d801b31fe165f8fe99ea085e0a37834e1be3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/625ad742c360c8ac580fcc647a1541d29e257f67", - "reference": "625ad742c360c8ac580fcc647a1541d29e257f67", + "url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/80c3d801b31fe165f8fe99ea085e0a37834e1be3", + "reference": "80c3d801b31fe165f8fe99ea085e0a37834e1be3", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0", - "php-http/promise": "^1.1", - "psr/http-client": "^1.0", - "psr/http-message": "^1.0 || ^2.0" + "paragonie/constant_time_encoding": "^1.0|^2.0", + "php": "^7.1|^8.0" }, "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", - "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eric GELOEN", - "email": "geloen.eric@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "description": "HTTPlug, the HTTP client abstraction for PHP", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "http" - ], - "support": { - "issues": "https://github.com/php-http/httplug/issues", - "source": "https://github.com/php-http/httplug/tree/2.4.0" - }, - "time": "2023-04-14T15:10:03+00:00" - }, - { - "name": "php-http/message", - "version": "1.16.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/message.git", - "reference": "47a14338bf4ebd67d317bf1144253d7db4ab55fd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/47a14338bf4ebd67d317bf1144253d7db4ab55fd", - "reference": "47a14338bf4ebd67d317bf1144253d7db4ab55fd", - "shasum": "" - }, - "require": { - "clue/stream-filter": "^1.5", - "php": "^7.2 || ^8.0", - "psr/http-message": "^1.1 || ^2.0" - }, - "provide": { - "php-http/message-factory-implementation": "1.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.6", - "ext-zlib": "*", - "guzzlehttp/psr7": "^1.0 || ^2.0", - "laminas/laminas-diactoros": "^2.0 || ^3.0", - "php-http/message-factory": "^1.0.2", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "slim/slim": "^3.0" - }, - "suggest": { - "ext-zlib": "Used with compressor/decompressor streams", - "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", - "laminas/laminas-diactoros": "Used with Diactoros Factories", - "slim/slim": "Used with Slim Framework PSR-7 implementation" - }, - "type": "library", - "autoload": { - "files": [ - "src/filters.php" - ], - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "HTTP Message related tools", - "homepage": "http://php-http.org", - "keywords": [ - "http", - "message", - "psr-7" - ], - "support": { - "issues": "https://github.com/php-http/message/issues", - "source": "https://github.com/php-http/message/tree/1.16.0" - }, - "time": "2023-05-17T06:43:38+00:00" - }, - { - "name": "php-http/message-factory", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/message-factory.git", - "reference": "4d8778e1c7d405cbb471574821c1ff5b68cc8f57" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message-factory/zipball/4d8778e1c7d405cbb471574821c1ff5b68cc8f57", - "reference": "4d8778e1c7d405cbb471574821c1ff5b68cc8f57", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "psr/http-message": "^1.0 || ^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Factory interfaces for PSR-7 HTTP Message", - "homepage": "http://php-http.org", - "keywords": [ - "factory", - "http", - "message", - "stream", - "uri" - ], - "support": { - "issues": "https://github.com/php-http/message-factory/issues", - "source": "https://github.com/php-http/message-factory/tree/1.1.0" - }, - "abandoned": "psr/http-factory", - "time": "2023-04-14T14:16:17+00:00" - }, - { - "name": "php-http/promise", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/promise.git", - "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", - "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.3.2", - "phpspec/phpspec": "^5.1.2 || ^6.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Joel Wurtz", - "email": "joel.wurtz@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Promise used for asynchronous HTTP requests", - "homepage": "http://httplug.io", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/php-http/promise/issues", - "source": "https://github.com/php-http/promise/tree/1.1.0" - }, - "time": "2020-07-07T09:29:14+00:00" - }, - { - "name": "phpoption/phpoption", - "version": "1.9.1", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/php-option.git", - "reference": "dd3a383e599f49777d8b628dadbb90cae435b87e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dd3a383e599f49777d8b628dadbb90cae435b87e", - "reference": "dd3a383e599f49777d8b628dadbb90cae435b87e", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.32 || ^9.6.3 || ^10.0.12" - }, - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": true - }, - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpOption\\": "src/PhpOption/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh" - }, - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - } - ], - "description": "Option Type for PHP", - "keywords": [ - "language", - "option", - "php", - "type" - ], - "support": { - "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", - "type": "tidelift" - } - ], - "time": "2023-02-25T19:38:58+00:00" - }, - { - "name": "phpseclib/phpseclib", - "version": "3.0.21", - "source": { - "type": "git", - "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "4580645d3fc05c189024eb3b834c6c1e4f0f30a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/4580645d3fc05c189024eb3b834c6c1e4f0f30a1", - "reference": "4580645d3fc05c189024eb3b834c6c1e4f0f30a1", - "shasum": "" - }, - "require": { - "paragonie/constant_time_encoding": "^1|^2", - "paragonie/random_compat": "^1.4|^2.0|^9.99.99", - "php": ">=5.6.1" - }, - "require-dev": { - "phpunit/phpunit": "*" - }, - "suggest": { - "ext-dom": "Install the DOM extension to load XML formatted public keys.", - "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", - "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", - "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", - "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." - }, - "type": "library", - "autoload": { - "files": [ - "phpseclib/bootstrap.php" - ], - "psr-4": { - "phpseclib3\\": "phpseclib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jim Wigginton", - "email": "terrafrost@php.net", - "role": "Lead Developer" - }, - { - "name": "Patrick Monnerat", - "email": "pm@datasphere.ch", - "role": "Developer" - }, - { - "name": "Andreas Fischer", - "email": "bantu@phpbb.com", - "role": "Developer" - }, - { - "name": "Hans-Jürgen Petrich", - "email": "petrich@tronic-media.com", - "role": "Developer" - }, - { - "name": "Graham Campbell", - "email": "graham@alt-three.com", - "role": "Developer" - } - ], - "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", - "homepage": "http://phpseclib.sourceforge.net", - "keywords": [ - "BigInteger", - "aes", - "asn.1", - "asn1", - "blowfish", - "crypto", - "cryptography", - "encryption", - "rsa", - "security", - "sftp", - "signature", - "signing", - "ssh", - "twofish", - "x.509", - "x509" - ], - "support": { - "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.21" - }, - "funding": [ - { - "url": "https://github.com/terrafrost", - "type": "github" - }, - { - "url": "https://www.patreon.com/phpseclib", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", - "type": "tidelift" - } - ], - "time": "2023-07-09T15:24:48+00:00" - }, - { - "name": "pragmarx/google2fa", - "version": "v8.0.1", - "source": { - "type": "git", - "url": "https://github.com/antonioribeiro/google2fa.git", - "reference": "80c3d801b31fe165f8fe99ea085e0a37834e1be3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/80c3d801b31fe165f8fe99ea085e0a37834e1be3", - "reference": "80c3d801b31fe165f8fe99ea085e0a37834e1be3", - "shasum": "" - }, - "require": { - "paragonie/constant_time_encoding": "^1.0|^2.0", - "php": "^7.1|^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.18", - "phpunit/phpunit": "^7.5.15|^8.5|^9.0" + "phpstan/phpstan": "^0.12.18", + "phpunit/phpunit": "^7.5.15|^8.5|^9.0" }, "type": "library", "autoload": { @@ -7623,112 +7114,42 @@ }, "time": "2023-12-06T07:11:08+00:00" }, - { - "name": "sentry/sdk", - "version": "3.5.0", - "source": { - "type": "git", - "url": "https://github.com/getsentry/sentry-php-sdk.git", - "reference": "cd91b752f07c4bab9fb3b173f81af68a78a78d6d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php-sdk/zipball/cd91b752f07c4bab9fb3b173f81af68a78a78d6d", - "reference": "cd91b752f07c4bab9fb3b173f81af68a78a78d6d", - "shasum": "" - }, - "require": { - "http-interop/http-factory-guzzle": "^1.0", - "sentry/sentry": "^3.19", - "symfony/http-client": "^4.3|^5.0|^6.0" - }, - "type": "metapackage", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Sentry", - "email": "accounts@sentry.io" - } - ], - "description": "This is a metapackage shipping sentry/sentry with a recommended HTTP client.", - "homepage": "http://sentry.io", - "keywords": [ - "crash-reporting", - "crash-reports", - "error-handler", - "error-monitoring", - "log", - "logging", - "sentry" - ], - "support": { - "issues": "https://github.com/getsentry/sentry-php-sdk/issues", - "source": "https://github.com/getsentry/sentry-php-sdk/tree/3.5.0" - }, - "funding": [ - { - "url": "https://sentry.io/", - "type": "custom" - }, - { - "url": "https://sentry.io/pricing/", - "type": "custom" - } - ], - "time": "2023-06-12T17:50:36+00:00" - }, { "name": "sentry/sentry", - "version": "3.21.0", + "version": "4.9.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "624aafc22b84b089ffa43b71fb01e0096505ec4f" + "reference": "788ec170f51ebb22f2809a1e3f78b19ccd39b70d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/624aafc22b84b089ffa43b71fb01e0096505ec4f", - "reference": "624aafc22b84b089ffa43b71fb01e0096505ec4f", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/788ec170f51ebb22f2809a1e3f78b19ccd39b70d", + "reference": "788ec170f51ebb22f2809a1e3f78b19ccd39b70d", "shasum": "" }, "require": { + "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/promises": "^1.5.3|^2.0", + "guzzlehttp/psr7": "^1.8.4|^2.1.1", "jean85/pretty-package-versions": "^1.5|^2.0.4", "php": "^7.2|^8.0", - "php-http/async-client-implementation": "^1.0", - "php-http/client-common": "^1.5|^2.0", - "php-http/discovery": "^1.15", - "php-http/httplug": "^1.1|^2.0", - "php-http/message": "^1.5", - "php-http/message-factory": "^1.1", - "psr/http-factory": "^1.0", - "psr/http-factory-implementation": "^1.0", "psr/log": "^1.0|^2.0|^3.0", - "symfony/options-resolver": "^3.4.43|^4.4.30|^5.0.11|^6.0", - "symfony/polyfill-php80": "^1.17" + "symfony/options-resolver": "^4.4.30|^5.0.11|^6.0|^7.0" }, "conflict": { - "php-http/client-common": "1.8.0", "raven/raven": "*" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.19|3.4.*", + "friendsofphp/php-cs-fixer": "^3.4", + "guzzlehttp/promises": "^1.0|^2.0", "guzzlehttp/psr7": "^1.8.4|^2.1.1", - "http-interop/http-factory-guzzle": "^1.0", "monolog/monolog": "^1.6|^2.0|^3.0", - "nikic/php-parser": "^4.10.3", - "php-http/mock-client": "^1.3", "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.3", - "phpstan/phpstan-phpunit": "^1.0", "phpunit/phpunit": "^8.5.14|^9.4", - "symfony/phpunit-bridge": "^5.2|^6.0", + "symfony/phpunit-bridge": "^5.2|^6.0|^7.0", "vimeo/psalm": "^4.17" }, "suggest": { @@ -7753,7 +7174,7 @@ "email": "accounts@sentry.io" } ], - "description": "A PHP SDK for Sentry (http://sentry.io)", + "description": "PHP SDK for Sentry (http://sentry.io)", "homepage": "http://sentry.io", "keywords": [ "crash-reporting", @@ -7762,11 +7183,13 @@ "error-monitoring", "log", "logging", - "sentry" + "profiling", + "sentry", + "tracing" ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/3.21.0" + "source": "https://github.com/getsentry/sentry-php/tree/4.9.0" }, "funding": [ { @@ -7778,46 +7201,42 @@ "type": "custom" } ], - "time": "2023-07-31T15:31:24+00:00" + "time": "2024-08-08T14:40:50+00:00" }, { "name": "sentry/sentry-laravel", - "version": "3.7.3", + "version": "4.9.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-laravel.git", - "reference": "2aee4ad217be8ef04ffcde6e9f7dd17af5a3b0bf" + "reference": "73078e1f26d57f7a10e3bee2a2f543a02f6493c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/2aee4ad217be8ef04ffcde6e9f7dd17af5a3b0bf", - "reference": "2aee4ad217be8ef04ffcde6e9f7dd17af5a3b0bf", + "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/73078e1f26d57f7a10e3bee2a2f543a02f6493c3", + "reference": "73078e1f26d57f7a10e3bee2a2f543a02f6493c3", "shasum": "" }, "require": { - "illuminate/support": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", + "illuminate/support": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0", "nyholm/psr7": "^1.0", "php": "^7.2 | ^8.0", - "sentry/sdk": "^3.4", - "sentry/sentry": "^3.20.1", - "symfony/psr-http-message-bridge": "^1.0 | ^2.0" + "sentry/sentry": "^4.9", + "symfony/psr-http-message-bridge": "^1.0 | ^2.0 | ^6.0 | ^7.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.11", - "laravel/framework": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", + "guzzlehttp/guzzle": "^7.2", + "laravel/folio": "^1.1", + "laravel/framework": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0", + "livewire/livewire": "^2.0 | ^3.0", "mockery/mockery": "^1.3", - "orchestra/testbench": "^4.7 | ^5.1 | ^6.0 | ^7.0 | ^8.0", + "orchestra/testbench": "^4.7 | ^5.1 | ^6.0 | ^7.0 | ^8.0 | ^9.0", "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^8.4 | ^9.3" + "phpunit/phpunit": "^8.4 | ^9.3 | ^10.4" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "3.x-dev", - "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev", - "dev-0.x": "0.x-dev" - }, "laravel": { "providers": [ "Sentry\\Laravel\\ServiceProvider", @@ -7853,11 +7272,13 @@ "laravel", "log", "logging", - "sentry" + "profiling", + "sentry", + "tracing" ], "support": { "issues": "https://github.com/getsentry/sentry-laravel/issues", - "source": "https://github.com/getsentry/sentry-laravel/tree/3.7.3" + "source": "https://github.com/getsentry/sentry-laravel/tree/4.9.0" }, "funding": [ { @@ -7869,7 +7290,7 @@ "type": "custom" } ], - "time": "2023-08-03T10:10:23+00:00" + "time": "2024-09-19T12:58:53+00:00" }, { "name": "spatie/browsershot", @@ -9685,176 +9106,6 @@ ], "time": "2023-07-31T08:31:44+00:00" }, - { - "name": "symfony/http-client", - "version": "v6.3.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-client.git", - "reference": "15f9f4bad62bfcbe48b5dedd866f04a08fc7ff00" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/15f9f4bad62bfcbe48b5dedd866f04a08fc7ff00", - "reference": "15f9f4bad62bfcbe48b5dedd866f04a08fc7ff00", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/log": "^1|^2|^3", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-client-contracts": "^3", - "symfony/service-contracts": "^2.5|^3" - }, - "conflict": { - "php-http/discovery": "<1.15", - "symfony/http-foundation": "<6.3" - }, - "provide": { - "php-http/async-client-implementation": "*", - "php-http/client-implementation": "*", - "psr/http-client-implementation": "1.0", - "symfony/http-client-implementation": "3.0" - }, - "require-dev": { - "amphp/amp": "^2.5", - "amphp/http-client": "^4.2.1", - "amphp/http-tunnel": "^1.0", - "amphp/socket": "^1.1", - "guzzlehttp/promises": "^1.4", - "nyholm/psr7": "^1.0", - "php-http/httplug": "^1.0|^2.0", - "psr/http-client": "^1.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/stopwatch": "^5.4|^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpClient\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", - "homepage": "https://symfony.com", - "keywords": [ - "http" - ], - "support": { - "source": "https://github.com/symfony/http-client/tree/v6.3.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-07-05T08:41:27+00:00" - }, - { - "name": "symfony/http-client-contracts", - "version": "v3.3.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "3b66325d0176b4ec826bffab57c9037d759c31fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/3b66325d0176b4ec826bffab57c9037d759c31fb", - "reference": "3b66325d0176b4ec826bffab57c9037d759c31fb", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\HttpClient\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to HTTP clients", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v3.3.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-05-23T14:45:45+00:00" - }, { "name": "symfony/http-foundation", "version": "v6.3.2", @@ -15577,6 +14828,6 @@ "platform": { "php": "^8.1" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.6.0" } From 04d752ce9eecb161825453ecbdcc0b04258332a4 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Fri, 8 Nov 2024 15:45:16 -0600 Subject: [PATCH 292/346] Reduce size of image and image caption for small size in digital publication [PUB-285] --- frontend/scss/pages/_p-issuearticle-show.scss | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 2c9f9aec2c..fd32164431 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -414,7 +414,7 @@ img { position: relative !important; - max-height: 450px !important; + max-height: 225px !important; width: 100% !important; object-fit: contain !important; display: block !important; @@ -422,6 +422,25 @@ } } + .m-media--s.o-blocks__block figcaption { + @include breakpoint('xsmall') { + padding-right: 0; + width: 100%; + } + @include breakpoint('small') { + padding-right: 0; + width: colspan(52, 'small'); + } + @include breakpoint('medium') { + width: colspan(38, 'medium'); + } + @include breakpoint('large') { + width: colspan(28, 'large'); + } + @include breakpoint('xlarge') { + width: colspan(25, 'xlarge'); + } + } .m-media.o-blocks__block .m-media__img img { margin-left: 0; From 7a310d7e1ef833720ddfb658774610e66913464b Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 7 Nov 2024 16:58:03 -0600 Subject: [PATCH 293/346] Update the sentry config to the lastest [WEB-2954] --- config/sentry.php | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/config/sentry.php b/config/sentry.php index 6900bb1102..b377e840d7 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -11,6 +11,12 @@ // @see https://docs.sentry.io/product/sentry-basics/dsn-explainer/ 'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')), + // @see https://spotlightjs.com/ + // 'spotlight' => env('SENTRY_SPOTLIGHT', false), + + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#logger + // 'logger' => Sentry\Logger\DebugFileLogger::class, // By default this will log to `storage_path('logs/sentry.log')` + // The release version of your application // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) 'release' => trim(exec('git log --pretty="%h" -n1 HEAD')), @@ -19,20 +25,29 @@ 'environment' => env('SENTRY_ENVIRONMENT'), // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#sample-rate - 'sample_rate' => env('SENTRY_SAMPLE_RATE') === null ? 1.0 : (float)env('SENTRY_SAMPLE_RATE'), + 'sample_rate' => env('SENTRY_SAMPLE_RATE') === null ? 1.0 : (float) env('SENTRY_SAMPLE_RATE'), // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#traces-sample-rate - 'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_TRACES_SAMPLE_RATE'), + 'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float) env('SENTRY_TRACES_SAMPLE_RATE'), // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#profiles-sample-rate - 'profiles_sample_rate' => env('SENTRY_PROFILES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_PROFILES_SAMPLE_RATE'), + 'profiles_sample_rate' => env('SENTRY_PROFILES_SAMPLE_RATE') === null ? null : (float) env('SENTRY_PROFILES_SAMPLE_RATE'), // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#send-default-pii 'send_default_pii' => env('SENTRY_SEND_DEFAULT_PII', false), + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#ignore-exceptions + // 'ignore_exceptions' => [], + + // @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#ignore-transactions + 'ignore_transactions' => [ + // Ignore Laravel's default health URL + '/up', + ], + // Breadcrumb specific configuration 'breadcrumbs' => [ - // Capture Laravel logs in breadcrumbs + // Capture Laravel logs as breadcrumbs 'logs' => env('SENTRY_BREADCRUMBS_LOGS_ENABLED', true), // Capture Laravel cache events (hits, writes etc.) as breadcrumbs @@ -55,12 +70,15 @@ // Capture HTTP client request information as breadcrumbs 'http_client_requests' => env('SENTRY_BREADCRUMBS_HTTP_CLIENT_REQUESTS_ENABLED', true), + + // Capture send notifications as breadcrumbs + 'notifications' => env('SENTRY_BREADCRUMBS_NOTIFICATIONS_ENABLED', true), ], // Performance monitoring specific configuration 'tracing' => [ // Trace queue jobs as their own transactions (this enables tracing for queue jobs) - 'queue_job_transactions' => env('SENTRY_TRACE_QUEUE_ENABLED', false), + 'queue_job_transactions' => env('SENTRY_TRACE_QUEUE_ENABLED', true), // Capture queue jobs as spans when executed on the sync driver 'queue_jobs' => env('SENTRY_TRACE_QUEUE_JOBS_ENABLED', true), @@ -68,9 +86,15 @@ // Capture SQL queries as spans 'sql_queries' => env('SENTRY_TRACE_SQL_QUERIES_ENABLED', true), + // Capture SQL query bindings (parameters) in SQL query spans + 'sql_bindings' => env('SENTRY_TRACE_SQL_BINDINGS_ENABLED', false), + // Capture where the SQL query originated from on the SQL query spans 'sql_origin' => env('SENTRY_TRACE_SQL_ORIGIN_ENABLED', true), + // Define a threshold in milliseconds for SQL queries to resolve their origin + 'sql_origin_threshold_ms' => env('SENTRY_TRACE_SQL_ORIGIN_THRESHOLD_MS', 100), + // Capture views rendered as spans 'views' => env('SENTRY_TRACE_VIEWS_ENABLED', true), @@ -80,12 +104,18 @@ // Capture HTTP client requests as spans 'http_client_requests' => env('SENTRY_TRACE_HTTP_CLIENT_REQUESTS_ENABLED', true), + // Capture Laravel cache events (hits, writes etc.) as spans + 'cache' => env('SENTRY_TRACE_CACHE_ENABLED', true), + // Capture Redis operations as spans (this enables Redis events in Laravel) 'redis_commands' => env('SENTRY_TRACE_REDIS_COMMANDS', false), // Capture where the Redis command originated from on the Redis command spans 'redis_origin' => env('SENTRY_TRACE_REDIS_ORIGIN_ENABLED', true), + // Capture send notifications as spans + 'notifications' => env('SENTRY_TRACE_NOTIFICATIONS_ENABLED', true), + // Enable tracing for requests without a matching route (404's) 'missing_routes' => env('SENTRY_TRACE_MISSING_ROUTES_ENABLED', false), From e86fc3f132d7de2a12c91ed37bb0ee2030fb7411 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Fri, 8 Nov 2024 17:18:17 -0600 Subject: [PATCH 294/346] Update comment [PUB-285] --- ...8_114028_update_digital_publication_article_image_blocks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php b/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php index e23dd1ae10..45c15a1d1e 100644 --- a/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php +++ b/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php @@ -13,7 +13,7 @@ public function up(): void ->where('blockable_type', 'digitalPublicationArticles') ->get(); - // Update the size in the content JSON column to 'l' + // Update the content JSON column for image block on digital publication articles foreach ($digiPubImageBlocks as $block) { $content = $block->content; if ($content['size'] == 'm') { From 1dd48c4f6650cd82bc32d913c8abfcb9041c634e Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 12 Nov 2024 12:19:06 -0600 Subject: [PATCH 295/346] Update line height and spacer [PUB-284] --- frontend/scss/molecules/_m-article-header.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/scss/molecules/_m-article-header.scss b/frontend/scss/molecules/_m-article-header.scss index 62830d8f5b..60837089df 100644 --- a/frontend/scss/molecules/_m-article-header.scss +++ b/frontend/scss/molecules/_m-article-header.scss @@ -1360,8 +1360,8 @@ margin-bottom: auto; margin-top: auto; opacity: 1; - font-size: 26px; - line-height: 24px; + font-size: 26px !important; + line-height: 28px !important; } .m-article-header__text .subtitle { @@ -1385,7 +1385,7 @@ &.p-digitalpublications-show { .m-article-header__spacer { - height: 75vh; + height: 58vh; } } From 28c166da910dc99dc8c12e889556e16d8862f39f Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 12 Nov 2024 12:19:35 -0600 Subject: [PATCH 296/346] Adjust space between entries [PUB-284] --- frontend/scss/molecules/_m-listing.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/scss/molecules/_m-listing.scss b/frontend/scss/molecules/_m-listing.scss index 7e77cc62d5..129f91730d 100644 --- a/frontend/scss/molecules/_m-listing.scss +++ b/frontend/scss/molecules/_m-listing.scss @@ -2300,7 +2300,7 @@ a:focus:hover .btn--magazine { } .m-listing__meta { - min-height: 76px; + min-height: 70px; } .type { From f33ff1814fa8e978c7ac1c00e48027ad8afc39d1 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Mon, 11 Nov 2024 10:04:23 -0600 Subject: [PATCH 297/346] Do not allow date_display_override to affect is closing soon [WEB-2923] --- app/Models/Api/Exhibition.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/Models/Api/Exhibition.php b/app/Models/Api/Exhibition.php index 5afd146c93..a15f74613f 100644 --- a/app/Models/Api/Exhibition.php +++ b/app/Models/Api/Exhibition.php @@ -136,11 +136,6 @@ public function getDateEndAttribute() public function getIsClosingSoonAttribute() { - // If the start and end dates are overriden, don't consider this exhibition as closing soon - if ($this->date_display_override) { - return false; - } - if (!empty($this->dateEnd)) { if (empty($this->dateStart) || Carbon::now()->gt($this->dateStart->endOfDay())) { return Carbon::now()->between($this->dateEnd->endOfDay()->subWeeks(2), $this->dateEnd->endOfDay()); From e197d2c79af0dcd3178ae42674544391928665e7 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Mon, 11 Nov 2024 09:44:33 -0600 Subject: [PATCH 298/346] Apply height restriciton only to small-size digital publication images [PUB-285] --- frontend/scss/pages/_p-issuearticle-show.scss | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index fd32164431..5174cc8987 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -414,7 +414,7 @@ img { position: relative !important; - max-height: 225px !important; + max-height: 450px !important; width: 100% !important; object-fit: contain !important; display: block !important; @@ -422,6 +422,14 @@ } } + .m-media--s.o-blocks__block { + .m-media__img { + img { + max-height: 225px !important; + } + } + } + .m-media--s.o-blocks__block figcaption { @include breakpoint('xsmall') { padding-right: 0; From 45edf2a42f6754f4592e3b6839f8b3c182ae8c43 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 12 Nov 2024 12:20:03 -0600 Subject: [PATCH 299/346] Prevent HR's from rendering if intro isn't present [PUB-284] --- frontend/scss/pages/_p-issue-show.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/scss/pages/_p-issue-show.scss b/frontend/scss/pages/_p-issue-show.scss index 8a79742a4a..9f434c5a64 100644 --- a/frontend/scss/pages/_p-issue-show.scss +++ b/frontend/scss/pages/_p-issue-show.scss @@ -103,6 +103,10 @@ top: -40px; height: calc(100% + 40px); } + + .o-article__body > .m-title-bar:first-of-type:not(:has(+ .m-showcase, + .o-issue__intro))::before { + content: none; + } } .p-digitalpublications-showlisting { From d63d3a3652eda9ff60db7e8ea5c824f60e629b5f Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 5 Nov 2024 09:29:46 -0600 Subject: [PATCH 300/346] Refactor and redesign magazine issue archive [WB-2919] --- .../Controllers/MagazineIssueController.php | 28 +++++++++---- frontend/js/behaviors/core/stickySidebar.js | 9 +--- frontend/scss/organisms/_o-accordion.scss | 6 ++- .../_o-article__primary-actions.scss | 15 ++++++- frontend/scss/setup/_colors.scss | 1 + frontend/scss/themes/_magazine.scss | 4 ++ ...rticle-actions----magazine-issue.blade.php | 35 ++++------------ .../organisms/_o-accordion-tree.blade.php | 42 +++++++++++++++++++ 8 files changed, 92 insertions(+), 48 deletions(-) create mode 100644 frontend/scss/themes/_magazine.scss create mode 100644 resources/views/components/organisms/_o-accordion-tree.blade.php diff --git a/app/Http/Controllers/MagazineIssueController.php b/app/Http/Controllers/MagazineIssueController.php index a90912d0f6..fd94dfdb14 100644 --- a/app/Http/Controllers/MagazineIssueController.php +++ b/app/Http/Controllers/MagazineIssueController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\Repositories\MagazineIssueRepository; +use Illuminate\Support\Carbon; class MagazineIssueController extends FrontController { @@ -24,13 +25,7 @@ public function latest() public function show($id, $slug = null, $isRequestForLatest = false) { - $issues = $this->repository->published()->ordered()->get(); - $item = $issues->where('id', (int) $id)->first(); - - if (!$item) { - abort(404); - } - + $item = $this->repository->findOrFail($id); $canonicalPath = route('magazine-issues.show', ['id' => $item->id, 'slug' => $item->getSlug()]); if (!$isRequestForLatest) { @@ -43,11 +38,28 @@ public function show($id, $slug = null, $isRequestForLatest = false) $this->seo->setDescription($item->meta_description ?: $item->list_description); // Issues have no blocks $this->seo->setImage($item->imageFront('hero')); + $issuesByYear = $this->repository + ->published() + ->ordered() + ->get() + ->mapToGroups(function ($issue) { + $year = (new Carbon($issue->publish_start_date))->year; + return [$year => $issue]; + }); + $issueArchive = ['title' => 'Archive', 'items' => []]; + foreach ($issuesByYear as $year => $yearIssues) { + $byYear = ['title' => (string)$year]; + foreach ($yearIssues as $issue) { + $byYear['items'][] = ['title' => $issue->title, 'url' => route('magazine-issues.show', [$issue])]; + } + $issueArchive['items'][] = $byYear; + } + return view('site.magazineIssueDetail', [ 'item' => $item, 'contrastHeader' => false, 'borderlessHeader' => false, - 'issues' => $issues, + 'issues' => [$issueArchive], 'welcomeNote' => $this->repository->getWelcomeNote($item), 'canonicalUrl' => $canonicalPath, ]); diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index 0045031e3c..03d2afdb85 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -68,7 +68,7 @@ const stickySidebar = function(container){ navContainer = document.querySelector('.g-header'); stickyHeaderContainer = document.querySelector('.m-article-header'); - // `containerToo` is caluclated in the `handleResize` method + // `containerTop` is caluclated in the `handleResize` method if (scrollTop < containerTop - (document.documentElement.classList.contains('s-sticky-digital-publication-header') ? stickyHeaderContainer.clientHeight : 0)) { top(); container.style.marginTop = '0px'; @@ -77,13 +77,6 @@ const stickySidebar = function(container){ bottom(); } else { sticky(); - - // Only add margin if the screen width is 1200px or above - if (window.innerWidth >= 1200) { - container.style.marginTop = (document.documentElement.classList.contains('p-digitalpublicationarticle-show') ? 0 : (!document.documentElement.classList.contains('s-unsticky-header') ? navContainer.clientHeight : 0) + (!document.documentElement.classList.contains('s-unsticky-digital-publication-header') ? stickyHeaderContainer.clientHeight : 0)) + 'px'; - } else { - container.style.marginTop = '0px'; - } } } } diff --git a/frontend/scss/organisms/_o-accordion.scss b/frontend/scss/organisms/_o-accordion.scss index f4e0cf7453..e32e6f68a5 100644 --- a/frontend/scss/organisms/_o-accordion.scss +++ b/frontend/scss/organisms/_o-accordion.scss @@ -390,7 +390,8 @@ margin-bottom: 48px; } -.o-accordion.o-accordion--publication-sidebar { +.o-accordion.o-accordion--publication-sidebar, +.o-accordion.o-accordion--magazine-issue-archive { h3 { padding: 1px 0 0 0; @@ -414,7 +415,8 @@ } } - .o-accordion__panel > .o-accordion--publication-sidebar { + .o-accordion__panel > .o-accordion--publication-sidebar, + .o-accordion__panel > .o-accordion.o-accordion--magazine-issue-archive { padding-left: 20px; &:last-of-type { padding-bottom: 20px; diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index 33cbd9ce12..1dff047778 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -401,9 +401,20 @@ } } - #h-nav-magazine-social { + button#archive { + color: $color__magazine__byzantium !important; + + .o-accordion__trigger-icon { + color: $color__black__90; + } + } + + #h-nav-magazine-social, + hr+.o-accordion .o-accordion>.o-accordion__title>.o-accordion__trigger { + color: $color__black--90 !important; + font-family: $sans-serif-font--loaded; + font-size: 17px; font-weight: 400; - color: $color__black--90; } } diff --git a/frontend/scss/setup/_colors.scss b/frontend/scss/setup/_colors.scss index e2f9063ed4..92759bd636 100755 --- a/frontend/scss/setup/_colors.scss +++ b/frontend/scss/setup/_colors.scss @@ -1,4 +1,5 @@ @import '../themes/rlc'; +@import '../themes/magazine'; // Main Color List - try not to use // Reds diff --git a/frontend/scss/themes/_magazine.scss b/frontend/scss/themes/_magazine.scss new file mode 100644 index 0000000000..5b9a4955fc --- /dev/null +++ b/frontend/scss/themes/_magazine.scss @@ -0,0 +1,4 @@ +// Magazine Issue color list +// Color names are taken from https://www.color-name.com/. + +$color__magazine__byzantium: #6F2562; diff --git a/resources/views/components/molecules/_m-article-actions----magazine-issue.blade.php b/resources/views/components/molecules/_m-article-actions----magazine-issue.blade.php index 3e0f77a856..21de3b8031 100644 --- a/resources/views/components/molecules/_m-article-actions----magazine-issue.blade.php +++ b/resources/views/components/molecules/_m-article-actions----magazine-issue.blade.php @@ -26,35 +26,14 @@
- @if (isset($issues) && $issues->count() > 1) + @if (isset($issues))
- -
    - @foreach($issues as $issue) -
  • - @component('components.atoms._tag') - @slot('href', route('magazine-issues.show', [ - 'id' => $issue->id, - 'slug' => $issue->getSlug(), - ])) - @slot('variation', 'tag--magazine tag--senary tag--w-image') - @slot('gtmAttributes', 'data-gtm-event="' . StringHelpers::getUtf8Slug( $issue->title ) . '" data-gtm-event-category="magazine-sidebar-issue"') - @if (!empty($issue->imageFront('hero', 'default'))) - @component('components.atoms._img') - @slot('image', $issue->imageFront('hero', 'default')) - @slot('settings', array( - 'fit' => 'crop', - 'ratio' => '1:1', - 'srcset' => array(30,60), - 'sizes' => '60px', - )) - @endcomponent - @endif - {!! $issue->present()->title !!} - @endcomponent -
  • - @endforeach -
+ @component('components.organisms._o-accordion-tree') + @slot('variation', 'o-accordion--magazine-issue-archive') + @slot('titleFont', 'f-tag-2') + @slot('items', $issues) + @slot('active', true) + @endcomponent @endif
diff --git a/resources/views/components/organisms/_o-accordion-tree.blade.php b/resources/views/components/organisms/_o-accordion-tree.blade.php new file mode 100644 index 0000000000..d98ccb2d6b --- /dev/null +++ b/resources/views/components/organisms/_o-accordion-tree.blade.php @@ -0,0 +1,42 @@ +
From 1466402093a26c9e5eafd167a35c719cba745890 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:04:03 -0600 Subject: [PATCH 301/346] Remove margin from grid listings on digipubs [PUB-284]] --- frontend/scss/molecules/_m-listing.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/scss/molecules/_m-listing.scss b/frontend/scss/molecules/_m-listing.scss index 129f91730d..cfe83f065d 100644 --- a/frontend/scss/molecules/_m-listing.scss +++ b/frontend/scss/molecules/_m-listing.scss @@ -2229,7 +2229,6 @@ a:focus:hover .btn--magazine { @include breakpoint('small+') { width: colspan(58, small) !important; margin-left: colspan(2, small) !important; - margin-top: colspan(map-get($grid-padding-tops, 'small'), 'small') !important; } @include breakpoint('medium+') { From 2d85f448725546e79ce6c82f5f63128e1e6a9450 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 7 Nov 2024 16:28:25 -0600 Subject: [PATCH 302/346] Add comment to template about expected data structure [WEB-2919] --- .../organisms/_o-accordion-tree.blade.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/resources/views/components/organisms/_o-accordion-tree.blade.php b/resources/views/components/organisms/_o-accordion-tree.blade.php index d98ccb2d6b..435058466b 100644 --- a/resources/views/components/organisms/_o-accordion-tree.blade.php +++ b/resources/views/components/organisms/_o-accordion-tree.blade.php @@ -1,3 +1,26 @@ +{{-- + Expects $items to be in the format: + [ + [ + 'title' => 'Level 1 title', + 'items' => [ + [ + 'title' => 'Level 2 title', + 'items' => [ + [ + 'title' => 'Level 3 item', + 'url' => 'https://some.link', + ], + [ + 'title' => 'Another level 3 item', + 'url' => 'https://some-other.link', + ] + ] + ], + ], + ] + ] +--}}
@foreach ($items as $item) @if (isset($item['items']) && count($item['items']) > 0) From b8a4d9b16291bef48195dc8b200a504822459f2b Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:04:18 -0600 Subject: [PATCH 303/346] Remove min-height from meta of listings [PUB-284] --- frontend/scss/molecules/_m-listing.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/scss/molecules/_m-listing.scss b/frontend/scss/molecules/_m-listing.scss index cfe83f065d..2abd85bb0e 100644 --- a/frontend/scss/molecules/_m-listing.scss +++ b/frontend/scss/molecules/_m-listing.scss @@ -2299,7 +2299,7 @@ a:focus:hover .btn--magazine { } .m-listing__meta { - min-height: 70px; + min-height: unset; } .type { From 543207af03a8d2b7be24ad972c409bc2b285c3ec Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 12 Nov 2024 14:56:47 -0600 Subject: [PATCH 304/346] Move sidebar under content on medium- screens [WEB-2919] --- .../_o-article__primary-actions.scss | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/frontend/scss/organisms/_o-article__primary-actions.scss b/frontend/scss/organisms/_o-article__primary-actions.scss index 1dff047778..d18e63ba60 100644 --- a/frontend/scss/organisms/_o-article__primary-actions.scss +++ b/frontend/scss/organisms/_o-article__primary-actions.scss @@ -388,6 +388,25 @@ } // Styles specific to magazine issues: +.p-magazineissue-latest, +.p-magazineissue-show { + @include breakpoint('medium-') { + .o-article { + display: flex; + flex-direction: column; + + &>.m-article-header { + order: 1; + } + &>.o-article__primary-actions { + order: 3; + } + &>.o-article__body { + order: 2; + } + } + } +} .o-article__primary-actions--magazine-issue { .o-sticky-sidebar__sticker { padding-top: 100px; From 3ee17ac7af26ba37a6b04a6b0da3c3d191429523 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:04:31 -0600 Subject: [PATCH 305/346] Update title bar HR and margin logic [PUB-284] --- frontend/scss/pages/_p-issue-show.scss | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/scss/pages/_p-issue-show.scss b/frontend/scss/pages/_p-issue-show.scss index 9f434c5a64..d6376bf200 100644 --- a/frontend/scss/pages/_p-issue-show.scss +++ b/frontend/scss/pages/_p-issue-show.scss @@ -104,8 +104,16 @@ height: calc(100% + 40px); } - .o-article__body > .m-title-bar:first-of-type:not(:has(+ .m-showcase, + .o-issue__intro))::before { - content: none; + .o-article__body > .m-title-bar { + margin-top: 55px; + } + + .o-article__body > .m-title-bar:first-of-type:not(:has(+ .m-showcase, + .o-issue__intro)) { + margin-top: 36px !important; + + &::before { + content: none; + } } } From 2b6c8fd864f31bcbc237ace97a9d7656c05e0918 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 13 Nov 2024 12:13:28 -0600 Subject: [PATCH 306/346] Only provide `s` and `l` option on digital publication article image blocks [PUB-285] --- resources/views/admin/blocks/image.blade.php | 33 +++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/resources/views/admin/blocks/image.blade.php b/resources/views/admin/blocks/image.blade.php index eb31df8265..e8ca98190f 100644 --- a/resources/views/admin/blocks/image.blade.php +++ b/resources/views/admin/blocks/image.blade.php @@ -1,6 +1,23 @@ @php $currentUrl = explode('/', request()->url()); $type = $currentUrl[5] ?? null; + $options = []; + $options[] = [ + 'value' => 's', + 'label' => 'Small' + ]; + + if ($type !== 'digitalPublications') { // replace $condition with your actual condition + $options[] = [ + 'value' => 'm', + 'label' => 'Medium' + ]; + } + + $options[] = [ + 'value' => 'l', + 'label' => 'Large' + ]; @endphp @twillBlockTitle('Image') @@ -19,21 +36,7 @@ 'label' => 'Size', 'placeholder' => 'Select size', 'default' => ($type === 'digitalPublications' ? 'l' : 'm'), - 'disabled' => ($type === 'digitalPublications' ? true : false), - 'options' => [ - [ - 'value' => 's', - 'label' => 'Small' - ], - [ - 'value' => 'm', - 'label' => 'Medium' - ], - [ - 'value' => 'l', - 'label' => 'Large' - ] - ] + 'options' => $options, ]) @formField('checkbox', [ From cd4cd70b9186d4eaf2dbf4b1dee6db76c75426cf Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 12 Nov 2024 15:08:30 -0600 Subject: [PATCH 307/346] Remove unnecessary
[WEB-2919] --- .../molecules/_m-article-actions----magazine-issue.blade.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/views/components/molecules/_m-article-actions----magazine-issue.blade.php b/resources/views/components/molecules/_m-article-actions----magazine-issue.blade.php index 21de3b8031..26de10a32e 100644 --- a/resources/views/components/molecules/_m-article-actions----magazine-issue.blade.php +++ b/resources/views/components/molecules/_m-article-actions----magazine-issue.blade.php @@ -36,8 +36,6 @@ @endcomponent @endif -
-
From 7a119246872d431cc1c52155509cc9a4e542a58f Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:10:33 -0600 Subject: [PATCH 308/346] Use null safe check of datahub_id on apiRelationElement [WEB-2959] --- app/Models/Behaviors/HasApiRelations.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Models/Behaviors/HasApiRelations.php b/app/Models/Behaviors/HasApiRelations.php index 3ba4ceaa5e..ae6dc067dd 100644 --- a/app/Models/Behaviors/HasApiRelations.php +++ b/app/Models/Behaviors/HasApiRelations.php @@ -106,8 +106,11 @@ public function getLocalApiMapping($items, $apiElements) { // Find locally selected objects return $items->filter(function ($relatedElement) use ($apiElements) { - $apiRelationElement = \App\Models\ApiRelation::where('id', $relatedElement->related_id)->first(); - $result = $apiElements->where('id', $apiRelationElement->datahub_id)->first(); + $apiRelationElement = \App\Models\ApiRelation::where('id', $relatedElement->related_id) + ->first() + ?->datahub_id; + + $result = $apiElements->where('id', $apiRelationElement)->first(); if ($result) { $result->position = $relatedElement->position; From 90232e1f334d7eef351c11a505354b34e46141c2 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 13 Nov 2024 12:13:55 -0600 Subject: [PATCH 309/346] Default all media blocks to size `large` and disable the size field for digital publication articles [PUB-285] --- resources/views/admin/blocks/360_embed.blade.php | 8 +++++++- resources/views/admin/blocks/artwork.blade.php | 3 ++- resources/views/admin/blocks/image_slider.blade.php | 8 +++++++- .../views/admin/blocks/layered_image_viewer.blade.php | 8 +++++++- resources/views/admin/blocks/media_embed.blade.php | 8 +++++++- resources/views/admin/blocks/mirador_embed.blade.php | 8 +++++++- resources/views/admin/blocks/table.blade.php | 9 +++++++-- resources/views/admin/blocks/video.blade.php | 8 +++++++- resources/views/admin/blocks/vtour_embed.blade.php | 6 ++++++ 9 files changed, 57 insertions(+), 9 deletions(-) diff --git a/resources/views/admin/blocks/360_embed.blade.php b/resources/views/admin/blocks/360_embed.blade.php index 89189c8ba6..d77a4f26a8 100644 --- a/resources/views/admin/blocks/360_embed.blade.php +++ b/resources/views/admin/blocks/360_embed.blade.php @@ -1,3 +1,8 @@ +@php + $currentUrl = explode('/', request()->url()); + $type = $currentUrl[5] ?? null; +@endphp + @twillBlockTitle('360 Embed') @twillBlockIcon('image') @@ -5,7 +10,8 @@ 'name' => 'size', 'label' => 'Size', 'placeholder' => 'Select size', - 'default' => 's', + 'default' => ($type === 'digitalPublications' ? 'l' : 's'), + 'disabled' => ($type === 'digitalPublications' ? true : false), 'options' => [ [ 'value' => 's', diff --git a/resources/views/admin/blocks/artwork.blade.php b/resources/views/admin/blocks/artwork.blade.php index 9af34f1d64..db0452c87c 100644 --- a/resources/views/admin/blocks/artwork.blade.php +++ b/resources/views/admin/blocks/artwork.blade.php @@ -18,7 +18,8 @@ 'name' => 'size', 'label' => 'Size', 'placeholder' => 'Select size', - 'default' => 'm', + 'default' => ($type === 'digitalPublications' ? 'l' : 'm'), + 'disabled' => ($type === 'digitalPublications' ? true : false), 'options' => [ [ 'value' => 's', diff --git a/resources/views/admin/blocks/image_slider.blade.php b/resources/views/admin/blocks/image_slider.blade.php index 01097a4300..2c5860be35 100644 --- a/resources/views/admin/blocks/image_slider.blade.php +++ b/resources/views/admin/blocks/image_slider.blade.php @@ -1,3 +1,8 @@ +@php + $currentUrl = explode('/', request()->url()); + $type = $currentUrl[5] ?? null; +@endphp + @twillBlockTitle('Image Slider') @twillBlockIcon('image') @@ -10,7 +15,8 @@ 'name' => 'size', 'label' => 'Size', 'placeholder' => 'Select size', - 'default' => 'm', + 'default' => ($type === 'digitalPublications' ? 'l' : 'm'), + 'disabled' => ($type === 'digitalPublications' ? true : false), 'options' => [ [ 'value' => 's', diff --git a/resources/views/admin/blocks/layered_image_viewer.blade.php b/resources/views/admin/blocks/layered_image_viewer.blade.php index 90d5d381e4..2cc37ddf8a 100644 --- a/resources/views/admin/blocks/layered_image_viewer.blade.php +++ b/resources/views/admin/blocks/layered_image_viewer.blade.php @@ -1,3 +1,8 @@ +@php + $currentUrl = explode('/', request()->url()); + $type = $currentUrl[5] ?? null; +@endphp + @twillBlockTitle('Layered Image Viewer') @twillBlockIcon('image') @@ -23,7 +28,8 @@ 'name' => 'size', 'label' => 'Size', 'placeholder' => 'Select size', - 'default' => 'm', + 'default' => ($type === 'digitalPublications' ? 'l' : 'm'), + 'disabled' => ($type === 'digitalPublications' ? true : false), 'options' => [ [ 'value' => 's', diff --git a/resources/views/admin/blocks/media_embed.blade.php b/resources/views/admin/blocks/media_embed.blade.php index 376a0096d5..c965e749ab 100644 --- a/resources/views/admin/blocks/media_embed.blade.php +++ b/resources/views/admin/blocks/media_embed.blade.php @@ -1,3 +1,8 @@ +@php + $currentUrl = explode('/', request()->url()); + $type = $currentUrl[5] ?? null; +@endphp + @twillBlockTitle('Media embed') @twillBlockIcon('text') @@ -5,7 +10,8 @@ 'name' => 'size', 'label' => 'Size', 'placeholder' => 'Select size', - 'default' => 's', + 'default' => ($type === 'digitalPublications' ? 'l' : 's'), + 'disabled' => ($type === 'digitalPublications' ? true : false), 'options' => [ [ 'value' => 's', diff --git a/resources/views/admin/blocks/mirador_embed.blade.php b/resources/views/admin/blocks/mirador_embed.blade.php index ce54de0346..128c613566 100644 --- a/resources/views/admin/blocks/mirador_embed.blade.php +++ b/resources/views/admin/blocks/mirador_embed.blade.php @@ -1,3 +1,8 @@ +@php + $currentUrl = explode('/', request()->url()); + $type = $currentUrl[5] ?? null; +@endphp + @twillBlockTitle('Mirador Embed') @twillBlockIcon('image') @@ -18,7 +23,8 @@ 'name' => 'size', 'label' => 'Size', 'placeholder' => 'Select size', - 'default' => 'm', + 'default' => ($type === 'digitalPublications' ? 'l' : 'm'), + 'disabled' => ($type === 'digitalPublications' ? true : false), 'options' => [ [ 'value' => 's', diff --git a/resources/views/admin/blocks/table.blade.php b/resources/views/admin/blocks/table.blade.php index ec28443dc7..ae1693994d 100644 --- a/resources/views/admin/blocks/table.blade.php +++ b/resources/views/admin/blocks/table.blade.php @@ -1,3 +1,8 @@ +@php + $currentUrl = explode('/', request()->url()); + $type = $currentUrl[5] ?? null; +@endphp + @twillBlockTitle('Table') @twillBlockIcon('text') @@ -9,7 +14,8 @@ 'name' => 'size', 'label' => 'Size', 'placeholder' => 'Select size', - 'default' => 's', + 'default' => ($type === 'digitalPublications' ? 'l' : 's'), + 'disabled' => ($type === 'digitalPublications' ? true : false), 'options' => [ [ 'value' => 's', @@ -62,4 +68,3 @@ 'name' => 'hide_columns', 'label' => 'Hide vertical cell borders', ]) - diff --git a/resources/views/admin/blocks/video.blade.php b/resources/views/admin/blocks/video.blade.php index e6d97df6af..e5a1e9fdcc 100644 --- a/resources/views/admin/blocks/video.blade.php +++ b/resources/views/admin/blocks/video.blade.php @@ -1,3 +1,8 @@ +@php + $currentUrl = explode('/', request()->url()); + $type = $currentUrl[5] ?? null; +@endphp + @twillBlockTitle('Video') @twillBlockIcon('image') @@ -5,7 +10,8 @@ 'name' => 'size', 'label' => 'Size', 'placeholder' => 'Select size', - 'default' => 'm', + 'default' => ($type === 'digitalPublications' ? 'l' : 'm'), + 'disabled' => ($type === 'digitalPublications' ? true : false), 'options' => [ [ 'value' => 's', diff --git a/resources/views/admin/blocks/vtour_embed.blade.php b/resources/views/admin/blocks/vtour_embed.blade.php index 3a4da70aa1..1ef3988d5b 100644 --- a/resources/views/admin/blocks/vtour_embed.blade.php +++ b/resources/views/admin/blocks/vtour_embed.blade.php @@ -1,3 +1,8 @@ +@php + $currentUrl = explode('/', request()->url()); + $type = $currentUrl[5] ?? null; +@endphp + @twillBlockTitle('Virtual Tour Embed') @twillBlockIcon('image') @@ -12,6 +17,7 @@ 'label' => 'Size', 'placeholder' => 'Select size', 'default' => 'l', + 'disabled' => ($type === 'digitalPublications' ? true : false), 'options' => [ [ 'value' => 'm', From 1c67bb790dee9b8712ff58c7d99a4a81ad46c0b1 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Tue, 12 Nov 2024 15:09:06 -0600 Subject: [PATCH 310/346] Remove excess space under archive [WEB-2919] --- frontend/scss/state/_s-sticky-sidebar.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/scss/state/_s-sticky-sidebar.scss b/frontend/scss/state/_s-sticky-sidebar.scss index 34e421d485..2c314feb90 100644 --- a/frontend/scss/state/_s-sticky-sidebar.scss +++ b/frontend/scss/state/_s-sticky-sidebar.scss @@ -13,7 +13,7 @@ For _p-issuearticle-show.scss and _p-issue-show.scss } .o-sticky-sidebar__sticker { - height: 100vh; + max-height: 100vh; } &.is-sidebar-overlay { From e3d51bce7ef4c3ce952c46afa49adbcadf23bae1 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 13 Nov 2024 12:25:49 -0600 Subject: [PATCH 311/346] Update all existing media blocks to `large` for digital publication image articles [PUB-285] --- ...gital_publication_article_image_blocks.php | 3 +- ...gital_publication_article_media_blocks.php | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 database/migrations/2024_11_13_121456_update_sizes_of_digital_publication_article_media_blocks.php diff --git a/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php b/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php index 45c15a1d1e..9006ea27f2 100644 --- a/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php +++ b/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php @@ -1,7 +1,6 @@ content; if ($content['size'] == 'm') { - $content['size'] = 's'; + $content['size'] = 'l'; } $content['use_alt_background'] = true; $content['use_contain'] = true; diff --git a/database/migrations/2024_11_13_121456_update_sizes_of_digital_publication_article_media_blocks.php b/database/migrations/2024_11_13_121456_update_sizes_of_digital_publication_article_media_blocks.php new file mode 100644 index 0000000000..381a8c4920 --- /dev/null +++ b/database/migrations/2024_11_13_121456_update_sizes_of_digital_publication_article_media_blocks.php @@ -0,0 +1,50 @@ + [], + 'artwork' => [], + 'image_slider' => [], + 'layered_image_viewer' => [], + 'media_embed' => [], + 'mirador_embed' => [], + 'table' => [], + 'video' => ['use_alt_background'], + 'vtour_embed' => [], + ]; + + foreach ($types as $type => $fieldsToSetToTrue) { + // Find all blocks of digitalPublicationArticles + $digiPubBlocks = Block::where('type', $type) + ->where('blockable_type', 'digitalPublicationArticles') + ->get(); + + // Update the content JSON column for image block on digital publication articles + foreach ($digiPubBlocks as $block) { + $content = $block->content; + if ($content['size'] == 'm') { + $content['size'] = 'l'; + } + + foreach ($fieldsToSetToTrue as $field) { + $content[$field] = true; + } + + // Update the block with the new JSON + $block->content = $content; + $block->save(); + } + } + } + + public function down(): void + { + // There's no going back... + } +}; From 44bf765348d445c6d811dc2a4acd2ca3ac077d42 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 13 Nov 2024 14:03:36 -0600 Subject: [PATCH 312/346] Remove Publication Image media library bucket [PUB-247] --- app/Console/Commands/TwillCopy.php | 19 - .../Admin/Vendor/MediaLibraryController.php | 32 - app/Repositories/MediaRepository.php | 19 - .../media-library/MediaLibrary.vue | 684 ------------------ .../views/vendor/twill/layouts/main.blade.php | 152 ---- routes/admin.php | 7 - 6 files changed, 913 deletions(-) delete mode 100644 app/Console/Commands/TwillCopy.php delete mode 100644 app/Http/Controllers/Admin/Vendor/MediaLibraryController.php delete mode 100644 app/Repositories/MediaRepository.php delete mode 100644 resources/assets/js/twill-components/media-library/MediaLibrary.vue delete mode 100644 resources/views/vendor/twill/layouts/main.blade.php diff --git a/app/Console/Commands/TwillCopy.php b/app/Console/Commands/TwillCopy.php deleted file mode 100644 index 41f9bb37d4..0000000000 --- a/app/Console/Commands/TwillCopy.php +++ /dev/null @@ -1,19 +0,0 @@ -request->has('except')) { - $prependScope['exceptIds'] = $this->request->get('except'); - } - if ($this->request->has('withTag')) { - $prependScope['withTag'] = $this->request->get('withTag'); - } - if ($this->request->has('withoutTag')) { - $prependScope['withoutTag'] = $this->request->get('withoutTag'); - } - - return $this->getIndexData($prependScope ?? []); - } - - protected function getNamespace() - { - return 'App'; - } -} diff --git a/app/Repositories/MediaRepository.php b/app/Repositories/MediaRepository.php deleted file mode 100644 index c08408bfbf..0000000000 --- a/app/Repositories/MediaRepository.php +++ /dev/null @@ -1,19 +0,0 @@ -$column($scopes[$column]); - unset($scopes[$column]); - } - } - return parent::filter($query, $scopes); - } -} diff --git a/resources/assets/js/twill-components/media-library/MediaLibrary.vue b/resources/assets/js/twill-components/media-library/MediaLibrary.vue deleted file mode 100644 index 3f19f77f89..0000000000 --- a/resources/assets/js/twill-components/media-library/MediaLibrary.vue +++ /dev/null @@ -1,684 +0,0 @@ - - - - - - - diff --git a/resources/views/vendor/twill/layouts/main.blade.php b/resources/views/vendor/twill/layouts/main.blade.php deleted file mode 100644 index 6c221404c9..0000000000 --- a/resources/views/vendor/twill/layouts/main.blade.php +++ /dev/null @@ -1,152 +0,0 @@ - - - - @include('twill::partials.head') - - - @include('twill::partials.icons.svg-sprite') - @if(config('twill.enabled.search', false)) - @partialView(($moduleName ?? null), 'navigation._overlay_navigation', ['search' => true]) - @else - @partialView(($moduleName ?? null), 'navigation._overlay_navigation') - @endif -
-
-
- @partialView(($moduleName ?? null), 'navigation._title') - @partialView(($moduleName ?? null), 'navigation._global_navigation') -
- @partialView(($moduleName ?? null), 'navigation._user') -
- @if(config('twill.enabled.search', false) && !($isDashboard ?? false)) -
- - - - - -
-
- -
-
-
- @endif -
-
- @hasSection('primaryNavigation') - @yield('primaryNavigation') - @else - @partialView(($moduleName ?? null), 'navigation._primary_navigation') - @partialView(($moduleName ?? null), 'navigation._secondary_navigation') - @partialView(($moduleName ?? null), 'navigation._breadcrumb') - @endif -
-
- @yield('content') - @if (config('twill.enabled.media-library') || config('twill.enabled.file-library')) - - - -

{!! twillTrans("twill::lang.media-library.dialogs.delete.delete-media-desc") !!}

-
- - -

{!! twillTrans("twill::lang.media-library.dialogs.replace.replace-media-desc") !!}

-
- @endif - - - - -
-
- - - -
- @include('twill::partials.footer') -
-
- -
- @csrf -
- - - - - @stack('extra_js') - - diff --git a/routes/admin.php b/routes/admin.php index bbaa927693..91027008c8 100644 --- a/routes/admin.php +++ b/routes/admin.php @@ -10,7 +10,6 @@ use App\Http\Controllers\Admin\FeeController; use App\Http\Controllers\Admin\GalleryController; use App\Http\Controllers\Admin\PageController; -use App\Http\Controllers\Admin\Vendor\MediaLibraryController; Route::module('pages'); @@ -122,9 +121,3 @@ Route::module('tourStops'); Route::module('vanityRedirects'); }); - -if (config('twill.enabled.media-library')) { - Route::group(['prefix' => 'media-library', 'as' => 'media-library.'], function () { - Route::resource('medias', MediaLibraryController::class, ['only' => ['index']]); - }); -} From 2adb7cb8c7b1efa24c6a7540d1a0d06277c5eb8b Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 13 Nov 2024 16:15:40 -0600 Subject: [PATCH 313/346] Remove unneccessary comment [PUB-285] --- resources/views/admin/blocks/image.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/admin/blocks/image.blade.php b/resources/views/admin/blocks/image.blade.php index e8ca98190f..d852986abc 100644 --- a/resources/views/admin/blocks/image.blade.php +++ b/resources/views/admin/blocks/image.blade.php @@ -7,7 +7,7 @@ 'label' => 'Small' ]; - if ($type !== 'digitalPublications') { // replace $condition with your actual condition + if ($type !== 'digitalPublications') { $options[] = [ 'value' => 'm', 'label' => 'Medium' From fb065bcf2d6abf4854600c16d9d059c2ceacad81 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 14 Nov 2024 11:48:56 -0600 Subject: [PATCH 314/346] Add HIDE_FROM_TOURS env var to .env.example [WEB-2958] --- .env.example | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.env.example b/.env.example index 40a44412c5..6649175ed7 100644 --- a/.env.example +++ b/.env.example @@ -20,6 +20,9 @@ DB_DATABASE='homestead' DB_USERNAME='homestead' DB_PASSWORD='secret' +# Comma-delimited list +HIDE_FROM_TOURS='130700,117241' + TOURS_DB_CONNECTION='mysql' TOURS_DB_HOST='127.0.0.1' TOURS_DB_PORT=3306 From e00232f60b9a3f91f782a72163e2c54ad6cb3270 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Thu, 14 Nov 2024 12:53:10 -0600 Subject: [PATCH 315/346] Remove values from example env var [WEB-2958] --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 6649175ed7..a5d318c9af 100644 --- a/.env.example +++ b/.env.example @@ -21,7 +21,7 @@ DB_USERNAME='homestead' DB_PASSWORD='secret' # Comma-delimited list -HIDE_FROM_TOURS='130700,117241' +HIDE_FROM_TOURS= TOURS_DB_CONNECTION='mysql' TOURS_DB_HOST='127.0.0.1' From 3a490ce3ce810663326730d32dec22660c1b061a Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:51:11 -0600 Subject: [PATCH 316/346] Update image styling for images in blocks [PUB-289] --- frontend/scss/pages/_p-issuearticle-show.scss | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 5174cc8987..30c9a601bb 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -41,6 +41,14 @@ } } + .o-blocks{ + &.o-blocks--with-sidebar { + >.o-gallery { + width: 100% !important; + } + } + } + .o-blocks:not(.o-blocks--bibliographic) > p { @include f-body; } @@ -392,8 +400,40 @@ } } + .m-split-block { + .m-media--s.o-blocks__block, + .m-media--l.o-blocks__block { + width: unset !important; + + .m-media__img { + display: block; + width: unset !important; + height: auto; + margin: 0 auto; + max-width: 100% !important; + max-height: 80vh !important; + + img { + min-width: 100% + } + } + } + } + .m-media--s.o-blocks__block, .m-media--l.o-blocks__block { + &.m-media--layered-image-viewer-embed { + width: 100% !important; + .m-media__img { + width: 100% !important; + } + } + + .m-media__img.m-media--360-embed { + max-height: unset !important; + width: 100% !important; + } + width: max-content !important; max-width: 100%; min-width: unset !important; From df93f4959a30ed17e03e9c0efb30ba39de6e834e Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Thu, 14 Nov 2024 14:47:36 -0600 Subject: [PATCH 317/346] Size audio blocks in digital publication articles to paragraph width [PUB-287] --- frontend/scss/pages/_p-issuearticle-show.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 30c9a601bb..f6e75e5526 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -215,6 +215,7 @@ &>div.author-links, &>div.m-title-bar, &>div.o-blocks--bibliographic, + &>.m-listing--sound, &>h1, &>h2, &>h3, From 37799b73c93a2ccb44e4bc7b4ceacb114e1f0f7b Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Thu, 14 Nov 2024 14:49:56 -0600 Subject: [PATCH 318/346] Convert all image blocks in digital publication articles to large [PUB-285] --- ...114028_update_digital_publication_article_image_blocks.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php b/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php index 9006ea27f2..98c8116be5 100644 --- a/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php +++ b/database/migrations/2024_10_08_114028_update_digital_publication_article_image_blocks.php @@ -15,9 +15,7 @@ public function up(): void // Update the content JSON column for image block on digital publication articles foreach ($digiPubImageBlocks as $block) { $content = $block->content; - if ($content['size'] == 'm') { - $content['size'] = 'l'; - } + $content['size'] = 'l'; $content['use_alt_background'] = true; $content['use_contain'] = true; From 21524c8ab95f10d441d046a0c63f1e13ac7901c9 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Fri, 15 Nov 2024 12:06:12 -0600 Subject: [PATCH 319/346] Update _slide-promo with default variation logic [WEB-2940] --- .../views/partials/_slider-promo.blade.php | 75 +++++++++++-------- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/resources/views/partials/_slider-promo.blade.php b/resources/views/partials/_slider-promo.blade.php index 65c29fc2c4..2c5b8cd1d5 100644 --- a/resources/views/partials/_slider-promo.blade.php +++ b/resources/views/partials/_slider-promo.blade.php @@ -9,18 +9,9 @@
{!! $modal['intro'] !!}
-
- @if ($modal['variation'] === \App\Models\Lightbox::VARIATION_NEWSLETTER) -
- @component('components.atoms._email') - @slot('id', 'edit-submitted-mail') - @slot('name', 'email') - @slot('required', 'required') - Email address - @endcomponent -
- @else - @if ($modal['variation'] === \App\Models\Lightbox::VARIATION_EMAIL) + @if ($modal['variation'] !== \App\Models\Lightbox::VARIATION_DEFAULT) + + @if ($modal['variation'] === \App\Models\Lightbox::VARIATION_NEWSLETTER)
@component('components.atoms._email') @slot('id', 'edit-submitted-mail') @@ -29,31 +20,53 @@ Email address @endcomponent
- @elseif ($modal['variation'] === \App\Models\Lightbox::VARIATION_TICKETING) -
- @component('components.atoms._select') - @slot('id', 'g-slider--promo__ticketing') - @slot('name', 'g-slider--promo__ticketing') - @slot('options', [ - ['value' => '1', 'label' => 'Visit today'], - ]) - @endcomponent -
+ @else + @if ($modal['variation'] === \App\Models\Lightbox::VARIATION_EMAIL) +
+ @component('components.atoms._email') + @slot('id', 'edit-submitted-mail') + @slot('name', 'submitted[mail]') + @slot('required', 'required') + Email address + @endcomponent +
+ @elseif ($modal['variation'] === \App\Models\Lightbox::VARIATION_TICKETING) +
+ @component('components.atoms._select') + @slot('id', 'g-slider--promo__ticketing') + @slot('name', 'g-slider--promo__ticketing') + @slot('options', [ + ['value' => '1', 'label' => 'Visit today'], + ]) + @endcomponent +
+ @endif + + + + @endif - - - - @endif +
+ @component('components.atoms._btn') + @slot('variation', 'btn--secondary') + {{ $modal['lightbox_button_text'] ?? 'Join Now' }} + @endcomponent +
+
+ @else - - + @endif
- @else - @if ($modal['variation'] === \App\Models\Lightbox::VARIATION_EMAIL) -
- @component('components.atoms._email') - @slot('id', 'edit-submitted-mail') - @slot('name', 'submitted[mail]') - @slot('required', 'required') - Email address - @endcomponent -
- @elseif ($modal['variation'] === \App\Models\Lightbox::VARIATION_TICKETING) -
- @component('components.atoms._select') - @slot('id', 'g-slider--promo__ticketing') - @slot('name', 'g-slider--promo__ticketing') - @slot('options', [ - ['value' => '1', 'label' => 'Visit today'], - ]) - @endcomponent -
- @endif - - - - + @elseif ($modal['variation'] === \App\Models\Lightbox::VARIATION_EMAIL) +
+ @component('components.atoms._email') + @slot('id', 'edit-submitted-mail') + @slot('name', 'submitted[mail]') + @slot('required', 'required') + Email address + @endcomponent +
+ @elseif ($modal['variation'] === \App\Models\Lightbox::VARIATION_TICKETING) +
+ @component('components.atoms._select') + @slot('id', 'g-slider--promo__ticketing') + @slot('name', 'g-slider--promo__ticketing') + @slot('options', [ + ['value' => '1', 'label' => 'Visit today'], + ]) + @endcomponent +
@endif + + + +
@component('components.atoms._btn') @slot('variation', 'btn--secondary') @@ -57,7 +55,7 @@ @else
- root()) ? 'target="_blank" rel="noopener noreferrer"' : '' }} > @component('components.atoms._btn') From b3e07268f3c5d58b76cd304fd1ff435eacf0ecd4 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 15 Nov 2024 17:27:49 -0600 Subject: [PATCH 322/346] Add scope to table headers for accessiblity See https://sonarcloud.io/project/issues?issueStatuses=OPEN%2CCONFIRMED&tags=wcag2-a&id=art-institute-of-chicago_artic.edu --- .../partials/_fixed-header--visit.blade.php | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/resources/views/partials/_fixed-header--visit.blade.php b/resources/views/partials/_fixed-header--visit.blade.php index 80f5ccec4f..2e4d70329e 100644 --- a/resources/views/partials/_fixed-header--visit.blade.php +++ b/resources/views/partials/_fixed-header--visit.blade.php @@ -81,16 +81,26 @@ - - - + + + @if (!empty($hour)) @foreach ($hour->present()->getHoursTableForVisit() as $hour) - - - - From 96539591a164e15f0f12ae6b3d702395ce0f42fb Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 15 Nov 2024 17:49:14 -0600 Subject: [PATCH 324/346] Fix scss rule See https://sonarcloud.io/project/issues?severities=BLOCKER%2CCRITICAL%2CMAJOR%2CMINOR&sinceLeakPeriod=true&issueStatuses=OPEN%2CCONFIRMED&types=BUG&id=art-institute-of-chicago_artic.edu&open=AYuSDJDV_FNI6HwifNx8 --- frontend/scss/molecules/_m-stories-block.scss | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/frontend/scss/molecules/_m-stories-block.scss b/frontend/scss/molecules/_m-stories-block.scss index cb11827992..041911d344 100644 --- a/frontend/scss/molecules/_m-stories-block.scss +++ b/frontend/scss/molecules/_m-stories-block.scss @@ -117,8 +117,10 @@ @include breakpoint('xsmall') { padding-bottom: 10px !important; + padding-left: 0; + padding-right: 0; + padding-top: 0; width: 100%; - padding: 0; } .m-story__link { @@ -181,7 +183,7 @@ display: none; } } - + .m-side-story:nth-of-type(1) { @include breakpoint('small-') { .m-story__link { @@ -190,7 +192,7 @@ } @include breakpoint('xsmall') { - + } } @@ -231,7 +233,7 @@ } .m-side-story:nth-of-type(3)::after { - + } .m-side-story:nth-of-type(4)::after { @@ -249,12 +251,12 @@ -o-transition-timing-function: ease-in-out; transition-timing-function: ease-in-out } - + a:focus .m-story-listing__img,a:hover .m-story-listing__img { opacity: .9 } - + a:active .m-story-listing__img { opacity: 1 } -} \ No newline at end of file +} From e05b2ec5d89b7d28e2d34049f1485e788361d389 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Mon, 18 Nov 2024 10:33:04 -0600 Subject: [PATCH 325/346] Fix gallery block padding on digipubs [PUB-290] --- frontend/scss/pages/_p-issuearticle-show.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index f6e75e5526..34bc782c51 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -562,7 +562,6 @@ Styling related specifically to digital publications .o-article__body.o-blocks>.o-gallery { >.o-gallery__media-wrapper { - padding: 0 !important; margin: 0 !important; } } From 4914507699f9f671945c6fbe4b8158665ee57ab2 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Fri, 15 Nov 2024 14:45:25 -0600 Subject: [PATCH 326/346] Fix sizing of gallery layout [PUB-288] --- frontend/scss/organisms/_o-blocks.scss | 2 +- frontend/scss/pages/_p-issuearticle-show.scss | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/frontend/scss/organisms/_o-blocks.scss b/frontend/scss/organisms/_o-blocks.scss index 365d89007e..652024b4b8 100644 --- a/frontend/scss/organisms/_o-blocks.scss +++ b/frontend/scss/organisms/_o-blocks.scss @@ -368,7 +368,7 @@ } @include breakpoint('xlarge') { - width: colspan(43, xlarge); + width: colspan(33, xlarge); margin-right: colspan(15, xlarge, 0, true); } } diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index f6e75e5526..a544ae95d8 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -443,7 +443,7 @@ display: none !important; } - .m-media__img { + .m-media__img:not(.m-media__img--video) { & { width: max-content !important; max-width: 100% !important; @@ -626,6 +626,18 @@ Styling related specifically to digital publications display: none; } } + + @include breakpoint('large') { + .o-gallery--small-mosaic .o-pinboard--3-col\@large > * { + width: colspan(grid-cols-to-colspan(4, 52), 'large'); + } + } + + @include breakpoint('xlarge') { + .o-gallery--small-mosaic .o-pinboard--3-col\@xlarge > * { + width: colspan(grid-cols-to-colspan(4, 52), 'xlarge'); + } + } } .p-digitalpublicationarticle-show:not(.p-t-contributions) { From 87025a61e910835985eff8ad8287557fde8e1fef Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Fri, 15 Nov 2024 14:46:06 -0600 Subject: [PATCH 327/346] Hie vertical grid lines on digital publication gallery [PUB-288] --- frontend/scss/pages/_p-issuearticle-show.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index a544ae95d8..f1c438749f 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -627,6 +627,10 @@ Styling related specifically to digital publications } } + .o-pinboard--3-col\@xlarge::before { + display: none; + } + @include breakpoint('large') { .o-gallery--small-mosaic .o-pinboard--3-col\@large > * { width: colspan(grid-cols-to-colspan(4, 52), 'large'); From 3916009836222406921aa663b82572ca5bb5134b Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Fri, 15 Nov 2024 14:46:50 -0600 Subject: [PATCH 328/346] Fix URL field on video block --- resources/views/admin/blocks/video.blade.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/views/admin/blocks/video.blade.php b/resources/views/admin/blocks/video.blade.php index e5a1e9fdcc..841005654e 100644 --- a/resources/views/admin/blocks/video.blade.php +++ b/resources/views/admin/blocks/video.blade.php @@ -88,7 +88,8 @@ @formField('input', [ 'name' => 'url', - 'label' => 'Video URL' + 'label' => 'Video URL', + 'type' => 'url' ]) @endcomponent From 42d3a572abe6a632b9ff7149261b9d896f71e4be Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Fri, 15 Nov 2024 14:47:11 -0600 Subject: [PATCH 329/346] Update all digital pub media blocks to `large` --- ...date_sizes_of_digital_publication_article_media_blocks.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/database/migrations/2024_11_13_121456_update_sizes_of_digital_publication_article_media_blocks.php b/database/migrations/2024_11_13_121456_update_sizes_of_digital_publication_article_media_blocks.php index 381a8c4920..84cd04bae4 100644 --- a/database/migrations/2024_11_13_121456_update_sizes_of_digital_publication_article_media_blocks.php +++ b/database/migrations/2024_11_13_121456_update_sizes_of_digital_publication_article_media_blocks.php @@ -28,9 +28,7 @@ public function up(): void // Update the content JSON column for image block on digital publication articles foreach ($digiPubBlocks as $block) { $content = $block->content; - if ($content['size'] == 'm') { - $content['size'] = 'l'; - } + $content['size'] = 'l'; foreach ($fieldsToSetToTrue as $field) { $content[$field] = true; From 588b34d8da61aa87932c3e7ba660b51efd9c753b Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 15 Nov 2024 11:58:09 -0600 Subject: [PATCH 330/346] Reinsert removed margin-adding code [PUB-286] --- frontend/js/behaviors/core/stickySidebar.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index 03d2afdb85..3e1d746d80 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -77,6 +77,12 @@ const stickySidebar = function(container){ bottom(); } else { sticky(); + // Only add margin if the screen width is 1200px or above + if (window.innerWidth >= 1200) { + container.style.marginTop = (document.documentElement.classList.contains('p-digitalpublicationarticle-show') ? 0 : (!document.documentElement.classList.contains('s-unsticky-header') ? navContainer.clientHeight : 0) + (!document.documentElement.classList.contains('s-unsticky-digital-publication-header') ? stickyHeaderContainer.clientHeight : 0)) + 'px'; + } else { + container.style.marginTop = '0px'; + } } } } From c6308c635906aeda8936fcae1e1ceab8a9e91202 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 15 Nov 2024 12:04:48 -0600 Subject: [PATCH 331/346] Refactored for readability [PUB-286] --- frontend/js/behaviors/core/stickySidebar.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index 3e1d746d80..3f466a4805 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -2,6 +2,7 @@ import { triggerCustomEvent, setFocusOnTarget } from '@area17/a17-helpers'; import { mediaQuery } from '../../functions/core'; const stickySidebar = function(container){ + const isDigitalPublicationArticle = document.documentElement.classList.contains('p-digitalpublicationarticle-show'); const getOffsetTop = element => { let offsetTop = 0; @@ -60,6 +61,10 @@ const stickySidebar = function(container){ let currentState; function update() { + const hasDigitalPublicationStickyHeader = document.documentElement.classList.contains('s-sticky-digital-publication-header'); + const hasDigitalPublicationUnstickyHeader = document.documentElement.classList.contains('s-unsticky-digital-publication-header'); + const hasUnstickyHeader = document.documentElement.classList.contains('s-unsticky-header'); + scrollTop = document.documentElement.scrollTop || document.body.scrollTop; containerHeight = container.offsetHeight; @@ -69,20 +74,25 @@ const stickySidebar = function(container){ stickyHeaderContainer = document.querySelector('.m-article-header'); // `containerTop` is caluclated in the `handleResize` method - if (scrollTop < containerTop - (document.documentElement.classList.contains('s-sticky-digital-publication-header') ? stickyHeaderContainer.clientHeight : 0)) { + let digitalPublicaitonStickyHeaderHeight = hasDigitalPublicationStickyHeader ? stickyHeaderContainer.clientHeight : 0; + let unstickyNavHeight = hasUnstickyHeader ? navContainer.clientHeight : 0; + if (scrollTop < containerTop - digitalPublicaitonStickyHeaderHeight) { top(); container.style.marginTop = '0px'; } else { - if (scrollTop + containerHeight > article.offsetHeight + (document.documentElement.classList.contains('s-unsticky-header') ? navContainer.clientHeight : 0)) { + if (scrollTop + containerHeight > article.offsetHeight + unstickyNavHeight) { bottom(); } else { sticky(); + let marginToAdd = 0; // Only add margin if the screen width is 1200px or above if (window.innerWidth >= 1200) { - container.style.marginTop = (document.documentElement.classList.contains('p-digitalpublicationarticle-show') ? 0 : (!document.documentElement.classList.contains('s-unsticky-header') ? navContainer.clientHeight : 0) + (!document.documentElement.classList.contains('s-unsticky-digital-publication-header') ? stickyHeaderContainer.clientHeight : 0)) + 'px'; - } else { - container.style.marginTop = '0px'; + if (!isDigitalPublicationArticle) { + marginToAdd += !hasUnstickyHeader ? navContainer.clientHeight : 0; + marginToAdd += !hasDigitalPublicationUnstickyHeader ? stickyHeaderContainer.clientHeight : 0; + } } + container.style.marginTop = marginToAdd + 'px'; } } } From 00bedf722ab3c563c2947f3e5b03dc8f42313b3f Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 15 Nov 2024 12:08:06 -0600 Subject: [PATCH 332/346] Fix sidebar disappering on nondigipub pages [PUB-286] --- frontend/js/behaviors/core/stickySidebar.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index 3f466a4805..f6eeac7a0c 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -2,7 +2,8 @@ import { triggerCustomEvent, setFocusOnTarget } from '@area17/a17-helpers'; import { mediaQuery } from '../../functions/core'; const stickySidebar = function(container){ - const isDigitalPublicationArticle = document.documentElement.classList.contains('p-digitalpublicationarticle-show'); + const isDigitalPublicationLanding = document.documentElement.classList.contains('p-digitalpublications-show'); + const isDigitalPublicationListing = document.documentElement.classList.contains('p-digitalpublications-showlisting'); const getOffsetTop = element => { let offsetTop = 0; @@ -87,7 +88,7 @@ const stickySidebar = function(container){ let marginToAdd = 0; // Only add margin if the screen width is 1200px or above if (window.innerWidth >= 1200) { - if (!isDigitalPublicationArticle) { + if (isDigitalPublicationLanding || isDigitalPublicationListing) { marginToAdd += !hasUnstickyHeader ? navContainer.clientHeight : 0; marginToAdd += !hasDigitalPublicationUnstickyHeader ? stickyHeaderContainer.clientHeight : 0; } From 54029c91e43ff4b8a99b58a76479c483a512d33e Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 15 Nov 2024 12:12:31 -0600 Subject: [PATCH 333/346] Simplify adding margin [PUB-286] --- frontend/js/behaviors/core/stickySidebar.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index f6eeac7a0c..3918b801c1 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -77,15 +77,14 @@ const stickySidebar = function(container){ // `containerTop` is caluclated in the `handleResize` method let digitalPublicaitonStickyHeaderHeight = hasDigitalPublicationStickyHeader ? stickyHeaderContainer.clientHeight : 0; let unstickyNavHeight = hasUnstickyHeader ? navContainer.clientHeight : 0; + let marginToAdd = 0; if (scrollTop < containerTop - digitalPublicaitonStickyHeaderHeight) { top(); - container.style.marginTop = '0px'; } else { if (scrollTop + containerHeight > article.offsetHeight + unstickyNavHeight) { bottom(); } else { sticky(); - let marginToAdd = 0; // Only add margin if the screen width is 1200px or above if (window.innerWidth >= 1200) { if (isDigitalPublicationLanding || isDigitalPublicationListing) { @@ -93,9 +92,9 @@ const stickySidebar = function(container){ marginToAdd += !hasDigitalPublicationUnstickyHeader ? stickyHeaderContainer.clientHeight : 0; } } - container.style.marginTop = marginToAdd + 'px'; } } + container.style.marginTop = marginToAdd + 'px'; } function top() { From 062b8e87c6b600c7a75d41eae5157ee745ba2df1 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 15 Nov 2024 12:23:14 -0600 Subject: [PATCH 334/346] Reorganize consts and globals [PUB-286] --- frontend/js/behaviors/core/stickySidebar.js | 35 +++++++++------------ 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index 3918b801c1..b1a3fc45dd 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -4,6 +4,21 @@ import { mediaQuery } from '../../functions/core'; const stickySidebar = function(container){ const isDigitalPublicationLanding = document.documentElement.classList.contains('p-digitalpublications-show'); const isDigitalPublicationListing = document.documentElement.classList.contains('p-digitalpublications-showlisting'); + const logo = document.querySelector('.m-article-actions--publication__logo'); + const sidebarOverlayState = 'is-sidebar-overlay'; + + let article; + let scrollTop; + let windowHeight; + let containerTop; + let containerHeight; + let navContainer; + let stickyHeaderContainer; + let contributionHeaderHeight; + let overlayActive = document.documentElement.classList.contains(sidebarOverlayState); + let savedFocus; + let savedScroll; + let currentState; const getOffsetTop = element => { let offsetTop = 0; @@ -40,26 +55,6 @@ const stickySidebar = function(container){ } } - let article; - let logo = document.querySelector('.m-article-actions--publication__logo'); - - let scrollTop; - - let windowHeight; - let containerTop; - let containerHeight; - - let navContainer; - let stickyHeaderContainer; - let contributionHeaderHeight; - - const sidebarOverlayState = 'is-sidebar-overlay'; - let overlayActive = document.documentElement.classList.contains(sidebarOverlayState); - - let savedFocus; - let savedScroll; - - let currentState; function update() { const hasDigitalPublicationStickyHeader = document.documentElement.classList.contains('s-sticky-digital-publication-header'); From dbdcd28c4bcb3189f80d948c0cbadc265becd6f7 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 15 Nov 2024 12:24:49 -0600 Subject: [PATCH 335/346] Remove unused variable [PUB-286] --- frontend/js/behaviors/core/stickySidebar.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index b1a3fc45dd..9ff3ca9534 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -9,7 +9,6 @@ const stickySidebar = function(container){ let article; let scrollTop; - let windowHeight; let containerTop; let containerHeight; let navContainer; @@ -111,7 +110,6 @@ const stickySidebar = function(container){ function handleResize() { top(); - windowHeight = window.innerHeight || document.documentElement.clientHeight; stickyHeaderContainer = document.querySelector('.m-article-header'); contributionHeaderHeight = 0; From 5bb06fb69f7415e5589bab81fdbfed5458baa7ed Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 15 Nov 2024 13:14:07 -0600 Subject: [PATCH 336/346] Clean up const and variables [PUB-286] --- frontend/js/behaviors/core/stickySidebar.js | 45 +++++++++------------ 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index 9ff3ca9534..96eec6cba7 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -2,22 +2,21 @@ import { triggerCustomEvent, setFocusOnTarget } from '@area17/a17-helpers'; import { mediaQuery } from '../../functions/core'; const stickySidebar = function(container){ + const hasDigitalPublicationStickyHeader = document.documentElement.classList.contains('s-sticky-digital-publication-header'); + const hasDigitalPublicationUnstickyHeader = document.documentElement.classList.contains('s-unsticky-digital-publication-header'); + const isDigitalPublicationArticle = document.documentElement.classList.contains('p-digitalpublicationarticle-show'); const isDigitalPublicationLanding = document.documentElement.classList.contains('p-digitalpublications-show'); const isDigitalPublicationListing = document.documentElement.classList.contains('p-digitalpublications-showlisting'); - const logo = document.querySelector('.m-article-actions--publication__logo'); + const logoSelector = '.m-article-actions--publication__logo'; + const logo = document.querySelector(logoSelector); const sidebarOverlayState = 'is-sidebar-overlay'; + const stickyHeaderContainer = document.querySelector('.m-article-header'); - let article; - let scrollTop; let containerTop; - let containerHeight; - let navContainer; - let stickyHeaderContainer; - let contributionHeaderHeight; + let currentState; let overlayActive = document.documentElement.classList.contains(sidebarOverlayState); let savedFocus; let savedScroll; - let currentState; const getOffsetTop = element => { let offsetTop = 0; @@ -54,28 +53,21 @@ const stickySidebar = function(container){ } } - function update() { - const hasDigitalPublicationStickyHeader = document.documentElement.classList.contains('s-sticky-digital-publication-header'); - const hasDigitalPublicationUnstickyHeader = document.documentElement.classList.contains('s-unsticky-digital-publication-header'); + const article = document.querySelector('.o-article'); const hasUnstickyHeader = document.documentElement.classList.contains('s-unsticky-header'); + const navContainer = document.querySelector('.g-header'); + const scrollTop = document.documentElement.scrollTop || document.body.scrollTop; - scrollTop = document.documentElement.scrollTop || document.body.scrollTop; - - containerHeight = container.offsetHeight; - - article = document.querySelector('.o-article'); - navContainer = document.querySelector('.g-header'); - stickyHeaderContainer = document.querySelector('.m-article-header'); - - // `containerTop` is caluclated in the `handleResize` method let digitalPublicaitonStickyHeaderHeight = hasDigitalPublicationStickyHeader ? stickyHeaderContainer.clientHeight : 0; let unstickyNavHeight = hasUnstickyHeader ? navContainer.clientHeight : 0; let marginToAdd = 0; + + // `containerTop` is caluclated in the `handleResize` method if (scrollTop < containerTop - digitalPublicaitonStickyHeaderHeight) { top(); } else { - if (scrollTop + containerHeight > article.offsetHeight + unstickyNavHeight) { + if (scrollTop + container.offsetHeight > article.offsetHeight + unstickyNavHeight) { bottom(); } else { sticky(); @@ -110,19 +102,18 @@ const stickySidebar = function(container){ function handleResize() { top(); - stickyHeaderContainer = document.querySelector('.m-article-header'); - - contributionHeaderHeight = 0; - let logoList = document.querySelectorAll('.m-article-actions--publication__logo'); + let contributionHeaderHeight = 0; + let logoList = document.querySelectorAll(logoSelector); for (let i = 0; i < logoList.length; i++) { contributionHeaderHeight += logoList[i].clientHeight; } containerTop = getOffsetTop(container) + document.body.scrollTop; - if (document.documentElement.classList.contains('s-sticky-digital-publication-header')) { + if (hasDigitalPublicationStickyHeader) { containerTop -= stickyHeaderContainer.offsetHeight; } - if (document.documentElement.classList.contains('p-digitalpublicationarticle-show') && document.documentElement.classList.contains('p-t-contributions')) { + let isContribution = document.documentElement.classList.contains('p-t-contributions'); + if (isDigitalPublicationArticle && isContribution) { containerTop += contributionHeaderHeight; } From 154c1e92304f46f27fd11ace35aca904af33fea3 Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 15 Nov 2024 13:35:25 -0600 Subject: [PATCH 337/346] Simplify update method [PUB-286] --- frontend/js/behaviors/core/stickySidebar.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index 96eec6cba7..adba6003ef 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -66,18 +66,14 @@ const stickySidebar = function(container){ // `containerTop` is caluclated in the `handleResize` method if (scrollTop < containerTop - digitalPublicaitonStickyHeaderHeight) { top(); + } else if (scrollTop + container.offsetHeight > article.offsetHeight + unstickyNavHeight) { + bottom(); } else { - if (scrollTop + container.offsetHeight > article.offsetHeight + unstickyNavHeight) { - bottom(); - } else { - sticky(); - // Only add margin if the screen width is 1200px or above - if (window.innerWidth >= 1200) { - if (isDigitalPublicationLanding || isDigitalPublicationListing) { - marginToAdd += !hasUnstickyHeader ? navContainer.clientHeight : 0; - marginToAdd += !hasDigitalPublicationUnstickyHeader ? stickyHeaderContainer.clientHeight : 0; - } - } + sticky(); + // Only add margin if the screen width is 1200px or above + if (window.innerWidth >= 1200 && (isDigitalPublicationLanding || isDigitalPublicationListing)) { + marginToAdd += !hasUnstickyHeader ? navContainer.clientHeight : 0; + marginToAdd += !hasDigitalPublicationUnstickyHeader ? stickyHeaderContainer.clientHeight : 0; } } container.style.marginTop = marginToAdd + 'px'; From 0e6a222646795f0b90e6d46e6a88e3060307eae6 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Mon, 18 Nov 2024 10:58:52 -0600 Subject: [PATCH 338/346] Minor adjustments to sticky sidebar visual behavior [PUB-286] --- frontend/js/behaviors/core/stickySidebar.js | 12 ++++++++---- frontend/scss/pages/_p-issuearticle-show.scss | 4 ++++ frontend/scss/state/_s-sticky-sidebar.scss | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index adba6003ef..410ce5a3dc 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -2,11 +2,11 @@ import { triggerCustomEvent, setFocusOnTarget } from '@area17/a17-helpers'; import { mediaQuery } from '../../functions/core'; const stickySidebar = function(container){ - const hasDigitalPublicationStickyHeader = document.documentElement.classList.contains('s-sticky-digital-publication-header'); - const hasDigitalPublicationUnstickyHeader = document.documentElement.classList.contains('s-unsticky-digital-publication-header'); const isDigitalPublicationArticle = document.documentElement.classList.contains('p-digitalpublicationarticle-show'); const isDigitalPublicationLanding = document.documentElement.classList.contains('p-digitalpublications-show'); const isDigitalPublicationListing = document.documentElement.classList.contains('p-digitalpublications-showlisting'); + const isContribution = document.documentElement.classList.contains('p-t-contributions'); + const isMagazineIssue = document.documentElement.classList.contains('p-magazineissue-latest') || document.documentElement.classList.contains('p-magazineissue-show'); const logoSelector = '.m-article-actions--publication__logo'; const logo = document.querySelector(logoSelector); const sidebarOverlayState = 'is-sidebar-overlay'; @@ -56,6 +56,8 @@ const stickySidebar = function(container){ function update() { const article = document.querySelector('.o-article'); const hasUnstickyHeader = document.documentElement.classList.contains('s-unsticky-header'); + const hasDigitalPublicationStickyHeader = document.documentElement.classList.contains('s-sticky-digital-publication-header'); + const hasDigitalPublicationUnstickyHeader = document.documentElement.classList.contains('s-unsticky-digital-publication-header'); const navContainer = document.querySelector('.g-header'); const scrollTop = document.documentElement.scrollTop || document.body.scrollTop; @@ -108,10 +110,12 @@ const stickySidebar = function(container){ if (hasDigitalPublicationStickyHeader) { containerTop -= stickyHeaderContainer.offsetHeight; } - let isContribution = document.documentElement.classList.contains('p-t-contributions'); - if (isDigitalPublicationArticle && isContribution) { + if ((isDigitalPublicationArticle && isContribution) || isDigitalPublicationLanding) { containerTop += contributionHeaderHeight; } + if (isMagazineIssue) { + containerTop -= 30; + } logo.setAttribute('style', 'display: block'); logo.removeAttribute('style'); diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 72dbcefe41..8da2698fbc 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -521,6 +521,10 @@ margin-top: 8px; } } + + .o-accordion__trigger { + background-color: transparent; + } } /*** diff --git a/frontend/scss/state/_s-sticky-sidebar.scss b/frontend/scss/state/_s-sticky-sidebar.scss index 2c314feb90..3743411112 100644 --- a/frontend/scss/state/_s-sticky-sidebar.scss +++ b/frontend/scss/state/_s-sticky-sidebar.scss @@ -14,6 +14,7 @@ For _p-issuearticle-show.scss and _p-issue-show.scss .o-sticky-sidebar__sticker { max-height: 100vh; + height: 100vh; } &.is-sidebar-overlay { @@ -119,7 +120,7 @@ For _p-issuearticle-show.scss and _p-issue-show.scss display: block; align-items: normal; height: auto; - margin-top: 40px; + margin-top: 30px; } @each $name in ('large', 'xlarge') { From 9c0ce7e3122ac4c22dfd119e8a11eb791b25a9e0 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Mon, 18 Nov 2024 11:41:30 -0600 Subject: [PATCH 339/346] Small fixes [PUB-286] --- frontend/js/behaviors/core/stickySidebar.js | 2 ++ frontend/scss/state/_s-sticky-sidebar.scss | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index 410ce5a3dc..ec279adde8 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -102,6 +102,8 @@ const stickySidebar = function(container){ top(); let contributionHeaderHeight = 0; let logoList = document.querySelectorAll(logoSelector); + let hasDigitalPublicationStickyHeader = document.documentElement.classList.contains('s-sticky-digital-publication-header'); + for (let i = 0; i < logoList.length; i++) { contributionHeaderHeight += logoList[i].clientHeight; } diff --git a/frontend/scss/state/_s-sticky-sidebar.scss b/frontend/scss/state/_s-sticky-sidebar.scss index 3743411112..b902585b7e 100644 --- a/frontend/scss/state/_s-sticky-sidebar.scss +++ b/frontend/scss/state/_s-sticky-sidebar.scss @@ -13,7 +13,6 @@ For _p-issuearticle-show.scss and _p-issue-show.scss } .o-sticky-sidebar__sticker { - max-height: 100vh; height: 100vh; } From 65e8692aaa39be359d0c838dec2ff2e9644ce850 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Mon, 18 Nov 2024 12:24:06 -0600 Subject: [PATCH 340/346] Fix Magazine logo getting covered by global nav on scroll up [PUB-286] --- frontend/js/behaviors/core/stickySidebar.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/frontend/js/behaviors/core/stickySidebar.js b/frontend/js/behaviors/core/stickySidebar.js index ec279adde8..fb7d3618c2 100644 --- a/frontend/js/behaviors/core/stickySidebar.js +++ b/frontend/js/behaviors/core/stickySidebar.js @@ -27,6 +27,11 @@ const stickySidebar = function(container){ return offsetTop; } + function _getPaddingTop(node) { + let style = window.getComputedStyle(node); + return parseInt(style.getPropertyValue('padding-top')); +} + const setState = targetState => { let classList = document.documentElement.classList; @@ -56,6 +61,7 @@ const stickySidebar = function(container){ function update() { const article = document.querySelector('.o-article'); const hasUnstickyHeader = document.documentElement.classList.contains('s-unsticky-header'); + const hasStickyNav = document.documentElement.classList.contains('s-scroll-direction-up'); const hasDigitalPublicationStickyHeader = document.documentElement.classList.contains('s-sticky-digital-publication-header'); const hasDigitalPublicationUnstickyHeader = document.documentElement.classList.contains('s-unsticky-digital-publication-header'); const navContainer = document.querySelector('.g-header'); @@ -73,9 +79,15 @@ const stickySidebar = function(container){ } else { sticky(); // Only add margin if the screen width is 1200px or above - if (window.innerWidth >= 1200 && (isDigitalPublicationLanding || isDigitalPublicationListing)) { - marginToAdd += !hasUnstickyHeader ? navContainer.clientHeight : 0; - marginToAdd += !hasDigitalPublicationUnstickyHeader ? stickyHeaderContainer.clientHeight : 0; + if (window.innerWidth >= 1200) { + if (isDigitalPublicationLanding || isDigitalPublicationListing) { + marginToAdd += !hasUnstickyHeader ? navContainer.clientHeight : 0; + marginToAdd += !hasDigitalPublicationUnstickyHeader ? stickyHeaderContainer.clientHeight : 0; + } + if (isMagazineIssue) { + let paddingTop = _getPaddingTop(container); + marginToAdd += hasStickyNav ? navContainer.clientHeight - paddingTop : 0; + } } } container.style.marginTop = marginToAdd + 'px'; From f02b084766f0c551986b9fb5e9d0c27b3e6c2b1d Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:20:42 -0600 Subject: [PATCH 341/346] Update styles of digipub blocks in detail page [PUB-289] --- frontend/scss/pages/_p-issuearticle-show.scss | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 8da2698fbc..3b4ec07fb0 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -394,9 +394,14 @@ .o-layered-image-viewer { .m-media.o-blocks__block { - .m-media__img img { - background-color: transparent; - background-image: none; + .m-media__img { + max-height: unset !important; + width: 100% !important; + + img { + background-color: transparent; + background-image: none; + } } } } @@ -424,6 +429,7 @@ .m-media--s.o-blocks__block, .m-media--l.o-blocks__block { &.m-media--layered-image-viewer-embed { + max-height: unset !important; width: 100% !important; .m-media__img { width: 100% !important; @@ -445,8 +451,8 @@ .m-media__img:not(.m-media__img--video) { & { - width: max-content !important; - max-width: 100% !important; + width: max-content; + max-width: 100%; max-height: 450px; overflow: hidden !important; text-align: left !important; From f0b2b9d93f1bfa94112d69bc9cf80cb9a6edbe61 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 19 Nov 2024 10:35:26 -0600 Subject: [PATCH 342/346] Show article title on about pages --- resources/views/site/digitalPublicationArticleDetail.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/site/digitalPublicationArticleDetail.blade.php b/resources/views/site/digitalPublicationArticleDetail.blade.php index c2bfae0e64..e36c40b98d 100644 --- a/resources/views/site/digitalPublicationArticleDetail.blade.php +++ b/resources/views/site/digitalPublicationArticleDetail.blade.php @@ -79,7 +79,7 @@
@if ($item->article_type !== DigitalPublicationArticleType::Entry) -
+
@component('components.atoms._title') @slot('tag', 'h1') @slot('font', 'f-headline-editorial') From 7e29a3cb791bd48a9bd2017fed2672894b8390b7 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:31:11 -0600 Subject: [PATCH 343/346] Fix shell digipub body widths [WEB-2967] --- frontend/scss/pages/_p-issue-show.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/scss/pages/_p-issue-show.scss b/frontend/scss/pages/_p-issue-show.scss index d6376bf200..69c5ab31b9 100644 --- a/frontend/scss/pages/_p-issue-show.scss +++ b/frontend/scss/pages/_p-issue-show.scss @@ -5,7 +5,7 @@ .p-digitalpublications-showlisting { @extend %sticky-sidebar; - .o-article__body { + .o-article:not(.o-article--generic-page) .o-article__body { border-top: none; float: none; @each $name in ('large', 'xlarge') { From 893fa1bc60d057dd579831c05dab56d45e2b0ede Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 19 Nov 2024 10:11:04 -0600 Subject: [PATCH 344/346] Adjust split block spacing in digital pubs [PUB-289] --- frontend/scss/pages/_p-issuearticle-show.scss | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 3b4ec07fb0..2b82afa8b0 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -216,6 +216,7 @@ &>div.m-title-bar, &>div.o-blocks--bibliographic, &>.m-listing--sound, + &>.m-split-block, &>h1, &>h2, &>h3, @@ -531,6 +532,32 @@ .o-accordion__trigger { background-color: transparent; } + + .m-split-block--quarter div { + &:first-child { + width: 25%; + margin-top: 16px; + margin-bottom: 16px; + } + + &:last-child { + & h2 { + margin-top: 0; + line-height: 21px; + } + } + + @include breakpoint('xsmall') { + &:last-child { + width: 72% + } + } + @include breakpoint('small+') { + &:last-child { + width: 75% + } + } + } } /*** From 8fbf3ce2cb1c28c45430a0774680e1146218e7d7 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 19 Nov 2024 10:28:30 -0600 Subject: [PATCH 345/346] Fix spacing for paragraph numbers [PUB-289] --- frontend/scss/pages/_p-issuearticle-show.scss | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 2b82afa8b0..1ed42b44b8 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -216,7 +216,6 @@ &>div.m-title-bar, &>div.o-blocks--bibliographic, &>.m-listing--sound, - &>.m-split-block, &>h1, &>h2, &>h3, @@ -536,7 +535,8 @@ .m-split-block--quarter div { &:first-child { width: 25%; - margin-top: 16px; + flex-basis: 15%; + margin-top: 21px; margin-bottom: 16px; } @@ -548,13 +548,21 @@ } @include breakpoint('xsmall') { + &:first-child { + flex-basis: 25%; + } + &:last-child { - width: 72% + width: 72%; } } @include breakpoint('small+') { + &:first-child { + flex-basis: 25%; + } + &:last-child { - width: 75% + width: 75%; } } } From e7a0b97d8999659a29d1e70cf3a6f553b691d3af Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 19 Nov 2024 10:57:38 -0600 Subject: [PATCH 346/346] Limit image height on split blocks [PUB-289] --- frontend/scss/pages/_p-issuearticle-show.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/scss/pages/_p-issuearticle-show.scss b/frontend/scss/pages/_p-issuearticle-show.scss index 1ed42b44b8..9328543c84 100644 --- a/frontend/scss/pages/_p-issuearticle-show.scss +++ b/frontend/scss/pages/_p-issuearticle-show.scss @@ -538,6 +538,10 @@ flex-basis: 15%; margin-top: 21px; margin-bottom: 16px; + + .m-media .m-media__img img { + max-height: 180px !important; + } } &:last-child {
MembersPublic + Members + + Public +
+ {{ $hour['days'] }} @@ -103,7 +113,7 @@ @endforeach @else
+ Monday @@ -114,8 +124,10 @@
- Tuesday–
Wednesday
+
+ + Tuesday–
Wednesday +
Closed @@ -125,8 +137,10 @@
- Thursday–
Sunday
+
+ + Thursday–
Sunday +
10–11 a.m. From 3e650826791e185343f1d495cfb01f2810fec0ef Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Fri, 15 Nov 2024 17:44:49 -0600 Subject: [PATCH 323/346] Fix typo --- resources/views/partials/_fixed-header--visit.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/partials/_fixed-header--visit.blade.php b/resources/views/partials/_fixed-header--visit.blade.php index 2e4d70329e..768b8b0c3a 100644 --- a/resources/views/partials/_fixed-header--visit.blade.php +++ b/resources/views/partials/_fixed-header--visit.blade.php @@ -90,7 +90,7 @@ Public