Skip to content

Commit

Permalink
Merge pull request #3631 from ovh/develop
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
antleblanc authored Sep 16, 2020
2 parents ab4f43c + 7313493 commit 5a8f7f6
Show file tree
Hide file tree
Showing 41 changed files with 274 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import isEmpty from 'lodash/isEmpty';

export default class FlavorsListController {
/* @ngInject */
constructor($q, PciProjectFlavors) {
constructor($q, $state, PciProjectFlavors) {
this.$q = $q;
this.$state = $state;
this.PciProjectFlavors = PciProjectFlavors;
}

$onInit() {
this.quotaUrl = this.$state.href('pci.projects.project.quota');
this.isLoading = true;
this.flavorCount = this.flavorCount || 1;
return this.getFlavors().finally(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,25 @@
<oui-select-picker-section
data-ng-if="$ctrl.region && !$ctrl.region.hasEnoughQuotaForFlavors(flavor, $ctrl.flavorCount)"
>
<a
class="oui-button oui-button_ghost"
data-ui-sref="pci.projects.project.quota"
data-translate="pci_project_flavors_quota"
>
</a>
<div class="text-small">
<span
class="oui-icon oui-icon-error text-small oui-color-ae-500"
aria-hidden="true"
></span>
<span
class="oui-color-ae-500"
data-translate="pci_project_flavors_quota_info"
>
</span>
<a
class="oui-link"
data-ng-href="{{ ::$ctrl.quotaUrl }}"
>
<span
data-translate="pci_project_flavors_quota_manage"
></span>
</a>
</div>
</oui-select-picker-section>
<oui-select-picker-section
data-ng-if="!$ctrl.hasEnoughDisk(flavor)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
"pci_project_flavors_spec_nvme_multiple": "{{count}} x {{capacity}} NVMe",
"pci_project_flavors_price_hourly": "{{price}} / Stunde (zzgl. MwSt)",
"pci_project_flavors_price_monthly": "Ab {{price}} / Monat (zzgl. MwSt.)",
"pci_project_flavors_quota": "Mein Quota erhöhen"
"pci_project_flavors_quota": "Mein Quota erhöhen",
"pci_project_flavors_spec_model": "Modell:",
"pci_project_flavors_quota_info": "Das Quota Ihres Projekts erlaubt es nicht, eine Maschine dieser Art in dieser Region hinzuzufügen.",
"pci_project_flavors_quota_manage": "Mein Quota verwalten."
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
"pci_project_flavors_spec_nvme_multiple": "{{count}} x {{capacity}} NVMe",
"pci_project_flavors_price_hourly": "{{price}} ex. VAT/hour",
"pci_project_flavors_price_monthly": "From {{price}} ex. VAT/month",
"pci_project_flavors_quota": "Increase your quota"
"pci_project_flavors_quota": "Increase your quota",
"pci_project_flavors_spec_model": "Model",
"pci_project_flavors_quota_info": "Your project quota will not allow you to add this machine type in this region.",
"pci_project_flavors_quota_manage": "Manage my quota"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
"pci_project_flavors_spec_nvme_multiple": "{{count}} x {{capacity}} NVMe",
"pci_project_flavors_price_hourly": "{{price}}/hora + IVA",
"pci_project_flavors_price_monthly": "Desde {{price}}/mes + IVA",
"pci_project_flavors_quota": "Aumentar los límites de mi cuota"
"pci_project_flavors_quota": "Aumentar los límites de mi cuota",
"pci_project_flavors_spec_model": "Modelo:",
"pci_project_flavors_quota_info": "El límite de su proyecto no permite añadir este tipo de máquina en esta región.",
"pci_project_flavors_quota_manage": "Gestionar mis límites"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
"pci_project_flavors_spec_nvme_multiple": "{{count}} x {{capacity}} NVMe",
"pci_project_flavors_price_hourly": "{{price}} ex. VAT/hour",
"pci_project_flavors_price_monthly": "From {{price}} ex. VAT/month",
"pci_project_flavors_quota": "Increase your quota"
"pci_project_flavors_quota": "Increase your quota",
"pci_project_flavors_spec_model": "Model",
"pci_project_flavors_quota_info": "Your project quota will not allow you to add this machine type in this region.",
"pci_project_flavors_quota_manage": "Manage my quota"
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@
"pci_project_flavors_price_hourly": "{{price}} HT/heure",
"pci_project_flavors_price_monthly": "À partir de {{price}} HT/mois",

"pci_project_flavors_quota": "Augmenter mon quota"
"pci_project_flavors_quota": "Augmenter mon quota",
"pci_project_flavors_quota_info": "Le quota de votre projet ne vous permet pas d’ajouter ce type de machine dans cette région.",
"pci_project_flavors_quota_manage": "Gérer mon quota"
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@
"pci_project_flavors_price_hourly": "{{price}} HT/heure",
"pci_project_flavors_price_monthly": "À partir de {{price}} HT/mois",

"pci_project_flavors_quota": "Augmenter mon quota"
"pci_project_flavors_quota": "Augmenter mon quota",
"pci_project_flavors_quota_info": "Le quota de votre projet ne vous permet pas d’ajouter ce type de machine dans cette région.",
"pci_project_flavors_quota_manage": "Gérer mon quota"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
"pci_project_flavors_spec_nvme_multiple": "{{count}} x {{capacity}} NVMe",
"pci_project_flavors_price_hourly": "{{price}} + IVA/ora",
"pci_project_flavors_price_monthly": "A partire da {{price}} +IVA/mese",
"pci_project_flavors_quota": "Aumenta la tua quota"
"pci_project_flavors_quota": "Aumenta la tua quota",
"pci_project_flavors_spec_model": "Modello:",
"pci_project_flavors_quota_info": "La quota del tuo progetto non consente di aggiungere macchine di questo tipo in questa Region. ",
"pci_project_flavors_quota_manage": "Gestisci la quota"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
"pci_project_flavors_spec_nvme_multiple": "{{count}} x {{capacity}} NVMe",
"pci_project_flavors_price_hourly": "{{price}} ex. VAT/hour",
"pci_project_flavors_price_monthly": "From {{price}} ex. VAT/month",
"pci_project_flavors_quota": "Increase your quota"
"pci_project_flavors_quota": "Increase your quota",
"pci_project_flavors_spec_model": "Model",
"pci_project_flavors_quota_info": "Your project quota will not allow you to add this machine type in this region.",
"pci_project_flavors_quota_manage": "Manage my quota"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
"pci_project_flavors_spec_nvme_multiple": "{{count}} x {{capacity}} NVMe",
"pci_project_flavors_price_hourly": "{{price}} netto/godz.",
"pci_project_flavors_price_monthly": "Od {{price}} netto/m-c",
"pci_project_flavors_quota": "Zwiększ limity"
"pci_project_flavors_quota": "Zwiększ limity",
"pci_project_flavors_spec_model": "Model:",
"pci_project_flavors_quota_info": "Limit Twojego projektu nie pozwala na dodanie tego typu maszyny w tym regionie. ",
"pci_project_flavors_quota_manage": "Zarządzaj limitami"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
"pci_project_flavors_spec_nvme_multiple": "{{count}} x {{capacity}} NVMe",
"pci_project_flavors_price_hourly": "{{price}} /hora + IVA",
"pci_project_flavors_price_monthly": "A partir de {{price}} /mês + IVA",
"pci_project_flavors_quota": "Aumentar o meu limite"
"pci_project_flavors_quota": "Aumentar o meu limite",
"pci_project_flavors_spec_model": "Modelo:",
"pci_project_flavors_quota_info": "O limite do seu projeto não lhe permite adicionar este tipo de máquina nesta região.",
"pci_project_flavors_quota_manage": "Gerir o meu limite"
}
5 changes: 5 additions & 0 deletions packages/manager/modules/pci/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@
.overflow-auto {
overflow: auto !important;
}

.text-small {
font-size: 0.875rem;
vertical-align: sub;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import template from './error-modal.html';

const component = {
bindings: {
goBack: '<',
message: '<',
submitAction: '<',
submitLabel: '<',
submitLink: '<',
},
template,
};

export default component;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<form
id="eligibilityWarning"
name="eligibilityWarning"
data-ng-submit="$ctrl.submitAction()"
novalidate
>
<oui-modal
data-primary-label="{{ ::$ctrl.submitLabel }}"
data-secondary-action="$ctrl.goBack()"
data-secondary-label="{{ ::'pci_project_new_error_cancel' | translate }}"
data-on-dismiss="$ctrl.goBack()"
data-type="error"
>
<p data-ng-bind="$ctrl.message"></p>
</oui-modal>
</form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import angular from 'angular';
import '@uirouter/angularjs';
import '@ovh-ux/ng-translate-async-loader';
import '@ovh-ux/ui-kit';
import 'angular-translate';

import component from './error-modal.component';
import routing from './error-modal.routing';

const moduleName = 'ovhManagerPciProjectErrorModal';

angular
.module(moduleName, [
'oui',
'ui.router',
'ngTranslateAsyncLoader',
'pascalprecht.translate',
])
.config(routing)
.component('pciProjectErrorModal', component)
.run(/* @ngTranslationsInject:json ./translations */);

export default moduleName;
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import set from 'lodash/set';

export default /* @ngInject */ ($stateProvider) => {
$stateProvider.state('pci.projects.project.error', {
url: '/error',
views: {
modal: {
component: 'pciProjectErrorModal',
},
},
layout: 'modal',
params: {
message: null,
projectId: null,
submitLabel: null,
submitLink: null,
},
resolve: {
goBack: /* @ngInject */ ($state, projectId) => () =>
$state.go('pci.projects.project', {
projectId,
}),

breadcrumb: () => null,

submitAction: /* @ngInject */ ($window, submitLink) => () => {
set($window, 'location.href', submitLink);
},

message: /* @ngInject */ ($transition$) =>
$transition$.params().message || null,

projectId: /* @ngInject */ ($transition$) =>
$transition$.params().projectId || null,

submitLabel: /* @ngInject */ ($transition$) =>
$transition$.params().submitLabel || null,

submitLink: /* @ngInject */ ($transition$) =>
$transition$.params().submitLink || null,
},
});
};
22 changes: 22 additions & 0 deletions packages/manager/modules/pci/src/projects/new/error-modal/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import angular from 'angular';
import '@uirouter/angularjs';
import 'oclazyload';

const moduleName = 'ovhManagerPciProjectErrorModalLazyloading';

angular.module(moduleName, ['ui.router', 'oc.lazyLoad']).config(
/* @ngInject */ ($stateProvider) => {
$stateProvider.state('pci.projects.project.error.**', {
url: '/error',
lazyLoad: ($transition$) => {
const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad');

return import('./error-modal.module').then((mod) =>
$ocLazyLoad.inject(mod.default || mod),
);
},
});
},
);

export default moduleName;
14 changes: 9 additions & 5 deletions packages/manager/modules/pci/src/projects/new/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export default /* @ngInject */ ($stateProvider) => {
const windowPromise = transition.injector().getAsync('$window');
const cartPromise = transition.injector().getAsync('cart');
const eligibilityPromise = transition.injector().getAsync('eligibility');
const newSupportTicketLink = transition
.injector()
.get('newSupportTicketLink');
return Promise.all([
translatePromise,
windowPromise,
Expand All @@ -38,20 +41,18 @@ export default /* @ngInject */ ($stateProvider) => {
};

if (eligibility.isAskIncreaseProjectsQuotaRequired()) {
redirectState = 'pci.error';
redirectState = 'pci.projects.project.error';
redirectParams = {
message: $translate.instant(
'pci_project_new_error_ask_increase_projects_quota',
),
code: ELIGIBILITY_ACTION_ENUM.ASK_INCREASE_PROJECTS_QUOTA,
image: ELIGIBILITY_ERROR_IMAGES_SRC.ASK_INCREASE_PROJECTS_QUOTA,
projectId: get(transition.params('from'), 'projectId'),
submitLabel: $translate.instant(
'pci_project_new_error_contact_support',
),
submitLink: get(
PCI_REDIRECT_URLS,
`${EnvironmentService.Environment.region}.support`,
),
submitLink: newSupportTicketLink,
};
} else if (eligibility.isVerifyPaypalRequired()) {
redirectState = 'pci.error';
Expand Down Expand Up @@ -88,6 +89,9 @@ export default /* @ngInject */ ($stateProvider) => {
resolve: {
breadcrumb: () => null,

newSupportTicketLink: /* @ngInject */ (RedirectionService) =>
RedirectionService.getURL('createTicket'),

cart: /* @ngInject */ ($transition$, me, pciProjectNew) =>
!get($transition$.params(), 'cartId')
? // just create cart - location will be reloaded to fetch the whole cart
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"pci_project_new_error_contact_support": "Kundendienst kontaktieren",
"pci_project_new_error_ask_increase_projects_quota": "Sie können kein weiteres Public Cloud Projekt erstellen, da Sie die maximale Zahl an Projekten bereits erreicht haben. Um das Quota zu erhöhen, wenden Sie sich bitte an den Support.",
"pci_project_new_error_verify_paypal": "Sie können mit Ihrem PayPal-Konto kein Public Cloud Projekt erstellen, da das Konto noch nicht verifiziert wurde. Bitte ergreifen Sie die notwendigen Maßnahmen bei PayPal, um Ihr Konto zu verifizieren, und versuchen Sie es erneut. Wahlweise können Sie auch ein anderes <a href=\"{{ href }}\">Standardzahlungsmittel</a> verwenden."
"pci_project_new_error_ask_increase_projects_quota": "Sie können kein Projekt mehr erstellen. Bitte kontaktieren Sie den Support um Ihr Quota zu erhöhen und so ein neues Projekt erstellen zu können.",
"pci_project_new_error_verify_paypal": "Sie können mit Ihrem PayPal-Konto kein Public Cloud Projekt erstellen, da das Konto noch nicht verifiziert wurde. Bitte ergreifen Sie die notwendigen Maßnahmen bei PayPal, um Ihr Konto zu verifizieren, und versuchen Sie es erneut. Wahlweise können Sie auch ein anderes <a href=\"{{ href }}\">Standardzahlungsmittel</a> verwenden.",
"pci_project_new_error_cancel": "Abbrechen"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"pci_project_new_error_contact_support": "Contact support",
"pci_project_new_error_ask_increase_projects_quota": "You cannot create an additional Public Cloud project because you have reached the maximum quota for projects. To unblock this quota, please contact our support team.",
"pci_project_new_error_verify_paypal": "You cannot create a Public Cloud project with your PayPal account, because it is not verified. Please go to the PayPal website and verify your account, then try again. You can also modify <a href=\"{{ href }}\">your default payment method</a>."
"pci_project_new_error_ask_increase_projects_quota": "You can no longer create projects. Please contact the support team to increase your quota, and create a new project.",
"pci_project_new_error_verify_paypal": "You cannot create a Public Cloud project with your PayPal account, because it is not verified. Please go to the PayPal website and verify your account, then try again. You can also modify <a href=\"{{ href }}\">your default payment method</a>.",
"pci_project_new_error_cancel": "Cancel"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"pci_project_new_error_contact_support": "Contactar con el soporte",
"pci_project_new_error_ask_increase_projects_quota": "No puede crear más proyectos de Public Cloud debido a que ha alcanzado el límite de proyectos. Para desbloquear dicho límite, contacte con el soporte.",
"pci_project_new_error_verify_paypal": "No puede crear proyectos de Public Cloud con su cuenta de PayPal debido a que esta no está verificada. Le rogamos que realice los trámites pertinentes con PayPal para verificar su cuenta. Posteriormente podrá volver a intentarlo. También puede modificar su <a href=\"{{ href }}\">forma de pago por defecto</a>."
"pci_project_new_error_ask_increase_projects_quota": "Si no puede crear más proyectos, puede ponerse en contacto con el soporte para aumentar su límite y poder crear un nuevo proyecto.",
"pci_project_new_error_verify_paypal": "No puede crear proyectos de Public Cloud con su cuenta de PayPal debido a que esta no está verificada. Le rogamos que realice los trámites pertinentes con PayPal para verificar su cuenta. Posteriormente podrá volver a intentarlo. También puede modificar su <a href=\"{{ href }}\">forma de pago por defecto</a>.",
"pci_project_new_error_cancel": "Cancelar"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"pci_project_new_error_contact_support": "Contact support",
"pci_project_new_error_ask_increase_projects_quota": "You cannot create an additional Public Cloud project because you have reached the maximum quota for projects. To unblock this quota, please contact our support team.",
"pci_project_new_error_verify_paypal": "You cannot create a Public Cloud project with your PayPal account, because it is not verified. Please go to the PayPal website and verify your account, then try again. You can also modify <a href=\"{{ href }}\">your default payment method</a>."
"pci_project_new_error_ask_increase_projects_quota": "You can no longer create projects. Please contact the support team to increase your quota, and create a new project.",
"pci_project_new_error_verify_paypal": "You cannot create a Public Cloud project with your PayPal account, because it is not verified. Please go to the PayPal website and verify your account, then try again. You can also modify <a href=\"{{ href }}\">your default payment method</a>.",
"pci_project_new_error_cancel": "Cancel"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"pci_project_new_error_contact_support": "Contacter le support",
"pci_project_new_error_ask_increase_projects_quota": "Vous ne pouvez pas créer de projet Public Cloud supplémentaire, car vous avez atteint le quota maximum de projets. Pour débloquer ce quota, nous vous invitons à contacter notre support.",
"pci_project_new_error_verify_paypal": "Vous ne pouvez pas créer de projet Public Cloud avec votre compte PayPal, car celui-ci n'est pas vérifié. Nous vous invitons à effectuer les démarches nécessaires auprès de PayPal pour vérifier votre compte, puis à réessayer. Vous pouvez aussi modifier <a href=\"{{ href }}\">votre moyen de paiement par défaut</a>."
"pci_project_new_error_ask_increase_projects_quota": "Vous ne pouvez plus créer de projet, veuillez contacter le support pour augmenter votre quota et avoir la possibilité de créer un nouveau projet.",
"pci_project_new_error_verify_paypal": "Vous ne pouvez pas créer de projet Public Cloud avec votre compte PayPal, car celui-ci n'est pas vérifié. Nous vous invitons à effectuer les démarches nécessaires auprès de PayPal pour vérifier votre compte, puis à réessayer. Vous pouvez aussi modifier <a href=\"{{ href }}\">votre moyen de paiement par défaut</a>.",
"pci_project_new_error_cancel": "Annuler"
}
Loading

0 comments on commit 5a8f7f6

Please sign in to comment.