From f6a34c1e86a42c873f915805112ae3b974db7189 Mon Sep 17 00:00:00 2001 From: David Watkins Date: Tue, 17 May 2022 12:28:06 +0100 Subject: [PATCH 1/2] Assorted fixes - Updated predicate docs, clarified fn name - Search/scroll region for survey templates - Added 'ROLE' as entity kind - ChangeLog app section restricted to only 'valid' pages - Bulk attestation js error - Entity relationship handles broken refs more gracefully #6054 #6049 #6051 --- .../EntityRelationshipDao.java | 4 +- .../org/finos/waltz/model/EntityKind.java | 1 + .../attestation-instance-list-user-view.js | 2 +- .../components/change-log-section.html | 18 +++--- .../components/change-log-section.js | 20 +++++- .../client/common/services/enums/entity.js | 7 +++ .../survey/components/survey-section.html | 62 +++++++++++-------- .../survey/components/survey-section.js | 3 +- .../client/survey/survey-template-edit.js | 4 +- .../QuestionAppPredicateNamespace.java | 2 +- 10 files changed, 80 insertions(+), 43 deletions(-) diff --git a/waltz-data/src/main/java/org/finos/waltz/data/entity_relationship/EntityRelationshipDao.java b/waltz-data/src/main/java/org/finos/waltz/data/entity_relationship/EntityRelationshipDao.java index 86117f5b73..988b1d543a 100644 --- a/waltz-data/src/main/java/org/finos/waltz/data/entity_relationship/EntityRelationshipDao.java +++ b/waltz-data/src/main/java/org/finos/waltz/data/entity_relationship/EntityRelationshipDao.java @@ -89,13 +89,13 @@ public class EntityRelationshipDao { .a(ImmutableEntityReference.builder() .kind(EntityKind.valueOf(record.getKindA())) .id(record.getIdA()) - .name(r.get(NAME_A)) + .name(Optional.ofNullable(r.get(NAME_A)).orElse("_Removed_")) .externalId(Optional.ofNullable(r.get(EXT_ID_A))) .build()) .b(ImmutableEntityReference.builder() .kind(EntityKind.valueOf(record.getKindB())) .id(record.getIdB()) - .name(r.get(NAME_B)) + .name(Optional.ofNullable(r.get(NAME_B)).orElse("_Removed_")) .externalId(Optional.ofNullable(r.get(EXT_ID_B))) .build()) .provenance(record.getProvenance()) 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 5dfdf7a4d4..a2eba28b7b 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 @@ -76,6 +76,7 @@ public enum EntityKind { RELATIONSHIP_KIND("Relationship Kind"), REPORT_GRID("Report Grid"), ROADMAP("Roadmap"), + ROLE("Role"), SCENARIO("Scenario"), SERVER("Server"), SERVER_USAGE("Server usage"), diff --git a/waltz-ng/client/attestation/attestation-instance-list-user-view.js b/waltz-ng/client/attestation/attestation-instance-list-user-view.js index 725cd43831..5909d468bd 100644 --- a/waltz-ng/client/attestation/attestation-instance-list-user-view.js +++ b/waltz-ng/client/attestation/attestation-instance-list-user-view.js @@ -106,7 +106,7 @@ function controller($q, const index = _.findIndex(instances, i => i.id === instance.id) const nextInstanceId = _.get(instances, [index + 1, "id"]); - attest(serviceBroker, instance.parentEntity, instance.attestedEntityKind, instance.attestedEntityId) + return attest(serviceBroker, instance.parentEntity, instance.attestedEntityKind, instance.attestedEntityId) .then(() => loadData()) .then(() => { const remainingInstances = getInstancesForRun(vm.runsWithInstances, instance.attestationRunId); diff --git a/waltz-ng/client/change-log/components/change-log-section.html b/waltz-ng/client/change-log/components/change-log-section.html index eb986d5626..7352372889 100644 --- a/waltz-ng/client/change-log/components/change-log-section.html +++ b/waltz-ng/client/change-log/components/change-log-section.html @@ -30,14 +30,16 @@ Log - - + + + +
{ if (vm.parentEntityRef || vm.userName) { loadEntries(); + vm.allowApplicationChangeCalendar = _.includes(allowedAppCalendarKinds, vm.parentEntityRef.kind); } }; diff --git a/waltz-ng/client/common/services/enums/entity.js b/waltz-ng/client/common/services/enums/entity.js index 4a68032070..628adc4806 100644 --- a/waltz-ng/client/common/services/enums/entity.js +++ b/waltz-ng/client/common/services/enums/entity.js @@ -311,6 +311,13 @@ export const entity = { description: null, position: 235 }, + ROLE: { + key: "ROLE", + name: "Role", + icon: "key", + description: null, + position: 236 + }, SCENARIO: { key: "SCENARIO", name: "Scenario", diff --git a/waltz-ng/client/survey/components/survey-section.html b/waltz-ng/client/survey/components/survey-section.html index 9dae9b873f..25d5f6d6a0 100644 --- a/waltz-ng/client/survey/components/survey-section.html +++ b/waltz-ng/client/survey/components/survey-section.html @@ -63,33 +63,41 @@

Select the survey template to issue
- - - - - - - - - - - - - - - -
NameDescriptionOwner
- - - - - - - - -
+ +
+ + + + + + + + + + + + + + + +
NameDescriptionOwner
+ + + + + + + + +
+ +
diff --git a/waltz-ng/client/survey/components/survey-section.js b/waltz-ng/client/survey/components/survey-section.js index e13c9aa194..68286f3218 100644 --- a/waltz-ng/client/survey/components/survey-section.js +++ b/waltz-ng/client/survey/components/survey-section.js @@ -37,7 +37,8 @@ const initialState = { issuanceKind: "GROUP", recipients: [], owningRole: null - } + }, + templateQuery: null }; diff --git a/waltz-ng/client/survey/survey-template-edit.js b/waltz-ng/client/survey/survey-template-edit.js index 5bcb7b1000..cdb8297f7c 100644 --- a/waltz-ng/client/survey/survey-template-edit.js +++ b/waltz-ng/client/survey/survey-template-edit.js @@ -42,7 +42,9 @@ See the documentation for a complete list of functions and their arguments. Bel * \`dataTypeUsages(name|extId)\`: returns set of usage kinds for the given data types (use the \`=~\` operator to test for membership) * \`isRetiring()\`: (application only) true if app has planned retirement date but no actual retirement date * \`hasDataType(name|extId)\`: returns whether the specified datatype (or a descendent) is in use by the app -* \`hasInvolvement(roleName)\`: returns whether the subject entity has any involvment record with the given role name +* \`hasInvolvement(roleName)\`: returns whether the subject entity has any involvement record with the given role name +* \`hasLifecyclePhase(lifecyclePhase)\`: returns true of the given lifecycle phase matches the entities lifecycles phase. (PRODUCTION, DEVELOPMENT, CONCEPTUAL, RETIRED) +* \`isAppKind(applicationKind)\`: returns true of the given app kind phase matches the application kind. ( IN_HOUSE, INTERNALLY_HOSTED, EXTERNALLY_HOSTED, EUC, THIRD_PARTY, CUSTOMISED, EXTERNAL) `; diff --git a/waltz-service/src/main/java/org/finos/waltz/service/survey/inclusion_evaluator/QuestionAppPredicateNamespace.java b/waltz-service/src/main/java/org/finos/waltz/service/survey/inclusion_evaluator/QuestionAppPredicateNamespace.java index 9297b6cab2..396fcf8fee 100644 --- a/waltz-service/src/main/java/org/finos/waltz/service/survey/inclusion_evaluator/QuestionAppPredicateNamespace.java +++ b/waltz-service/src/main/java/org/finos/waltz/service/survey/inclusion_evaluator/QuestionAppPredicateNamespace.java @@ -75,7 +75,7 @@ public boolean belongsToOrgUnit(String name) { } - public boolean isKind(String name) { + public boolean isAppKind(String name) { return dsl.fetchExists(DSL .select() .from(APPLICATION) From fd6cdff096a17c3933576042d7179ff91100d8a3 Mon Sep 17 00:00:00 2001 From: David Watkins Date: Tue, 17 May 2022 12:31:36 +0100 Subject: [PATCH 2/2] Update survey-template-edit.js --- waltz-ng/client/survey/survey-template-edit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/waltz-ng/client/survey/survey-template-edit.js b/waltz-ng/client/survey/survey-template-edit.js index cdb8297f7c..3298fb6340 100644 --- a/waltz-ng/client/survey/survey-template-edit.js +++ b/waltz-ng/client/survey/survey-template-edit.js @@ -44,7 +44,7 @@ See the documentation for a complete list of functions and their arguments. Bel * \`hasDataType(name|extId)\`: returns whether the specified datatype (or a descendent) is in use by the app * \`hasInvolvement(roleName)\`: returns whether the subject entity has any involvement record with the given role name * \`hasLifecyclePhase(lifecyclePhase)\`: returns true of the given lifecycle phase matches the entities lifecycles phase. (PRODUCTION, DEVELOPMENT, CONCEPTUAL, RETIRED) -* \`isAppKind(applicationKind)\`: returns true of the given app kind phase matches the application kind. ( IN_HOUSE, INTERNALLY_HOSTED, EXTERNALLY_HOSTED, EUC, THIRD_PARTY, CUSTOMISED, EXTERNAL) +* \`isAppKind(applicationKind)\`: returns true of the given app kind phase matches the application kind. ( IN_HOUSE, INTERNALLY_HOSTED, EXTERNALLY_HOSTED, EUC, THIRD_PARTY, CUSTOMISED, EXTERNAL) `; @@ -245,4 +245,4 @@ const page = { }; -export default page; \ No newline at end of file +export default page;