diff --git a/locales/default.pot b/locales/default.pot
index f0bc0574b..a90838d04 100644
--- a/locales/default.pot
+++ b/locales/default.pot
@@ -1609,6 +1609,21 @@ msgstr ""
msgid "Error while creating new object."
msgstr ""
+msgid "Edit related objects"
+msgstr ""
+
+msgid "Choose object type"
+msgstr ""
+
+msgid "Choose relation"
+msgstr ""
+
+msgid "Filter to apply"
+msgstr ""
+
+msgid "Search related objects"
+msgstr ""
+
msgid "Action"
msgstr ""
diff --git a/locales/en_US/default.po b/locales/en_US/default.po
index 413e1e849..00dadeb67 100644
--- a/locales/en_US/default.po
+++ b/locales/en_US/default.po
@@ -1612,6 +1612,21 @@ msgstr ""
msgid "Error while creating new object."
msgstr ""
+msgid "Edit related objects"
+msgstr ""
+
+msgid "Choose object type"
+msgstr ""
+
+msgid "Choose relation"
+msgstr ""
+
+msgid "Filter to apply"
+msgstr ""
+
+msgid "Search related objects"
+msgstr ""
+
msgid "Action"
msgstr ""
diff --git a/locales/it_IT/default.po b/locales/it_IT/default.po
index a95dc55f1..01df7a0ef 100644
--- a/locales/it_IT/default.po
+++ b/locales/it_IT/default.po
@@ -1631,6 +1631,21 @@ msgstr "Dato obbligatorio mancante \"${ required }\". Riprovare"
msgid "Error while creating new object."
msgstr "Si รจ verificato un errore durante la creazione del nuovo oggetto."
+msgid "Edit related objects"
+msgstr "Modifica oggetti correlati"
+
+msgid "Choose object type"
+msgstr "Scegli il tipo di oggetto"
+
+msgid "Choose relation"
+msgstr "Scegli la relazione"
+
+msgid "Filter to apply"
+msgstr "Filtro da applicare"
+
+msgid "Search related objects"
+msgstr "Cerca oggetti correlati"
+
msgid "Action"
msgstr "Azione"
diff --git a/resources/js/app/app.js b/resources/js/app/app.js
index 24f1b3a85..746b02120 100644
--- a/resources/js/app/app.js
+++ b/resources/js/app/app.js
@@ -111,6 +111,7 @@ const _vueInstance = new Vue({
FieldTextarea: () => import(/* webpackChunkName: "field-textarea" */'app/components/form/field-textarea'),
FieldTitle: () => import(/* webpackChunkName: "field-title" */'app/components/form/field-title'),
ObjectInfo: () => import(/* webpackChunkName: "object-info" */'app/components/object-info/object-info'),
+ RelatedObjectsFilter: () => import(/* webpackChunkName: "related-objects-filter" */'app/components/related-objects-filter/related-objects-filter'),
ModuleProperties: () => import(/* webpackChunkName: "module-properties" */'app/components/module/module-properties'),
ModuleSetup: () => import(/* webpackChunkName: "module-setup" */'app/components/module/module-setup'),
AddRelatedById: () => import(/* webpackChunkName: "add-related-by-id" */'app/components/add-related-by-id/add-related-by-id'),
@@ -624,6 +625,7 @@ window._vueInstance = _vueInstance;
// use component everywhere in Manager
Vue.component('AppIcon', AppIcon);
+Vue.component('ClipboardItem', _vueInstance.$options.components.ClipboardItem);
Vue.component('DateRangesView', _vueInstance.$options.components.DateRangesView);
Vue.component('FieldCheckbox', _vueInstance.$options.components.FieldCheckbox);
Vue.component('FieldGeoCoordinates', _vueInstance.$options.components.FieldGeoCoordinates);
@@ -643,5 +645,7 @@ Vue.component('ModuleSetup', _vueInstance.$options.components.ModuleSetup);
Vue.component('ObjectCategories', _vueInstance.$options.components.ObjectCategories);
Vue.component('ObjectCaptions', _vueInstance.$options.components.ObjectCaptions);
Vue.component('ObjectInfo', _vueInstance.$options.components.ObjectInfo);
+Vue.component('RelatedObjectsFilter', _vueInstance.$options.components.RelatedObjectsFilter);
+Vue.component('Thumbnail', _vueInstance.$options.components.Thumbnail);
Vue.component('RibbonItem', _vueInstance.$options.components.RibbonItem);
Vue.component('UploadedObject', _vueInstance.$options.components.UploadedObject);
diff --git a/resources/js/app/components/filter-box.vue b/resources/js/app/components/filter-box.vue
index f113215f5..d612acb3e 100644
--- a/resources/js/app/components/filter-box.vue
+++ b/resources/js/app/components/filter-box.vue
@@ -38,6 +38,10 @@ export default {
default: '[10]'
},
filterActive: Boolean,
+ filterRelationsActive: {
+ type: Boolean,
+ default: false
+ },
filterList: {
type: Array,
default: () => [],
@@ -81,7 +85,9 @@ export default {
* When disabled, only direct children are fetched.
* This will switch the API filter between `parent` and `ancestor`.
*/
+ editFilterRelations: this.filterRelationsActive,
filterByDescendants: false,
+ filterRelations: {},
folder: null,
moreFilters: this.filterActive,
pageSize: this.pagination.page_size,
@@ -364,6 +370,10 @@ export default {
const filter = this.prepareFilters();
const filterObject = { ...this.queryFilter, filter };
+ filterObject.filter = {
+ ...filterObject.filter,
+ ...this.filterRelations,
+ };
this.availableFilters = this.filtersByType?.[filterObject?.filter?.type] || [];
this.$emit('filter-objects', filterObject);
},
@@ -461,6 +471,20 @@ export default {
delete this.queryFilter.filter[oldFilter];
this.queryFilter.filter[newFilter] = this.folder?.id || null;
},
+
+ toggleFilterRelations() {
+ this.editFilterRelations = !this.editFilterRelations;
+ },
+
+ updateFilterRelations(filter) {
+ this.filterRelations = {};
+ for (const [key, value] of Object.entries(filter)) {
+ this.filterRelations[key] = [];
+ for (const v of value) {
+ this.filterRelations[key].push(v);
+ }
+ }
+ },
}
};
diff --git a/resources/js/app/components/object-info/object-info.vue b/resources/js/app/components/object-info/object-info.vue
index 1d0739910..eb0ce58fa 100644
--- a/resources/js/app/components/object-info/object-info.vue
+++ b/resources/js/app/components/object-info/object-info.vue
@@ -57,7 +57,7 @@ export default {
fillData() {
const source = BEDITA?.indexLists?.[this.reloadedData?.type] || {};
this.fields = source || ['title', 'description'];
- this.fields = this.fields.filter((value, index, array) => {
+ this.fields = this.fields?.filter((value, index, array) => {
return array.indexOf(value) === index;
});
for (const field of this.fields) {
diff --git a/resources/js/app/components/related-objects-filter/related-objects-filter.vue b/resources/js/app/components/related-objects-filter/related-objects-filter.vue
new file mode 100644
index 000000000..3fb122353
--- /dev/null
+++ b/resources/js/app/components/related-objects-filter/related-objects-filter.vue
@@ -0,0 +1,133 @@
+
+
+
+
+
diff --git a/resources/js/app/components/related-objects-filter/related-objects-panel.vue b/resources/js/app/components/related-objects-filter/related-objects-panel.vue
new file mode 100644
index 000000000..81cdec1f1
--- /dev/null
+++ b/resources/js/app/components/related-objects-filter/related-objects-panel.vue
@@ -0,0 +1,401 @@
+
+
+
+
+
diff --git a/resources/js/app/components/related-objects-filter/results-pagination.vue b/resources/js/app/components/related-objects-filter/results-pagination.vue
new file mode 100644
index 000000000..34f22e311
--- /dev/null
+++ b/resources/js/app/components/related-objects-filter/results-pagination.vue
@@ -0,0 +1,137 @@
+
+
+ {{ item.attributes.title }}
+
+