From 4c38183ff6bc968bcd1b81c34cc213f40ebe6382 Mon Sep 17 00:00:00 2001
From: Stefan Seifert <stefanseifert@users.noreply.github.com>
Date: Thu, 18 Jul 2024 09:56:35 +0200
Subject: [PATCH 1/4] [gitflow-maven-plugin] Update for next development
 version 1.16.3-SNAPSHOT

---
 bundle/pom.xml  | 6 +++---
 package/pom.xml | 8 ++++----
 parent/pom.xml  | 4 ++--
 pom.xml         | 4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/bundle/pom.xml b/bundle/pom.xml
index f2d2bcd..e0fac22 100644
--- a/bundle/pom.xml
+++ b/bundle/pom.xml
@@ -25,13 +25,13 @@
   <parent>
     <groupId>io.wcm</groupId>
     <artifactId>io.wcm.caconfig.editor.parent</artifactId>
-    <version>1.16.2</version>
+    <version>1.16.3-SNAPSHOT</version>
     <relativePath>../parent/pom.xml</relativePath>
   </parent>
 
   <groupId>io.wcm</groupId>
   <artifactId>io.wcm.caconfig.editor</artifactId>
-  <version>1.16.2</version>
+  <version>1.16.3-SNAPSHOT</version>
   <packaging>jar</packaging>
 
   <name>Context-Aware Configuration Editor</name>
@@ -42,7 +42,7 @@
     <site.url.module.prefix>caconfig/editor/bundle</site.url.module.prefix>
 
     <!-- Enable reproducible builds -->
-    <project.build.outputTimestamp>2024-07-18T07:54:44Z</project.build.outputTimestamp>
+    <project.build.outputTimestamp>2024-07-18T07:56:33Z</project.build.outputTimestamp>
   </properties>
 
   <dependencies>
diff --git a/package/pom.xml b/package/pom.xml
index e49f0ac..5b53b2a 100644
--- a/package/pom.xml
+++ b/package/pom.xml
@@ -25,13 +25,13 @@
   <parent>
     <groupId>io.wcm</groupId>
     <artifactId>io.wcm.caconfig.editor.parent</artifactId>
-    <version>1.16.2</version>
+    <version>1.16.3-SNAPSHOT</version>
     <relativePath>../parent/pom.xml</relativePath>
   </parent>
 
   <groupId>io.wcm</groupId>
   <artifactId>io.wcm.caconfig.editor.package</artifactId>
-  <version>1.16.2</version>
+  <version>1.16.3-SNAPSHOT</version>
   <packaging>content-package</packaging>
   <name>Context-Aware Configuration Editor Package</name>
   <url>${site.url}/caconfig/editor/</url>
@@ -41,7 +41,7 @@
     <contentPackage.group>wcm-io</contentPackage.group>
 
     <!-- Enable reproducible builds -->
-    <project.build.outputTimestamp>2024-07-18T07:54:44Z</project.build.outputTimestamp>
+    <project.build.outputTimestamp>2024-07-18T07:56:33Z</project.build.outputTimestamp>
   </properties>
 
   <dependencies>
@@ -50,7 +50,7 @@
       <groupId>io.wcm</groupId>
       <artifactId>io.wcm.caconfig.editor</artifactId>
       <scope>compile</scope>
-      <version>1.16.2</version>
+      <version>1.16.3-SNAPSHOT</version>
     </dependency>
 
   </dependencies>
diff --git a/parent/pom.xml b/parent/pom.xml
index 5faa0a5..bd1bc5f 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -31,7 +31,7 @@
 
   <groupId>io.wcm</groupId>
   <artifactId>io.wcm.caconfig.editor.parent</artifactId>
-  <version>1.16.2</version>
+  <version>1.16.3-SNAPSHOT</version>
   <packaging>pom</packaging>
 
   <name>Context-Aware Configuration Editor Parent</name>
@@ -49,7 +49,7 @@
 
   <properties>
     <!-- Enable reproducible builds -->
-    <project.build.outputTimestamp>2024-07-18T07:54:44Z</project.build.outputTimestamp>
+    <project.build.outputTimestamp>2024-07-18T07:56:33Z</project.build.outputTimestamp>
   </properties>
 
   <build>
diff --git a/pom.xml b/pom.xml
index 34c0c33..23798a7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,13 +25,13 @@
   <parent>
     <groupId>io.wcm</groupId>
     <artifactId>io.wcm.caconfig.editor.parent</artifactId>
