diff --git a/waltz-data/src/main/java/org/finos/waltz/data/application/ApplicationIdSelectorFactory.java b/waltz-data/src/main/java/org/finos/waltz/data/application/ApplicationIdSelectorFactory.java index 18d31965ac..353ade81fe 100644 --- a/waltz-data/src/main/java/org/finos/waltz/data/application/ApplicationIdSelectorFactory.java +++ b/waltz-data/src/main/java/org/finos/waltz/data/application/ApplicationIdSelectorFactory.java @@ -36,8 +36,6 @@ import org.jooq.SelectOrderByStep; import org.jooq.SelectWhereStep; import org.jooq.impl.DSL; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import java.util.function.Function; @@ -61,8 +59,6 @@ @Service public class ApplicationIdSelectorFactory implements Function>> { - private static final Logger LOG = LoggerFactory.getLogger(ApplicationIdSelectorFactory.class); - private static final DataTypeIdSelectorFactory dataTypeIdSelectorFactory = new DataTypeIdSelectorFactory(); private static final MeasurableIdSelectorFactory measurableIdSelectorFactory = new MeasurableIdSelectorFactory(); private static final OrganisationalUnitIdSelectorFactory orgUnitIdSelectorFactory = new OrganisationalUnitIdSelectorFactory(); @@ -80,6 +76,8 @@ public Select> apply(IdSelectionOptions options) { checkNotNull(options, "options cannot be null"); EntityReference ref = options.entityReference(); switch (ref.kind()) { + case ALL: + return mkForAll(options); case ACTOR: return mkForActor(options); case APP_GROUP: @@ -129,6 +127,16 @@ public Select> apply(IdSelectionOptions options) { } } + + private Select> mkForAll(IdSelectionOptions options) { + Condition applicationConditions = SelectorUtilities.mkApplicationConditions(options); + + return DSL + .select(APPLICATION.ID) + .from(APPLICATION) + .where(applicationConditions); + } + private Select> mkForLegalEntity(IdSelectionOptions options) { return DSL .select(LEGAL_ENTITY_RELATIONSHIP.TARGET_ID) diff --git a/waltz-model/src/main/java/org/finos/waltz/model/EntityKind.java b/waltz-model/src/main/java/org/finos/waltz/model/EntityKind.java index 44e45b71a5..cc2c913891 100644 --- a/waltz-model/src/main/java/org/finos/waltz/model/EntityKind.java +++ b/waltz-model/src/main/java/org/finos/waltz/model/EntityKind.java @@ -20,6 +20,7 @@ public enum EntityKind { + ALL("All"), // when used in an entity ref the id will be ignored ACTOR("Actor"), AGGREGATE_OVERLAY_DIAGRAM("Aggregate Overlay Diagram"), AGGREGATE_OVERLAY_DIAGRAM_INSTANCE("Aggregate Overlay Diagram Instance"), diff --git a/waltz-ng/client/applications/components/app-list-page-header/AppListPageHeader.svelte b/waltz-ng/client/applications/components/app-list-page-header/AppListPageHeader.svelte new file mode 100644 index 0000000000..9262e706d7 --- /dev/null +++ b/waltz-ng/client/applications/components/app-list-page-header/AppListPageHeader.svelte @@ -0,0 +1,21 @@ + + + +
+
    +
  1. + Home +
  2. +
  3. + Application +
  4. +
+
+
diff --git a/waltz-ng/client/applications/pages/list/app-list.html b/waltz-ng/client/applications/pages/list/app-list.html new file mode 100644 index 0000000000..039aacc375 --- /dev/null +++ b/waltz-ng/client/applications/pages/list/app-list.html @@ -0,0 +1,10 @@ +
+ + +
+ +
+ + +
diff --git a/waltz-ng/client/applications/pages/list/app-list.js b/waltz-ng/client/applications/pages/list/app-list.js new file mode 100644 index 0000000000..643a9eca53 --- /dev/null +++ b/waltz-ng/client/applications/pages/list/app-list.js @@ -0,0 +1,34 @@ +import template from "./app-list.html"; +import AppListPageHeader from "../../components/app-list-page-header/AppListPageHeader.svelte"; +import {showGridSelector} from "../../../report-grid/components/svelte/report-grid-ui-service"; +import namedSettings from "../../../system/named-settings"; + + +const initialState = { + app: {}, + AppListPageHeader, + parentEntityRef: { kind: "ALL", id: 1} +}; + + +function controller(settingsService) { + const vm = Object.assign(this, initialState); + showGridSelector.set(false); + settingsService + .findOrDie(namedSettings.defaultAppGridId, `No default app grid id defined, should be under setting: ${namedSettings.defaultAppGridId}`) + .then(d => vm.gridId = console.log(d) || d); +} + + + +controller.$inject = [ + "SettingsService" +]; + + +export default { + template, + controller, + controllerAs: "$ctrl" +}; + diff --git a/waltz-ng/client/applications/pages/view/app-view.html b/waltz-ng/client/applications/pages/view/app-view.html index a7e688360a..6c1863005a 100644 --- a/waltz-ng/client/applications/pages/view/app-view.html +++ b/waltz-ng/client/applications/pages/view/app-view.html @@ -25,7 +25,7 @@
  1. Home
  2. -
  3. Applications
  4. +
  5. Applications
diff --git a/waltz-ng/client/applications/routes.js b/waltz-ng/client/applications/routes.js index 3e78a30bdc..ca35e1c1cf 100644 --- a/waltz-ng/client/applications/routes.js +++ b/waltz-ng/client/applications/routes.js @@ -22,10 +22,11 @@ import AppViewAssetCode from "./pages/asset-code-view/app-asset-code-view"; import AppEdit from "./pages/edit/app-edit"; import AppRegistration from "./pages/registration/app-registration"; import AppView from "./pages/view/app-view"; -import {activeSections} from "../dynamic-section/section-store"; +import AppList from "./pages/list/app-list"; const base = { - url: "application" + url: "application", + views: {"content@": AppList } }; diff --git a/waltz-ng/client/common/entity-utils.js b/waltz-ng/client/common/entity-utils.js index 8a6b3c8509..6098357651 100644 --- a/waltz-ng/client/common/entity-utils.js +++ b/waltz-ng/client/common/entity-utils.js @@ -30,7 +30,6 @@ export function sameRef(r1, r2, options = { skipChecks: false }) { } - export function isSameParentEntityRef(changes) { return sameRef( changes.parentEntityRef.previousValue, diff --git a/waltz-ng/client/common/svelte/ViewLink.svelte b/waltz-ng/client/common/svelte/ViewLink.svelte index 69a8e7ac0e..5ef22d3914 100644 --- a/waltz-ng/client/common/svelte/ViewLink.svelte +++ b/waltz-ng/client/common/svelte/ViewLink.svelte @@ -10,7 +10,7 @@ const routes = { "main": { - path: () => "", + path: () => "home", title: "Home page" }, "main.system.list": { diff --git a/waltz-ng/client/report-grid/components/svelte/ReportGridOverview.svelte b/waltz-ng/client/report-grid/components/svelte/ReportGridOverview.svelte index 2bd550506d..c56ab1e2c4 100644 --- a/waltz-ng/client/report-grid/components/svelte/ReportGridOverview.svelte +++ b/waltz-ng/client/report-grid/components/svelte/ReportGridOverview.svelte @@ -161,13 +161,15 @@ doCancel={cancel}/> {:else if activeMode === Modes.VIEW || activeMode === Modes.REMOVE} {#if $gridDefinition?.id} -

- -

+ {#if primaryEntityRef.kind !== "ALL"} +

+ +

+ {/if} diff --git a/waltz-ng/client/system/named-settings.js b/waltz-ng/client/system/named-settings.js index 555e695e28..ba7f19ae5f 100644 --- a/waltz-ng/client/system/named-settings.js +++ b/waltz-ng/client/system/named-settings.js @@ -28,5 +28,6 @@ export default { avatarTemplateUrl: "ui.avatar.template.url", costExportEnabled: "feature.data-extractor.entity-cost.enabled", measurableRatingRoadmapsEnabled: "feature.measurable-rating-roadmaps.enabled", - overlayDiagramWidgetsDisabled: "feature.overlay-diagrams.disabled-widget-keys" + overlayDiagramWidgetsDisabled: "feature.overlay-diagrams.disabled-widget-keys", + defaultAppGridId: "feature.application-list.default-report-grid-id" }; \ No newline at end of file