-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
210 additions
and
35 deletions.
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
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
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,97 @@ | ||
<?php | ||
|
||
namespace App\Transformers\Outbound\Web; | ||
|
||
use App\Transformers\Outbound\Web\Traits\HasPublishDates; | ||
|
||
use App\Transformers\Outbound\AbstractTransformer as BaseTransformer; | ||
|
||
class PressRelease extends BaseTransformer | ||
{ | ||
|
||
use HasPublishDates; | ||
|
||
protected function getFields() | ||
{ | ||
$sharedFields = [ | ||
// TODO: Ensure consistent naming and move to HasPublishDates | ||
'is_published' => [ | ||
'doc' => 'Whether the page has been published', | ||
'type' => 'boolean', | ||
'elasticsearch' => 'boolean', | ||
'value' => function ($item) { | ||
return $item->published; | ||
}, | ||
'is_restricted' => true, | ||
], | ||
'is_unlisted' => [ | ||
'doc' => 'Whether the press release is unlisted', | ||
'type' => 'boolean', | ||
'elasticsearch' => 'boolean', | ||
'value' => function ($item) { | ||
return $item->is_unlisted; | ||
}, | ||
'is_restricted' => true, | ||
], | ||
// TODO: This seems to always be null. Remove? | ||
'type' => [ | ||
'doc' => 'The type of page this record represents', | ||
'type' => 'string', | ||
'elasticsearch' => 'keyword', | ||
], | ||
|
||
'web_url' => [ | ||
'doc' => 'The URL to this page on our website', | ||
'type' => 'string', | ||
'elasticsearch' => 'keyword', | ||
], | ||
'slug' => [ | ||
'doc' => 'A human-readable string used in the URL', | ||
'type' => 'string', | ||
'elasticsearch' => 'keyword', | ||
], | ||
|
||
// TODO: This also seems to always be null. Audit? | ||
'image_url' => [ | ||
'doc' => 'The URL of an image representing this page', | ||
'type' => 'string', | ||
'elasticsearch' => 'keyword', | ||
], | ||
|
||
// TODO: Give option to put long fields last? | ||
// TODO: Combine `listing_description` and `short_description`? | ||
'listing_description' => [ | ||
'doc' => 'A brief description of the page used in listings', | ||
'type' => 'string', | ||
'elasticsearch' => 'text', | ||
], | ||
'short_description' => [ | ||
'doc' => 'A brief description of the page used in mobile and meta tags', | ||
'type' => 'string', | ||
'elasticsearch' => 'text', | ||
], | ||
'copy' => [ | ||
'doc' => 'The text of the page', | ||
'type' => 'string', | ||
'elasticsearch' => [ | ||
'default' => true, | ||
], | ||
], | ||
]; | ||
|
||
return array_merge( | ||
$sharedFields, | ||
$this->getPageFields() | ||
); | ||
} | ||
|
||
/** | ||
* Provide a way for child classes to add fields to the transformation. | ||
* | ||
* @return array | ||
*/ | ||
protected function getPageFields() | ||
{ | ||
return []; | ||
} | ||
} |
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
24 changes: 24 additions & 0 deletions
24
database/migrations/2022_04_15_151647_drop_support_aat_id_from_artworks.php
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,24 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class DropSupportAatIdFromArtworks extends Migration | ||
{ | ||
public function up() | ||
{ | ||
Schema::table('artworks', function (Blueprint $table) { | ||
$table->dropColumn([ | ||
'support_aat_id', | ||
]); | ||
}); | ||
} | ||
|
||
public function down() | ||
{ | ||
Schema::table('artworks', function (Blueprint $table) { | ||
$table->integer('support_aat_id')->signed()->nullable()->after('medium_display'); | ||
}); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
database/migrations/2022_04_18_130811_add_is_unlisted_columns.php
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,46 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class AddIsUnlistedColumns extends Migration | ||
{ | ||
public function up() | ||
{ | ||
Schema::table('articles', function (Blueprint $table) { | ||
$table->boolean('is_unlisted')->default(false); | ||
}); | ||
|
||
Schema::table('experiences', function (Blueprint $table) { | ||
$table->boolean('is_unlisted')->default(false); | ||
}); | ||
|
||
Schema::table('highlights', function (Blueprint $table) { | ||
$table->boolean('is_unlisted')->default(false); | ||
}); | ||
|
||
Schema::table('press_releases', function (Blueprint $table) { | ||
$table->boolean('is_unlisted')->default(false); | ||
}); | ||
} | ||
|
||
public function down() | ||
{ | ||
Schema::table('articles', function (Blueprint $table) { | ||
$table->dropColumn('is_unlisted'); | ||
}); | ||
|
||
Schema::table('experiences', function (Blueprint $table) { | ||
$table->dropColumn('is_unlisted'); | ||
}); | ||
|
||
Schema::table('highlights', function (Blueprint $table) { | ||
$table->dropColumn('is_unlisted'); | ||
}); | ||
|
||
Schema::table('press_releases', function (Blueprint $table) { | ||
$table->dropColumn('is_unlisted'); | ||
}); | ||
} | ||
} |