diff --git a/CHANGELOG.md b/CHANGELOG.md
index f01d1c090..b66cda0c4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.
-## 0.10.1 - Dayjs Hotfix
+## 0.11 -
+### Added
+- Indicator in _Data Model Editor_ that visualizes if an attribute is used in any entity-type
+
+## 0.10.1
### Fixed
- Frontend errors due to wrong dayjs import
diff --git a/app/Http/Controllers/EditorController.php b/app/Http/Controllers/EditorController.php
index 50e44d2ac..cc964b269 100644
--- a/app/Http/Controllers/EditorController.php
+++ b/app/Http/Controllers/EditorController.php
@@ -83,7 +83,7 @@ public function getAttributes() {
'error' => __('You do not have the permission to view entity data')
], 403);
}
- $attributes = Attribute::whereNull('parent_id')->orderBy('id')->get();
+ $attributes = Attribute::whereNull('parent_id')->withCount('entity_types')->orderBy('id')->get();
$selections = [];
foreach($attributes as $a) {
$selection = $a->getSelection();
diff --git a/resources/js/components/AttributeList.vue b/resources/js/components/AttributeList.vue
index 5188ace7a..3f56adfaa 100644
--- a/resources/js/components/AttributeList.vue
+++ b/resources/js/components/AttributeList.vue
@@ -14,22 +14,25 @@
@@ -97,6 +101,8 @@
import store from '@/bootstrap/store.js';
import router from '%router';
+ import AttributeUsageIndicator from '@/components/dme/AttributeUsageIndicator.vue';
+
import {
duplicateEntityType as duplicateEntityTypeApi,
getEntityTypeOccurrenceCount,
@@ -117,6 +123,9 @@
} from '@/helpers/modal.js';
export default {
+ components: {
+ AttributeUsageIndicator,
+ },
setup(props, context) {
const { t } = useI18n();
const currentRoute = useRoute();
diff --git a/resources/js/components/dme/AttributeUsageIndicator.vue b/resources/js/components/dme/AttributeUsageIndicator.vue
new file mode 100644
index 000000000..3cd19e366
--- /dev/null
+++ b/resources/js/components/dme/AttributeUsageIndicator.vue
@@ -0,0 +1,53 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/js/i18n/de.json b/resources/js/i18n/de.json
index 7e5b79ac2..27934dc14 100644
--- a/resources/js/i18n/de.json
+++ b/resources/js/i18n/de.json
@@ -716,6 +716,7 @@
"title": "Verfügbare Attribute",
"add_button": "Attribut hinzufügen",
"show_hidden": "Ausgeblendete anzeigen",
+ "indicator_info": "Dieses Attribut wird aktuell in keinem Entitätstyp verwendet! | Dieses Attribut wird aktuell in einem Entitätstyp verwendet. | Dieses Attribut wird aktuell in {cnt} Entitätstypen verwendet.",
"modal": {
"new": {
"title": "Neues Attribut"
diff --git a/resources/js/i18n/en.json b/resources/js/i18n/en.json
index 64082f9c0..24a818eda 100644
--- a/resources/js/i18n/en.json
+++ b/resources/js/i18n/en.json
@@ -716,6 +716,7 @@
"title": "Available Attributes",
"add_button": "Add Attribute",
"show_hidden": "Show hidden",
+ "indicator_info": "This attribute is not currently used in any entity-type! | This attribute is currently used in one entity-type. | This attribute is currently used in {cnt} entity-types.",
"modal": {
"new": {
"title": "New Attribute"