Skip to content

Commit 720f1ea

Browse files
nikhiltriIllyaMoskvin
authored andcommitted
Rename selections to highlights [API-32]
1 parent fe6ebd5 commit 720f1ea

File tree

12 files changed

+60
-32
lines changed

12 files changed

+60
-32
lines changed

app/Console/Commands/Import/ImportWebFull.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use App\Models\Web\Exhibition;
1212
use App\Models\Web\Experience;
1313
use App\Models\Web\InteractiveFeature;
14-
use App\Models\Web\Selection;
14+
use App\Models\Web\Highlight;
1515
use App\Models\Web\GenericPage;
1616
use App\Models\Web\PressRelease;
1717
use App\Models\Web\EducatorResource;
@@ -70,7 +70,7 @@ protected function reset($endpoint = null)
7070
Exhibition::class => 'web_exhibitions',
7171
Experience::class => 'experiences',
7272
InteractiveFeature::class => 'interactive_features',
73-
Selection::class => 'selections',
73+
Highlight::class => 'highlights',
7474
GenericPage::class => 'generic_pages',
7575
PressRelease::class => 'press_releases',
7676
EducatorResource::class => 'educator_resources',
@@ -102,7 +102,7 @@ protected function importEndpoints()
102102
$this->importFromWeb('exhibitions');
103103
$this->importFromWeb('experiences');
104104
$this->importFromWeb('interactive-features');
105-
$this->importFromWeb('selections');
105+
$this->importFromWeb('highlights');
106106

107107
$this->importFromWeb('genericpages');
108108
$this->importFromWeb('pressreleases');

app/Http/Middleware/RestrictContent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static function getSearchRestrictForEndpoint($endpoint)
4747
'generic-pages',
4848
'press-releases',
4949
'printed-catalogues',
50-
'selections',
50+
'highlights',
5151
'sponsors',
5252
'static-pages',
5353
'web-exhibitions',

app/Models/BaseModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use App\Models\Web\GenericPage;
2121
use App\Models\Web\PressRelease;
2222
use App\Models\Web\PrintedCatalog;
23-
use App\Models\Web\Selection;
23+
use App\Models\Web\Highlight;
2424
use App\Models\Web\Sponsor;
2525
use App\Models\Web\StaticPage;
2626

@@ -140,7 +140,7 @@ public static function addRestrictContentScopes($isDump = false)
140140
GenericPage::addGlobalScope(new PublishedScope);
141141
PressRelease::addGlobalScope(new PublishedScope);
142142
PrintedCatalog::addGlobalScope(new PublishedScope);
143-
Selection::addGlobalScope(new PublishedScope);
143+
Highlight::addGlobalScope(new PublishedScope);
144144
Sponsor::addGlobalScope(new PublishedScope);
145145
StaticPage::addGlobalScope(new PublishedScope);
146146
WebExhibition::addGlobalScope(new PublishedScope);

app/Models/Web/Selection.php renamed to app/Models/Web/Highlight.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
use App\Models\WebModel;
66

77
/**
8-
* Selections are a grouping of artworks on the website
8+
* Highlights are a grouping of artworks on the website
99
*/
10-
class Selection extends WebModel
10+
class Highlight extends WebModel
1111
{
1212

1313
protected $casts = [

app/Transformers/Inbound/Web/Selection.php renamed to app/Transformers/Inbound/Web/Highlight.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use App\Transformers\Datum;
66
use App\Transformers\Inbound\WebTransformer;
77

8-
class Selection extends WebTransformer
8+
class Highlight extends WebTransformer
99
{
1010

1111
// Technically, we only need `copy`, but `imgix_url` gets pruned

app/Transformers/Outbound/Web/Selection.php renamed to app/Transformers/Outbound/Web/Highlight.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use App\Transformers\Outbound\AbstractTransformer as BaseTransformer;
88

9-
class Selection extends BaseTransformer
9+
class Highlight extends BaseTransformer
1010
{
1111

1212
use HasPublishDates;
@@ -22,12 +22,12 @@ protected function getFields()
2222
'is_restricted' => true,
2323
],
2424
'short_copy' => [
25-
'doc' => 'A brief summary of what is contained in the selection',
25+
'doc' => 'A brief summary of what is contained in the highlight',
2626
'type' => 'string',
2727
'elasticsearch' => 'text',
2828
],
2929
'copy' => [
30-
'doc' => 'The text of the selection description',
30+
'doc' => 'The text of the highlight description',
3131
'type' => 'string',
3232
'elasticsearch' => [
3333
'default' => true,

config/resources/inbound.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@
195195
'model' => \App\Models\Web\InteractiveFeature::class,
196196
'transformer' => \App\Transformers\Inbound\Web\InteractiveFeature::class,
197197
],
198-
'selections' => [
199-
'model' => \App\Models\Web\Selection::class,
200-
'transformer' => \App\Transformers\Inbound\Web\Selection::class,
198+
'highlights' => [
199+
'model' => \App\Models\Web\Highlight::class,
200+
'transformer' => \App\Transformers\Inbound\Web\Highlight::class,
201201
],
202202
'staticpages' => [
203203
'model' => \App\Models\Web\StaticPage::class,

config/resources/outbound.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,9 @@
363363
'is_searchable' => true,
364364
],
365365
[
366-
'endpoint' => 'selections',
367-
'model' => \App\Models\Web\Selection::class,
368-
'transformer' => \App\Transformers\Outbound\Web\Selection::class,
366+
'endpoint' => 'highlights',
367+
'model' => \App\Models\Web\Highlight::class,
368+
'transformer' => \App\Transformers\Outbound\Web\Highlight::class,
369369
'is_searchable' => true,
370370
],
371371
[

database/factories/WebFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
];
5454
});
5555

56-
$factory->define(App\Models\Web\Selection::class, function (Faker\Generator $faker) {
56+
$factory->define(App\Models\Web\Highlight::class, function (Faker\Generator $faker) {
5757
return [
5858
'id' => $faker->unique()->randomNumber(4) + 999 * pow(10, 4),
5959
'title' => ucfirst($faker->words(3, true)),
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class RenameSelectionsToHighlights extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::rename('selections', 'highlights');
17+
}
18+
19+
/**
20+
* Reverse the migrations.
21+
*
22+
* @return void
23+
*/
24+
public function down()
25+
{
26+
Schema::rename('highlights', 'selections');
27+
}
28+
}

0 commit comments

Comments
 (0)