Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display last internal comment in application sidebar #404

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ang/crmFunding/application/application.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ <h1 crm-page-title>{{ ts('Application %1', {1: applicationProcess.title}) }}</h1
<div class="tab-content">
<div role="tabpanel" class="tab-pane" ng-class="{active: tab === 'application'}">
<funding-application-editor ng-show="tab === 'application'"
activities="activities"
application-process="applicationProcess"
form="form"
status-options="statusOptions"
Expand Down
1 change: 1 addition & 0 deletions ang/crmFunding/application/applicationEditor.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fundingModule.directive('fundingApplicationEditor', ['$compile', function($compi
return {
restrict: 'E',
scope: {
activities: '<',
applicationProcess: '=',
// Buttons are not shown initially if JSON schema is loaded in controller.
form: '=',
Expand Down
12 changes: 12 additions & 0 deletions ang/crmFunding/application/defaultApplicationSidebar.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,20 @@ fundingModule.directive('fundingDefaultApplicationSidebar', function() {
templateUrl: '~/crmFunding/application/defaultApplicationSidebar.template.html',
controllerAs: '$ctrl',
controller: ['$scope', function ($scope) {
const ctrl = this;
this.ts = CRM.ts('funding');
this.applicationProcessLabel = $scope.fundingCaseType.application_process_label || this.ts('Application');

$scope.$watch('activities', function (activities) {
if (activities) {
for (const activity of activities) {
if (activity['activity_type_id:name'] === 'funding_application_comment_internal') {
ctrl.lastInternalCommentActivity = activity;
break;
}
}
}
});
}],
};
});
14 changes: 14 additions & 0 deletions ang/crmFunding/application/defaultApplicationSidebar.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,17 @@ <h4 class="panel-title">
<funding-action-button action="update" with-comment="'required'" class="btn btn-success funding-application-sidebar-element" crm-icon="fa-check">{{ $ctrl.ts('Save') }}</funding-action-button>
<button type="button" class="btn btn-danger funding-application-sidebar-element" ng-click="reset()" ng-disabled="editCount > 0" crm-icon="fa-times">{{ $ctrl.ts('Reset') }}</button>
</span>

<div class="funding-application-sidebar-element" ng-show="$ctrl.lastInternalCommentActivity">
<div class="funding-activity funding-application-comment panel panel-info">
<div class="funding-activity-title panel-heading">{{:: ts('Last Internal Comment')}}</div>
<div class="panel-body">
<div class="funding-activity-date">{{ ts('Date: %date', {date: ($ctrl.lastInternalCommentActivity.created_date | fundingDate)}) }}</div>
<div class="funding-activity-performed-by">{{ ts('From: %name', {name: $ctrl.lastInternalCommentActivity.source_contact_name}) }}</div>
<div class="funding-activity-comment">
{{:: ts('Text:') }}<br>
<span ng-bind-html="$ctrl.lastInternalCommentActivity.details"></span>
</div>
</div>
</div>
</div>
Binary file modified l10n/de_DE/LC_MESSAGES/funding.mo
Binary file not shown.
101 changes: 75 additions & 26 deletions l10n/de_DE/LC_MESSAGES/funding.po

Large diffs are not rendered by default.

116 changes: 60 additions & 56 deletions l10n/funding.pot

Large diffs are not rendered by default.