Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Jul 18, 2024
2 parents 468fec6 + 0cd6ee7 commit 090fcbf
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 27 deletions.
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Declare text files with unix file ending
*.any text eol=lf
*.cfg text eol=lf
*.conf text eol=lf
*.config text eol=lf
*.css text eol=lf
*.dtd text eol=lf
*.esp text eol=lf
*.ecma text eol=lf
*.farm text eol=lf
*.gdsl text eol=lf
*.groovy text eol=lf
*.hbrs text eol=lf
*.hbs text eol=lf
Expand All @@ -15,6 +19,7 @@
*.js text eol=lf
*.json text eol=lf
*.jsp text eol=lf
*.md text eol=lf
*.mustache text eol=lf
*.tld text eol=lf
*.launch text eol=lf
Expand All @@ -24,14 +29,19 @@
*.project text eol=lf
*.properties text eol=lf
*.props text eol=lf
*.py text eol=lf
*.rules text eol=lf
*.sass text eol=lf
*.scss text eol=lf
*.sh text eol=lf
*.shtm text eol=lf
*.shtml text eol=lf
*.sql text eol=lf
*.svg text eol=lf
*.tf text eol=lf
*.ts text eol=lf
*.txt text eol=lf
*.vhost text eol=lf
*.vm text eol=lf
*.xml text eol=lf
*.xsd text eol=lf
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ npm-debug.log
.vlt
.vlt-sync*
.brackets.json
.aio
6 changes: 3 additions & 3 deletions bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.caconfig.editor.parent</artifactId>
<version>1.16.0</version>
<version>1.16.2</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

<groupId>io.wcm</groupId>
<artifactId>io.wcm.caconfig.editor</artifactId>
<version>1.16.0</version>
<version>1.16.2</version>
<packaging>jar</packaging>

<name>Context-Aware Configuration Editor</name>
Expand All @@ -42,7 +42,7 @@
<site.url.module.prefix>caconfig/editor/bundle</site.url.module.prefix>

<!-- Enable reproducible builds -->
<project.build.outputTimestamp>2024-04-17T07:55:21Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2024-07-18T07:54:44Z</project.build.outputTimestamp>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private ConfigurationPersistData parseConfigData(JsonNode item, ConfigurationMet
// skip nested configuration and empty properties
continue;
}
else if (propertyType == null) {
if (propertyType == null) {
JsonNode value = properties.get(propertyName);
if (value.isArray()) {
ArrayNode arrayValue = (ArrayNode)value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@
$rootScope.i18n = function (key) {
return Granite.I18n.get("io.wcm.caconfig.editor." + key);
};

$rootScope.$on('$routeChangeStart', function(event, next, current) {
if (isSameRoute(current, next)) {
// avoid reload when route is the same as before
event.preventDefault();
}
});
}

function isSameRoute(current, next) {
const currentController = current?.$$route?.controller;
const currentConfigName = current?.pathParams?.configName;
const nextController = next?.$$route?.controller;
const nextConfigName = current?.pathParams?.configName;
return currentController !== undefined && currentController === nextController && currentConfigName === nextConfigName;
}

}(angular, Granite));
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@

