Skip to content

Commit

Permalink
Add preview condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Prokyonn committed Dec 21, 2023
1 parent c3e02eb commit a79ecee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Admin/ArticleAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ function(Localization $localization) {
];
}

$previewCondition = 'route != null';

$viewCollection->add(
$this->viewBuilderFactory->createListViewBuilder(static::LIST_VIEW . '_' . $typeKey, '/:locale/' . $typeKey)
->setResourceKey(ArticleDocument::RESOURCE_KEY)
Expand Down Expand Up @@ -308,6 +310,7 @@ function(Localization $localization) {
->setTabCondition('shadowOn == false')
->setTabPriority(1024)
->addToolbarActions($formToolbarActionsWithType)
->setPreviewCondition($previewCondition)
->setParent(static::EDIT_FORM_VIEW . '_' . $typeKey)
);
$viewCollection->add(
Expand All @@ -318,6 +321,7 @@ function(Localization $localization) {
->setTabCondition('shadowOn == false')
->addToolbarActions($formToolbarActionsWithoutType)
->setTitleVisible(true)
->setPreviewCondition($previewCondition)
->setParent(static::EDIT_FORM_VIEW . '_' . $typeKey)
);
$viewCollection->add(
Expand All @@ -328,6 +332,7 @@ function(Localization $localization) {
->setTabCondition('shadowOn == false')
->addToolbarActions($formToolbarActionsWithoutType)
->setTitleVisible(true)
->setPreviewCondition($previewCondition)
->setParent(static::EDIT_FORM_VIEW . '_' . $typeKey)
);
$viewCollection->add(
Expand All @@ -338,6 +343,7 @@ function(Localization $localization) {
->setTabPriority(512)
->addToolbarActions($formToolbarActionsWithoutType)
->setTitleVisible(true)
->setPreviewCondition($previewCondition)
->setParent(static::EDIT_FORM_VIEW . '_' . $typeKey)
);

Expand Down

0 comments on commit a79ecee

Please sign in to comment.