Skip to content

Commit

Permalink
Merge branch '4.x' into feature/static-recache-without-deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Feb 28, 2024
2 parents c74b400 + 7da46d8 commit d0dc261
Show file tree
Hide file tree
Showing 172 changed files with 1,701 additions and 184 deletions.
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# Release Notes

## 4.50.0 (2024-02-26)

### What's new
- Add `hex_to_rgb` modifier. [#9582](https://github.com/statamic/cms/issues/9582) by @DanielDarrenJones
- Add UI mode option to forms fieldtype config. [#9591](https://github.com/statamic/cms/issues/9591) by @jacksleight
- First invalid field will be scrolled into view when submitting publish forms. [#9577](https://github.com/statamic/cms/issues/9577) by @jacksleight
- Add Antlers shorthand parameter value syntax. [#9505](https://github.com/statamic/cms/issues/9505) by @JohnathonKoster
- Hooks. [#9481](https://github.com/statamic/cms/issues/9481) by @ryanmitchell
- Add `Entry::findOrFail`. [#9506](https://github.com/statamic/cms/issues/9506) by @benfurfie

### What's fixed
- Fix field conditions in Grid fields. [#9586](https://github.com/statamic/cms/issues/9586) by @duncanmcclean
- Fix pixel gap on relationship fieldtype items. [#9579](https://github.com/statamic/cms/issues/9579) by @jasonvarga
- Use static_cache store for nocache. [#9527](https://github.com/statamic/cms/issues/9527) by @ryanmitchell
- Make tags using old-style __call method compatible with Macroable. [#9553](https://github.com/statamic/cms/issues/9553) by @SylvesterDamgaard
- Fix `locales` tag inside replicator, bard, and grid. [#9566](https://github.com/statamic/cms/issues/9566) by @aerni
- Add `accepted_if` validation to Bard `enable_input_rules` [#9555](https://github.com/statamic/cms/issues/9555) by @robdekort
- Add `accepted_if` validation rule [#9557](https://github.com/statamic/cms/issues/9557) by @robdekort
- Fix modal height UI issue. [#9538](https://github.com/statamic/cms/issues/9538) by @JohnathonKoster
- Fix arrays being returned by translations. [#9525](https://github.com/statamic/cms/issues/9525) by @duncanmcclean
- Fix Stache pathing issue on Windows. [#9537](https://github.com/statamic/cms/issues/9537) by @JohnathonKoster
- Antlers: Resolve values from augmented values when there is more data to process. [#9548](https://github.com/statamic/cms/issues/9548) by @JohnathonKoster
- Antlers: Stop double-initial execution of tags within conditions. [#9504](https://github.com/statamic/cms/issues/9504) by @JohnathonKoster
- Fix error in event listener when uploading file in front-end forms. [#9542](https://github.com/statamic/cms/issues/9542) by @ryanmitchell
- Drop Laravel 6 mail view. [#9545](https://github.com/statamic/cms/issues/9545) by @duncanmcclean
- Remove any uploaded assets when submission silently fails or validation fails. [#9549](https://github.com/statamic/cms/issues/9549) by @ryanmitchell
- Check if form request wantsJson. [#9533](https://github.com/statamic/cms/issues/9533) by @ryanmitchell
- Pass parent field and index down to imported fields. [#9550](https://github.com/statamic/cms/issues/9550) by @jacksleight
- Fix protection redirect URLs when they contain query parameters. [#9543](https://github.com/statamic/cms/issues/9543) by @duncanmcclean
- Fix issues when saving entries with `JsonResource::withoutWrapping()`. [#9519](https://github.com/statamic/cms/issues/9519) by @duncanmcclean



## 4.49.0 (2024-02-16)

### What's new
Expand Down
2 changes: 1 addition & 1 deletion resources/css/components/items.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@apply text-sm outline-none flex w-full justify-between rounded border bg-white shadow-sm items-center;

.item-move {
@apply w-4 border-r rounded-l p-2;
@apply w-4 self-stretch border-r rounded-l p-2;
cursor: grab;
background: theme('colors.gray.200') url('../../svg/icons/light/drag-dots.svg') center center no-repeat;
background-size: 7px 17px;
Expand Down
4 changes: 4 additions & 0 deletions resources/css/core/utilities.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,7 @@
[x-cloak] {
display: none
}

.-max-h-screen-px {
max-height: calc(100vh - 1px) !important;
}
1 change: 1 addition & 0 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Vue.prototype.$events = new Vue();
Vue.prototype.$echo = Statamic.$echo;
Vue.prototype.$bard = Statamic.$bard;
Vue.prototype.$keys = Statamic.$keys;
Vue.prototype.$reveal = Statamic.$reveal;

import Moment from 'moment';
window.moment = Vue.moment = Vue.prototype.$moment = Moment;
Expand Down
4 changes: 4 additions & 0 deletions resources/js/bootstrap/fieldtypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import AssetsFieldtype from '../components/fieldtypes/assets/AssetsFieldtype.vue
import AssetsIndexFieldtype from '../components/fieldtypes/assets/AssetsIndexFieldtype.vue';
import AssetFolderFieldtype from '../components/fieldtypes/AssetFolderFieldtype.vue';
import BardFieldtype from '../components/fieldtypes/bard/BardFieldtype.vue';
import BardSet from '../components/fieldtypes/bard/Set.vue';
import BardButtonsSettingFieldtype from '../components/fieldtypes/bard/BardButtonsSettingFieldtype.vue';
import ButtonGroupFieldtype from '../components/fieldtypes/ButtonGroupFieldtype.vue';
import CheckboxesFieldtype from '../components/fieldtypes/CheckboxesFieldtype.vue';
Expand Down Expand Up @@ -44,6 +45,7 @@ import RangeFieldtype from '../components/fieldtypes/RangeFieldtype.vue';
import RelationshipFieldtype from '../components/fieldtypes/relationship/RelationshipFieldtype.vue';
import RelationshipIndexFieldtype from '../components/fieldtypes/relationship/RelationshipIndexFieldtype.vue';
import Replicator from '../components/fieldtypes/replicator/Replicator.vue';
import ReplicatorSet from '../components/fieldtypes/replicator/Set.vue';
import ReplicatorIndex from '../components/fieldtypes/replicator/ReplicatorIndex.vue';
import SectionFieldtype from '../components/fieldtypes/SectionFieldtype.vue';
import SelectFieldtype from '../components/fieldtypes/SelectFieldtype.vue';
Expand Down Expand Up @@ -74,6 +76,7 @@ Vue.component('assets-fieldtype', AssetsFieldtype);
Vue.component('assets-fieldtype-index', AssetsIndexFieldtype);
Vue.component('asset_folder-fieldtype', AssetFolderFieldtype);
Vue.component('bard-fieldtype', BardFieldtype);
Vue.component('bard-fieldtype-set', BardSet);
Vue.component('bard_buttons_setting-fieldtype', BardButtonsSettingFieldtype);
Vue.component('button_group-fieldtype', ButtonGroupFieldtype);
Vue.component('checkboxes-fieldtype', CheckboxesFieldtype);
Expand Down Expand Up @@ -103,6 +106,7 @@ Vue.component('range-fieldtype', RangeFieldtype);
Vue.component('relationship-fieldtype', RelationshipFieldtype);
Vue.component('relationship-fieldtype-index', RelationshipIndexFieldtype);
Vue.component('replicator-fieldtype', Replicator);
Vue.component('replicator-fieldtype-set', ReplicatorSet);
Vue.component('replicator-fieldtype-index', ReplicatorIndex);
Vue.component('section-fieldtype', SectionFieldtype);
Vue.component('select-fieldtype', SelectFieldtype);
Expand Down
13 changes: 13 additions & 0 deletions resources/js/bootstrap/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,16 @@ export function escapeHtml(string) {
export function replicatorPreviewHtml(html) {
return new PreviewHtml(html);
}

export function closestVm(el, name) {
let parent = el;
while (parent) {
if (parent.__vue__) break;
parent = parent.parentElement;
}
let vm = parent.__vue__;
while (vm !== vm.$root) {
if (!name || name === vm.$options.name) return vm;
vm = vm.$parent;
}
}
35 changes: 35 additions & 0 deletions resources/js/components/Reveal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { closestVm } from '../bootstrap/globals';

class Reveal {
element(el) {
if (!el) return;
let parent = el;
while (parent) {
if (parent.matches('.tab-panel')) {
closestVm(parent, 'publish-tabs').setActive(parent.dataset.tabHandle);
}
if (parent.matches('.replicator-set')) {
closestVm(parent, 'replicator-fieldtype-set').expand();
}
if (parent.matches('.bard-set')) {
closestVm(parent, 'bard-fieldtype-set').expand();
}
parent = parent.parentElement;
}
Vue.nextTick(() => {
el.scrollIntoView({
block: 'center',
});
});
}

invalid() {
Vue.nextTick(() => {
const el = document.querySelector('.publish-field.has-error:not(:has(.publish-field.has-error))');
if (!el) return;
this.element(el);
});
}
}

export default Reveal;
2 changes: 2 additions & 0 deletions resources/js/components/SessionExpiry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<button v-if="isWarning" class="session-expiry-stripe" @click="extend" v-text="warningText" />

<modal name="session-timeout-login" v-if="isShowingLogin" height="auto" width="500px" :adaptive="true">
<div class="-max-h-screen-px">
<div class="flex items-center p-6 bg-gray-200 border-b text-center">
{{ __('Resume Your Session') }}
</div>
Expand Down Expand Up @@ -42,6 +43,7 @@
</div>
</div>
</div>
</div>
</modal>

</div>
Expand Down
6 changes: 6 additions & 0 deletions resources/js/components/Statamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import Echo from './Echo';
import Bard from './Bard';
import Keys from './keys/Keys';
import Hooks from './Hooks';
import Reveal from './Reveal';
import Components from './Components';
import FieldConditions from './FieldConditions';
import Callbacks from './Callbacks';
const echo = new Echo;
const bard = new Bard;
const keys = new Keys;
const hooks = new Hooks;
const reveal = new Reveal;
const components = new Components;
const conditions = new FieldConditions;
const callbacks = new Callbacks;
Expand Down Expand Up @@ -49,6 +51,10 @@ export default new Vue({
return hooks;
},

$reveal() {
return reveal;
},

$conditions() {
return conditions;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default {
: [field]
);
}, [])
.map(handle => prefix ? `${prefix}${handle}` : handle);
.map(field => prefix ? { ...field, handle: prefix + field.handle } : field);
}

}
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/data-list/ColumnPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</button>

<modal v-if="open" name="column-picker" @closed="open = false" draggable=".modal-drag-handle" click-to-close>
<div class="flex flex-col h-full">
<div class="flex flex-col h-full -max-h-screen-px">

<header class="modal-drag-handle p-4 bg-gray-200 border-b flex items-center justify-between cursor-grab active:cursor-grabbing">
<h2>{{ __('Customize Columns') }}</h2>
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/entries/PublishForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ export default {
this.error = message;
this.errors = errors;
this.$toast.error(message);
this.$reveal.invalid();
} else if (e.response) {
this.$toast.error(e.response.data.message);
} else {
Expand Down
5 changes: 5 additions & 0 deletions resources/js/components/field-validation/Rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ export default [
label: 'Accepted',
value: 'accepted'
},
{
label: 'Accepted If',
value: 'accepted_if:',
example: 'accepted_if:anotherfield,value,...'
},
{
label: 'Active URL',
value: 'active_url'
Expand Down
14 changes: 13 additions & 1 deletion resources/js/components/fieldtypes/grid/FieldsFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:fields="fields"
:editing-field="editingField"
:can-define-localizable="false"
:suggestable-condition-fields="suggestableConditionFields"
@field-created="fieldCreated"
@field-updated="fieldUpdated"
@field-linked="fieldLinked"
Expand All @@ -17,10 +18,15 @@
<script>
import Fields from '../../blueprints/Fields.vue';
import {Sortable, Plugins} from '@shopify/draggable';
import SuggestsConditionalFields from '../../blueprints/SuggestsConditionalFields';
export default {
mixins: [Fieldtype],
mixins: [Fieldtype, SuggestsConditionalFields],
inject: {
suggestableConditionFieldsProvider: { default: null }
},
components: {
Fields,
Expand All @@ -33,6 +39,12 @@ export default {
}
},
computed: {
fieldsForConditionSuggestions() {
return this.fields;
},
},
mounted() {
this.makeSortable();
},
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/modals/KeyboardShortcutsModal.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<modal v-if="open" name="keyboard-shortcuts" width="380" height="auto" :adaptive="true" @closed="open = false" click-to-close>
<div class="-max-h-screen-px">
<h1 class="p-4 bg-gray-200 border-b text-center">
{{ __('Keyboard Shortcuts') }}
</h1>
Expand Down Expand Up @@ -47,6 +48,7 @@
<span class="shortcut-value">{{ __('Close Modal') }}</span>
</div>
</div>
</div>
</modal>
</template>

Expand Down
1 change: 1 addition & 0 deletions resources/js/components/publish/Tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
:role="showTabs && 'tabpanel'"
:id="showTabs && tabPanelId(tab.handle)"
:aria-labelledby="showTabs && tabId(tab.handle)"
:data-tab-handle="tab.handle"
tabindex="0"
:key="tab.handle"
v-for="tab in mainTabs"
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/terms/PublishForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ export default {
this.error = message;
this.errors = errors;
this.$toast.error(message);
this.$reveal.invalid();
} else {
this.$toast.error(__('Something went wrong'));
}
Expand Down
1 change: 1 addition & 0 deletions resources/js/components/users/PublishForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export default {
this.error = message;
this.errors = errors;
this.$toast.error(message);
this.$reveal.invalid();
} else {
this.$toast.error(__('Something went wrong'));
}
Expand Down
2 changes: 2 additions & 0 deletions resources/views/addons/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@extends('statamic::layout')
@section('title', __('Addons'))

Expand Down
2 changes: 2 additions & 0 deletions resources/views/addons/settings.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@extends('statamic::layout')
@section('title', __('Addon Settings'))

Expand Down
2 changes: 2 additions & 0 deletions resources/views/assets/browse.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@extends('statamic::layout')
@section('title', Statamic::crumb('Assets', $container['title']))
@section('wrapper_class', 'max-w-full')
Expand Down
2 changes: 2 additions & 0 deletions resources/views/assets/containers/blueprints/edit.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@extends('statamic::layout')
@section('title', __('Edit Blueprint'))

Expand Down
2 changes: 2 additions & 0 deletions resources/views/assets/containers/create.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@extends('statamic::layout')
@section('title', __('Create Asset Container'))

Expand Down
2 changes: 2 additions & 0 deletions resources/views/assets/containers/edit.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@extends('statamic::layout')
@section('title', __('Configure Asset Container'))

Expand Down
2 changes: 2 additions & 0 deletions resources/views/assets/containers/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@extends('statamic::layout')
@section('title', __('Asset Containers'))

Expand Down
2 changes: 2 additions & 0 deletions resources/views/assets/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@extends('statamic::layout')
@section('title', __('Assets'))

Expand Down
2 changes: 2 additions & 0 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@inject('str', 'Statamic\Support\Str')
@extends('statamic::outside')
@section('title', __('Log in'))
Expand Down
2 changes: 2 additions & 0 deletions resources/views/auth/passwords/email.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@extends('statamic::outside')

@section('content')
Expand Down
2 changes: 2 additions & 0 deletions resources/views/auth/passwords/reset.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@extends('statamic::outside')

@section('content')
Expand Down
2 changes: 2 additions & 0 deletions resources/views/auth/unauthorized.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@extends('statamic::outside')
@section('title', __('Unauthorized'))

Expand Down
2 changes: 2 additions & 0 deletions resources/views/blueprints/edit.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@extends('statamic::layout')
@section('title', __('Edit Blueprint'))

Expand Down
2 changes: 2 additions & 0 deletions resources/views/blueprints/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@extends('statamic::layout')
@section('title', __('Blueprints'))

Expand Down
2 changes: 2 additions & 0 deletions resources/views/collections/blueprints/create.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@php use function Statamic\trans as __; @endphp

@extends('statamic::layout')
@section('title', __('Create Blueprint'))

Expand Down
Loading

0 comments on commit d0dc261

Please sign in to comment.