Skip to content

Commit

Permalink
Merge branch 'db-contrib/waltz-4815-make-YTD-label-configurable'
Browse files Browse the repository at this point in the history
# Conflicts:
#	waltz-data/src/main/ddl/liquibase/db.changelog-1.26.xml
  • Loading branch information
davidwatkins73 committed Jul 2, 2020
2 parents 2d06161 + 67cedd4 commit 0568e65
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
12 changes: 12 additions & 0 deletions waltz-data/src/main/ddl/liquibase/db.changelog-1.26.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,16 @@
</column>
</addColumn>
</changeSet>


<!-- 4815: insert current year date settings value -->
<changeSet id="20200605-4815-1"
author="woodjes">
<comment>4815: Insert enum values into table</comment>
<insert tableName="settings">
<column name="name" value="settings.asset-cost.current-year-text"/>
<column name="value" value="YTD"/>
</insert>
</changeSet>

</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ <h3>
</h3>
<h4>
<span ng-bind="$ctrl.costsMostRecentYear"></span>
<span ng-if="$ctrl.costsMostRecentYear == $ctrl.currentYear">YTD</span>
<span ng-if="$ctrl.costsMostRecentYear == $ctrl.currentYear"
ng-bind="$ctrl.currentYearText">
</span>
</h4>
</div>
<div class="col-md-7">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import _ from "lodash";
import {CORE_API} from "../../../common/services/core-api-utils";
import {initialiseData} from "../../../common/index";
import template from "./app-costs-section.html";
import namedSettings from "../../../system/named-settings";


const bindings = {
Expand Down Expand Up @@ -58,7 +59,7 @@ function filterCostsForYear(year, costs = []) {
}


function controller(serviceBroker) {
function controller(serviceBroker, settingsService) {
const vm = initialiseData(this, initialState);

const refresh = () => {
Expand All @@ -77,6 +78,10 @@ function controller(serviceBroker) {

vm.$onInit = () => {

settingsService
.findOrDefault(namedSettings.currentYearText, "YTD")
.then(r => vm.currentYearText = r);

serviceBroker
.loadAppData(CORE_API.SourceDataRatingStore.findAll)
.then(r => vm.sourceDataRatings = r.data);
Expand All @@ -90,6 +95,7 @@ function controller(serviceBroker) {

controller.$inject = [
"ServiceBroker",
"SettingsService"
];


Expand Down
1 change: 1 addition & 0 deletions waltz-ng/client/system/named-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ export default {
betaEnvironment: "web.beta",
betaNagMessage: "web.beta.nag-message",
defaultCurrency: "settings.asset-cost.default-currency",
currentYearText: "settings.asset-cost.current-year-text",
avatarTemplateUrl: "ui.avatar.template.url"
};

0 comments on commit 0568e65

Please sign in to comment.