-    <version>1.16.2</version>
+    <version>1.16.3-SNAPSHOT</version>
     <relativePath>parent/pom.xml</relativePath>
   </parent>
 
   <groupId>io.wcm</groupId>
   <artifactId>io.wcm.caconfig.editor.root</artifactId>
-  <version>1.16.2</version>
+  <version>1.16.3-SNAPSHOT</version>
   <packaging>pom</packaging>
 
   <name>Context-Aware Configuration Editor Root</name>

From 212159b4b3a5ccc9c16008f859bc0c49b96e9f69 Mon Sep 17 00:00:00 2001
From: Stefan Seifert <stefanseifert@users.noreply.github.com>
Date: Fri, 23 Aug 2024 08:56:10 +0200
Subject: [PATCH 2/4] Dropdown widget with multiple values: Preserve order of
 selected items when displaying configuration (#41)

---
 .../js/widgets/property-dropdown.directive.js         | 11 +++++++++--
 changes.xml                                           |  6 ++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/bundle/src/main/webapp/app-root/clientlibs/io.wcm.caconfig.editor/js/widgets/property-dropdown.directive.js b/bundle/src/main/webapp/app-root/clientlibs/io.wcm.caconfig.editor/js/widgets/property-dropdown.directive.js
index 5370c68..324f903 100644
--- a/bundle/src/main/webapp/app-root/clientlibs/io.wcm.caconfig.editor/js/widgets/property-dropdown.directive.js
+++ b/bundle/src/main/webapp/app-root/clientlibs/io.wcm.caconfig.editor/js/widgets/property-dropdown.directive.js
@@ -186,9 +186,16 @@
    */
   function setValue(selectWidget, value) {
     var newValues = angular.isArray(value) ? value.map(String) : [String(value)];
-
+    // de-select all existing items
     selectWidget.items.getAll().forEach(function(item) {
-      item.selected = newValues.indexOf(item.value) > -1;
+      item.selected = false;
+    });
+    // reselect items exactly in the order stored in the data
+    newValues.forEach(value => {
+      var matchingItem = selectWidget.items.getAll().find(item => item.value == value);
+      if (matchingItem) {
+        matchingItem.selected = true;
+      }
     });
   }
 
diff --git a/changes.xml b/changes.xml
index 29ce16e..7ca3bf1 100644
--- a/changes.xml
+++ b/changes.xml
@@ -23,6 +23,12 @@
     xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
   <body>
 
+    <release version="1.16.4" date="not released">
+      <action type="fix" dev="sseifert" issue="40">
+        Dropdown widget with multiple values: Preserve order of selected items when displaying configuration.
+      </action>
+    </release>
+
     <release version="1.16.2" date="2024-07-18">
       <action type="fix" dev="sseifert" issue="37">
         Prevent view reload when actual view parameters do not change (avoid issue e.g. with selecting item in pathbrowser first time when Unified Shell is active in AEMaaCS).

From e66c8a57e2b0f1ad3748695f4d53cef6bbfbb25e Mon Sep 17 00:00:00 2001
From: Stefan Seifert <stefanseifert@users.noreply.github.com>
Date: Mon, 26 Aug 2024 11:51:46 +0200
Subject: [PATCH 3/4] prepare release

---
 bundle/pom.xml | 2 +-
 changes.xml    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bundle/pom.xml b/bundle/pom.xml
index e0fac22..41aa969 100644
--- a/bundle/pom.xml
+++ b/bundle/pom.xml
@@ -119,7 +119,7 @@
     <dependency>
       <groupId>io.wcm</groupId>
       <artifactId>io.wcm.testing.aem-mock.junit5</artifactId>
-      <version>5.5.0</version>
+      <version>5.6.0</version>
       <scope>test</scope>
     </dependency>
     <dependency>
diff --git a/changes.xml b/changes.xml
index 7ca3bf1..440fbd8 100644
--- a/changes.xml
+++ b/changes.xml
@@ -23,7 +23,7 @@
     xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
   <body>
 
-    <release version="1.16.4" date="not released">
+    <release version="1.16.4" date="2024-08-26">
       <action type="fix" dev="sseifert" issue="40">
         Dropdown widget with multiple values: Preserve order of selected items when displaying configuration.
       </action>

From 3079b4cb5c6c379ac1e5e69c20abdd3fae21becd Mon Sep 17 00:00:00 2001
From: Stefan Seifert <stefanseifert@users.noreply.github.com>
Date: Mon, 26 Aug 2024 11:52:46 +0200
Subject: [PATCH 4/4] [gitflow-maven-plugin] Update versions for release 1.16.4

---
 bundle/pom.xml  | 6 +++---
 package/pom.xml | 8 ++++----
 parent/pom.xml  | 4 ++--
 pom.xml         | 4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/bundle/pom.xml b/bundle/pom.xml
index 41aa969..c835dcb 100644
--- a/bundle/pom.xml
+++ b/bundle/pom.xml
@@ -25,13 +25,13 @@
   <parent>
     <groupId>io.wcm</groupId>
     <artifactId>io.wcm.caconfig.editor.parent</artifactId>
-    <version>1.16.3-SNAPSHOT</version>
+    <version>1.16.4</version>
     <relativePath>../parent/pom.xml</relativePath>
   </parent>
 
   <groupId>io.wcm</groupId>
   <artifactId>io.wcm.caconfig.editor</artifactId>
-  <version>1.16.3-SNAPSHOT</version>
+  <version>1.16.4</version>
   <packaging>jar</packaging>
 
   <name>Context-Aware Configuration Editor</name>
@@ -42,7 +42,7 @@
     <site.url.module.prefix>caconfig/editor/bundle</site.url.module.prefix>
 
     <!-- Enable reproducible builds -->
-    <project.build.outputTimestamp>2024-07-18T07:56:33Z</project.build.outputTimestamp>
+    <project.build.outputTimestamp>2024-08-26T09:52:43Z</project.build.outputTimestamp>
   </properties>
 
   <dependencies>
diff --git a/package/pom.xml b/package/pom.xml
index 5b53b2a..649d645 100644
--- a/package/pom.xml
+++ b/package/pom.xml
@@ -25,13 +25,13 @@
   <parent>
     <groupId>io.wcm</groupId>
     <artifactId>io.wcm.caconfig.editor.parent</artifactId>
-    <version>1.16.3-SNAPSHOT</version>
+    <version>1.16.4</version>
     <relativePath>../parent/pom.xml</relativePath>
   </parent>
 
   <groupId>io.wcm</groupId>
   <artifactId>io.wcm.caconfig.editor.package</artifactId>
-  <version>1.16.3-SNAPSHOT</version>
+  <version>1.16.4</version>
   <packaging>content-package</packaging>
   <name>Context-Aware Configuration Editor Package</name>
   <url>${site.url}/caconfig/editor/</url>
@@ -41,7 +41,7 @@
     <contentPackage.group>wcm-io</contentPackage.group>
 
     <!-- Enable reproducible builds -->
-    <project.build.outputTimestamp>2024-07-18T07:56:33Z</project.build.outputTimestamp>
+    <project.build.outputTimestamp>2024-08-26T09:52:43Z</project.build.outputTimestamp>
   </properties>
 
   <dependencies>
@@ -50,7 +50,7 @@
       <groupId>io.wcm</groupId>
       <artifactId>io.wcm.caconfig.editor</artifactId>
       <scope>compile</scope>
-      <version>1.16.3-SNAPSHOT</version>
+      <version>1.16.4</version>
     </dependency>
 
   </dependencies>
diff --git a/parent/pom.xml b/parent/pom.xml
index bd1bc5f..187fa44 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -31,7 +31,7 @@
 
   <groupId>io.wcm</groupId>
   <artifactId>io.wcm.caconfig.editor.parent</artifactId>
-  <version>1.16.3-SNAPSHOT</version>
+  <version>1.16.4</version>
   <packaging>pom</packaging>
 
   <name>Context-Aware Configuration Editor Parent</name>
@@ -49,7 +49,7 @@
 
   <properties>
     <!-- Enable reproducible builds -->
-    <project.build.outputTimestamp>2024-07-18T07:56:33Z</project.build.outputTimestamp>
+    <project.build.outputTimestamp>2024-08-26T09:52:43Z</project.build.outputTimestamp>
   </properties>
 
   <build>
diff --git a/pom.xml b/pom.xml
index 23798a7..4b6e4d2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,13 +25,13 @@
   <parent>
     <groupId>io.wcm</groupId>
     <artifactId>io.wcm.caconfig.editor.parent</artifactId>
-    <version>1.16.3-SNAPSHOT</version>
+    <version>1.16.4</version>
     <relativePath>parent/pom.xml</relativePath>
   </parent>
 
   <groupId>io.wcm</groupId>
   <artifactId>io.wcm.caconfig.editor.root</artifactId>
-  <version>1.16.3-SNAPSHOT</version>
+  <version>1.16.4</version>
   <packaging>pom</packaging>
 
   <name>Context-Aware Configuration Editor Root</name>