Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Match whereJsonContains to how Laravel handles it #11113

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b75055b
[5.x] Allow setting tag pair content from fluent tags (#11018)
daun Oct 28, 2024
f8c6108
[5.x] Add support for avif image format (#11016)
daun Oct 28, 2024
7172e7a
[5.x] Fix helpBlock error with custom js validation rule (#11023)
irfandumanx Oct 29, 2024
0cd579a
[5.x] Fix color fieldtype's collapsed state showing plain HTML (#11031)
jackmcdade Oct 30, 2024
b8f73b5
[5.x] Fix Filesystem AbstractAdapter put method return (#11032)
godismyjudge95 Oct 31, 2024
4ecdd9b
[5.x] Statamic Tag Blade Compiler (#10967)
JohnathonKoster Oct 31, 2024
3bd3171
changelog
jasonvarga Oct 31, 2024
f74cd05
[5.x] Fix inline Bard with leading line break (#11038)
jacksleight Nov 1, 2024
ce21344
[5.x] Add a config for specifying the default layout (#11025)
ryanmitchell Nov 1, 2024
37c7c2b
[5.x] Translations (#11050)
jasonvarga Nov 4, 2024
b9ea442
[5.x] Fix query parameters in external script URLs being wrongly enco…
duncanmcclean Nov 4, 2024
495a3d9
[5.x] Improved fieldtype search using keywords (#11053)
jasonvarga Nov 4, 2024
ba04ca4
[5.x] Fix addon events dispatched twice if registered manually (#11049)
morhi Nov 4, 2024
2a63aef
[5.x] Files Fieldtype: Don't truncate existing filename (#11055)
duncanmcclean Nov 5, 2024
44ea6dc
[5.x] Fix typeahead relationship input corrupting data (#11059)
daun Nov 5, 2024
ee9d9ee
[5.x] Offer to enable Pro during make user command (#11071)
jasonvarga Nov 6, 2024
89fab65
[5.x] Fix Ignition Runnable Error Solutions (#11072)
jasonvarga Nov 6, 2024
d8d09d1
[5.x] Update addon `.gitignore` stub (#11068)
duncanmcclean Nov 6, 2024
ad32277
[5.x] Integer fields should render with `type="number"` (#11065)
duncanmcclean Nov 6, 2024
f012812
[5.x] Adjust legacy ignition classes (#11073)
jasonvarga Nov 6, 2024
16bb315
[5.x] Add `--clear` option for `starter-kit:export` (#11079)
jesseleite Nov 6, 2024
9b4302c
[5.x] Extra values for entry field conditions, including depth (#11080)
jasonvarga Nov 6, 2024
44c8bab
changelog
jasonvarga Nov 6, 2024
90e8488
[5.x] Use layout config in errors too (#11083)
ryanmitchell Nov 7, 2024
97bdb43
[5.x] Render HTML for dictionary fields in listings (#11088)
jasonvarga Nov 7, 2024
0a2ec25
[5.x] Fix error after deleting role when storing users in the databas…
duncanmcclean Nov 7, 2024
31fe562
[5.x] French translations (#11093)
ebeauchamps Nov 7, 2024
c6727f3
[5.x] Create edit/{id} route for control panel access (#11092)
aaronbushnell Nov 7, 2024
1d78ccf
[5.x] Add `fullyQualifiedHandle` method to `Blueprint` (#11096)
duncanmcclean Nov 8, 2024
09a2c4b
[5.x] Add "Container" option to Asset Folders fieldtype (#11099)
duncanmcclean Nov 11, 2024
4c28bd7
[5.x] German translations (#11098)
helloDanuk Nov 11, 2024
74e5bb2
[5.x] Accept collections in ampersand list modifier (#11102)
daun Nov 11, 2024
7a80411
[5.x] Allow customizing term create label (#11103)
daun Nov 11, 2024
f13a997
[5.x] French translations (#11100)
ebeauchamps Nov 11, 2024
d479f05
[5.x] Hide "Localizable" button on non-localizable blueprints (#11107)
duncanmcclean Nov 11, 2024
d25c9e3
[5.x] French translations (#11108)
jasonvarga Nov 11, 2024
158bb14
Match how whereJsonContains to how Laravel handles it
ryanmitchell Nov 12, 2024
f2f2338
Fix failing test
ryanmitchell Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# Release Notes

## 5.37.0 (2024-11-06)

### What's new
- Improved fieldtype search using keywords [#11053](https://github.com/statamic/cms/issues/11053) by @jasonvarga
- Offer to enable Pro during make user command [#11071](https://github.com/statamic/cms/issues/11071) by @jasonvarga
- Add `--clear` option for `starter-kit:export` [#11079](https://github.com/statamic/cms/issues/11079) by @jesseleite
- Extra values for entry field conditions, including depth [#11080](https://github.com/statamic/cms/issues/11080) by @jasonvarga
- Add a config for specifying the default layout [#11025](https://github.com/statamic/cms/issues/11025) by @ryanmitchell

### What's fixed
- Integer fields should render with `type="number"` [#11065](https://github.com/statamic/cms/issues/11065) by @duncanmcclean
- Update addon `.gitignore` stub [#11068](https://github.com/statamic/cms/issues/11068) by @duncanmcclean
- Adjust legacy ignition classes [#11073](https://github.com/statamic/cms/issues/11073) by @jasonvarga
- Fix Ignition Runnable Error Solutions [#11072](https://github.com/statamic/cms/issues/11072) by @jasonvarga
- Fix typeahead relationship input corrupting data [#11059](https://github.com/statamic/cms/issues/11059) by @daun
- Files Fieldtype: Don't truncate existing filename [#11055](https://github.com/statamic/cms/issues/11055) by @duncanmcclean
- Fix addon events dispatched twice if registered manually [#11049](https://github.com/statamic/cms/issues/11049) by @morhi
- Fix query parameters in external script URLs being wrongly encoded [#11052](https://github.com/statamic/cms/issues/11052) by @duncanmcclean
- Fix inline Bard with leading line break [#11038](https://github.com/statamic/cms/issues/11038) by @jacksleight
- Update Translations and fill in blanks with Google Translate [#11050](https://github.com/statamic/cms/issues/11050) by @jasonvarga



## 5.36.0 (2024-10-31)

### What's new
- New Blade syntax for using Tags [#10967](https://github.com/statamic/cms/issues/10967) by @JohnathonKoster
- Add support for avif image format [#11016](https://github.com/statamic/cms/issues/11016) by @daun
- Allow setting tag pair content from fluent tags [#11018](https://github.com/statamic/cms/issues/11018) by @daun

### What's fixed
- Fix Filesystem AbstractAdapter put method return [#11032](https://github.com/statamic/cms/issues/11032) by @godismyjudge95
- Fix color fieldtype's collapsed state showing plain HTML [#11031](https://github.com/statamic/cms/issues/11031) by @jackmcdade
- Fix helpBlock error with custom js validation rule [#11023](https://github.com/statamic/cms/issues/11023) by @irfandumanx



## 5.35.0 (2024-10-28)

### What's new
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
"rebing/graphql-laravel": "^9.5",
"rhukster/dom-sanitizer": "^1.0.6",
"spatie/blink": "^1.3",
"spatie/ignition": "^1.12",
"spatie/ignition": "^1.15",
"statamic/stringy": "^3.1.2",
"stillat/blade-parser": "^1.10.1",
"symfony/lock": "^6.4",
"symfony/var-exporter": "^6.0",
"symfony/yaml": "^6.0 || ^7.0",
Expand Down Expand Up @@ -80,7 +81,8 @@
},
"files": [
"src/helpers.php",
"src/namespaced_helpers.php"
"src/namespaced_helpers.php",
"src/View/Blade/helpers.php"
]
},
"autoload-dev": {
Expand Down
11 changes: 11 additions & 0 deletions config/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,15 @@

'fake_sql_queries' => config('app.debug'),

/*
|--------------------------------------------------------------------------
| Layout
|--------------------------------------------------------------------------
|
| Define the default layout that will be used by views.
|
*/

'layout' => env('STATAMIC_LAYOUT', 'layout'),

];
11 changes: 6 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"codemirror": "^5.58.2",
"cookies-js": "^1.2.2",
"floating-vue": "^1.0.0-beta.19",
"fuse.js": "^3.4.6",
"fuse.js": "^7.0.0",
"highlight.js": "^11.7.0",
"imask": "^6.6.0-alpha.0",
"laravel-echo": "^1.16.0",
Expand Down
2 changes: 2 additions & 0 deletions resources/js/bootstrap/fieldtypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import TitleFormats from '../components/collections/TitleFormats.vue';
import ColorFieldtype from '../components/fieldtypes/ColorFieldtype.vue';
import DateFieldtype from '../components/fieldtypes/DateFieldtype.vue';
import DictionaryFieldtype from "../components/fieldtypes/DictionaryFieldtype.vue";
import DictionaryIndexFieldtype from "../components/fieldtypes/DictionaryIndexFieldtype.vue";
import DictionaryFields from "../components/fieldtypes/DictionaryFields.vue";
import FieldDisplayFieldtype from '../components/fieldtypes/FieldDisplayFieldtype.vue';
import FieldsFieldtype from '../components/fieldtypes/grid/FieldsFieldtype.vue';
Expand Down Expand Up @@ -89,6 +90,7 @@ Vue.component('collection_title_formats-fieldtype', TitleFormats);
Vue.component('color-fieldtype', ColorFieldtype);
Vue.component('date-fieldtype', DateFieldtype);
Vue.component('dictionary-fieldtype', DictionaryFieldtype);
Vue.component('dictionary-fieldtype-index', DictionaryIndexFieldtype);
Vue.component('dictionary_fields-fieldtype', DictionaryFields);
Vue.component('field_display-fieldtype', FieldDisplayFieldtype);
Vue.component('fields-fieldtype', FieldsFieldtype);
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/FileIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export default {
return 'video';
case 'xml':
return 'xml';
case 'avif':
case 'bmp':
case 'gif':
case 'ico':
Expand All @@ -90,6 +91,7 @@ export default {
case 'raw':
case 'nef':
case 'tiff':
case 'webp':
return 'image';
default:
return 'generic';
Expand Down
4 changes: 3 additions & 1 deletion resources/js/components/blueprints/Builder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
:single-tab="!useTabs"
:initial-tabs="tabs"
:errors="errors.tabs"
:can-define-localizable="canDefineLocalizable"
@updated="tabsUpdated"
/>

Expand All @@ -53,10 +54,11 @@
<script>
import SuggestsConditionalFields from './SuggestsConditionalFields';
import Tabs from './Tabs.vue';
import CanDefineLocalizable from "../fields/CanDefineLocalizable";

export default {

mixins: [SuggestsConditionalFields],
mixins: [SuggestsConditionalFields, CanDefineLocalizable],

components: {
Tabs,
Expand Down
4 changes: 4 additions & 0 deletions resources/js/components/blueprints/TabContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@
:edit-section-text="editSectionText"
:show-section-handle-field="showSectionHandleField"
:show-section-hide-field="showSectionHideField"
:can-define-localizable="canDefineLocalizable"
@updated="sectionsUpdated($event)"
/>
</div>
</template>

<script>
import Sections from './Sections.vue';
import CanDefineLocalizable from "../fields/CanDefineLocalizable";

export default {

mixins: [CanDefineLocalizable],

components: {
Sections,
},
Expand Down
4 changes: 4 additions & 0 deletions resources/js/components/blueprints/Tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
:new-section-text="newSectionText"
:edit-section-text="editSectionText"
:add-section-text="addSectionText"
:can-define-localizable="canDefineLocalizable"
@updated="updateTab(tab._id, $event)"
/>
</div>
Expand All @@ -47,9 +48,12 @@ import {Sortable, Plugins} from '@shopify/draggable';
import uniqid from 'uniqid';
import Tab from './Tab.vue';
import TabContent from './TabContent.vue';
import CanDefineLocalizable from "../fields/CanDefineLocalizable";

export default {

mixins: [CanDefineLocalizable],

components: {
Tab,
TabContent,
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/data-list/DataList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default {
keys: this.searchableColumns,
});

return fuse.search(this.searchQuery);
return fuse.search(this.searchQuery).map(result => result.item);
},

sortRows(rows) {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/data-list/HasFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default {

searchPlaceholder() {
if (this.activePreset) {
return __('Searching in: ') + this.activePresetPayload.display;
return `${__('Searching in:')} ${this.activePresetPayload.display}`;
}

return __('Search');
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/entries/BaseCreateForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
:collection-has-routes="collectionHasRoutes"
:initial-fieldset="fieldset"
:initial-values="values"
:initial-extra-values="extraValues"
:initial-meta="meta"
:initial-localizations="localizations"
:initial-has-origin="false"
Expand Down Expand Up @@ -37,6 +38,7 @@ export default {
'collectionHasRoutes',
'fieldset',
'values',
'extraValues',
'meta',
'localizations',
'revisions',
Expand Down
5 changes: 5 additions & 0 deletions resources/js/components/entries/PublishForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
:name="publishContainer"
:blueprint="fieldset"
:values="values"
:extra-values="extraValues"
:reference="initialReference"
:meta="meta"
:errors="errors"
Expand Down Expand Up @@ -335,6 +336,7 @@ export default {
initialReference: String,
initialFieldset: Object,
initialValues: Object,
initialExtraValues: Object,
initialMeta: Object,
initialTitle: String,
initialLocalizations: Array,
Expand Down Expand Up @@ -375,6 +377,7 @@ export default {
title: this.initialTitle,
values: _.clone(this.initialValues),
meta: _.clone(this.initialMeta),
extraValues: _.clone(this.initialExtraValues),
localizations: _.clone(this.initialLocalizations),
localizedFields: this.initialLocalizedFields,
hasOrigin: this.initialHasOrigin,
Expand Down Expand Up @@ -606,6 +609,7 @@ export default {
clearTimeout(this.trackDirtyStateTimeout)
this.trackDirtyState = false
this.values = this.resetValuesFromResponse(response.data.data.values);
this.extraValues = response.data.data.extraValues;
this.trackDirtyStateTimeout = setTimeout(() => (this.trackDirtyState = true), 500)
this.$nextTick(() => this.$emit('saved', response));
return;
Expand All @@ -630,6 +634,7 @@ export default {
clearTimeout(this.trackDirtyStateTimeout);
this.trackDirtyState = false;
this.values = this.resetValuesFromResponse(response.data.data.values);
this.extraValues = response.data.data.extraValues;
this.trackDirtyStateTimeout = setTimeout(() => (this.trackDirtyState = true), 500);
this.initialPublished = response.data.data.published;
this.activeLocalization.published = response.data.data.published;
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 @@ -176,7 +176,7 @@ export default {
return false;
}

let rule = _.chain(RULES)
let rule = _.chain(this.allRules)
.filter(rule => rule.value === this.selectedLaravelRule)
.first()
.value();
Expand Down
11 changes: 7 additions & 4 deletions resources/js/components/fields/FieldtypeSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default {
if (!this.fieldtypesLoaded) return [];

let options = this.fieldtypes.map(fieldtype => {
return {text: fieldtype.title, value: fieldtype.handle, categories: fieldtype.categories, icon: fieldtype.icon};
return {text: fieldtype.title, value: fieldtype.handle, categories: fieldtype.categories, keywords: fieldtype.keywords, icon: fieldtype.icon};
});

if (this.allowDate) options.unshift({text: __('Publish Date'), value: 'date', categories: ['system'], isMeta: true, icon: 'date'});
Expand Down Expand Up @@ -131,11 +131,14 @@ export default {
const fuse = new Fuse(options, {
findAllMatches: true,
threshold: 0.1,
minMatchCharLength: 2,
keys: ['text'],
keys: [
{name: 'text', weight: 1},
{name: 'categories', weight: 0.1},
{name: 'keywords', weight: 0.4},
],
});

options = fuse.search(this.search);
options = fuse.search(this.search).map(result => result.item);
}

return options;
Expand Down
6 changes: 2 additions & 4 deletions resources/js/components/fieldtypes/AssetFolderFieldtype.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<template>
<div class="asset-folder-fieldtype-wrapper">
<small class="help-block text-gray-600" v-if="!container">{{ __('Select asset container') }}</small>

<relationship-fieldtype
v-if="container"
:handle="handle"
:value="value"
:meta="relationshipMeta"
:config="{ type: 'asset_folder' }"
:config="{ type: 'asset_folder', max_items: this.config.max_items }"
@input="update"
/>
</div>
Expand All @@ -23,7 +21,7 @@ export default {
computed: {

container() {
return data_get(this.$store.state.publish[this.storeName].values.container, '0', null);
return data_get(this.$store.state.publish[this.storeName].values.container, '0', this.config.container);
},

relationshipMeta() {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/fieldtypes/ColorFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default {
if (! this.showFieldPreviews || ! this.config.replicator_preview) return;

return this.value
? `<span class="little-dot" style="background-color:${this.value}"></span>`
? replicatorPreviewHtml(`<span class="little-dot" style="background-color:${this.value}"></span>`)
: null;
}

Expand Down
19 changes: 19 additions & 0 deletions resources/js/components/fieldtypes/DictionaryIndexFieldtype.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<template>
<div class="text-ellipsis" v-html="formatted" />
</template>

<script>
export default {

mixins: [IndexFieldtype],

computed: {
formatted() {
if (!this.value) {
return null;
}
return this.value.join(', ');
},
},
};
</script>
2 changes: 1 addition & 1 deletion resources/js/components/fieldtypes/FilesFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</div>
<div
class="flex items-center flex-1 rtl:mr-2 ltr:ml-2 text-xs rtl:text-right ltr:text-left truncate"
v-text="file.slice(11)"
v-text="file"
/>
</td>
<td class="p-0 w-8 rtl:text-left ltr:text-right align-middle">
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/fieldtypes/assets/Asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default {
},

canBeTransparent() {
return ['png', 'svg'].includes(this.asset.extension)
return ['png', 'svg', 'webp', 'avif'].includes(this.asset.extension)
},

canDownload() {
Expand Down
Loading
Loading