-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[4352] Add support to range column filters in table
Bug: #4352 Signed-off-by: Florian ROUËNÉ <[email protected]>
- Loading branch information
Showing
9 changed files
with
207 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
...rius-components-core/src/test/java/org/eclipse/sirius/components/core/URLParserTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 CEA LIST. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.sirius.components.core; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.util.List; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
/** | ||
* Tests of the URLParser. | ||
* | ||
* @author frouene | ||
*/ | ||
public class URLParserTests { | ||
|
||
@Test | ||
public void testGetParameterEntriesWithNestedLists() { | ||
URLParser parser = new URLParser(); | ||
String value = "[467ec1c3-8ba7-32dc-9d72-71a2ccad161b:[\"1\",\"\"],4752c1c3-8ba7-32dc-9d72-71a2ccad161b:[\"1\",\"2\"]]"; | ||
List<String> expected = List.of( | ||
"467ec1c3-8ba7-32dc-9d72-71a2ccad161b:[\"1\",\"\"]", | ||
"4752c1c3-8ba7-32dc-9d72-71a2ccad161b:[\"1\",\"2\"]" | ||
); | ||
List<String> result = parser.getParameterEntries(value); | ||
assertThat(expected).isEqualTo(result); | ||
} | ||
|
||
@Test | ||
public void testGetParameterEntriesWithEmptyList() { | ||
URLParser parser = new URLParser(); | ||
String value = "[]"; | ||
List<String> expected = List.of(); | ||
List<String> result = parser.getParameterEntries(value); | ||
assertThat(expected).isEqualTo(result); | ||
} | ||
|
||
@Test | ||
public void testGetParameterEntriesWithSingleElement() { | ||
URLParser parser = new URLParser(); | ||
String value = "[467ec1c3-8ba7-32dc-9d72-71a2ccad161b:[\"1\",\"\"]]"; | ||
List<String> expected = List.of("467ec1c3-8ba7-32dc-9d72-71a2ccad161b:[\"1\",\"\"]"); | ||
List<String> result = parser.getParameterEntries(value); | ||
assertThat(expected).isEqualTo(result); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...ponents-tables/src/main/java/org/eclipse/sirius/components/tables/ColumnFilterMapped.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 CEA LIST. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Obeo - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.sirius.components.tables; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
/** | ||
* Data representing the filter of a column with column mapped to the targetObjectId. | ||
* | ||
* @author frouene | ||
*/ | ||
public record ColumnFilterMapped(String id, List<String> values) { | ||
|
||
public ColumnFilterMapped { | ||
Objects.requireNonNull(id); | ||
Objects.requireNonNull(values); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters