From 255e61f88977849860a3aa327629bfbb13352ce9 Mon Sep 17 00:00:00 2001
From: Mark Hall <mark.hall@work.room3b.eu>
Date: Thu, 5 Dec 2019 09:16:03 +0000
Subject: [PATCH] Updated the editor config to enable the de-duplication
 functionality

---
 CHANGES.md                            |  4 ++++
 editor/static/editor/js/tei-editor.js | 11 +++++++++++
 scripts/tei-editor/config.js          | 11 +++++++++++
 3 files changed, 26 insertions(+)

diff --git a/CHANGES.md b/CHANGES.md
index b8197d0..7e913db 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,5 +1,9 @@
 # Changes
 
+## 0.8.10:
+
+* **Bugfix**: Updated the config to actually enable the deduplication
+
 ## 0.8.9 (04.12.2019)
 
 * **Update**: Updated TEI editor to address duplicate metadata issue
diff --git a/editor/static/editor/js/tei-editor.js b/editor/static/editor/js/tei-editor.js
index a8bdf42..b3cd75c 100644
--- a/editor/static/editor/js/tei-editor.js
+++ b/editor/static/editor/js/tei-editor.js
@@ -28,6 +28,17 @@
                                     {
                                         tag: 'tei:respStmt',
                                         multiple: true,
+                                        deduplicate: {
+                                            key: 'attrs.xml:id',
+                                            merge: [
+                                                {
+                                                    tag: 'tei:resp',
+                                                },
+                                                {
+                                                    tag: 'tei:name'
+                                                },
+                                            ],
+                                        },
                                         attrs: {
                                             'xml:id': '_attrs.xml:id'
                                         },
diff --git a/scripts/tei-editor/config.js b/scripts/tei-editor/config.js
index e7ce2ee..044ea36 100644
--- a/scripts/tei-editor/config.js
+++ b/scripts/tei-editor/config.js
@@ -28,6 +28,17 @@
                                     {
                                         tag: 'tei:respStmt',
                                         multiple: true,
+                                        deduplicate: {
+                                            key: 'attrs.xml:id',
+                                            merge: [
+                                                {
+                                                    tag: 'tei:resp',
+                                                },
+                                                {
+                                                    tag: 'tei:name'
+                                                },
+                                            ],
+                                        },
                                         attrs: {
                                             'xml:id': '_attrs.xml:id'
                                         },
-- 
GitLab