// Add change event listener
$(pathfieldWidget).on("change", function onChange() {
scope.property.value = pathfieldWidget.value;
if ($rootScope.configForm.$pristine) {
$rootScope.configForm.$setDirty();
if (scope.property.value != pathfieldWidget.value) {
scope.property.value = pathfieldWidget.value;
if ($rootScope.configForm.$pristine) {
$rootScope.configForm.$setDirty();
}
scope.$digest();
}
scope.$digest();
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.Mock.Strictness;
import org.mockito.junit.jupiter.MockitoExtension;

import io.wcm.caconfig.editor.DropdownOptionItem;
Expand All @@ -46,16 +47,16 @@ class DropdownOptionProviderServiceTest {

@Mock
private Resource resource;
@Mock(lenient = true)
@Mock(strictness = Strictness.LENIENT)
private DropdownOptionProvider provider1;
@Mock(lenient = true)
@Mock(strictness = Strictness.LENIENT)
private DropdownOptionProvider provider2;

private DropdownOptionProviderService underTest;

@BeforeEach
@SuppressWarnings("null")
void setUp() throws Exception {
void setUp() {
when(provider1.getDropdownOptions(resource)).thenReturn(List.of(
new DropdownOptionItem("v1", "desc1"),
new DropdownOptionItem("v2", "desc2")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.Mock.Strictness;
import org.mockito.junit.jupiter.MockitoExtension;

import io.wcm.caconfig.editor.PathBrowserRootPathProvider;
Expand All @@ -42,15 +43,15 @@ class PathBrowserRootPathProviderServiceTest {

@Mock
private Resource resource;
@Mock(lenient = true)
@Mock(strictness = Strictness.LENIENT)
private PathBrowserRootPathProvider provider1;
@Mock(lenient = true)
@Mock(strictness = Strictness.LENIENT)
private PathBrowserRootPathProvider provider2;

private PathBrowserRootPathProviderService underTest;

@BeforeEach
void setUp() throws Exception {
void setUp() {
when(provider1.getRootPath(resource)).thenReturn("/content/root1");
context.registerService(PathBrowserRootPathProvider.class, provider1, PathBrowserRootPathProvider.PROPERTY_SELECTOR, "provider1");
when(provider2.getRootPath(resource)).thenReturn("/content/root2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.Mock.Strictness;
import org.mockito.junit.jupiter.MockitoExtension;

import io.wcm.caconfig.editor.TagBrowserRootPathProvider;
Expand All @@ -42,15 +43,15 @@ class TagBrowserRootPathProviderServiceTest {

@Mock
private Resource resource;
@Mock(lenient = true)
@Mock(strictness = Strictness.LENIENT)
private TagBrowserRootPathProvider provider1;
@Mock(lenient = true)
@Mock(strictness = Strictness.LENIENT)
private TagBrowserRootPathProvider provider2;

private TagBrowserRootPathProviderService underTest;

@BeforeEach
void setUp() throws Exception {
void setUp() {
when(provider1.getRootPath(resource)).thenReturn("/content/root1");
context.registerService(TagBrowserRootPathProvider.class, provider1, TagBrowserRootPathProvider.PROPERTY_SELECTOR, "provider1");
when(provider2.getRootPath(resource)).thenReturn("/content/root2");
Expand Down
6 changes: 6 additions & 0 deletions changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.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).
</action>
</release>

<release version="1.16.0" date="2024-04-17">
<action type="add" dev="sseifert" issue="31">
Check permissions of configuration persistence path and render configuration as read-only if current user does not have write permissions.
Expand Down
8 changes: 4 additions & 4 deletions package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.caconfig.editor.parent</artifactId>
<version>1.16.0</version>
<version>1.16.2</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

<groupId>io.wcm</groupId>
<artifactId>io.wcm.caconfig.editor.package</artifactId>
<version>1.16.0</version>
<version>1.16.2</version>
<packaging>content-package</packaging>
<name>Context-Aware Configuration Editor Package</name>
<url>${site.url}/caconfig/editor/</url>
Expand All @@ -41,7 +41,7 @@
<contentPackage.group>wcm-io</contentPackage.group>

<!-- Enable reproducible builds -->
<project.build.outputTimestamp>2024-04-17T07:55:21Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2024-07-18T07:54:44Z</project.build.outputTimestamp>
</properties>

<dependencies>
Expand All @@ -50,7 +50,7 @@
<groupId>io.wcm</groupId>
<artifactId>io.wcm.caconfig.editor</artifactId>
<scope>compile</scope>
<version>1.16.0</version>
<version>1.16.2</version>
</dependency>

</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.parent_toplevel</artifactId>
<version>2.3.0</version>
<version>2.3.2</version>
<relativePath />
</parent>

<groupId>io.wcm</groupId>
<artifactId>io.wcm.caconfig.editor.parent</artifactId>
<version>1.16.0</version>
<version>1.16.2</version>
<packaging>pom</packaging>

<name>Context-Aware Configuration Editor Parent</name>
Expand All @@ -49,7 +49,7 @@

<properties>
<!-- Enable reproducible builds -->
<project.build.outputTimestamp>2024-04-17T07:55:21Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2024-07-18T07:54:44Z</project.build.outputTimestamp>
</properties>

<build>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.caconfig.editor.parent</artifactId>
<version>1.16.0</version>
<version>1.16.2</version>
<relativePath>parent/pom.xml</relativePath>
</parent>

<groupId>io.wcm</groupId>
<artifactId>io.wcm.caconfig.editor.root</artifactId>
<version>1.16.0</version>
<version>1.16.2</version>
<packaging>pom</packaging>

<name>Context-Aware Configuration Editor Root</name>
Expand Down
2 changes: 1 addition & 1 deletion src/site/markdown/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ on the needs of the application.

Only the template has to be defined, the page component resource type can be referenced. Example:

```json
```json-jcr
{
"jcr:primaryType": "cq:Template",
"jcr:title": "Configuration Editor",
Expand Down

0 comments on commit 090fcbf

Please sign in to comment.