-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: news data array adjusted for component loop, and test updated #768
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e1c5ab7
feat: news data array adjusted for component loop, and test updated
Fw7424 642ddc8
fix: remove commented code
Fw7424 a78b147
feat: news columns and row styleguide data. WIP this displays but err…
Fw7424 0ef3fb3
feat: Styleguide data setup for articles
Fw7424 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
<?php | ||
|
||
namespace Factories; | ||
|
||
use Contracts\Factories\FactoryContract; | ||
use Faker\Factory; | ||
|
||
class ArticleComponent implements FactoryContract | ||
{ | ||
/** | ||
* Construct the factory. | ||
*/ | ||
public function __construct(Factory $faker) | ||
{ | ||
$this->faker = $faker->create(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function create($limit = 1, $flatten = false, $options = []) | ||
{ | ||
$hero = [ | ||
'featured' => 0, | ||
'url' => '/styleguide/image/1600x580', | ||
'caption' => $this->faker->sentence(rand(5, 10)), | ||
'alt_text' => $this->faker->sentence(rand(5, 10)), | ||
'type' => 'Hero Image', | ||
]; | ||
|
||
$social = [ | ||
'featured' => 0, | ||
'url' => '/styleguide/image/1600x580', | ||
'caption' => $this->faker->sentence(rand(5, 10)), | ||
'alt_text' => $this->faker->sentence(rand(5, 10)), | ||
'type' => 'Social Image', | ||
]; | ||
|
||
$featured = [ | ||
'featured' => 1, | ||
'url' => '/styleguide/image/770x434', | ||
'caption' => $this->faker->sentence(rand(5, 10)), | ||
'alt_text' => $this->faker->sentence(rand(5, 10)), | ||
'type' => 'Embeddable', | ||
]; | ||
|
||
$faculty = []; | ||
for ($i = 0; $i < 3; $i++) { | ||
$faculty[] = [ | ||
'id' => $this->faker->randomDigit(), | ||
'first_name' => $this->faker->firstName(), | ||
'last_name' => $this->faker->lastName(), | ||
'accessid' => $this->faker->randomLetter().$this->faker->randomLetter().$this->faker->randomNumber(4, true), | ||
]; | ||
} | ||
|
||
$programs = []; | ||
for ($i = 0; $i < 3; $i++) { | ||
$programs[] = [ | ||
'name' => $this->faker->randomElement(['Accounting (BS)', 'Art Education (BA)', 'Biological Sciences (BA)', 'Chemical Engineering (MS)']), | ||
'url' => 'https://wayne.edu', | ||
]; | ||
} | ||
|
||
$assets = []; | ||
for ($i = 0; $i < 3; $i++) { | ||
$assets[] = [ | ||
'id' => $this->faker->randomDigit(), | ||
'url' => 'https://wayne.edu', | ||
'caption' => $this->faker->sentence(), | ||
'filename' => substr(md5($this->faker->sentence()), 0, 10).'.pdf', | ||
]; | ||
} | ||
|
||
for ($i = 1; $i <= $limit; $i++) { | ||
$data[$i] = [ | ||
'id' => $i, | ||
'user_id' => $this->faker->randomDigit(), | ||
'application_id' => $this->faker->randomDigit(), | ||
'favicon_id' => null, | ||
'title' => $this->faker->sentence(rand(6, 10)), | ||
'short_title' => $this->faker->sentence(rand(3, 6)), | ||
'sub_title' => null, | ||
'permalink' => $this->faker->slug(), | ||
'meta_description' => $this->faker->sentence(), | ||
'body' => '<p>'.$this->faker->paragraph(8).'</p> | ||
<p>'.$this->faker->paragraph(8).'</p> | ||
<figure class="figure" style="padding-bottom:10px; float:right"> | ||
<img alt="Placeholder" height="400" src="/styleguide/image/300x400?text=Figure%20float%20right" style="padding:10px" width="300"> | ||
<figcaption>'.$this->faker->paragraph().'</figcaption> | ||
</figure> | ||
<p>'.$this->faker->paragraph().'</p> | ||
<blockquote class="blockquote1"> | ||
<p>'.$this->faker->paragraph(1).'</p> | ||
</blockquote> | ||
<p>'.$this->faker->paragraph(8).'</p> | ||
<p>'.$this->faker->paragraph(8).'</p> | ||
<blockquote class="blockquote2"> | ||
<p>'.$this->faker->paragraph(1).'</p> | ||
</blockquote> | ||
<p>'.$this->faker->paragraph(8).'</p> | ||
<p>'.$this->faker->paragraph(8).'</p> | ||
<p> </p> | ||
<h2>'.$this->faker->paragraph(1).'</h2> | ||
<figure class="figure" style="padding-bottom:10px; float:left"> | ||
<img alt="Placeholder" height="600" src="/styleguide/image/800x600?text=Figure%20float%20left" style="padding:10px" width="800"> | ||
<figcaption>'.$this->faker->paragraph().'</figcaption> | ||
</figure> | ||
<p>'.$this->faker->paragraph(8).'</p> | ||
<p>'.$this->faker->paragraph(15).'</p> | ||
<blockquote class="blockquote3"> | ||
<p>'.$this->faker->paragraph(5).'</p> | ||
</blockquote> | ||
<p>'.$this->faker->paragraph(15).'</p> | ||
<div style="text-align:center"> | ||
<figure class="figure" style="display:inline-block"> | ||
<img alt="Placeholder" height="450" src="/styleguide/image/800x450?text=Figure%20centered" style="padding:10px" width="800"> | ||
<figcaption>'.$this->faker->paragraph().'</figcaption> | ||
</figure> | ||
</div> | ||
<p>'.$this->faker->paragraph(15).'</p> | ||
<img alt="Placeholder" height="400" src="/styleguide/image/300x400?text=Image%20float%20right" style="padding:10px; float:right" width="300"> | ||
<p>'.$this->faker->paragraph(8).'</p> | ||
<p>'.$this->faker->paragraph(15).'</p> | ||
<img alt="Placeholder" height="300" src="/styleguide/image/400x300?text=Image%20float%20left" style="padding:10px; float:left" width="400"> | ||
<p>'.$this->faker->paragraph(8).'</p> | ||
<p>'.$this->faker->paragraph(15).'</p> | ||
<p style="text-align:center"> | ||
<img alt="Placeholder" height="350" src="/styleguide/image/800x350?text=Image%20centered" style="padding:10px" width="800"> | ||
</p> | ||
<p>'.$this->faker->paragraph(8).'</p> | ||
', | ||
'article_date' => $this->faker->date(), | ||
'status' => 'Published', | ||
'link' => '/styleguide/'.config('base.news_view_route').'/item-1', | ||
'hero_image' => $hero, | ||
'social_image' => $social, | ||
'featured' => $featured, | ||
'files' => [ | ||
0 => $hero, | ||
1 => $featured, | ||
], | ||
'assets' => $this->faker->randomElements($assets, rand(1, 3)), | ||
'faculty' => $this->faker->randomElements($faculty, rand(1, 3)), | ||
'programs' => $this->faker->randomElements($programs, rand(1, 3)), | ||
'favicon' => null, | ||
'user' => null, | ||
'applications' => null, | ||
]; | ||
|
||
$data[$i] = array_replace_recursive($data[$i], $options); | ||
} | ||
|
||
if ($limit === 1 && $flatten === true) { | ||
$data = current($data); | ||
} | ||
|
||
return $data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Factories; | ||
|
||
use Contracts\Factories\FactoryContract; | ||
use Faker\Factory; | ||
|
||
class ArticleMeta implements FactoryContract | ||
{ | ||
/** | ||
* Construct the factory. | ||
*/ | ||
public function __construct(Factory $faker) | ||
{ | ||
$this->faker = $faker->create(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function create($limit = 1, $flatten = false, $options = []) | ||
{ | ||
$data = [ | ||
'total' => '', | ||
'per_page' => '', | ||
'current_page' => '', | ||
'last_page' => 3, | ||
'next_page_url' => '', | ||
'prev_page_url' => '', | ||
]; | ||
|
||
return $data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file needed? It isn't referenced anywhere.