Skip to content

Commit 19cd7ad

Browse files
committed
Merge remote-tracking branch 'origin/5.x'
2 parents b79120e + 37609e4 commit 19cd7ad

13 files changed

Lines changed: 91 additions & 23 deletions

File tree

resources/js/components/entries/PublishForm.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ export default {
658658
this.trackDirtyState = false;
659659
this.values = this.resetValuesFromResponse(response.data.data.values);
660660
this.extraValues = response.data.data.extraValues;
661-
this.trackDirtyStateTimeout = setTimeout(() => (this.trackDirtyState = true), 500);
661+
this.trackDirtyStateTimeout = setTimeout(() => (this.trackDirtyState = true), 750);
662662
this.$nextTick(() => this.$emit('saved', response));
663663
return;
664664
}
@@ -683,7 +683,7 @@ export default {
683683
this.trackDirtyState = false;
684684
this.values = this.resetValuesFromResponse(response.data.data.values);
685685
this.extraValues = response.data.data.extraValues;
686-
this.trackDirtyStateTimeout = setTimeout(() => (this.trackDirtyState = true), 500);
686+
this.trackDirtyStateTimeout = setTimeout(() => (this.trackDirtyState = true), 750);
687687
this.initialPublished = response.data.data.published;
688688
this.activeLocalization.published = response.data.data.published;
689689
this.activeLocalization.status = response.data.data.status;
@@ -773,7 +773,7 @@ export default {
773773
this.initialPublished = data.values.published;
774774
this.readOnly = data.readOnly;
775775
776-
this.trackDirtyStateTimeout = setTimeout(() => (this.trackDirtyState = true), 500); // after any fieldtypes do a debounced update
776+
this.trackDirtyStateTimeout = setTimeout(() => (this.trackDirtyState = true), 750); // after any fieldtypes do a debounced update
777777
});
778778
},
779779
@@ -856,7 +856,7 @@ export default {
856856
clearTimeout(this.trackDirtyStateTimeout);
857857
this.trackDirtyState = false;
858858
this.values = this.resetValuesFromResponse(response.data.data.values);
859-
this.trackDirtyStateTimeout = setTimeout(() => (this.trackDirtyState = true), 500);
859+
this.trackDirtyStateTimeout = setTimeout(() => (this.trackDirtyState = true), 750);
860860
this.activeLocalization.title = response.data.data.title;
861861
this.activeLocalization.published = response.data.data.published;
862862
this.activeLocalization.status = response.data.data.status;
@@ -912,7 +912,7 @@ export default {
912912
clearTimeout(this.trackDirtyStateTimeout);
913913
this.trackDirtyState = false;
914914
this.values = this.resetValuesFromResponse(response.data.values);
915-
this.trackDirtyStateTimeout = setTimeout(() => (this.trackDirtyState = true), 500);
915+
this.trackDirtyStateTimeout = setTimeout(() => (this.trackDirtyState = true), 750);
916916
this.initialPublished = response.data.published;
917917
this.activeLocalization.published = response.data.published;
918918
this.activeLocalization.status = response.data.status;

resources/js/components/fieldtypes/VideoFieldtype.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ export default {
9292
9393
isEmbeddable() {
9494
return (
95-
(this.isUrl && this.data.includes('youtube')) ||
96-
this.data.includes('vimeo') ||
97-
this.data.includes('youtu.be')
95+
(this.isUrl && this.data?.includes('youtube')) ||
96+
this.data?.includes('vimeo') ||
97+
this.data?.includes('youtu.be')
9898
);
9999
},
100100
@@ -113,10 +113,10 @@ export default {
113113
isVideo() {
114114
return (
115115
!this.isEmbeddable &&
116-
(this.data.includes('.mp4') ||
117-
this.data.includes('.ogv') ||
118-
this.data.includes('.mov') ||
119-
this.data.includes('.webm'))
116+
(this.data?.includes('.mp4') ||
117+
this.data?.includes('.ogv') ||
118+
this.data?.includes('.mov') ||
119+
this.data?.includes('.webm'))
120120
);
121121
},
122122
},

resources/js/components/fieldtypes/replicator/Field.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export default {
159159
},
160160
161161
shouldShowFieldActions() {
162-
return !this.isInsideConfigFields && this.fieldActions.length > 0;
162+
return !this.isInsideConfigFields && this.fieldActions?.length > 0;
163163
},
164164
165165
fieldActions() {

resources/js/components/navigation/View.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168

169169
<template v-if="canEdit" #branch-options="{ branch, removeBranch, stat, depth }">
170170
<dropdown-item v-if="isEntryBranch(stat)" :text="__('Edit Entry')" :redirect="branch.edit_url" />
171+
<dropdown-item :text="__('Edit nav item')" @click="editPage(branch)" />
171172
<dropdown-item v-if="depth < maxDepth" :text="__('Add child nav item')" @click="linkPage(stat)" />
172173
<dropdown-item
173174
v-if="depth < maxDepth && hasCollections"

resources/lang/fr/fieldtypes.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
'bard.config.section.editor.instructions' => 'Configurez l’apparence et le comportement général de l’éditeur.',
4444
'bard.config.section.links.instructions' => 'Configurez comment les liens sont gérés dans cette instance de Bard.',
4545
'bard.config.section.sets.instructions' => 'Configurez des blocs de champs qui peuvent être insérés n’importe où dans votre contenu Bard.',
46+
'bard.config.select_across_sites' => 'Autorisez la sélection d’entrées à partir d’autres sites. Cela désactive également les options de localisation sur le frontal. Pour en savoir plus, consultez la [documentation](https://statamic.dev/fieldtypes/entries#select-across-sites).',
4647
'bard.config.smart_typography' => 'Remplacez les styles de texte courants par les caractères typographiques appropriés.',
4748
'bard.config.target_blank' => 'Définissez `target="_blank"` sur tous les liens.',
4849
'bard.config.toolbar_mode' => 'Choisissez le style de barre d’outils que vous préférez.',
@@ -175,7 +176,7 @@
175176
'taggable.config.placeholder' => 'Saisissez et appuyez sur ↩ Entrée',
176177
'taggable.title' => 'Taggable',
177178
'taxonomies.title' => 'Taxonomies',
178-
'template.config.blueprint' => 'Ajoute une option "Mapper au Blueprint". Apprenez-en plus dans la [documentation](https://statamic.dev/views#inferring-templates-from-entry-blueprints).',
179+
'template.config.blueprint' => 'Ajoute une option "Mapper au Blueprint". Pour en savoir plus, consultez la [documentation](https://statamic.dev/views#inferring-templates-from-entry-blueprints).',
179180
'template.config.folder' => 'Affichez uniquement les modèles de ce dossier.',
180181
'template.config.hide_partials' => 'Les partiels sont rarement destinés à être utilisés comme modèles.',
181182
'template.title' => 'Template',

src/CP/Navigation/NavItem.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,21 @@ public function isChild($isChild = null)
281281
->value($isChild);
282282
}
283283

284+
/**
285+
* Check if current url is a restful descendant.
286+
*/
287+
protected function currentUrlIsRestfulDescendant(): bool
288+
{
289+
return (bool) Str::endsWith(request()->url(), [
290+
'/create',
291+
'/edit',
292+
]);
293+
}
294+
284295
/**
285296
* Check if this nav item was ever a child before user preferences were applied.
286-
*
287-
* @param bool|null $isChild
288-
* @return mixed
289297
*/
290-
protected function wasOriginallyChild()
298+
protected function wasOriginallyChild(): bool
291299
{
292300
return (bool) $this->wasOriginallyChild;
293301
}
@@ -366,8 +374,12 @@ public function isActive()
366374
// If the current URL is not explicitly referenced in the CP nav,
367375
// and if this item is/was ever a child nav item,
368376
// then check against URL heirarchy conventions using regex pattern.
369-
if ($this->currentUrlIsNotExplicitlyReferencedInNav() && $this->wasOriginallyChild()) {
370-
return $this->isActiveByPattern($this->active);
377+
if ($this->currentUrlIsNotExplicitlyReferencedInNav()) {
378+
switch (true) {
379+
case $this->currentUrlIsRestfulDescendant():
380+
case $this->wasOriginallyChild():
381+
return $this->isActiveByPattern($this->active);
382+
}
371383
}
372384

373385
return request()->url() === URL::removeQueryAndFragment($this->url);

src/Fieldtypes/Entries.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ protected function configFieldItems(): array
9595
'instructions' => __('statamic::fieldtypes.entries.config.create'),
9696
'type' => 'toggle',
9797
'default' => true,
98+
'if' => [
99+
'mode' => 'default',
100+
],
98101
],
99102
'collections' => [
100103
'display' => __('Collections'),

src/Http/Controllers/FrontendController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ public function route(Request $request, ...$args)
4646
$view = Arr::pull($params, 'view');
4747
$data = Arr::pull($params, 'data');
4848

49-
throw_if(is_callable($view) && $data, new \Exception('Parameter [$data] not supported with [$view] closure!'));
49+
throw_if(($view instanceof Closure) && $data, new \Exception('Parameter [$data] not supported with [$view] closure!'));
5050

51-
if (is_callable($view)) {
51+
if ($view instanceof Closure) {
5252
$resolvedView = static::resolveRouteClosure($view, $params);
5353
}
5454

src/StaticCaching/Middleware/Cache.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ private function shouldBeCached($request, $response)
184184
$response->headers->has('X-Statamic-Draft')
185185
|| $response->headers->has('X-Statamic-Private')
186186
|| $response->headers->has('X-Statamic-Protected')
187+
|| $response->headers->has('X-Statamic-Uncacheable')
187188
) {
188189
return false;
189190
}

src/Structures/TreeBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected function transformTreeForController($tree)
101101
'handle' => $page->entry()->blueprint()->handle(),
102102
'title' => $page->entry()->blueprint()->title(),
103103
] : null,
104-
'url' => $referenceExists ? $page->url() : null,
104+
'url' => $page->url(),
105105
'edit_url' => $page->editUrl(),
106106
'can_delete' => $referenceExists ? User::current()->can('delete', $page->entry()) : true,
107107
'slug' => $page->slug(),

0 commit comments

Comments
 (0)