Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

Trust: Fix UI issue with incoming trust (RT-3373) #2486

Merged
merged 1 commit into from
May 4, 2015
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
15 changes: 2 additions & 13 deletions src/js/tabs/trust.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,19 +634,8 @@ TrustTab.prototype.angular = function (module)
});
};

$scope.isIncoming = function () {
if (Number($scope.component.limit.to_json().value) === 0 && $scope.acctDefaultRippleFlag) {
// If limit is 0 and DefaultRipple flag is on, that means that the default state
// for that trust line has rippling turned on.

// This is an incoming trustline
return true;
} else if (Number($scope.component.limit.to_json().value) === 0) {
// This is also an incoming trustline
return true;
} else {
return false;
}
$scope.isIncomingOnly = function () {
return ($scope.component.limit.is_zero() && !$scope.component.limit_peer.is_zero());
};

}]);
Expand Down
26 changes: 13 additions & 13 deletions src/templates/tabs/trust.jade
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,14 @@ section.col-xs-12.content(ng-controller="TrustCtrl")
cancel-button-css="btn btn-cancel"
cancel-button-text="cancel"
ng-hide="showPassword==true")
button.btn.btn-block.btn-danger.submit(type="button", ng-click="load_orderbook()", ng-show="!isIncoming()", l10n) Remove
button.btn.btn-block.btn-danger.submit(type="button", ng-click="load_orderbook()", ng-show="!isIncomingOnly()", l10n) Remove
span(
rp-popover
rp-popover-placement="bottom"
rp-popover-trigger="hover"
l10n-rp-popover-title="Incoming trust"
l10n-data-content="You can't delete incoming trust lines. Incoming trust lines are when other Ripple users trust you.")
button.btn.btn-block.btn-danger.submit(type="button", ng-click="load_orderbook()", ng-show="isIncoming()", disabled, l10n) Remove
button.btn.btn-block.btn-danger.submit(type="button", ng-click="load_orderbook()", ng-show="isIncomingOnly()", disabled, l10n) Remove
span(ng-show='trust.balance !== "0" && orderbookStatus === "not"')
rp-confirm(
action-text="Are you sure you want to remove this gateway? Ripple Trade will return the balance of {{ trust.balance }} {{ trust.currency }} to the issuer. This action can't be undone."
Expand All @@ -287,23 +287,23 @@ section.col-xs-12.content(ng-controller="TrustCtrl")
cancel-button-css="btn btn-cancel"
cancel-button-text="cancel"
ng-hide="showPassword==true")
button.btn.btn-block.btn-danger.submit(type="button", ng-click="load_orderbook()", ng-show="!isIncoming()", l10n) Remove
button.btn.btn-block.btn-danger.submit(type="button", ng-click="load_orderbook()", ng-show="!isIncomingOnly()", l10n) Remove
span(
rp-popover
rp-popover-placement="bottom"
rp-popover-trigger="hover"
l10n-rp-popover-title="Incoming trust"
l10n-data-content="You can't delete incoming trust lines. Incoming trust lines are when other Ripple users trust you.")
button.btn.btn-block.btn-danger.submit(type="button", ng-click="load_orderbook()", ng-show="isIncoming()", disabled, l10n) Remove
button.btn.btn-block.btn-danger.submit(type="button", ng-click="load_orderbook()", ng-show="isIncomingOnly()", disabled, l10n) Remove
span(ng-show='trust.balance === "0"')
button.btn.btn-block.btn-danger.submit(type="button", ng-click="delete_account()", ng-show="!isIncoming()", l10n) Remove
button.btn.btn-block.btn-danger.submit(type="button", ng-click="delete_account()", ng-show="!isIncomingOnly()", l10n) Remove
span(
rp-popover
rp-popover-placement="bottom"
rp-popover-trigger="hover"
l10n-rp-popover-title="Incoming trust"
l10n-data-content="You can't delete incoming trust lines. Incoming trust lines are when other Ripple users trust you.")
button.btn.btn-block.btn-danger.submit(type="button", ng-click="delete_account()", ng-show="isIncoming()", disabled, l10n) Remove
button.btn.btn-block.btn-danger.submit(type="button", ng-click="delete_account()", ng-show="isIncomingOnly()", disabled, l10n) Remove
.col-md-5.col-sm-5.col-xs-6
a.btn.btn-block.btn-cancel(href="", ng-click="cancel()"
ng-disabled="trust.loading", l10n) cancel
Expand Down Expand Up @@ -331,7 +331,7 @@ section.col-xs-12.content(ng-controller="TrustCtrl")
.col-sm-2.col-md-2.inputPadding
div.rippling-checkbox
label(l10n) Rippling 
input(name='rippling', type='checkbox', ng-model='trust.rippling', ng-disabled='trust.balance !== "0" && isIncoming()')
input(name='rippling', type='checkbox', ng-model='trust.rippling', ng-disabled='trust.balance !== "0" && isIncomingOnly()')
.col-sm-7.col-md-6
.row.row-padding-small
.col-xs-6.col-sm-5(ng-hide="trust.loading && trust.state==='removing'")
Expand All @@ -354,14 +354,14 @@ section.col-xs-12.content(ng-controller="TrustCtrl")
cancel-button-css="btn btn-cancel"
cancel-button-text="cancel"
ng-hide="showPassword==true")
button.btn.btn-block.btn-danger.btn-xs.submit(type="button", ng-click="load_orderbook()", ng-show="!isIncoming()", l10n) Remove
button.btn.btn-block.btn-danger.btn-xs.submit(type="button", ng-click="load_orderbook()", ng-show="!isIncomingOnly()", l10n) Remove
span(
rp-popover
rp-popover-placement="bottom"
rp-popover-trigger="hover"
l10n-rp-popover-title="Incoming trust"
l10n-data-content="You can't delete incoming trust lines. Incoming trust lines are when other Ripple users trust you.")
button.btn.btn-block.btn-danger.btn-xs.submit(type="button", ng-click="load_orderbook()", ng-show="isIncoming()", disabled, l10n) Remove
button.btn.btn-block.btn-danger.btn-xs.submit(type="button", ng-click="load_orderbook()", ng-show="isIncomingOnly()", disabled, l10n) Remove
.col-xs-12(ng-show='trust.balance !== "0" && orderbookStatus === "not"')
rp-confirm(
action-text="Are you sure you want to remove this gateway? Ripple Trade will return the balance of {{ trust.balance }} {{ trust.currency }} to the issuer. This action can't be undone."
Expand All @@ -371,23 +371,23 @@ section.col-xs-12.content(ng-controller="TrustCtrl")
cancel-button-css="btn btn-link"
cancel-button-text="cancel"
ng-hide="showPassword==true")
button.btn.btn-block.btn-danger.btn-xs.submit(type="button", ng-click="load_orderbook()", ng-show="!isIncoming()", l10n) Remove
button.btn.btn-block.btn-danger.btn-xs.submit(type="button", ng-click="load_orderbook()", ng-show="!isIncomingOnly()", l10n) Remove
span(
rp-popover
rp-popover-placement="bottom"
rp-popover-trigger="hover"
l10n-rp-popover-title="Incoming trust"
l10n-data-content="You can't delete incoming trust lines. Incoming trust lines are when other Ripple users trust you.")
button.btn.btn-block.btn-danger.btn-xs.submit(type="button", ng-click="load_orderbook()", ng-show="isIncoming()", disabled, l10n) Remove
button.btn.btn-block.btn-danger.btn-xs.submit(type="button", ng-click="load_orderbook()", ng-show="isIncomingOnly()", disabled, l10n) Remove
.col-xs-12(ng-show='trust.balance === "0"')
button.btn.btn-block.btn-danger.btn-xs.submit(type="button", ng-click="delete_account()", ng-show="!isIncoming()", l10n) Remove
button.btn.btn-block.btn-danger.btn-xs.submit(type="button", ng-click="delete_account()", ng-show="!isIncomingOnly()", l10n) Remove
span(
rp-popover
rp-popover-placement="bottom"
rp-popover-trigger="hover"
l10n-rp-popover-title="Incoming trust"
l10n-data-content="You can't delete incoming trust lines. Incoming trust lines are when other Ripple users trust you.")
button.btn.btn-block.btn-danger.btn-xs.submit(type="button", ng-click="delete_account()", ng-show="isIncoming()", disabled, l10n) Remove
button.btn.btn-block.btn-danger.btn-xs.submit(type="button", ng-click="delete_account()", ng-show="isIncomingOnly()", disabled, l10n) Remove
.col-xs-3
a.btn.btn-block.btn-cancel(href="", ng-click="cancel()"
ng-disabled="trust.loading", l10n) cancel