Skip to content

Commit

Permalink
Merge pull request #6059 from davidwatkins73/waltz-6054-assorted-fixes
Browse files Browse the repository at this point in the history
Assorted fixes
  • Loading branch information
jessica-woodland-scott-db authored May 17, 2022
2 parents 62be949 + fd6cdff commit 8d3b7b3
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
18 changes: 10 additions & 8 deletions waltz-ng/client/change-log/components/change-log-section.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@
<span>Log</span>
</label>

<input type="radio"
value="calendar"
ng-model="$ctrl.activeTab"
id="calendar">
<label class="wt-label"
for="calendar">
<span>Application Change Calendar</span>
</label>
<span ng-if="$ctrl.allowApplicationChangeCalendar">
<input type="radio"
value="calendar"
ng-model="$ctrl.activeTab"
id="calendar">
<label class="wt-label"
for="calendar">
<span>Application Change Calendar</span>
</label>
</span>

<div class="wt-tab wt-active">
<div ng-if="$ctrl.activeTab === 'calendar'"
Expand Down
20 changes: 18 additions & 2 deletions waltz-ng/client/change-log/components/change-log-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

import {initialiseData} from "../../common";
import {CORE_API} from "../../common/services/core-api-utils";
import template from './change-log-section.html';
import template from "./change-log-section.html";
import {entity} from "../../common/services/enums/entity";


const bindings = {
Expand All @@ -29,10 +30,24 @@ const bindings = {

const initialState = {
entries: [],
activeTab: "table"
activeTab: "table",
allowApplicationChangeCalendar: false
};


const allowedAppCalendarKinds = [
entity.APP_GROUP.key,
entity.ORG_UNIT.key,
entity.PROCESS_DIAGRAM.key,
entity.CHANGE_INITIATIVE.key,
entity.APPLICATION.key,
entity.MEASURABLE.key,
entity.FLOW_DIAGRAM.key,
entity.LOGICAL_DATA_FLOW.key,
entity.PHYSICAL_FLOW.key,
entity.PHYSICAL_SPECIFICATION.key,
entity.PERSON.key
];


function controller(serviceBroker) {
Expand Down Expand Up @@ -63,6 +78,7 @@ function controller(serviceBroker) {
vm.$onChanges = (changes) => {
if (vm.parentEntityRef || vm.userName) {
loadEntries();
vm.allowApplicationChangeCalendar = _.includes(allowedAppCalendarKinds, vm.parentEntityRef.kind);
}
};

Expand Down
7 changes: 7 additions & 0 deletions waltz-ng/client/common/services/enums/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
62 changes: 35 additions & 27 deletions waltz-ng/client/survey/components/survey-section.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,33 +63,41 @@ <h4>
<div class="help-block">
Select the survey template to issue
</div>
<table class="table table-condensed small">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Owner</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="template in $ctrl.templates">
<td>
<a ng-click="$ctrl.onSelectTemplate(template)"
class="clickable">
<span ng-bind="template.name"></span>
</a>
</td>
<td>
<span ng-bind="template.description"></span>
</td>
<td>
<waltz-entity-link tooltip-placement="left"
entity-ref="{ kind: 'PERSON', id: template.ownerId}">
</waltz-entity-link>
</td>
</tr>
</tbody>
</table>
<input type="search"
class="form-control"
ng-if="$ctrl.templates.length > 7"
placeholder="Filter..."
ng-model="$ctrl.templateQuery">
<div class="waltz-scroll-region-300">
<table class="table table-condensed small">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Owner</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="template in $ctrl.templates | filter:$ctrl.templateQuery">
<td>
<a ng-click="$ctrl.onSelectTemplate(template)"
class="clickable">
<span ng-bind="template.name"></span>
</a>
</td>
<td>
<span ng-bind="template.description | truncateMiddle:100"></span>
</td>
<td>
<waltz-entity-link tooltip-placement="left"
entity-ref="{ kind: 'PERSON', id: template.ownerId}">
</waltz-entity-link>
</td>
</tr>
</tbody>
</table>

</div>

<a ng-click="$ctrl.onDismissCreateForm()"
class="clickable">
Expand Down
3 changes: 2 additions & 1 deletion waltz-ng/client/survey/components/survey-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const initialState = {
issuanceKind: "GROUP",
recipients: [],
owningRole: null
}
},
templateQuery: null
};


Expand Down
6 changes: 4 additions & 2 deletions waltz-ng/client/survey/survey-template-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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&#95;HOUSE, INTERNALLY&#95;HOSTED, EXTERNALLY&#95;HOSTED, EUC, THIRD&#95;PARTY, CUSTOMISED, EXTERNAL)
`;


Expand Down Expand Up @@ -243,4 +245,4 @@ const page = {
};


export default page;
export default page;
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8d3b7b3

Please sign in to comment.