Skip to content

Commit

Permalink
Merge branch '4.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Feb 19, 2024
2 parents 5e6df0a + 693762c commit 91c0834
Show file tree
Hide file tree
Showing 236 changed files with 1,166 additions and 512 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
node_modules
.DS_Store
.phpunit.result.cache
.phpunit.cache
.php-cs-fixer.cache
tests/Fakes/Composer/Package/test-package/composer.json
resources/dist
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# Release Notes

## 4.49.0 (2024-02-16)

### What's new
- Support YouTube Shorts in `embed_code` modifier. [#9521](https://github.com/statamic/cms/issues/9521) by @mnlmaier
- Allow number literals inside Antlers tag parameters. [#9503](https://github.com/statamic/cms/issues/9503) by @JohnathonKoster
- Add clear value button to popover `date` fieldtype. [#9478](https://github.com/statamic/cms/issues/9478) by @jacksleight
- Add GraphQL type for `group` fieldtype. [#9499](https://github.com/statamic/cms/issues/9499) by @duncanmcclean
- Add PHP `fieldPathPrefix` method. [#9080](https://github.com/statamic/cms/issues/9080) by @jacksleight

### What's improved
- French translations. [#9476](https://github.com/statamic/cms/issues/9476) by @ebeauchamps
- Improve speed of "Duplicate" action by only searching for descendants if multi-site is enabled. [#9528](https://github.com/statamic/cms/issues/9528) by @helloiamlukas
- Improve CP page speed by cleaning up some JS event handlers. [#9500](https://github.com/statamic/cms/issues/9500) by @jasonvarga

### What's fixed
- Exclude super when using a custom field. [#9536](https://github.com/statamic/cms/issues/9536) by @jasonvarga
- Fix table drag handles disappearing. [#9522](https://github.com/statamic/cms/issues/9522) by @jasonvarga
- Prevent non-images being processed through source preset. [#9517](https://github.com/statamic/cms/issues/9517) by @duncanmcclean
- Fix numbers not being cast in API filters. [#9511](https://github.com/statamic/cms/issues/9511) by @jasonvarga
- Fix scrolling in Inline Publish Form on Safari on iOS. [#9510](https://github.com/statamic/cms/issues/9510) by @duncanmcclean
- Prevent warming redirect URLs. [#9509](https://github.com/statamic/cms/issues/9509) by @duncanmcclean
- Fix pagination with the `nocache` tag. [#9394](https://github.com/statamic/cms/issues/9394) by @duncanmcclean
- Fix missing translations. [#9450](https://github.com/statamic/cms/issues/9450) by @peimn
- Fix error from `code` fieldtype when switching sites in global. [#9488](https://github.com/statamic/cms/issues/9488) by @duncanmcclean
- Fix `$authenticatedUser` error with third-party addon events. [#9490](https://github.com/statamic/cms/issues/9490) by @duncanmcclean
- Fix directory separator in `templates` fieldtype on Windows. [#9483](https://github.com/statamic/cms/issues/9483) by @duncanmcclean
- Include `honeypot` in Alpine.js form data. [#9498](https://github.com/statamic/cms/issues/9498) by @duncanmcclean
- Localize entry & term fields in Taxonomy Term GraphQL queries. [#9492](https://github.com/statamic/cms/issues/9492) by @duncanmcclean
- Make `BlueprintRepository` a singleton. [#9489](https://github.com/statamic/cms/issues/9489) by @jacksleight
- Allow namespace to be passed in `Blueprint::make()`. [#9484](https://github.com/statamic/cms/issues/9484) by @ryanmitchell
- Fix update counter. [#9479](https://github.com/statamic/cms/issues/9479) by @jasonvarga
- Fix missing updates badge. [#9477](https://github.com/statamic/cms/issues/9477) by @jasonvarga
- Test suite uses PHPUnit 10. [#9529](https://github.com/statamic/cms/issues/9529) by @jasonvarga
- Fix Windows tests not running in GitHub Actions. [#9482](https://github.com/statamic/cms/issues/9482) by @duncanmcclean



## 4.48.0 (2024-02-06)

### What's new
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"laravel/pint": "^1.0",
"mockery/mockery": "^1.3.3",
"orchestra/testbench": "^7.0 || ^8.0",
"phpunit/phpunit": "^9.0"
"phpunit/phpunit": "^9.0 || ^10.0"
},
"config": {
"optimize-autoloader": true,
Expand Down
8 changes: 3 additions & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
backupStaticProperties="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
cacheDirectory=".phpunit.cache"
stopOnFailure="false">
<testsuites>
<testsuite name="Tests">
Expand Down
1 change: 1 addition & 0 deletions resources/css/elements/tables.css
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@

td.table-drag-handle {
@apply w-3 border-r h-full p-2;
min-width: 16px;
cursor: grab;
background: theme('colors.gray.200') url('../../svg/icons/light/drag-dots.svg') center center no-repeat;
background-size: 7px 17px;
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/Breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="breadcrumb flex">
<a :href="url" class="flex-initial flex p-2 -m-2 items-center text-xs text-gray-700 hover:text-gray-900">
<svg-icon name="micro/chevron-right" class="h-6 w-4 rotate-180" />
<span v-text="title" />
<span v-text="__(title)" />
</a>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/ResourceDeleter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default {
},
modalTitle() {
return __('Delete :resource', {resource: this.title});
return __('Delete :resource', {resource: __(this.title)});
},
modalBody() {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/SiteSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:value="site"
:clearable="false"
:searchable="false"
:get-option-label="site => site.name"
:get-option-label="site => __(site.name)"
:options="sites"
@input="$emit('input', $event)"
/>
Expand Down
7 changes: 6 additions & 1 deletion resources/js/components/assets/Browser/Browser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<div class="publish-tabs tabs rounded-none rounded-t mb-3 shadow-none" v-if="showContainerTabs">
<button class="tab-button" v-for="item in containers" :key="item.id"
v-text="item.title"
v-text="__(item.title)"
:class="{
active: item.id === container.id,
'border-b border-gray-300': item.id !== container.id
Expand Down Expand Up @@ -446,6 +446,11 @@ export default {
this.$events.$on('editor-action-completed', this.actionCompleted);
},
destroyed() {
this.$events.$off('editor-action-started', this.actionStarted);
this.$events.$off('editor-action-completed', this.actionCompleted);
},
watch: {
initialContainer() {
Expand Down
6 changes: 3 additions & 3 deletions resources/js/components/blueprints/LinkFields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ export default {
.filter(field => field.type !== 'import')
.map(field => ({
value: `${fieldset.handle}.${field.handle}`,
label: field.config.display,
fieldset: fieldset.title,
label: __(field.config.display),
fieldset: __(fieldset.title),
}));
});
Expand All @@ -124,7 +124,7 @@ export default {
fieldSuggestions,
fieldsetSuggestions: fieldsets.map(fieldset => ({
value: fieldset.handle,
label: fieldset.title,
label: __(fieldset.title),
})),
fieldsets,
}
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/blueprints/Listing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<template slot="cell-title" slot-scope="{ row: blueprint }">
<div class="flex items-center">
<div class="little-dot mr-2" :class="[blueprint.hidden ? 'hollow' : 'bg-green-600']" />
<a :href="blueprint.edit_url">{{ blueprint.title }}</a>
<a :href="blueprint.edit_url">{{ __(blueprint.title) }}</a>
</div>
</template>
<template slot="cell-handle" slot-scope="{ value }">
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/blueprints/RegularField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="flex flex-1 items-center justify-between">
<div class="flex items-center flex-1 pr-4 py-2 pl-2">
<svg-icon class="text-gray-800 mr-2 h-4 w-4 flex-none" :name="field.icon.startsWith('<svg') ? field.icon : `light/${field.icon}`" v-tooltip="tooltipText" default="light/generic-field" />
<a class="break-all" v-text="labelText" @click="$emit('edit')" />
<a class="break-all" v-text="__(labelText)" @click="$emit('edit')" />
<svg-icon name="light/hyperlink" v-if="isReferenceField" class="text-gray-600 text-3xs ml-2 h-4 w-4" v-tooltip="__('Imported from fieldset') + ': ' + field.field_reference" />
</div>
<div class="flex-none pr-2 flex">
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/blueprints/Section.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="p-2 flex-1 flex items-center">
<a class="flex items-center flex-1 group" @click="edit">
<svg-icon :name="iconName(section.icon)" :directory="iconBaseDirectory" class="h-4 w-4 mr-2 text-gray-700 group-hover:text-blue-500" />
<div class="mr-2" v-text="section.display" />
<div class="mr-2" v-text="__(section.display)" />
</a>
<button class="flex items-center text-gray-700 hover:text-gray-950 mr-3" @click="edit">
<svg-icon class="h-4 w-4" name="pencil" />
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/blueprints/Tab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>
<svg-icon v-if="tab.icon" :name="iconName(tab.icon)" :directory="iconBaseDirectory" class="w-4 h-4 mr-1" />

{{ tab.display }}
{{ __(tab.display) }}

<dropdown-list v-if="isActive" ref="dropdown" placement="bottom-start" class="text-left">
<template #trigger>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</thead>
<tbody>
<tr v-for="site in sites" :key="site.handle">
<td class="align-middle" v-text="site.name" />
<td class="align-middle" v-text="__(site.name)" />
<td>
<text-input
class="slug-field"
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/collections/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
v-for="blueprint in blueprints"
:key="blueprint.handle"
@click="createEntry(blueprint.handle, branch.id)"
v-text="blueprints.length > 1 ? blueprint.title : __('Create Child Entry')" />
v-text="blueprints.length > 1 ? __(blueprint.title) : __('Create Child Entry')" />
</template>
<template v-if="branch.can_delete">
<li class="divider"></li>
Expand Down
4 changes: 4 additions & 0 deletions resources/js/components/data-list/Action.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ export default {
this.$events.$on('reset-action-modals', this.reset);
},
destroyed() {
this.$events.$off('reset-action-modals', this.reset);
},
methods: {
select() {
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/data-list/ColumnPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div class="column-picker-item" v-for="column in hiddenColumns" :key="column.field" v-if="hiddenColumns.length">
<label class="flex items-center cursor-pointer">
<input type="checkbox" class="mr-2" v-model="column.visible" @change="columnToggled(column) "/>
{{ column.label }}
{{ __(column.label) }}
</label>
</div>
</div>
Expand All @@ -48,7 +48,7 @@
<div class="item-move py-1">&nbsp;</div>
<div class="flex flex-1 ml-2 items-center p-0">
<input type="checkbox" class="mr-2" v-model="column.visible" @change="columnToggled(column)" :disabled="selectedColumns.length === 1" />
{{ column.label }}
{{ __(column.label) }}
</div>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions resources/js/components/data-list/DataList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ export default {
this.$events.$on('clear-selections', this.clearSelections);
},
destroyed() {
this.$events.$off('clear-selections', this.clearSelections);
},
methods: {
setInitialSortColumn() {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/data-list/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class="group"
@click.prevent="changeSortColumn(column.field)"
>
<span v-text="column.label" />
<span v-text="__(column.label)" />
<svg v-if="column.sortable" :class="[sharedState.sortDirection, {'opacity-100 pointer-events-none': sharedState.sortColumn === column.field}]" height="8" width="8" viewBox="0 0 10 6.5" class="ml-1 opacity-0 group-hover:opacity-100">
<path d="M9.9,1.4L5,6.4L0,1.4L1.4,0L5,3.5L8.5,0L9.9,1.4z" fill="currentColor"/>
</svg>
Expand Down
6 changes: 3 additions & 3 deletions resources/js/components/entries/PublishForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<div class="flex items-center mb-6">
<h1 class="flex-1">
<div class="flex items-center">
<span v-if="! isCreating" class="little-dot mr-2" :class="activeLocalization.status" v-tooltip="activeLocalization.status" />
<span v-html="$options.filters.striptags(title)" />
<span v-if="! isCreating" class="little-dot mr-2" :class="activeLocalization.status" v-tooltip="__(activeLocalization.status)" />
<span v-html="$options.filters.striptags(__(title))" />
</div>
</h1>

Expand Down Expand Up @@ -176,7 +176,7 @@
'bg-gray-500': !option.published,
'bg-red-500': !option.exists
}" />
{{ option.name }}
{{ __(option.name) }}
<loading-graphic
:size="14"
text=""
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/field-validation/Builder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
/>
</template>
<template #option="{ value, display }">
{{ display }} <code class="ml-2">{{ valueWithoutTrailingColon(value) }}</code>
{{ __(display) }} <code class="ml-2">{{ valueWithoutTrailingColon(value) }}</code>
</template>
<template #no-options="{ search }">
<div class="vs__dropdown-option text-left">{{ __('Add') }} <code class="ml-2">{{ search }}</code></div>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/fields/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<header v-if="!loading" class="flex items-center sticky top-0 inset-x-0 bg-white shadow px-8 py-2 z-1 h-13">
<h1 class="flex-1 flex items-center text-xl">
{{ values.display || config.display || config.handle }}
{{ __(values.display) || __(config.display) || config.handle }}
<small class="badge-pill bg-gray-100 ml-4 border text-xs text-gray-700 font-medium leading-none flex items-center">
<svg-icon class="h-4 w-4 mr-2 inline-block text-gray-700" :name="fieldtype.icon.startsWith('<svg') ? fieldtype.icon : `light/${fieldtype.icon}`"></svg-icon>
{{ fieldtype.title }}
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/fieldsets/EditForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<header class="mb-6">
<breadcrumb :url="breadcrumbUrl" :title="__('Fieldsets')" />
<div class="flex items-center justify-between">
<h1>{{ initialTitle }}</h1>
<h1>{{ __(initialTitle) }}</h1>
<button type="submit" class="btn-primary" @click.prevent="save" v-text="__('Save')" />
</div>
</header>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/fieldsets/FieldsetDeleter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default {
},
modalTitle() {
return __('Delete :resource', {resource: this.title});
return __('Delete :resource', {resource: __(this.title)});
},
deleteUrl() {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/fieldsets/Listing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="overflow-x-auto overflow-y-hidden">
<data-list-table>
<template slot="cell-title" slot-scope="{ row: fieldset }">
<a :href="fieldset.edit_url">{{ fieldset.title }}</a>
<a :href="fieldset.edit_url">{{ __(fieldset.title) }}</a>
</template>
<template slot="cell-handle" slot-scope="{ value }">
<span class="font-mono text-xs">{{ value }}</span>
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/fieldtypes/CodeFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ export default {
watch: {
value(value, oldValue) {
if (value.code == this.codemirror.doc.getValue()) return;
if (! value.code) value.code = '';
this.codemirror.doc.setValue(value.code);
},
readOnlyOption(val) {
Expand Down
6 changes: 6 additions & 0 deletions resources/js/components/fieldtypes/Fieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export default {
return this.value;
},
fieldPathKeys() {
const prefix = this.fieldPathPrefix || this.handle;
return prefix.split('.');
},
fieldId() {
let prefix = this.fieldPathPrefix ? this.fieldPathPrefix+'.' : '';
Expand Down
9 changes: 8 additions & 1 deletion resources/js/components/fieldtypes/date/RangePopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div class="input-group-prepend flex items-center">
<svg-icon name="light/calendar" class="w-4 h-4" />
</div>
<div class="input-text border border-gray-500 border-l-0" :class="{ 'read-only': isReadOnly }">
<div class="input-text border border-gray-500 border-l-0 flex items-center pr-0" :class="{ 'read-only': isReadOnly }">
<input
class="input-text-minimal p-0 bg-transparent leading-none"
:readonly="isReadOnly"
Expand All @@ -37,6 +37,9 @@
@focus="$emit('focus', $event.target)"
@blur="$emit('blur')"
/>
<button @click="clear" type="button" title="Clear" aria-label="Clear" class="cursor-pointer px-2 hover:text-blue-500">
<span>×</span>
</button>
</div>
</div>
</template>
Expand Down Expand Up @@ -195,6 +198,10 @@ export default {
});
},
clear() {
this.$emit('input', null)
},
resetPicker() {
this.picker = this.$refs.picker;
}
Expand Down
Loading

0 comments on commit 91c0834

Please sign in to comment.