Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close #3913 Add new content field to AZ Publication. #3914

Merged
merged 33 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4a550bc
Close #3913 Add new content field to publication.
trackleft Nov 26, 2024
12301a9
Add demo pdf and cover image
trackleft Nov 26, 2024
2be3e1d
Adding required tag
trackleft Nov 26, 2024
6b198c0
Merge branch 'main' into issue/3913-add-content-field-to-az-publication
trackleft Dec 6, 2024
3e84db9
Update demo content
trackleft Dec 6, 2024
b66e08c
Merge branch 'issue/3913-add-content-field-to-az-publication' of gith…
trackleft Dec 6, 2024
0171066
Change field type from text area to paragraph field.
trackleft Dec 6, 2024
c7006bc
Merge branch 'main' into issue/3913-add-content-field-to-az-publication
trackleft Dec 11, 2024
8f66ac6
Update labels for publication display.
trackleft Jan 17, 2025
4e57f03
Merge branch 'main' into issue/3913-add-content-field-to-az-publication
trackleft Jan 17, 2025
3e5b3a6
Update modules/custom/az_demo/data/az_demo_image_file.json
trackleft Jan 17, 2025
4410b3a
Update az_publication.module
trackleft Feb 5, 2025
cc2cae8
Update modules/custom/az_publication/az_publication.module
trackleft Feb 5, 2025
2f12f64
Link to node if there is anything in the paragraphs field.
trackleft Feb 5, 2025
24d02a2
Provide demo content that does not have extra links.
trackleft Feb 5, 2025
449e4d5
Provide more demo combinations.
trackleft Feb 5, 2025
88cb018
Update tests
trackleft Feb 5, 2025
1546491
Uncomment tests we want to keep.
trackleft Feb 5, 2025
132ad7c
PHPCS fix
trackleft Feb 5, 2025
37ecfb0
fix test
trackleft Feb 6, 2025
a4d07fb
fix test
trackleft Feb 6, 2025
da28c42
Merge branch 'main' into issue/3913-add-content-field-to-az-publication
trackleft Feb 6, 2025
82809b9
fix test
trackleft Feb 6, 2025
913d9c2
Merge branch 'issue/3913-add-content-field-to-az-publication' of gith…
trackleft Feb 6, 2025
43f05c4
Updates
trackleft Feb 7, 2025
d772d23
Merge branch 'main' into issue/3913-add-content-field-to-az-publication
trackleft Feb 7, 2025
25ecb75
Trissotetras
trackleft Feb 7, 2025
add6f5d
I cant get this last test to work.
trackleft Feb 7, 2025
dbe371a
Merge branch 'main' into issue/3913-add-content-field-to-az-publication
trackleft Feb 7, 2025
aa42d5e
Update modules/custom/az_demo/tests/src/Functional/AZDemoContentTest.php
trackleft Feb 7, 2025
dfe2212
Merge branch 'main' into issue/3913-add-content-field-to-az-publication
trackleft Feb 11, 2025
c32ae9c
Update az_publication.info.yml
trackleft Feb 13, 2025
c278f26
Merge branch 'main' into issue/3913-add-content-field-to-az-publication
trackleft Feb 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion modules/custom/az_demo/data/az_demo_image_file.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@
"caption" : "Insulix-21 is a novel therapy that combines cutting-edge stem cell technology with advanced immunomodulation techniques",
"credit" : "Courtesy of Wilma Wildcat",
"uuid": "aec26a34-72da-4a7c-94e1-8e2793ec67c2"
},
{
"filename" : "1386px-Leonardo_da_Vinci_-_presumed_self-portrait_-_WGA12798.jpg",
"alt" : "Self-portrait of Leonardo da Vinci",
"title": "Self-portrait of Leonardo da Vinci",
"caption": "Leonardo da Vinci was an Italian polymath of the Renaissance whose areas of interest included invention, painting, sculpting, architecture, science, music, mathematics, engineering, literature, anatomy, geology, astronomy, botany, writing, history, and cartography.",
"credit": "By Leonardo da Vinci. Image source: Wikipedia, https://commons.wikimedia.org/w/index.php?curid=15497207. Public domain.",
"uuid": "5cec161c-71bc-4d23-124f-a692400ee17a"
}
]
}
}
16 changes: 16 additions & 0 deletions modules/custom/az_demo/data/az_demo_media_document.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"documents": [
{
"filename" : "Wilbur_Wildcat_Book_Review_The_Life_of_Leonardo_da_Vinci.pdf",
"uuid" : "5cec161c-71bc-4d23-624f-a692400ee17a"
},
{
"filename" : "Wilma_Wildcat_phd_Book_Review_The_Life_of_Leonardo_da_Vinci.pdf",
"uuid" : "5cec161c-71bc-4d23-924f-a692400ee17b"
},
{
"filename" : "Small-PDF.pdf",
"uuid" : "5cec161c-71bc-4d23-824f-a692400ee17c"
}
]
}
98 changes: 84 additions & 14 deletions modules/custom/az_demo/data/az_demo_node_publication.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"approximate": "false",
"category": "Biography",
"container": "Book",
"content": "",
"date": "2022-06-01",
"date_type": "default",
"doi": "10.1000/182",
Expand All @@ -17,9 +18,9 @@
"isbn": "978-3-16-148410-0",
"issn": "",
"issue": "",
"link": "https://example.com/gargantua-book",
"link": "",
"location": "France",
"media": "Print",
"media": "",
"page": "350",
"pmcid": "",
"pmid": "",
Expand All @@ -37,6 +38,7 @@
"approximate": "true",
"category": "Mathematics",
"container": "book",
"content": "",
"date": "2023-01-15",
"date_type": "default",
"doi": "10.1000/2000",
Expand All @@ -47,7 +49,7 @@
"issue": "",
"link": "https://example.com/trissotetras-book",
"location": "Scotland",
"media": "Print",
"media": "Small-PDF.pdf",
"page": "400",
"pmcid": "",
"pmid": "",
Expand All @@ -61,21 +63,22 @@
"title": "An Exploration of Quantum Mechanics",
"authors": "1|2",
"accessed_date": "2023-07-22",
"abstract": "A comprehensive study on the principles of quantum mechanics.",
"abstract": "",
"approximate": "false",
"category": "Physics",
"container": "Journal",
"content": "",
"date": "2021-11-10",
"date_type": "month",
"doi": "10.1000/184",
"extra_links": "https://example.com/quantum-mechanics",
"extra_links": "",
"image": "",
"isbn": "",
"issn": "1234-5678",
"issue": "5",
"link": "https://example.com/quantum-mechanics-journal",
"link": "",
"location": "USA",
"media": "Online",
"media": "",
"page": "120-150",
"pmcid": "PMC1234567",
"pmid": "987654321",
Expand All @@ -93,6 +96,7 @@
"approximate": "true",
"category": "Computer Science",
"container": "book",
"content": "",
"date": "2020-09-05",
"date_type": "month",
"doi": "10.1000/2000",
Expand All @@ -103,7 +107,7 @@
"issue": "",
"link": "https://example.com/data-structures-book",
"location": "Germany",
"media": "Print",
"media": "",
"page": "500",
"pmcid": "",
"pmid": "",
Expand All @@ -121,6 +125,7 @@
"approximate": "false",
"category": "Artificial Intelligence",
"container": "Conference Paper",
"content": "",
"date": "2019-03-18",
"date_type": "default",
"doi": "10.1000/186",
Expand All @@ -131,7 +136,7 @@
"issue": "",
"link": "https://example.com/machine-learning-paper",
"location": "Canada",
"media": "Print",
"media": "",
"page": "50-75",
"pmcid": "",
"pmid": "",
Expand All @@ -149,6 +154,7 @@
"approximate": "false",
"category": "Computer Science",
"container": "book",
"content": "",
"date": "2018-07-01",
"date_type": "default",
"doi": "10.1000/187",
Expand All @@ -159,7 +165,7 @@
"issue": "",
"link": "https://example.com/algorithms-book",
"location": "USA",
"media": "Print",
"media": "",
"page": "900",
"pmcid": "",
"pmid": "",
Expand All @@ -177,6 +183,7 @@
"approximate": "false",
"category": "Artificial Intelligence",
"container": "book",
"content": "",
"date": "2017-05-15",
"date_type": "default",
"doi": "10.1000/188",
Expand All @@ -187,7 +194,7 @@
"issue": "",
"link": "https://example.com/deep-learning-book",
"location": "Canada",
"media": "Print",
"media": "",
"page": "600",
"pmcid": "",
"pmid": "",
Expand All @@ -205,6 +212,7 @@
"approximate": "true",
"category": "Statistics",
"container": "Journal",
"content": "",
"date": "2016-11-25",
"date_type": "month",
"doi": "10.1000/189",
Expand All @@ -215,7 +223,7 @@
"issue": "3",
"link": "",
"location": "UK",
"media": "Print",
"media": "",
"page": "100-130",
"pmcid": "PMC7654321",
"pmid": "123456789",
Expand All @@ -233,6 +241,7 @@
"approximate": "false",
"category": "Ethics",
"container": "book",
"content": "",
"date": "2015-02-14",
"date_type": "default",
"doi": "10.1000/190",
Expand All @@ -243,7 +252,7 @@
"issue": "",
"link": "https://example.com/ai-ethics-book",
"location": "Australia",
"media": "Print",
"media": "",
"page": "450",
"pmcid": "",
"pmid": "",
Expand All @@ -261,6 +270,7 @@
"approximate": "true",
"category": "Environmental Science",
"container": "Journal",
"content": "",
"date": "2014-09-30",
"date_type": "season",
"doi": "10.1000/191",
Expand All @@ -271,14 +281,74 @@
"issue": "4",
"link": "https://example.com/climate-change-journal",
"location": "Global",
"media": "Online",
"media": "",
"page": "200-230",
"pmcid": "PMC2345678",
"pmid": "234567890",
"publisher": "Environmental Journal Publishing",
"type": "az_article_journal",
"version": "Final",
"volume": "20"
},
{
"id": 11,
"title": "The Life of Leonardo da Vinci",
"authors": "1",
"accessed_date": "2023-11-26",
"abstract": "Wilbur Wildcat's book review on The Life of Leonardo da Vinci, exploring the Renaissance master's boundless creativity and curiosity.",
"approximate": "false",
"category": "Book Review",
"container": "Book Review",
"content" : "191",
"date": "2023-11-26",
"date_type": "default",
"doi": "",
"extra_links": "",
"image": "1386px-Leonardo_da_Vinci_-_presumed_self-portrait_-_WGA12798.jpg",
"isbn": "",
"issn": "",
"issue": "",
"link": "https://example.com/wildcat-book-review",
"location": "USA",
"media": "Wilbur_Wildcat_Book_Review_The_Life_of_Leonardo_da_Vinci.pdf",
"page": "",
"pmcid": "",
"pmid": "",
"publisher": "University of Arizona Quickstart Publishing",
"type": "az_review_book",
"version": "1st Edition",
"volume": "",
"uuid": "51f0ed83-fa70-4e9a-90d5-1b08f4835078"
},
{
"id": 12,
"title": "The Life of Leonardo da Vinci",
"authors": "2",
"accessed_date": "2023-11-26",
"abstract": "Wilma Wildcat's book review on The Life of Leonardo da Vinci, highlighting the passion and creativity of the Renaissance master.",
"approximate": "false",
"category": "Book Review",
"container": "Book Review",
"content" : "192",
"date": "2023-11-26",
"date_type": "default",
"doi": "",
"extra_links": "",
"image": "1386px-Leonardo_da_Vinci_-_presumed_self-portrait_-_WGA12798.jpg",
"isbn": "",
"issn": "",
"issue": "",
"link": "",
"location": "USA",
"media": "Wilma_Wildcat_phd_Book_Review_The_Life_of_Leonardo_da_Vinci.pdf",
"page": "",
"pmcid": "",
"pmid": "",
"publisher": "University of Arizona Publishing",
"type": "az_review_book",
"version": "1st Edition",
"volume": "",
"uuid": "c0cfb47c-60fa-4d5f-96d3-b5528d5eb583"
}
]
}
10 changes: 10 additions & 0 deletions modules/custom/az_demo/data/az_demo_text_paragraph.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@
"id": 89,
"az_text_area": "<code>code tag</code> <br> <pre>pre tags</pre>",
"bottom_spacing": "mb-0"
},
{
"id": 191,
"az_text_area": "<strong>Howdy Wildcats!</strong> It's your favorite mascot, Wilbur Wildcat, here to pounce on a new book review. Today, we're diving into <em>The Life of Leonardo da Vinci</em> by Serge Bramly, and let me tell you, this book is as fierce as a last-minute game-winning touchdown!<br><br>If you've ever been curious about what made one of history's greatest geniuses tick, this book will give you all the insight you need. Bramly paints a vivid picture of da Vinci's life, from his early years in Italy to his revolutionary work as an artist, scientist, and inventor. You'll discover how Leonardo's boundless curiosity led to amazing creations and how his relentless drive pushed the boundaries of what was possible during the Renaissance.<br><br>Right from the start, you're catapulted back to Renaissance Italy, and I gotta say, Leonardo was a true top cat of his time. He wasn't just a painter; he was a thinker, an inventor, and a dreamer—the kind of guy who made everything from mechanical lions to famous paintings like the <em>Mona Lisa</em>. And let me tell ya, folks, he had more interests than I have stripes! The book really digs into his life and lets you see that the dude was a total genius, but also, just like us, he sometimes struggled with unfinished projects (anyone else still trying to finish last semester's paper?).<br><br>The author brings da Vinci to life, showing not only the strokes of his brush but also his scribbles and sketches—which by the way, would look great on the walls of our library. I think what really clawed my attention was how Leonardo never stopped exploring, never stopped wondering, and always had the heart of a curious wildcat. If you're looking for a tale of passion, creativity, and a bit of mystery, this is the book to sink your claws into.<br><br>So, if you're prowling for something that makes you feel inspired to tackle big ideas or just curious to know more about the cat who drew Vitruvian Man, grab this book from the library and give it a read. You might just discover a little Leonardo in you too!<br><br>Stay curious, Wildcats!<br><br>— Wilbur Wildcat",
"bottom_spacing": "mb-0"
},
{
"id": 192,
"az_text_area": "<strong>Howdy Wildcats!</strong> It's Wilma Wildcat here, ready to share my thoughts on <em>The Life of Leonardo da Vinci</em> by Serge Bramly! Let me tell you, Wildcats, this book is an absolute masterpiece, much like the man himself!<br><br>Leonardo da Vinci wasn't just a painter—he was an inventor, a scientist, and a dreamer with paws in so many different pursuits. Bramly does an incredible job of showing just how curious and adventurous Leonardo was. Each chapter takes you deeper into his life, from his early days in Florence to his groundbreaking sketches and ideas. It’s like taking a stroll through the Renaissance, and believe me, the sights are spectacular!<br><br>What really grabbed my attention was Leonardo's determination. He faced obstacles, sure, but he always kept pushing the limits of what could be done. Whether he was dissecting bodies to better understand anatomy or designing machines centuries ahead of his time, Leonardo’s passion is infectious. It made me want to tackle some big projects of my own—like making sure every Wildcat knows the magic of learning and creativity!<br><br>The book doesn’t just tell you about Leonardo’s famous works like the <em>Mona Lisa</em> or <em>The Last Supper</em>. It also gives you a glimpse into his unfinished works and constant experimenting. Just like us Wildcats when we're trying to perfect our game, Leonardo never stopped striving for more. His sketches and notes are everywhere in this book, and it’s amazing to see how his mind worked.<br><br>If you're looking for a book that will inspire you to be curious, explore new ideas, and take on challenges head-first, this one is for you. So grab your library card, Wildcats, and check it out! Trust me, you'll come away feeling like anything is possible.<br><br>Stay adventurous, and keep that curiosity alive!<br><br>— Wilma Wildcat",
"bottom_spacing": "mb-0"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
75 changes: 75 additions & 0 deletions modules/custom/az_demo/migrations/az_demo_media_document.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
id: az_demo_media_document
label: AZ Quickstart Demo Media Documents
migration_tags:
- Quickstart Demo Content
- Media
source:
constants:
DEMO_FILE_DIRECTORY: profiles/custom/az_quickstart/modules/custom/az_demo/media/document
DRUPAL_FILE_SCHEME: 'public://'
plugin: url
data_fetcher_plugin: file
data_parser_plugin: json
urls:
- profiles/custom/az_quickstart/modules/custom/az_demo/data/az_demo_media_document.json
item_selector: documents
ids:
filename:
type: string

fields:
-
name: uuid
selector: uuid
-
name: filename
selector: filename

destination:
plugin: 'entity:media'
process:
uuid:
plugin: skip_on_empty
method: process
source: uuid
bundle:
plugin: default_value
default_value: az_document

pseudo_source_path:
-
plugin: concat
delimiter: /
source:
- constants/DEMO_FILE_DIRECTORY
- filename

pseudo_destination_path:
-
plugin: concat
delimiter: ''
source:
- constants/DRUPAL_FILE_SCHEME
- filename

filename: filename
uri:
-
plugin: file_copy
source:
- '@pseudo_source_path'
- '@pseudo_destination_path'
file_exists: replace
move: false

'field_media_az_document/target_id':
plugin: entity_generate
source: '@uri'
entity_type: file
value_key: uri

# Dependencies.
dependencies:
enforced:
module:
- az_media
Loading
Loading