Skip to content

Commit

Permalink
QA comments fix for 6121 (#1364)
Browse files Browse the repository at this point in the history
6121 - QA test comments fix
  • Loading branch information
karthik-aot authored Feb 22, 2021
1 parent 99c52ed commit c562643
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 11 deletions.
4 changes: 2 additions & 2 deletions auth-api/src/auth_api/services/org.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,8 @@ def change_org_status(org_id: int, status_code, token_info: Dict = None):
user: UserModel = UserModel.find_by_jwt_token(token=token_info)
current_app.logger.debug('<setting org status to ')
org_model.status_code = status_code
org_model.decision_made_by = user.id # not sure if a new field is needed for this.
if status_code == ChangeType.SUSPEND.value:
org_model.decision_made_by = user.username # not sure if a new field is needed for this.
if status_code == OrgStatus.SUSPENDED.value:
org_model.suspended_on = datetime.today()
org_model.save()
current_app.logger.debug('change_org_status>')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
<template v-slot:actions>
<v-btn
large
class="font-weight-bold white--text"
class="font-weight-bold white--text btn-dialog"
:color="getDialogStatusButtonColor(currentOrganization.orgStatus)"
data-test='btn-suspend-dialog'
@click="confirmSuspendAccount()"
Expand All @@ -185,6 +185,7 @@
<v-btn
large
depressed
clss="btn-dialog"
@click="closeSuspendAccountDialog()"
data-test='btn-cancel-suspend-dialog'
>
Expand Down Expand Up @@ -329,7 +330,7 @@ export default class AccountInfo extends Mixins(AccountChangeMixin) {
private async confirmSuspendAccount (): Promise<void> {
await this.suspendOrganization()
this.$router.push(Pages.STAFF_DASHBOARD)
this.$refs.suspendAccountDialog.close()
}
private closeSuspendAccountDialog () {
Expand Down Expand Up @@ -636,5 +637,12 @@ export default class AccountInfo extends Mixins(AccountChangeMixin) {
.suspend-account-btn {
margin-left: 0 !important;
height: 2.1em;
width: 10.9375em;
}
.btn-dialog {
height: 2.75em;
width: 6.25em;
}
</style>
35 changes: 29 additions & 6 deletions auth-web/src/components/auth/common/AccountSuspendAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,31 @@
<div class="account-alert">
<div class="account-alert-inner">
<v-icon large class="mt-2">mdi-information-outline</v-icon>
<div class="account-alert__info ml-7">
<div class="account-alert__info ml-7" v-if="isSuspendedForNSF">
<div class="font-weight-bold">Account Suspended</div>
<div>Account has been suspended for outstanding balance (NSF).</div>
<div class="mt-6 title font-weight-bold">BALANCE DUE: ${{totalAmountToPay.toFixed(2)}}</div>
</div>
<div class="account-alert__date">
<div class="account-alert__date" v-if="isSuspendedForNSF">
{{suspendedDate}}
</div>
<div v-else class="d-flex flex-column ml-7">
<div class="title font-weight-bold">Account Suspended</div>
<div class="d-flex">
<span>Date Suspended: {{ suspendedDate }}<span class="vertical-line"></span> Suspended by: {{ suspendedBy }}</span>
</div>
</div>
</div>
</div>
</v-alert>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import { Member, Organization } from '@/models/Organization'
import { AccountStatus } from '@/util/constants'
import CommonUtils from '@/util/common-util'
import { FailedInvoice } from '@/models/invoice'
import { Organization } from '@/models/Organization'
import { namespace } from 'vuex-class'
const OrgModule = namespace('org')
Expand All @@ -39,10 +46,20 @@ export default class AccountSuspendAlert extends Vue {
return (this.currentOrganization?.suspendedOn) ? this.formatDate(new Date(this.currentOrganization.suspendedOn)) : ''
}
private get isSuspendedForNSF (): boolean {
return this.currentOrganization?.statusCode === AccountStatus.NSF_SUSPENDED
}
private get suspendedBy (): string {
return this.currentOrganization?.decisionMadeBy
}
async mounted () {
const failedInvoices: FailedInvoice = await this.calculateFailedInvoices()
this.totalTransactionAmount = failedInvoices.totalTransactionAmount || 0
this.totalAmountToPay = failedInvoices.totalAmountToPay || 0
if (this.isSuspendedForNSF) {
const failedInvoices: FailedInvoice = await this.calculateFailedInvoices()
this.totalTransactionAmount = failedInvoices.totalTransactionAmount || 0
this.totalAmountToPay = failedInvoices.totalAmountToPay || 0
}
}
}
</script>
Expand All @@ -62,4 +79,10 @@ export default class AccountSuspendAlert extends Vue {
flex: 0 0 auto;
}
.vertical-line {
margin: 0 2em;
border-left: solid;
border-width: 0.125em;
}
</style>
2 changes: 1 addition & 1 deletion auth-web/src/views/auth/AccountSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export default class AccountSettings extends Mixins(AccountMixin) {
}
// show baner for staff user and account suspended
private get showAccountFreezeBanner () {
return this.isStaff && this.currentOrganization?.statusCode === AccountStatus.NSF_SUSPENDED
return this.isStaff && (this.currentOrganization?.statusCode === AccountStatus.NSF_SUSPENDED || this.currentOrganization?.statusCode === AccountStatus.SUSPENDED)
}
private async mounted () {
Expand Down

0 comments on commit c562643

Please sign in to comment.