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

feat(component) bh-bebtor-group-history #3611

Merged

Conversation

jeremielodi
Copy link
Collaborator

closes #3609

Copy link
Collaborator

@jniles jniles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeremielodi this is a good start!

It looks like a mistake happened in the Patient Registration page, let's restore it back to the old values.

Could you put this component on the patient edit page? Right under this:

screenshot 2019-02-19 at 18 33 36

That way we can see how it looks!

transclude : true,
bindings : {
debtorUuid : '@?',
limit : '<',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this should be optional.

controller : bhDebtorGroupHistoryController,
transclude : true,
bindings : {
debtorUuid : '@?',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the debtorUuid should be required.

$ctrl.$onInit = () => {
$ctrl.limit = $ctrl.limit || 5;
loadHistory();
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also put a $onChanges binding so that we reload the history when the debtorUuid changes.

@@ -117,5 +118,11 @@ function DebtorGroupService(Modal, Session, $translate, Api) {
.then(service.util.unwrapHttpResponse);
}

function history(debtorUuid, limit) {
const url = `${baseUrl}history/${debtorUuid}/${limit}`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make the limit into a query string? That way, it would be option and you could either see the entire history with /history/:uuid or a slice of the history with /history/:uuid?limit=X.

@@ -101,7 +92,7 @@
<div class="help-block text-right">
<p>
<a ng-click="PatientRegCtrl.toggleFullDate()" href>
<i class="fa fa-circle-o" ng-class="PatientRegCtrl.dateIndicatorIcon"></i>
<i class="fa fa-calendar-o"></i>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might change the display @mbayopanda was going for - in one state, it is supposed to be a circle that is filled in and in the other it is supposed to be a circle that is empty.

</ol>

<div class="toolbar">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all the changes to this page must be a mistake. Can you revert them?

<p><u><span translate>DEBTOR_GROUP.CHANGE</span></u></p>

<ul class="list-unstyled">
<li ng-repeat="change in $ctrl.groupChanges | orderBy:'-created_at'">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you do the ORDER BY in SQL, there isn't a need for this here.

<ul class="list-unstyled">
<li ng-repeat="change in $ctrl.groupChanges | orderBy:'-created_at'">
<i class="fa fa-clock-o"></i>
<b><span translate>FORM.LABELS.FROM</span></b> {{change.group_prev}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this into an arrow to make it super clear: Something like

{{change.group_prev}} &#8594; {{change.group_next}}

which will render → as the arrow.

@@ -117,5 +118,11 @@ function DebtorGroupService(Modal, Session, $translate, Api) {
.then(service.util.unwrapHttpResponse);
}

function history(debtorUuid, parameters) {
const url = `${baseUrl}history/${debtorUuid}`;
return service.$http.get(url, { params : parameters || {}})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A space is required before '}' object-curly-spacing

}

function loadHistory() {
const parameters = { limit : $ctrl.limit };
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple spaces found before '{' no-multi-spaces


$ctrl.$onChanges = () => {
loadHistory();
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon semi

@jeremielodi
Copy link
Collaborator Author

group change

Copy link
Collaborator

@jniles jniles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Good work.

bors r+

bors bot added a commit that referenced this pull request Feb 22, 2019
3611: feat(component) bh-bebtor-group-history r=jniles a=jeremielodi

closes #3609

Co-authored-by: jeremielodi <jeremielodi@gmail.com>
@bors
Copy link
Contributor

bors bot commented Feb 22, 2019

Build succeeded

@bors bors bot merged commit c6e24f5 into Third-Culture-Software:master Feb 22, 2019
@jeremielodi jeremielodi deleted the bh-debtor-group-history branch October 1, 2021 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make display component for debtor group history (bhDebtorGroupHistory)
2 participants