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

Update all forms to formview declarations [WEB-2984] #663

Draft
wants to merge 12 commits into
base: feature/twill-upgrade
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion app/Http/Controllers/Twill/ArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class ArticleController extends \App\Http\Controllers\Twill\ModuleController
'edit_link' => true,
'sort' => true,
'field' => 'author',
'present' => true,
],
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ protected function indexData($request)
'breadcrumb' => [
[
'label' => 'Digital Publication',
'url' => moduleRoute('digitalPublications', 'collection.articles_publications', 'index'),
'url' => moduleRoute('digitalPublications', 'collection.articlesPublications', 'index'),
],
[
'label' => $digPub->title,
'url' => moduleRoute('digitalPublications', 'collection.articles_publications', 'edit', [$digPub->id]),
'url' => moduleRoute('digitalPublications', 'collection.articlesPublications', 'edit', [$digPub->id]),
],
[
'label' => 'Articles',
Expand Down Expand Up @@ -100,7 +100,7 @@ protected function getBrowserData($prependScope = []): array
return [
'id' => $article->id,
'name' => $name,
'edit' => route('twill.collection.articles_publications.digitalPublications.articles.edit', [
'edit' => route('twill.collection.articlesPublications.digitalPublications.articles.edit', [
'digitalPublication' => $article->digital_publication_id,
'article' => $article->id
]),
Expand Down Expand Up @@ -139,15 +139,15 @@ protected function formData($request)
'breadcrumb' => [
[
'label' => 'Digital Publications',
'url' => moduleRoute('digitalPublications', 'collection.articles_publications', 'index'),
'url' => moduleRoute('digitalPublications', 'collection.articlesPublications', 'index'),
],
[
'label' => $digPub->title,
'url' => moduleRoute('digitalPublications', 'collection.articles_publications', 'edit', [$digPub->id]),
'url' => moduleRoute('digitalPublications', 'collection.articlesPublications', 'edit', [$digPub->id]),
],
[
'label' => 'Articles',
'url' => moduleRoute('digitalPublications.articles', 'collection.articles_publications', 'index', [$request->route('digitalPublication')]),
'url' => moduleRoute('digitalPublications.articles', 'collection.articlesPublications', 'index', [$request->route('digitalPublication')]),
],
[
'label' => $item->title,
Expand Down
10 changes: 5 additions & 5 deletions app/Http/Controllers/Twill/ExperienceSlideController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ protected function indexData($request)
'breadcrumb' => [
[
'label' => 'Experiences',
'url' => moduleRoute('experiences', 'collection.interactive_features', 'index'),
'url' => moduleRoute('experiences', 'collection.interactiveFeatures', 'index'),
],
[
'label' => $experience->title,
'url' => moduleRoute('experiences', 'collection.interactive_features', 'edit', [$experience->id]),
'url' => moduleRoute('experiences', 'collection.interactiveFeatures', 'edit', [$experience->id]),
],
[
'label' => 'Slides',
Expand Down Expand Up @@ -64,15 +64,15 @@ protected function formData($request)
'breadcrumb' => [
[
'label' => 'Experiences',
'url' => moduleRoute('experiences', 'collection.interactive_features', 'index'),
'url' => moduleRoute('experiences', 'collection.interactiveFeatures', 'index'),
],
[
'label' => $experience->title,
'url' => moduleRoute('experiences', 'collection.interactive_features', 'edit', [$experience->id]),
'url' => moduleRoute('experiences', 'collection.interactiveFeatures', 'edit', [$experience->id]),
],
[
'label' => 'Slides',
'url' => moduleRoute('experiences.slides', 'collection.interactive_features', 'index', [$experience->id]),
'url' => moduleRoute('experiences.slides', 'collection.interactiveFeatures', 'index', [$experience->id]),
],
[
'label' => $slide->title,
Expand Down
11 changes: 5 additions & 6 deletions app/Http/Controllers/Twill/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function home(PageRepository $pages)
public function exhibitions(PageRepository $pages)
{
abort_unless($page = $pages->byName('Exhibitions and Events'), 500, self::MISSING_CMS_PAGE_MESSAGE);
Session::put('pages_back_link', route('twill.exhibitions_events.landing'));
Session::put('pages_back_link', route('twill.exhibitionsEvents.landing'));

$additionalFieldsets = [];
$fields = $this->form($page->id);
Expand All @@ -68,11 +68,10 @@ public function art(PageRepository $pages)
return view('twill.pages.form', $fields);
}

// phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
public function articles_publications(PageRepository $pages)
public function articlesPublications(PageRepository $pages)
{
abort_unless($page = $pages->byName('Articles and Publications'), 500, self::MISSING_CMS_PAGE_MESSAGE);
Session::put('pages_back_link', route('twill.collection.articles_publications.landing'));
Session::put('pages_back_link', route('twill.collection.articlesPublications.landing'));

$additionalFieldsets = [];
$fields = $this->form($page->id);
Expand Down Expand Up @@ -107,7 +106,7 @@ public function visit(PageRepository $pages)
public function articles(PageRepository $pages)
{
abort_unless($page = $pages->byName('Articles'), 500, self::MISSING_CMS_PAGE_MESSAGE);
Session::put('pages_back_link', route('twill.collection.articles_publications.landing'));
Session::put('pages_back_link', route('twill.collection.articlesPublications.landing'));
$additionalFieldsets = [];
$fields = $this->form($page->id);
$fields['additionalFieldsets'] = $additionalFieldsets;
Expand All @@ -118,7 +117,7 @@ public function articles(PageRepository $pages)
public function exhibitionHistory(PageRepository $pages)
{
abort_unless($page = $pages->byName('Exhibition History'), 500, self::MISSING_CMS_PAGE_MESSAGE);
Session::put('pages_back_link', route('twill.exhibitions_events.history'));
Session::put('pages_back_link', route('twill.exhibitionsEvents.history'));

$additionalFieldsets = [];
$fields = $this->form($page->id);
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function getUrlWithoutSlugAttribute()

public function getAdminEditUrlAttribute()
{
return route('twill.collection.articles_publications.articles.edit', $this->id);
return route('twill.collection.articlesPublications.articles.edit', $this->id);
}

public function categories()
Expand Down
4 changes: 4 additions & 0 deletions app/Models/Behaviors/HasAuthors.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public function showAuthors()
}
}

public function getAuthorAttribute() {
return $this->showAuthors();
}

/**
* Meant for sidebar.
*/
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Behaviors/HasFeaturedRelated.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getCustomRelatedItems()
$relatedItems = $this->getRelatedWithApiModels('sidebar_items', [
'exhibitions' => [
'apiModel' => 'App\Models\Api\Exhibition',
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
'moduleName' => 'exhibitions',
],
], [
Expand Down
2 changes: 1 addition & 1 deletion app/Models/DigitalPublication.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function getUrlAttribute()

public function getAdminEditUrlAttribute()
{
return route('twill.collection.articles_publications.digitalPublications.edit', $this->id);
return route('twill.collection.articlesPublications.digitalPublications.edit', $this->id);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Models/EducatorResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function getUrlAttribute()

public function getAdminEditUrlAttribute()
{
return route('twill.collection.research_resources.educatorResources.edit', $this->id);
return route('twill.collection.researchResources.educatorResources.edit', $this->id);
}

public function scopeIds($query, $ids = []): Builder
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function getUrlWithoutSlugAttribute()

public function getAdminEditUrlAttribute()
{
return route('twill.exhibitions_events.events.edit', $this->id);
return route('twill.exhibitionsEvents.events.edit', $this->id);
}

public function getTimeStartAttribute()
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Exhibition.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function getTitleInBucketAttribute()

public function getAdminEditUrlAttribute()
{
return route('twill.exhibitions_events.exhibitions.edit', $this->id);
return route('twill.exhibitionsEvents.exhibitions.edit', $this->id);
}

public function events()
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Experience.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public function getUrl()

public function getAdminEditUrlAttribute()
{
return route('twill.collection.interactive_features.experiences.edit', $this->id);
return route('twill.collection.interactiveFeatures.experiences.edit', $this->id);
}

public function getUrlWithoutSlugAttribute()
Expand Down
2 changes: 1 addition & 1 deletion app/Models/PrintedPublication.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function getUrlAttribute()

public function getAdminEditUrlAttribute()
{
return route('twill.collection.articles_publications.printedPublications.edit', $this->id);
return route('twill.collection.articlesPublications.printedPublications.edit', $this->id);
}

protected function transformMappingInternal()
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Video.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function getUrlWithoutSlugAttribute()

public function getAdminEditUrlAttribute()
{
return route('twill.collection.articles_publications.videos.edit', $this->id);
return route('twill.collection.articlesPublications.videos.edit', $this->id);
}

public function getUrlAttribute()
Expand Down
6 changes: 3 additions & 3 deletions app/Repositories/Api/ArtistRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function getRelatedItems($item)
$hiddenItems = $item->getRelatedWithApiModels('hidden_related_items', [
'exhibitions' => [
'apiModel' => 'App\Models\Api\Exhibition',
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
'moduleName' => 'exhibitions',
],
], [
Expand All @@ -42,12 +42,12 @@ public function getCustomRelatedItems($item)
$relatedItems = $item->getRelatedWithApiModels('related_items', [
'exhibitions' => [
'apiModel' => 'App\Models\Api\Exhibition',
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
'moduleName' => 'exhibitions',
],
'experiences' => [
'apiModel' => 'App\Models\Experience',
'routePrefix' => 'collection.interactive_features',
'routePrefix' => 'collection.interactiveFeatures',
'moduleName' => 'experiences',
],
], [
Expand Down
4 changes: 2 additions & 2 deletions app/Repositories/Api/DepartmentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ public function getCustomRelatedItems($item)
$relatedItems = $item->getRelatedWithApiModels('related_items', [
'exhibitions' => [
'apiModel' => 'App\Models\Api\Exhibition',
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
'moduleName' => 'exhibitions',
],
'experiences' => [
'apiModel' => 'App\Models\Experience',
'routePrefix' => 'collection.interactive_features',
'routePrefix' => 'collection.interactiveFeatures',
'moduleName' => 'experiences',
],
], [
Expand Down
6 changes: 3 additions & 3 deletions app/Repositories/ArtistRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public function getFormFields(TwillModelContract $object): array
$fields['browsers']['related_items'] = $this->getFormFieldsForMultiBrowserApi($object, 'related_items', [
'experiences' => [
'apiModel' => 'App\Models\Experience',
'routePrefix' => 'collection.interactive_features',
'routePrefix' => 'collection.interactiveFeatures',
'moduleName' => 'experiences',
],
'exhibitions' => [
'apiModel' => 'App\Models\Api\Exhibition',
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
'moduleName' => 'exhibitions',
],
], [
Expand All @@ -65,7 +65,7 @@ public function getFormFields(TwillModelContract $object): array
$fields['browsers']['hidden_related_items'] = $this->getFormFieldsForMultiBrowserApi($object, 'hidden_related_items', [
'exhibitions' => [
'apiModel' => 'App\Models\Api\Exhibition',
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
'moduleName' => 'exhibitions',
],
], [
Expand Down
2 changes: 1 addition & 1 deletion app/Repositories/Behaviors/HandleFeaturedRelated.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getFormFieldsHandleFeaturedRelated(TwillModelContract $object, a
$fields['browsers']['sidebar_items'] = $this->getFormFieldsForMultiBrowserApi($object, 'sidebar_items', [
'exhibitions' => [
'apiModel' => 'App\Models\Api\Exhibition',
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
'moduleName' => 'exhibitions',
],
], [
Expand Down
4 changes: 2 additions & 2 deletions app/Repositories/DepartmentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public function getFormFields(TwillModelContract $object): array
$fields['browsers']['related_items'] = $this->getFormFieldsForMultiBrowserApi($object, 'related_items', [
'experiences' => [
'apiModel' => 'App\Models\Experience',
'routePrefix' => 'collection.interactive_features',
'routePrefix' => 'collection.interactiveFeatures',
'moduleName' => 'experiences',
],
'exhibitions' => [
'apiModel' => 'App\Models\Api\Exhibition',
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
'moduleName' => 'exhibitions',
],
], [
Expand Down
4 changes: 2 additions & 2 deletions app/Repositories/EventRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class EventRepository extends ModuleRepository

protected $browsers = [
'sponsors' => [
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
],
'events' => [
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
]
];

Expand Down
6 changes: 3 additions & 3 deletions app/Repositories/ExhibitionRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ class ExhibitionRepository extends BaseApiRepository

protected $browsers = [
'sponsors' => [
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
],
'events' => [
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
]
];

protected $apiBrowsers = [
'exhibitions' => [
'routePrefix' => 'exhibitions_events'
'routePrefix' => 'exhibitionsEvents'
],
'shopItems',
'waitTimes',
Expand Down
2 changes: 1 addition & 1 deletion app/Repositories/GenericPageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class GenericPageRepository extends ModuleRepository

protected $browsers = [
'sponsors' => [
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
],
];

Expand Down
6 changes: 3 additions & 3 deletions app/Repositories/HomeFeatureRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class HomeFeatureRepository extends ModuleRepository

protected $browsers = [
'articles' => [
'routePrefix' => 'collection.articles_publications',
'routePrefix' => 'collection.articlesPublications',
],
'events' => [
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
],
'highlights' => [
'routePrefix' => 'collection',
Expand All @@ -29,7 +29,7 @@ class HomeFeatureRepository extends ModuleRepository

protected $apiBrowsers = [
'exhibitions' => [
'routePrefix' => 'exhibitions_events'
'routePrefix' => 'exhibitionsEvents'
],
];

Expand Down
6 changes: 3 additions & 3 deletions app/Repositories/PageFeatureRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class PageFeatureRepository extends ModuleRepository

protected $browsers = [
'articles' => [
'routePrefix' => 'collection.articles_publications',
'routePrefix' => 'collection.articlesPublications',
],
'events' => [
'routePrefix' => 'exhibitions_events',
'routePrefix' => 'exhibitionsEvents',
],
'highlights' => [
'routePrefix' => 'collection',
Expand All @@ -29,7 +29,7 @@ class PageFeatureRepository extends ModuleRepository

protected $apiBrowsers = [
'exhibitions' => [
'routePrefix' => 'exhibitions_events'
'routePrefix' => 'exhibitionsEvents'
],
];

Expand Down
Loading
Loading