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 authored Feb 16, 2024
2 parents 4526c2f + 1d6b9b9 commit c74b400
Show file tree
Hide file tree
Showing 288 changed files with 1,889 additions and 733 deletions.
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Please take 30 seconds to read the following so we can be as efficient as possib
4️⃣ We _really_ appreciate it if your PR includes tests. This makes it much easier for us to review, merge, and release. A PR with tests is usually reviewed and merged 5x-10x faster.

5️⃣ If your PR introduce a new feature, adds to an existing one, or changes current behavior, please **open an issue for it in the [statamic/docs](https://github.com/statamic/docs/issues) repo referencing your PR**. A simple "Goes along with statamic/cms#9000" is enough. Otherwise it's really easy to forget and no will ever become aware of your ✨ sparkling ✨ invention if it's not documented.

6️⃣ Remove this placeholder text and replace it with a description of what this PR is doing.
13 changes: 9 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
uses: tj-actions/changed-files@v42
with:
files: |
config
Expand All @@ -58,7 +58,9 @@ jobs:
- name: Determine whether tests should run
id: should-run-tests
if: steps.changed-files.outputs.any_modified == 'true' || github.event_name == 'schedule'
run: echo "result=true" >> $GITHUB_OUTPUT
run: |
echo "result=true" >> $GITHUB_OUTPUT
echo "result=true" >> $env:GITHUB_OUTPUT
- name: Update apt sources
if: steps.should-run-tests.outputs.result == 'true' && matrix.os == 'ubuntu-latest'
Expand Down Expand Up @@ -108,16 +110,19 @@ jobs:

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
uses: tj-actions/changed-files@v42
with:
files: |
**.{js,vue,ts}
package.json
.github/workflows/tests.yml
- name: Determine whether tests should run
id: should-run-tests
if: steps.changed-files.outputs.any_modified == 'true' || github.event_name == 'schedule'
run: echo "result=true" >> $GITHUB_OUTPUT
run: |
echo "result=true" >> $GITHUB_OUTPUT
echo "result=true" >> $env:GITHUB_OUTPUT
- name: Install required npm version
if: steps.should-run-tests.outputs.result == 'true'
Expand Down
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
114 changes: 114 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,119 @@
# 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
- Ability to customize Echo client configuration. [#9464](https://github.com/statamic/cms/issues/9464) by @jacksleight
- Tags are macroable. [#9466](https://github.com/statamic/cms/issues/9466) by @SylvesterDamgaard
- Statamic route views can be implied. [#9436](https://github.com/statamic/cms/issues/9436) by @jasonvarga
- Add sites to support details output. [#9461](https://github.com/statamic/cms/issues/9461) by @jasonvarga

### What's fixed
- Fix unit translations. [#9472](https://github.com/statamic/cms/issues/9472) by @jasonvarga
- Remove typo inside UserProvider. [#9459](https://github.com/statamic/cms/issues/9459) by @jonassiewertsen
- Translate more untranslated strings. [#9451](https://github.com/statamic/cms/issues/9451) by @peimn
- Fix timeout when using `nocache` tag. [#9449](https://github.com/statamic/cms/issues/9449) by @duncanmcclean
- Revert Stache watcher performance PR. [#9448](https://github.com/statamic/cms/issues/9448) by @jasonvarga
- Tidy up replicator field styles to match normal fields. [#9446](https://github.com/statamic/cms/issues/9446) by @duncanmcclean
- Ensure template and termTemplate are accessed correctly in Taxonomy controller. [#9444](https://github.com/statamic/cms/issues/9444) by @ryanmitchell



## 4.47.0 (2024-01-31)

### What's new
- Allow a custom static caching url store to be specified. [#9405](https://github.com/statamic/cms/issues/9405) by @ryanmitchell
- Add reset button to color fieldtype. [#9419](https://github.com/statamic/cms/issues/9419) by @duncanmcclean
- Ability to add inline scripts into the CP. [#9386](https://github.com/statamic/cms/issues/9386) by @jacksleight

### What's improved
- Improve the workflow around enabling Statamic Pro. [#9435](https://github.com/statamic/cms/issues/9435) by @jesseleite
- Improve collection Stache watcher performance. [#9302](https://github.com/statamic/cms/issues/9302) by @JohnathonKoster
- French translations. [#9402](https://github.com/statamic/cms/issues/9402) by @ebeauchamps

### What's fixed
- Fix issue with set previews in Bard. [#9422](https://github.com/statamic/cms/issues/9422) by @duncanmcclean
- Improve UX of field conditions builder for select & toggle fields. [#9379](https://github.com/statamic/cms/issues/9379) by @duncanmcclean
- Don't set termTemplate and template if they are the defaults. [#9421](https://github.com/statamic/cms/issues/9421) by @ryanmitchell
- Prevent serialization errors with `@nocache` directive when using Blade view components. [#9409](https://github.com/statamic/cms/issues/9409) by @duncanmcclean
- Fix user wizard error when user blueprint has Bard field. [#9416](https://github.com/statamic/cms/issues/9416) by @jesseleite
- Hide listing filters when reordering entries. [#9420](https://github.com/statamic/cms/issues/9420) by @duncanmcclean
- Rename route binding parameter to prevent overlapping. [#9415](https://github.com/statamic/cms/issues/9415) by @duncanmcclean
- Fix Entries fieldtype tree view on Assets publish form. [#9404](https://github.com/statamic/cms/issues/9404) by @duncanmcclean
- Fix translations in `nocache` tag. [#9400](https://github.com/statamic/cms/issues/9400) by @duncanmcclean
- Translate dimension conjunction. [#9393](https://github.com/statamic/cms/issues/9393) by @peimn



## 4.46.0 (2024-01-25)

### What's new
- Allow roles and groups to be database driven. [#5686](https://github.com/statamic/cms/issues/5686) by @ryanmitchell
- Add console command to import file-based groups and roles into database. [#6774](https://github.com/statamic/cms/issues/6774) by @ryanmitchell
- SVG images get sanitized upon upload. [#9365](https://github.com/statamic/cms/issues/9365) by @duncanmcclean
- Allow `.html` to be stripped from `parent_uri` in routes. [#9364](https://github.com/statamic/cms/issues/9364) by @duncanmcclean

### What's improved
- German translations. [#9374](https://github.com/statamic/cms/issues/9374) by @helloDanuk

### What's fixed
- Support data in Eloquent based user groups. [#9395](https://github.com/statamic/cms/issues/9395) by @jasonvarga
- Revert overzealous file extension renaming feature. [#9389](https://github.com/statamic/cms/issues/9389) by @jasonvarga
- Make copy reset password link action opt-in. [#9390](https://github.com/statamic/cms/issues/9390) [#9397](https://github.com/statamic/cms/issues/9397) by @jasonvarga
- Fix importing fieldsets in custom blueprint namespaces. [#9387](https://github.com/statamic/cms/issues/9387) by @duncanmcclean
- Catch errors when sending user activation email. [#9382](https://github.com/statamic/cms/issues/9382) by @duncanmcclean
- Only use site language for form submission validation messages if submitted from front-end. [#9383](https://github.com/statamic/cms/issues/9383) by @jasonvarga
- Avoid caching URLs with a token. [#9381](https://github.com/statamic/cms/issues/9381) by @jasonvarga
- Fix user groups/roles querying. [#6131](https://github.com/statamic/cms/issues/6131) by @ryanmitchell
- Avoid saving icons to field configs. [#9372](https://github.com/statamic/cms/issues/9372) by @duncanmcclean
- Hide actions on form index/show pages when user is missing relevant permissions. [#9371](https://github.com/statamic/cms/issues/9371) by @duncanmcclean
- Bard: Only configure placeholder extension when placeholder is provided. [#9369](https://github.com/statamic/cms/issues/9369) by @duncanmcclean
- Always show slug rengerate button if enabled. [#9366](https://github.com/statamic/cms/issues/9366) by @jasonvarga
- Fix some translations. [#9361](https://github.com/statamic/cms/issues/9361) by @peimn
- Fix whereTime affecting the date as well as time. [#9360](https://github.com/statamic/cms/issues/9360) by @ryanmitchell
- Passthrough Cmd/Ctrl + Enter inside Bard. [#9313](https://github.com/statamic/cms/issues/9313) by @godismyjudge95
- Support brackets in translation strings in translator helper. [#9380](https://github.com/statamic/cms/issues/9380) by @jasonvarga
- Bump vite from 4.2.3 to 4.5.2. [#9367](https://github.com/statamic/cms/issues/9367) by @dependabot



## 4.45.0 (2024-01-18)

### 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
2 changes: 1 addition & 1 deletion config/editions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

return [

'pro' => false,
'pro' => env('STATAMIC_PRO_ENABLED', false),

'addons' => [
//
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
9 changes: 8 additions & 1 deletion resources/js/components/Echo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ window.Pusher = Pusher;
class Echo {

constructor() {
this.configCallbacks = [];
this.bootedCallbacks = [];
}

config(callback) {
this.configCallbacks.push(callback);
}

booted(callback) {
this.bootedCallbacks.push(callback);
}

start() {
const config = {
let config = {
broadcaster: 'pusher',
key: Statamic.$config.get('broadcasting.pusher.key'),
cluster: Statamic.$config.get('broadcasting.pusher.cluster'),
Expand All @@ -22,6 +27,8 @@ class Echo {
authEndpoint: Statamic.$config.get('broadcasting.endpoint'),
};

this.configCallbacks.forEach(callback => config = callback(config));

this.echo = new LaravelEcho(config);

this.bootedCallbacks.forEach(callback => callback(this));
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
45 changes: 31 additions & 14 deletions resources/js/components/UpdatesBadge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,45 @@

<script>
export default {
data() {
return {
count: 0,
};
},
mounted() {
this.getCount();
computed: {
count() {
return this.$store.state.updates.count;
}
},
created() {
this.$events.$on('recount-updates', this.getCount);
this.registerVuexModule();
this.getCount();
},
methods: {
getCount(clearCache = true) {
let params = clearCache ? {'clearCache': clearCache} : {};
registerVuexModule() {
if (this.$store.state.updates) return;
this.$axios.get(cp_url('updater/count'), params).then(response => {
this.count = !isNaN(response.data) ? response.data : 0;
});
}
this.$store.registerModule('updates', {
namespaced: true,
state: {
count: 0,
requested: false,
},
mutations: {
count: (state, count) => state.count = count,
requested: (state) => state.requested = true,
}
})
},
getCount() {
if (this.$store.state.updates.requested) return;
this.$axios
.get(cp_url('updater/count'))
.then(response => this.$store.commit('updates/count', !isNaN(response.data) ? response.data : 0));
this.$store.commit('updates/requested');
},
}
}
</script>
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
2 changes: 1 addition & 1 deletion resources/js/components/assets/Editor/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
<div id="asset-meta-data" class="flex-1 hidden sm:flex space-x-3 py-1 h-full text-xs text-gray-800">
<div class="flex items-center bg-gray-400 rounded py-1 pl-2 pr-3" v-if="isImage">
<svg-icon name="image-picture" class="h-3 mr-2" />
<div class="">{{ asset.width }} x {{ asset.height }}</div>
<div class="">{{ __('messages.width_x_height', { width: asset.width, height: asset.height }) }}</div>
</div>
<div class="flex items-center bg-gray-400 rounded py-1 pl-2 pr-3">
<svg-icon name="sd-card" class="h-3 mr-2" />
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
Loading

0 comments on commit c74b400

Please sign in to comment.