Skip to content

Commit ed1e82e

Browse files
Merge pull request #6685 from davidwatkins73/waltz-6677-apps-list
All applications list view
2 parents 28147ae + 75a9f7c commit ed1e82e

25 files changed

Lines changed: 210 additions & 19 deletions

File tree

waltz-data/src/main/java/org/finos/waltz/data/application/ApplicationIdSelectorFactory.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
import org.jooq.SelectOrderByStep;
3737
import org.jooq.SelectWhereStep;
3838
import org.jooq.impl.DSL;
39-
import org.slf4j.Logger;
40-
import org.slf4j.LoggerFactory;
4139
import org.springframework.stereotype.Service;
4240

4341
import java.util.function.Function;
@@ -61,8 +59,6 @@
6159
@Service
6260
public class ApplicationIdSelectorFactory implements Function<IdSelectionOptions, Select<Record1<Long>>> {
6361

64-
private static final Logger LOG = LoggerFactory.getLogger(ApplicationIdSelectorFactory.class);
65-
6662
private static final DataTypeIdSelectorFactory dataTypeIdSelectorFactory = new DataTypeIdSelectorFactory();
6763
private static final MeasurableIdSelectorFactory measurableIdSelectorFactory = new MeasurableIdSelectorFactory();
6864
private static final OrganisationalUnitIdSelectorFactory orgUnitIdSelectorFactory = new OrganisationalUnitIdSelectorFactory();
@@ -80,6 +76,8 @@ public Select<Record1<Long>> apply(IdSelectionOptions options) {
8076
checkNotNull(options, "options cannot be null");
8177
EntityReference ref = options.entityReference();
8278
switch (ref.kind()) {
79+
case ALL:
80+
return mkForAll(options);
8381
case ACTOR:
8482
return mkForActor(options);
8583
case APP_GROUP:
@@ -129,6 +127,16 @@ public Select<Record1<Long>> apply(IdSelectionOptions options) {
129127
}
130128
}
131129

130+
131+
private Select<Record1<Long>> mkForAll(IdSelectionOptions options) {
132+
Condition applicationConditions = SelectorUtilities.mkApplicationConditions(options);
133+
134+
return DSL
135+
.select(APPLICATION.ID)
136+
.from(APPLICATION)
137+
.where(applicationConditions);
138+
}
139+
132140
private Select<Record1<Long>> mkForLegalEntity(IdSelectionOptions options) {
133141
return DSL
134142
.select(LEGAL_ENTITY_RELATIONSHIP.TARGET_ID)

waltz-data/src/main/java/org/finos/waltz/data/change_initiative/ChangeInitiativeIdSelectorFactory.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.finos.waltz.data.entity_hierarchy.AbstractIdSelectorFactory;
2323
import org.finos.waltz.data.orgunit.OrganisationalUnitIdSelectorFactory;
2424
import org.finos.waltz.model.*;
25+
import org.finos.waltz.model.application.LifecyclePhase;
2526
import org.finos.waltz.schema.tables.EntityHierarchy;
2627
import org.jooq.Record1;
2728
import org.jooq.Select;
@@ -48,6 +49,8 @@ public ChangeInitiativeIdSelectorFactory() {
4849
@Override
4950
protected Select<Record1<Long>> mkForOptions(IdSelectionOptions options) {
5051
switch (options.entityReference().kind()) {
52+
case ALL:
53+
return mkForAll(options);
5154
case ACTOR:
5255
case APPLICATION:
5356
case MEASURABLE:
@@ -124,6 +127,14 @@ private Select<Record1<Long>> mkForChangeInitiative(IdSelectionOptions options)
124127
}
125128

126129

130+
private Select<Record1<Long>> mkForAll(IdSelectionOptions options) {
131+
return DSL
132+
.select(CHANGE_INITIATIVE.ID)
133+
.from(CHANGE_INITIATIVE)
134+
.where(CHANGE_INITIATIVE.LIFECYCLE_PHASE.ne(LifecyclePhase.RETIRED.name()));
135+
}
136+
137+
127138
private Select<Record1<Long>> mkForRef(IdSelectionOptions options) {
128139
EntityReference ref = options.entityReference();
129140

waltz-data/src/main/java/org/finos/waltz/data/change_set/ChangeSetIdSelectorFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public Select<Record1<Long>> apply(IdSelectionOptions options) {
4444
case CHANGE_INITIATIVE:
4545
// all physical flows where the app is a source or target
4646
return mkForChangeInitiative(options);
47+
case ALL:
4748
case APPLICATION:
4849
case APP_GROUP:
4950
case FLOW_DIAGRAM:

waltz-data/src/main/java/org/finos/waltz/data/change_unit/ChangeUnitIdSelectorFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public Select<Record1<Long>> apply(IdSelectionOptions options) {
4848
case APPLICATION:
4949
// all physical flows where the app is a source or target
5050
return mkForFlowEndpoint(options);
51+
case ALL:
5152
case APP_GROUP:
5253
case FLOW_DIAGRAM:
5354
case MEASURABLE:

waltz-data/src/main/java/org/finos/waltz/data/legal_entity/LegalEntityRelationshipIdSelectorFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public Select<Record1<Long>> apply(IdSelectionOptions options) {
4343
switch (options.entityReference().kind()) {
4444
case ACTOR:
4545
return mkForActor(options);
46+
case ALL:
4647
case APPLICATION:
4748
case APP_GROUP:
4849
case MEASURABLE:

waltz-data/src/main/java/org/finos/waltz/data/licence/LicenceIdSelectorFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ protected Select<Record1<Long>> mkForOptions(IdSelectionOptions options) {
5555
case LICENCE:
5656
return mkForLicence(options);
5757
case ACTOR:
58+
case ALL:
5859
case APP_GROUP:
5960
case CHANGE_INITIATIVE:
6061
case FLOW_DIAGRAM:

waltz-data/src/main/java/org/finos/waltz/data/logical_flow/LogicalFlowIdSelectorFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public Select<Record1<Long>> apply(IdSelectionOptions options) {
6363
switch (options.entityReference().kind()) {
6464
case ACTOR:
6565
return mkForActor(options);
66+
case ALL:
6667
case APPLICATION:
6768
case APP_GROUP:
6869
case CHANGE_INITIATIVE:

waltz-data/src/main/java/org/finos/waltz/data/measurable/MeasurableIdSelectorFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public Select<Record1<Long>> apply(IdSelectionOptions options) {
7676
return mkForMeasurable(options);
7777
case APP_GROUP:
7878
case PROCESS_DIAGRAM:
79+
case ALL:
7980
return mkViaAppSelector(options);
8081
case AGGREGATE_OVERLAY_DIAGRAM:
8182
return mkForAggregatedEntityDiagram(options);

waltz-data/src/main/java/org/finos/waltz/data/process_diagram/ProcessDiagramIdSelectorFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public Select<Record1<Long>> apply(IdSelectionOptions options) {
4242
checkNotNull(options, "options cannot be null");
4343
switch(options.entityReference().kind()) {
4444
case ACTOR:
45+
case ALL:
4546
case APPLICATION:
4647
case CHANGE_INITIATIVE:
4748
case DATA_TYPE:

waltz-model/src/main/java/org/finos/waltz/model/EntityKind.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
public enum EntityKind {
2222

23+
ALL("All"), // when used in an entity ref the id will be ignored
2324
ACTOR("Actor"),
2425
AGGREGATE_OVERLAY_DIAGRAM("Aggregate Overlay Diagram"),
2526
AGGREGATE_OVERLAY_DIAGRAM_INSTANCE("Aggregate Overlay Diagram Instance"),

0 commit comments

Comments
 (0)