Skip to content

Commit 23478ba

Browse files
JacquesLariqueovh-cds
authored andcommitted
fix(billing-components): put back service status on subscription tile
ref: #MANAGER-20155 Signed-off-by: Jacques Larique <jacques.larique.ext@ovhcloud.com> Co-authored-by: CDS Translator Agent <opensource@ovh.net>
1 parent 36a5e02 commit 23478ba

File tree

15 files changed

+201
-1
lines changed

15 files changed

+201
-1
lines changed

packages/manager/modules/billing-components/src/components/subscription-tile/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import '@ovh-ux/manager-core';
77
import '@ovh-ux/ng-at-internet';
88

99
import utils from '../utils';
10+
import renewStatus from './renew-status';
1011
import component from './subscription-tile.component';
1112

1213
const moduleName = 'ovhManagerBillingSubscriptionTile';
@@ -20,6 +21,7 @@ angular
2021
'oui',
2122
'ovhManagerCore',
2223
utils,
24+
renewStatus,
2325
])
2426
.component('billingSubscriptionTile', component)
2527
.run(/* @ngTranslationsInject:json ./translations */);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import 'angular-translate';
2+
import '@ovh-ux/ng-translate-async-loader';
3+
import '@ovh-ux/ui-kit';
4+
import ovhManagerCore from '@ovh-ux/manager-core';
5+
6+
import component from './renew-status.component';
7+
8+
const moduleName = 'ovhManagerBillingRenewStatus';
9+
10+
angular
11+
.module(moduleName, [
12+
'pascalprecht.translate',
13+
'ngTranslateAsyncLoader',
14+
'oui',
15+
ovhManagerCore,
16+
])
17+
.component('renewStatus', component)
18+
.run(/* @ngTranslationsInject:json ./translations */);
19+
20+
export default moduleName;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import controller from './renew-status.controller';
2+
import template from './renew-status.template.html';
3+
4+
export default {
5+
bindings: {
6+
service: '<',
7+
},
8+
controller,
9+
template,
10+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export const RENEW_STATES_BADGES_CLASSES_MAP = {
2+
error: ['expired', 'delete_at_expiration'],
3+
success: ['auto', 'automatic'],
4+
warning: ['manual', 'manualPayment'],
5+
info: ['billing_suspended', 'forced_manual'],
6+
};
7+
8+
export default {
9+
RENEW_STATES_BADGES_CLASSES_MAP,
10+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { RENEW_STATES_BADGES_CLASSES_MAP } from './renew-status.constants';
2+
3+
export default class {
4+
constructor() {
5+
this.RENEW_STATES_BADGES_CLASSES_MAP = RENEW_STATES_BADGES_CLASSES_MAP;
6+
}
7+
8+
shouldHideAutorenewStatus() {
9+
return (
10+
this.service.isOneShot?.() || ['SMS'].includes(this.service.serviceType)
11+
);
12+
}
13+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<p>
2+
<span
3+
class="oui-badge oui-badge_error"
4+
data-ng-if="$ctrl.service.hasDebt()"
5+
data-translate="manager_billing_service_status_pending_debt"
6+
>
7+
</span>
8+
<span
9+
data-ng-if="$ctrl.shouldHideAutorenewStatus() && !$ctrl.service.isResiliated()"
10+
>-</span
11+
>
12+
<span
13+
data-ng-if="$ctrl.shouldHideAutorenewStatus() && $ctrl.service.isResiliated()"
14+
class="oui-badge oui-badge_error"
15+
data-translate="manager_billing_service_status_expired"
16+
>
17+
</span>
18+
<span
19+
class="oui-badge text-wrap"
20+
data-ng-class="{
21+
'oui-badge_error': $ctrl.RENEW_STATES_BADGES_CLASSES_MAP.error.includes($ctrl.service.getRenew()),
22+
'oui-badge_warning': $ctrl.RENEW_STATES_BADGES_CLASSES_MAP.warning.includes($ctrl.service.getRenew()),
23+
'oui-badge_success': $ctrl.RENEW_STATES_BADGES_CLASSES_MAP.success.includes($ctrl.service.getRenew()),
24+
'oui-badge_info': $ctrl.RENEW_STATES_BADGES_CLASSES_MAP.info.includes($ctrl.service.getRenew()),
25+
}"
26+
data-ng-if="!$ctrl.service.hasDebt() && !$ctrl.shouldHideAutorenewStatus() && $ctrl.service.getRenew()"
27+
data-translate="{{:: 'manager_billing_service_status_' + $ctrl.service.getRenew() | translate }}"
28+
></span>
29+
<span
30+
data-ng-if="$ctrl.service.isRestorable"
31+
class="oui-badge text-wrap oui-badge_warning"
32+
data-translate="{{:: 'manager_billing_service_status_restorable' | translate }}"
33+
></span>
34+
<button
35+
type="button"
36+
class="oui-popover-button"
37+
data-ng-if="$ctrl.service.statusHelp"
38+
data-oui-popover="{{ $ctrl.service.statusHelp }}"
39+
data-oui-popover-placement="bottom"
40+
></button>
41+
</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"manager_billing_service_status": "Status",
3+
"manager_billing_service_status_auto": "Automatische Verlängerung",
4+
"manager_billing_service_status_automatic": "Automatische Verlängerung",
5+
"manager_billing_service_status_manual": "Manuelle Verlängerung",
6+
"manager_billing_service_status_manualPayment": "Manuelle Verlängerung",
7+
"manager_billing_service_status_pending_debt": "Zahlungsausfall",
8+
"manager_billing_service_status_delete_at_expiration": "Geplante Kündigung",
9+
"manager_billing_service_status_expired": "Gekündigt",
10+
"manager_billing_service_status_billing_suspended": "Abrechnung verschoben",
11+
"manager_billing_service_status_forced_manual": "Zwangsweise manuelle Verlängerung",
12+
"manager_billing_service_status_restorable": "Wiederherstellbar"
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"manager_billing_service_status": "Status",
3+
"manager_billing_service_status_auto": "Via automatic renewal:",
4+
"manager_billing_service_status_automatic": "Via automatic renewal:",
5+
"manager_billing_service_status_manual": "Manual renewal",
6+
"manager_billing_service_status_manualPayment": "Manual renewal",
7+
"manager_billing_service_status_pending_debt": "Non-payment",
8+
"manager_billing_service_status_delete_at_expiration": "Scheduled cancellation",
9+
"manager_billing_service_status_expired": "Cancelled",
10+
"manager_billing_service_status_billing_suspended": "Deferred billing",
11+
"manager_billing_service_status_forced_manual": "Forced manual renewal",
12+
"manager_billing_service_status_restorable": "Restorable"
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"manager_billing_service_status": "Estado",
3+
"manager_billing_service_status_auto": "Renovación automática ",
4+
"manager_billing_service_status_automatic": "Renovación automática ",
5+
"manager_billing_service_status_manual": "Renovación manual",
6+
"manager_billing_service_status_manualPayment": "Renovación manual",
7+
"manager_billing_service_status_pending_debt": "Impago",
8+
"manager_billing_service_status_delete_at_expiration": "Cancelación programada",
9+
"manager_billing_service_status_expired": "Cancelado",
10+
"manager_billing_service_status_billing_suspended": "Facturación diferida",
11+
"manager_billing_service_status_forced_manual": "Renovación manual forzada",
12+
"manager_billing_service_status_restorable": "Restaurable"
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"manager_billing_service_status": "Statut",
3+
"manager_billing_service_status_auto": "Renouvellement automatique",
4+
"manager_billing_service_status_automatic": "Renouvellement automatique",
5+
"manager_billing_service_status_manual": "Renouvellement manuel",
6+
"manager_billing_service_status_manualPayment": "Renouvellement manuel",
7+
"manager_billing_service_status_pending_debt": "Défaut de paiement",
8+
"manager_billing_service_status_delete_at_expiration": "Résiliation programmée",
9+
"manager_billing_service_status_expired": "Résilié",
10+
"manager_billing_service_status_billing_suspended": "Facturation reportée",
11+
"manager_billing_service_status_forced_manual": "Renouvellement manuel forcé",
12+
"manager_billing_service_status_restorable": "Restaurable"
13+
}

0 commit comments

Comments
 (0)