diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/index.js b/packages/manager/modules/billing-components/src/components/subscription-tile/index.js index a8ab210d04d6..9fbc052f97a6 100644 --- a/packages/manager/modules/billing-components/src/components/subscription-tile/index.js +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/index.js @@ -7,6 +7,7 @@ import '@ovh-ux/manager-core'; import '@ovh-ux/ng-at-internet'; import utils from '../utils'; +import renewStatus from './renew-status'; import component from './subscription-tile.component'; const moduleName = 'ovhManagerBillingSubscriptionTile'; @@ -20,6 +21,7 @@ angular 'oui', 'ovhManagerCore', utils, + renewStatus, ]) .component('billingSubscriptionTile', component) .run(/* @ngTranslationsInject:json ./translations */); diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/index.js b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/index.js new file mode 100644 index 000000000000..0c5e637a1646 --- /dev/null +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/index.js @@ -0,0 +1,20 @@ +import 'angular-translate'; +import '@ovh-ux/ng-translate-async-loader'; +import '@ovh-ux/ui-kit'; +import ovhManagerCore from '@ovh-ux/manager-core'; + +import component from './renew-status.component'; + +const moduleName = 'ovhManagerBillingRenewStatus'; + +angular + .module(moduleName, [ + 'pascalprecht.translate', + 'ngTranslateAsyncLoader', + 'oui', + ovhManagerCore, + ]) + .component('renewStatus', component) + .run(/* @ngTranslationsInject:json ./translations */); + +export default moduleName; diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/renew-status.component.js b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/renew-status.component.js new file mode 100644 index 000000000000..ce42d331fd57 --- /dev/null +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/renew-status.component.js @@ -0,0 +1,10 @@ +import controller from './renew-status.controller'; +import template from './renew-status.template.html'; + +export default { + bindings: { + service: '<', + }, + controller, + template, +}; diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/renew-status.constants.js b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/renew-status.constants.js new file mode 100644 index 000000000000..d5dec9eadb83 --- /dev/null +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/renew-status.constants.js @@ -0,0 +1,10 @@ +export const RENEW_STATES_BADGES_CLASSES_MAP = { + error: ['expired', 'delete_at_expiration'], + success: ['auto', 'automatic'], + warning: ['manual', 'manualPayment'], + info: ['billing_suspended', 'forced_manual'], +}; + +export default { + RENEW_STATES_BADGES_CLASSES_MAP, +}; diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/renew-status.controller.js b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/renew-status.controller.js new file mode 100644 index 000000000000..c333013e5e0a --- /dev/null +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/renew-status.controller.js @@ -0,0 +1,13 @@ +import { RENEW_STATES_BADGES_CLASSES_MAP } from './renew-status.constants'; + +export default class { + constructor() { + this.RENEW_STATES_BADGES_CLASSES_MAP = RENEW_STATES_BADGES_CLASSES_MAP; + } + + shouldHideAutorenewStatus() { + return ( + this.service.isOneShot?.() || ['SMS'].includes(this.service.serviceType) + ); + } +} diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/renew-status.template.html b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/renew-status.template.html new file mode 100644 index 000000000000..a80605e7d53f --- /dev/null +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/renew-status.template.html @@ -0,0 +1,41 @@ +

+ + + - + + + + + +

diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_de_DE.json b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_de_DE.json new file mode 100644 index 000000000000..06384e180c30 --- /dev/null +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_de_DE.json @@ -0,0 +1,13 @@ +{ + "manager_billing_service_status": "Status", + "manager_billing_service_status_auto": "Automatische Verlängerung", + "manager_billing_service_status_automatic": "Automatische Verlängerung", + "manager_billing_service_status_manual": "Manuelle Verlängerung", + "manager_billing_service_status_manualPayment": "Manuelle Verlängerung", + "manager_billing_service_status_pending_debt": "Zahlungsausfall", + "manager_billing_service_status_delete_at_expiration": "Geplante Kündigung", + "manager_billing_service_status_expired": "Gekündigt", + "manager_billing_service_status_billing_suspended": "Abrechnung verschoben", + "manager_billing_service_status_forced_manual": "Zwangsweise manuelle Verlängerung", + "manager_billing_service_status_restorable": "Wiederherstellbar" +} diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_en_GB.json b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_en_GB.json new file mode 100644 index 000000000000..280987628cbf --- /dev/null +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_en_GB.json @@ -0,0 +1,13 @@ +{ + "manager_billing_service_status": "Status", + "manager_billing_service_status_auto": "Via automatic renewal:", + "manager_billing_service_status_automatic": "Via automatic renewal:", + "manager_billing_service_status_manual": "Manual renewal", + "manager_billing_service_status_manualPayment": "Manual renewal", + "manager_billing_service_status_pending_debt": "Non-payment", + "manager_billing_service_status_delete_at_expiration": "Scheduled cancellation", + "manager_billing_service_status_expired": "Cancelled", + "manager_billing_service_status_billing_suspended": "Deferred billing", + "manager_billing_service_status_forced_manual": "Forced manual renewal", + "manager_billing_service_status_restorable": "Restorable" +} diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_es_ES.json b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_es_ES.json new file mode 100644 index 000000000000..c8a76b9b4d3f --- /dev/null +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_es_ES.json @@ -0,0 +1,13 @@ +{ + "manager_billing_service_status": "Estado", + "manager_billing_service_status_auto": "Renovación automática ", + "manager_billing_service_status_automatic": "Renovación automática ", + "manager_billing_service_status_manual": "Renovación manual", + "manager_billing_service_status_manualPayment": "Renovación manual", + "manager_billing_service_status_pending_debt": "Impago", + "manager_billing_service_status_delete_at_expiration": "Cancelación programada", + "manager_billing_service_status_expired": "Cancelado", + "manager_billing_service_status_billing_suspended": "Facturación diferida", + "manager_billing_service_status_forced_manual": "Renovación manual forzada", + "manager_billing_service_status_restorable": "Restaurable" +} diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_fr_CA.json b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_fr_CA.json new file mode 100644 index 000000000000..94aca613ae71 --- /dev/null +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_fr_CA.json @@ -0,0 +1,13 @@ +{ + "manager_billing_service_status": "Statut", + "manager_billing_service_status_auto": "Renouvellement automatique", + "manager_billing_service_status_automatic": "Renouvellement automatique", + "manager_billing_service_status_manual": "Renouvellement manuel", + "manager_billing_service_status_manualPayment": "Renouvellement manuel", + "manager_billing_service_status_pending_debt": "Défaut de paiement", + "manager_billing_service_status_delete_at_expiration": "Résiliation programmée", + "manager_billing_service_status_expired": "Résilié", + "manager_billing_service_status_billing_suspended": "Facturation reportée", + "manager_billing_service_status_forced_manual": "Renouvellement manuel forcé", + "manager_billing_service_status_restorable": "Restaurable" +} diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_fr_FR.json b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_fr_FR.json new file mode 100644 index 000000000000..94aca613ae71 --- /dev/null +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_fr_FR.json @@ -0,0 +1,13 @@ +{ + "manager_billing_service_status": "Statut", + "manager_billing_service_status_auto": "Renouvellement automatique", + "manager_billing_service_status_automatic": "Renouvellement automatique", + "manager_billing_service_status_manual": "Renouvellement manuel", + "manager_billing_service_status_manualPayment": "Renouvellement manuel", + "manager_billing_service_status_pending_debt": "Défaut de paiement", + "manager_billing_service_status_delete_at_expiration": "Résiliation programmée", + "manager_billing_service_status_expired": "Résilié", + "manager_billing_service_status_billing_suspended": "Facturation reportée", + "manager_billing_service_status_forced_manual": "Renouvellement manuel forcé", + "manager_billing_service_status_restorable": "Restaurable" +} diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_it_IT.json b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_it_IT.json new file mode 100644 index 000000000000..ca054f01037e --- /dev/null +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_it_IT.json @@ -0,0 +1,13 @@ +{ + "manager_billing_service_status": "Status", + "manager_billing_service_status_auto": "Rinnovo automatico", + "manager_billing_service_status_automatic": "Rinnovo automatico", + "manager_billing_service_status_manual": "Rinnovo manuale", + "manager_billing_service_status_manualPayment": "Rinnovo manuale", + "manager_billing_service_status_pending_debt": "Mancato pagamento", + "manager_billing_service_status_delete_at_expiration": "Cancellazione programmata", + "manager_billing_service_status_expired": "Cancellato", + "manager_billing_service_status_billing_suspended": "Fatturazione posticipata", + "manager_billing_service_status_forced_manual": "Rinnovo manuale forzato", + "manager_billing_service_status_restorable": "Ripristinabile" +} diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_pl_PL.json b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_pl_PL.json new file mode 100644 index 000000000000..ebb235d6dfd3 --- /dev/null +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_pl_PL.json @@ -0,0 +1,13 @@ +{ + "manager_billing_service_status": "Status", + "manager_billing_service_status_auto": "Automatyczne odnowienie", + "manager_billing_service_status_automatic": "Automatyczne odnowienie", + "manager_billing_service_status_manual": "Ręczne odnawianie", + "manager_billing_service_status_manualPayment": "Ręczne odnawianie", + "manager_billing_service_status_pending_debt": "Problem z płatnością", + "manager_billing_service_status_delete_at_expiration": "Zaplanowane rozwiązanie", + "manager_billing_service_status_expired": "Rozwiązany", + "manager_billing_service_status_billing_suspended": "Fakturowanie opóźnione", + "manager_billing_service_status_forced_manual": "Wymuszone ręczne odnawianie", + "manager_billing_service_status_restorable": "Możliwe do przywrócenia" +} diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_pt_PT.json b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_pt_PT.json new file mode 100644 index 000000000000..1cc730875628 --- /dev/null +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/renew-status/translations/Messages_pt_PT.json @@ -0,0 +1,13 @@ +{ + "manager_billing_service_status": "Estado", + "manager_billing_service_status_auto": "Renovação automática", + "manager_billing_service_status_automatic": "Renovação automática", + "manager_billing_service_status_manual": "Renovação manual", + "manager_billing_service_status_manualPayment": "Renovação manual", + "manager_billing_service_status_pending_debt": "Pagamento em falta", + "manager_billing_service_status_delete_at_expiration": "Rescisão programada", + "manager_billing_service_status_expired": "Rescindido", + "manager_billing_service_status_billing_suspended": "Faturação adiada", + "manager_billing_service_status_forced_manual": "Renovação manual forçada", + "manager_billing_service_status_restorable": "Restaurável" +} diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/subscription-tile.html b/packages/manager/modules/billing-components/src/components/subscription-tile/subscription-tile.html index 52ba3c72e3cc..63177ba08bfa 100644 --- a/packages/manager/modules/billing-components/src/components/subscription-tile/subscription-tile.html +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/subscription-tile.html @@ -17,7 +17,7 @@

- +