Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate criteria filters to expert filters #137

Merged
merged 35 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d534a22
Migration equipment filter - first phase Ok
Nov 13, 2024
692a804
refactoring
Nov 14, 2024
21821e2
Merge branch 'main' into migration-equipment-filter
basseche Nov 14, 2024
6ad27eb
checkStyle Ok
Nov 14, 2024
dcffee4
Migration ok for transformers
Nov 18, 2024
e65da30
desactivate search for migrated tables
Nov 18, 2024
03e5f84
delete TU on Criteria filters
Nov 19, 2024
3343d68
Merge branch 'main' into migration-equipment-filter
thangqp Nov 20, 2024
838f8ca
merge from main
thangqp Nov 20, 2024
005b72e
Merge remote-tracking branch 'origin/migration-equipment-filter' into…
thangqp Nov 20, 2024
7de7207
exclude migrations from sonar coverage
Nov 21, 2024
8807198
review
Nov 22, 2024
0ae3b24
little optimization
Nov 26, 2024
c7e531f
Merge branch 'main' into migration-equipment-filter
basseche Nov 28, 2024
2a216bb
correct TU
basseche Dec 2, 2024
53d45a3
remove unused code
basseche Dec 2, 2024
926e7bd
for coverage
etiennehomer Dec 2, 2024
2a4d7c0
Clean
etiennehomer Dec 2, 2024
4d0a2ce
delete code of criteria filters
basseche Dec 2, 2024
3233cca
suppress criteria filter code - part 2
basseche Dec 2, 2024
4a863ab
Trigger coverage
etiennehomer Dec 2, 2024
85ab4dc
correction
basseche Dec 2, 2024
1f747e6
Clean
etiennehomer Dec 2, 2024
c32adf6
Merge branch 'delete_code_criteria_filters' of https://github.com/gri…
etiennehomer Dec 2, 2024
26cdf85
changelog drop criteria base tables
basseche Dec 2, 2024
8c12164
add changelog to master file
basseche Dec 2, 2024
1d36960
remove unused class
basseche Dec 2, 2024
7426e9c
remove unused class 2
basseche Dec 2, 2024
bdb0afc
improve tests and suppress warnings
basseche Dec 3, 2024
6c21a33
add tests
basseche Dec 3, 2024
2417776
Merge branch 'migration-equipment-filter' into delete_code_criteria_f…
etiennehomer Dec 3, 2024
bb8adbb
Trigger coverage
etiennehomer Dec 3, 2024
a8c110d
add tests
basseche Dec 3, 2024
14e2a2d
Merge branch 'migration-equipment-filter' into delete_code_criteria_f…
etiennehomer Dec 3, 2024
a29e149
Clean
etiennehomer Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<gridsuite-dependencies.version>35</gridsuite-dependencies.version>
<string-template.version>4.3.1</string-template.version>
<liquibase-hibernate-package>org.gridsuite.filter.server</liquibase-hibernate-package>
<sonar.coverage.exclusions>**/migrations/**/*</sonar.coverage.exclusions>
etiennehomer marked this conversation as resolved.
Show resolved Hide resolved
<filter.version>1.0.16</filter.version>
</properties>

Expand Down Expand Up @@ -173,7 +174,6 @@
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
Expand Down
41 changes: 1 addition & 40 deletions src/main/java/org/gridsuite/filter/server/FilterService.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,18 @@
import org.gridsuite.filter.AbstractFilter;
import org.gridsuite.filter.FilterLoader;
import org.gridsuite.filter.IFilterAttributes;
import org.gridsuite.filter.criteriafilter.CriteriaFilter;
import org.gridsuite.filter.identifierlistfilter.FilterEquipments;
import org.gridsuite.filter.identifierlistfilter.IdentifiableAttributes;
import org.gridsuite.filter.server.dto.IdsByGroup;
import org.gridsuite.filter.server.entities.AbstractFilterEntity;
import org.gridsuite.filter.server.repositories.FilterRepository;
import org.gridsuite.filter.server.repositories.criteriafilter.*;
import org.gridsuite.filter.server.repositories.expertfilter.ExpertFilterRepository;
import org.gridsuite.filter.server.repositories.identifierlistfilter.IdentifierListFilterRepository;
import org.gridsuite.filter.server.repositories.proxies.AbstractFilterRepositoryProxy;
import org.gridsuite.filter.server.repositories.proxies.criteriafilter.*;
import org.gridsuite.filter.server.repositories.proxies.expertfiler.ExpertFilterRepositoryProxy;
import org.gridsuite.filter.server.repositories.proxies.identifierlistfilter.IdentifierListFilterRepositoryProxy;
import org.gridsuite.filter.server.repositories.proxies.scriptfilter.ScriptFilterRepositoryProxy;
import org.gridsuite.filter.server.repositories.scriptfilter.ScriptFilterRepository;
import org.gridsuite.filter.utils.EquipmentType;
import org.gridsuite.filter.utils.FilterServiceUtils;
import org.gridsuite.filter.utils.FilterType;
import org.springframework.context.annotation.ComponentScan;
Expand Down Expand Up @@ -65,44 +61,12 @@ public class FilterService {
private final FilterService self;

public FilterService(final ScriptFilterRepository scriptFiltersRepository,
final LineFilterRepository lineFilterRepository,
etiennehomer marked this conversation as resolved.
Show resolved Hide resolved
final GeneratorFilterRepository generatorFilterRepository,
final LoadFilterRepository loadFilterRepository,
final ShuntCompensatorFilterRepository shuntCompensatorFilterRepository,
final StaticVarCompensatorFilterRepository staticVarCompensatorFilterRepository,
final BatteryFilterRepository batteryFilterRepository,
final BusBarSectionFilterRepository busBarSectionFilterRepository,
final DanglingLineFilterRepository danglingLineFilterRepository,
final LccConverterStationFilterRepository lccConverterStationFilterRepository,
final VscConverterStationFilterRepository vscConverterStationFilterRepository,
final TwoWindingsTransformerFilterRepository twoWindingsTransformerFilterRepository,
final ThreeWindingsTransformerFilterRepository threeWindingsTransformerFilterRepository,
final HvdcLineFilterRepository hvdcLineFilterRepository,
final VoltageLevelFilterRepository voltageLevelFilterRepository,
final SubstationFilterRepository substationFilterRepository,
final IdentifierListFilterRepository identifierListFilterRepository,
final ExpertFilterRepository expertFilterRepository,
NetworkStoreService networkStoreService,
NotificationService notificationService,
@Lazy FilterService self) {
filterRepositories.put(EquipmentType.LINE.name(), new LineFilterRepositoryProxy(lineFilterRepository));
filterRepositories.put(EquipmentType.GENERATOR.name(), new GeneratorFilterRepositoryProxy(generatorFilterRepository));
filterRepositories.put(EquipmentType.LOAD.name(), new LoadFilterRepositoryProxy(loadFilterRepository));
filterRepositories.put(EquipmentType.SHUNT_COMPENSATOR.name(), new ShuntCompensatorFilterRepositoryProxy(shuntCompensatorFilterRepository));
filterRepositories.put(EquipmentType.STATIC_VAR_COMPENSATOR.name(), new StaticVarCompensatorFilterRepositoryProxy(staticVarCompensatorFilterRepository));
filterRepositories.put(EquipmentType.BATTERY.name(), new BatteryFilterRepositoryProxy(batteryFilterRepository));
filterRepositories.put(EquipmentType.BUSBAR_SECTION.name(), new BusBarSectionFilterRepositoryProxy(busBarSectionFilterRepository));
filterRepositories.put(EquipmentType.DANGLING_LINE.name(), new DanglingLineFilterRepositoryProxy(danglingLineFilterRepository));
filterRepositories.put(EquipmentType.LCC_CONVERTER_STATION.name(), new LccConverterStationFilterRepositoryProxy(lccConverterStationFilterRepository));
filterRepositories.put(EquipmentType.VSC_CONVERTER_STATION.name(), new VscConverterStationFilterRepositoryProxy(vscConverterStationFilterRepository));
filterRepositories.put(EquipmentType.TWO_WINDINGS_TRANSFORMER.name(), new TwoWindingsTransformerFilterRepositoryProxy(twoWindingsTransformerFilterRepository));
filterRepositories.put(EquipmentType.THREE_WINDINGS_TRANSFORMER.name(), new ThreeWindingsTransformerFilterRepositoryProxy(threeWindingsTransformerFilterRepository));
filterRepositories.put(EquipmentType.HVDC_LINE.name(), new HvdcLineFilterRepositoryProxy(hvdcLineFilterRepository));
filterRepositories.put(EquipmentType.VOLTAGE_LEVEL.name(), new VoltageLevelFilterRepositoryProxy(voltageLevelFilterRepository));
filterRepositories.put(EquipmentType.SUBSTATION.name(), new SubstationFilterRepositoryProxy(substationFilterRepository));

filterRepositories.put(FilterType.SCRIPT.name(), new ScriptFilterRepositoryProxy(scriptFiltersRepository));

filterRepositories.put(FilterType.IDENTIFIER_LIST.name(), new IdentifierListFilterRepositoryProxy(identifierListFilterRepository));

filterRepositories.put(FilterType.EXPERT.name(), new ExpertFilterRepositoryProxy(expertFilterRepository));
Expand Down Expand Up @@ -199,10 +163,7 @@ public Map<UUID, UUID> duplicateFilters(List<UUID> filterUuids) {

private AbstractFilterRepositoryProxy<? extends AbstractFilterEntity,
? extends FilterRepository<? extends AbstractFilterEntity>> getRepository(AbstractFilter filter) {
if (!filter.getType().equals(FilterType.CRITERIA)) {
return filterRepositories.get(filter.getType().name());
}
return filterRepositories.get(((CriteriaFilter) filter).getEquipmentFilterForm().getEquipmentType().name());
return filterRepositories.get(filter.getType().name());
}

@Transactional
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading