Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pci-object-storage): s3 localzones #13561

Merged
merged 39 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8940d25
feat(pci-object-storage): s3 localzones
Oct 11, 2024
9be9ab1
feat(pci-object-storage): fix loclazones list
Oct 11, 2024
b1dc4de
feat(pci-object-storage): testing issues
Oct 15, 2024
cef42a5
feat(pci-object-storage): update wording
Oct 16, 2024
82ca54c
feat(pci-object-storage): fix qa issues
Oct 16, 2024
0a214d5
feat(pci-object-storage): fix new issues
Oct 18, 2024
c450d18
feat(pci-object-storage): delete comment
Oct 18, 2024
e09e349
feat(pci-object-storage): fix new qa issues
Oct 22, 2024
4b277e8
feat(pci-object-storage): feature flipping lz in the usa
Oct 23, 2024
5096d8f
fix(i18n): add missing translations [CDS 3435]
Oct 23, 2024
278f34e
feat(pci-object-storage): update wording for the usa
Oct 23, 2024
bca91b0
feat(pci-object-storage): fix bucket details url
Oct 23, 2024
7af5ead
feat(pci-object-storage): disable feature flipping momentarily
Oct 24, 2024
a305d13
feat(pci-object-storage): enable feature flipping
Oct 24, 2024
00e5476
feat(pci-object-storage): edit wording USA
Oct 30, 2024
56485ea
feat(pci-object-storage): enable feature flipping usa again
Oct 30, 2024
7917df9
fix(i18n): add missing translations [CDS 3448]
Oct 31, 2024
e18ba10
fix(i18n): add missing translations [CDS 3449]
Oct 31, 2024
94c817a
fix(i18n): add missing translations [CDS 3451]
Oct 31, 2024
4c748c6
Revert "feat(manager-react-components): build manager react component…
anooparveti Oct 24, 2024
5646a08
build: yarn.lock update
anooparveti Oct 24, 2024
7743b4f
feat(pci-object-storage): 3az feature flipping (#13521)
selm3n Oct 25, 2024
9bb6c0b
feat(*): build and publish manager-react-components and its deps
anooparveti Oct 29, 2024
2e29e7d
feat(pci-object-storage): testing issues
Oct 15, 2024
f1dce18
feat(pci-object-storage): feature flipping lz in the usa
Oct 23, 2024
883ba69
feat(pci-object-storage): disable feature flipping momentarily
Oct 24, 2024
1daab6e
feat(pci-object-storage): enable feature flipping
Oct 24, 2024
309ba43
feat(pci-object-storage): edit wording USA
Oct 30, 2024
19e6882
feat(pci-object-storage): enable feature flipping usa again
Oct 30, 2024
e878049
feat(pci-object-storage): rebase and disable feature flipping usa
Oct 31, 2024
a2a6980
feat(pci-object-storage): add feature flipping usa
Oct 31, 2024
f5ee13f
feat(pci-object-storage): remove wrong file
Oct 31, 2024
16b1e0a
feat(pci-object-storage): remove duplicated dependencies
Oct 31, 2024
8c41106
feat(pci-object-storage): add feat flip us
Oct 31, 2024
123212a
feat(pci-object-storage): review issue
Oct 31, 2024
d196cec
feat(pci-object-storage): fix review issue
Nov 4, 2024
18a7c70
feat(pci-object-storage): us qa issues
Nov 5, 2024
69cf172
feat(pci-object-storage): add feature flipping usa lz
Nov 5, 2024
39c90b5
feat(pci-object-storage): remove lz banners for the usa
Nov 6, 2024
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
10 changes: 5 additions & 5 deletions packages/manager-react-components/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ export default defineConfig({
'react-router-dom',
'react-i18next',
'zustand',
"@ovhcloud/ods-common-core",
"@ovhcloud/ods-common-theming",
"@ovhcloud/ods-components",
"@ovhcloud/ods-components/react",
"@ovhcloud/ods-theme-blue-jeans"
'@ovhcloud/ods-common-core',
'@ovhcloud/ods-common-theming',
'@ovhcloud/ods-components',
'@ovhcloud/ods-components/react',
'@ovhcloud/ods-theme-blue-jeans',
],
output: {
globals: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ export default {
projectId: '<?',
reload: '<?',
loadEnd: '&?',
isDiscoveryProject: '<',
projectActivationPageHref: '<',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,25 @@ export default class RegionsListController {
this.coreConfig.getUser().ovhSubsidiary,
)
.then((productCapabilities) => {
const productCapability = productCapabilities.plans
?.filter((plan) =>
plan.code?.startsWith(STORAGE_STANDARD_REGION_PLANCODE),
)
.filter(
(plan, index, self) =>
index === self.findIndex((p) => p.name === plan.name),
);
const productCapability = productCapabilities.plans?.filter((plan) =>
plan.code?.startsWith(STORAGE_STANDARD_REGION_PLANCODE),
);

const productRegionsAllowed = productCapability?.flatMap(
({ regions }) => regions,
);

const regionsAllowedByDeploymentMode = productRegionsAllowed.filter(
const uniqueProductRegionsAllowed = productRegionsAllowed.filter(
(value, index, self) =>
index ===
self.findIndex(
(region) =>
region.name === value.name &&
region.datacenter === value.datacenter,
),
);

const regionsAllowedByDeploymentMode = uniqueProductRegionsAllowed.filter(
(item) => item.type === this.deploymentMode,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,32 @@
data-ng-if="$ctrl.selectedRegion.enabled === false"
class="regions-list"
>
<p class="oui-color-ae-500">
<p class="oui-color-ae-500" data-ng-if="!$ctrl.isDiscoveryProject">
<strong
data-translate="pci_projects_project_storages_containers_add_add_region_activate"
>
</strong>
</p>
<p class="oui-color-ae-500" data-ng-if="$ctrl.isDiscoveryProject">
<strong
data-translate="pci_project_regions_list_activate_project_banner_message"
></strong>
<a
data-ng-href="{{:: $ctrl.projectActivationPageHref }}"
data-translate="pci_project_regions_list_activate_project_banner_link_text"
></a>
</p>
</div>
<div data-ng-if="$ctrl.isDiscoveryProject" class="regions-list">
<p class="oui-color-ae-500">
<strong
data-translate="pci_project_regions_list_activate_project_banner_message"
></strong>
<a
data-ng-href="{{:: $ctrl.projectActivationPageHref }}"
data-translate="pci_project_regions_list_activate_project_banner_link_text"
></a>
</p>
</div>
</oui-tabs-item>
</oui-tabs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"pci_project_regions_list_add": "Bitte aktivieren Sie die letzten Standorte jeder Zone im Bereich <a href=\"{{url}}\" class=\"oui-link\">Standorte</a>",
"pci_project_regions_list_region": "Standort",
"pci_project_regions_list_quota": "Mein Quota erhöhen",
"pci_project_regions_list_current_offer": "Derzeitiges Angebot"
"pci_project_regions_list_current_offer": "Derzeitiges Angebot",
"pci_project_regions_list_activate_project_banner_message": "Um auf die folgenden Schritte zuzugreifen, müssen Sie",
"pci_project_regions_list_activate_project_banner_link_text": "Ihr Projekt aktivieren."
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"pci_project_regions_list_add": "Please activate the latest locations in each zone in the <a href=\"{{url}}\" class=\"oui-link\">Locations</a> section.",
"pci_project_regions_list_region": "Location",
"pci_project_regions_list_quota": "Increase your quota",
"pci_project_regions_list_current_offer": "Current solution"
"pci_project_regions_list_current_offer": "Current solution",
"pci_project_regions_list_activate_project_banner_message": "To go to the next steps,",
"pci_project_regions_list_activate_project_banner_link_text": "activate your project."
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"pci_project_regions_list_add": "Por favor, active las últimas localizaciones de cada zona en la sección <a href=\"{{url}}\" class=\"oui-link\">Localizaciones</a>.",
"pci_project_regions_list_region": "Localización",
"pci_project_regions_list_quota": "Aumentar los límites de mi cuota",
"pci_project_regions_list_current_offer": "Producto actual"
"pci_project_regions_list_current_offer": "Producto actual",
"pci_project_regions_list_activate_project_banner_message": "Para acceder a las siguientes etapas",
"pci_project_regions_list_activate_project_banner_link_text": "debe activar el proyecto."
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"pci_project_regions_list_add": "Nous vous invitons à activer les dernières localisations de chaque zone dans la partie <a href=\"{{url}}\" class=\"oui-link\">Localisations</a>",
"pci_project_regions_list_region": "Localisation",
"pci_project_regions_list_quota": "Augmenter mon quota",
"pci_project_regions_list_current_offer": "Offre actuelle"
"pci_project_regions_list_current_offer": "Offre actuelle",
"pci_project_regions_list_activate_project_banner_message": "Pour accéder aux étapes suivantes, vous devez",
"pci_project_regions_list_activate_project_banner_link_text": "activer votre projet."
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"pci_project_regions_list_add": "Nous vous invitons à activer les dernières localisations de chaque zone dans la partie <a href=\"{{url}}\" class=\"oui-link\">Localisations</a>",
"pci_project_regions_list_region": "Localisation",
"pci_project_regions_list_quota": "Augmenter mon quota",
"pci_project_regions_list_current_offer": "Offre actuelle"
"pci_project_regions_list_current_offer": "Offre actuelle",
"pci_project_regions_list_activate_project_banner_message": "Pour accéder aux étapes suivantes, vous devez",
"pci_project_regions_list_activate_project_banner_link_text": "activer votre projet."
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"pci_project_regions_list_add": "Per attivare le ultime localizzazioni disponibili in ogni zona, accedi alla sezione <a href=\"{{url}}\" class=\"oui-link\">Region</a>",
"pci_project_regions_list_region": "Localizzazione",
"pci_project_regions_list_quota": "Aumenta la tua quota",
"pci_project_regions_list_current_offer": "Soluzione corrente"
"pci_project_regions_list_current_offer": "Soluzione corrente",
"pci_project_regions_list_activate_project_banner_message": "Per accedere agli step successivi, è necessario",
"pci_project_regions_list_activate_project_banner_link_text": "attivare il tuo progetto."
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"pci_project_regions_list_add": "Włącz najnowsze regiony każdej strefy w sekcji <a href=\"{{url}}\" class=\"oui-link\">Lokalizacje</a>.",
"pci_project_regions_list_region": "Lokalizacja",
"pci_project_regions_list_quota": "Zwiększ limit",
"pci_project_regions_list_current_offer": "Aktualna oferta"
"pci_project_regions_list_current_offer": "Aktualna oferta",
"pci_project_regions_list_activate_project_banner_message": "Aby przejść do kolejnych etapów, musisz",
"pci_project_regions_list_activate_project_banner_link_text": "aktywować projekt."
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"pci_project_regions_list_add": "Pode ativar as últimas regiões de cada zona na secção <a href=\"{{url}}\" class=\"oui-link\">Localizações</a>",
"pci_project_regions_list_region": "Localização",
"pci_project_regions_list_quota": "Aumentar o meu limite",
"pci_project_regions_list_current_offer": "Oferta atual"
"pci_project_regions_list_current_offer": "Oferta atual",
"pci_project_regions_list_activate_project_banner_message": "Para aceder às etapas seguintes, deve",
"pci_project_regions_list_activate_project_banner_link_text": "ativar o seu projeto."
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ export default {
trackEncryptionAction: '<',
catalog: '<',
is3azAvailable: '<',
projectActivationPageHref: '<',
isLocalzoneAvailable: '<',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
OBJECT_CONTAINER_MODE_MONO_ZONE,
STORAGE_STANDARD_PLANCODE,
SWIFT_PLANCODE,
OBJECT_CONTAINER_MODE_LOCAL_ZONE,
} from '../containers.constants';

import { CONTAINER_USER_ASSOCIATION_MODES } from './components/associate-user-to-container/constant';
Expand Down Expand Up @@ -107,6 +108,7 @@ export default class PciStoragesContainersAddController {
},
);

this.featureFlipLocalzoneContainer();
this.setOffersPrices();
this.setDeploymentModePrices();
this.featureFlip3azContainer();
Expand Down Expand Up @@ -137,6 +139,13 @@ export default class PciStoragesContainersAddController {
this.messages = this.messageHandler.getMessages();
}

shouldDisplayContainerName() {
if (this.isRightOffer() && !this.isLocalZone()) {
return !this.archive && this.currentStep > 4;
}
return !this.archive && !this.isAddingRegion && !this.isAddingRegionError;
}

featureFlip3azContainer() {
if (!this.is3azAvailable) {
const index = OBJECT_CONTAINER_DEPLOYMENT_MODES.indexOf(
Expand All @@ -158,7 +167,19 @@ export default class PciStoragesContainersAddController {
.filter((addon) => addon.planCode === planCode)
.map((addon) => addon.pricings[0].price)[0];

return hourlyPrice * 720 * 1024 * 0.00000001;
return hourlyPrice * 730 * 1024 * 0.00000001;
}

featureFlipLocalzoneContainer() {
if (!this.isLocalzoneAvailable) {
const index = OBJECT_CONTAINER_DEPLOYMENT_MODES.indexOf(
OBJECT_CONTAINER_MODE_LOCAL_ZONE,
);

if (index > -1) {
OBJECT_CONTAINER_DEPLOYMENT_MODES.splice(index, 1);
}
}
}

setOffersPrices() {
Expand Down Expand Up @@ -192,7 +213,7 @@ export default class PciStoragesContainersAddController {

if (price > 0) {
if (!lowestPrice || price < lowestPrice) {
lowestPrice = price * 720 * 1024 * 0.00000001;
lowestPrice = price * 730 * 1024 * 0.00000001;
}
}
}
Expand Down Expand Up @@ -237,9 +258,27 @@ export default class PciStoragesContainersAddController {
OBJECT_CONTAINER_MODE_MONO_ZONE,
),
);

this.OBJECT_CONTAINER_DEPLOYMENT_MODES_LABELS[
OBJECT_CONTAINER_MODE_LOCAL_ZONE
].price =
this.getLowestPriceAddon(
productCapability,
OBJECT_CONTAINER_MODE_LOCAL_ZONE,
) &&
this.PriceFormatter.format(
this.getLowestPriceAddon(
productCapability,
OBJECT_CONTAINER_MODE_LOCAL_ZONE,
),
);
});
}

isLocalZone() {
return this.container.deploymentMode === OBJECT_CONTAINER_MODE_LOCAL_ZONE;
}

isRightOffer() {
return OBJECT_CONTAINER_OFFER_STORAGE_STANDARD === this.container.offer;
}
Expand Down Expand Up @@ -271,6 +310,7 @@ export default class PciStoragesContainersAddController {

onContainerSolutionChange() {
this.container.region = null;
this.container.containerType = null;
}

onRegionsFocus() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,23 +193,31 @@ <h2 class="oui-header__description mb-5">
>
<oui-select-picker-label>
<span
data-ng-bind=":: ('pci_projects_project_storages_containers_add_deployment_mode_' + deploymentModeName) | translate"
></span>
data-ng-bind="::($ctrl.isLocalzoneAvailable
? 'pci_projects_project_storages_containers_add_deployment_mode_'
: 'pci_projects_project_storages_containers_add_deployment_mode_flipping_') + deploymentModeName | translate"
>
</span>
<span
class="oui-badge oui-badge_best-seller"
data-ng-if="$ctrl.OBJECT_CONTAINER_DEPLOYMENT_MODES_LABELS[deploymentModeName].isMultiZone"
data-ng-bind=":: ('pci_projects_project_storages_containers_add_deployment_mode_' + deploymentModeName + '_label') | translate"
></span>
<span
class="oui-badge oui-badge_info"
data-ng-if="!$ctrl.OBJECT_CONTAINER_DEPLOYMENT_MODES_LABELS[deploymentModeName].isMultiZone"
data-ng-if="$ctrl.OBJECT_CONTAINER_DEPLOYMENT_MODES_LABELS[deploymentModeName].isMonoZone && $ctrl.isLocalzoneAvailable"
data-ng-bind=":: ('pci_projects_project_storages_containers_add_deployment_mode_' + deploymentModeName + '_label') | translate"
></span>
<span
class="oui-badge oui-badge_limited-edition"
data-ng-if="$ctrl.OBJECT_CONTAINER_DEPLOYMENT_MODES_LABELS[deploymentModeName].isMultiZone"
data-translate="pci_projects_project_storages_containers_add_deployment_mode_soon"
></span>
<span
class="oui-badge oui-badge_promotion"
data-ng-if="$ctrl.OBJECT_CONTAINER_DEPLOYMENT_MODES_LABELS[deploymentModeName].isLocalZone"
data-ng-bind=":: ('pci_projects_project_storages_containers_add_deployment_mode_' + deploymentModeName + '_label') | translate"
></span>
</oui-select-picker-label>
<oui-select-picker-section>
<p
Expand Down Expand Up @@ -274,7 +282,12 @@ <h2 class="oui-header__description mb-5">
></span>
<span
class="oui-badge oui-badge_info"
data-ng-if="!$ctrl.OBJECT_CONTAINER_DEPLOYMENT_MODES_LABELS[$ctrl.container.deploymentMode].isMultiZone"
data-ng-if="$ctrl.OBJECT_CONTAINER_DEPLOYMENT_MODES_LABELS[$ctrl.container.deploymentMode].isMonoZone && $ctrl.isLocalzoneAvailable"
data-ng-bind=":: ('pci_projects_project_storages_containers_add_deployment_mode_' + $ctrl.container.deploymentMode + '_label') | translate"
></span>
<span
class="oui-badge oui-badge_promotion"
data-ng-if="$ctrl.OBJECT_CONTAINER_DEPLOYMENT_MODES_LABELS[$ctrl.container.deploymentMode].isLocalZone"
data-ng-bind=":: ('pci_projects_project_storages_containers_add_deployment_mode_' + $ctrl.container.deploymentMode + '_label') | translate"
></span>
</oui-select-picker-label>
Expand Down Expand Up @@ -305,7 +318,7 @@ <h2 class="oui-header__description mb-5">
data-ng-if="!$ctrl.archive && (!$ctrl.isRightOffer() || $ctrl.container.deploymentMode)"
data-name="storage_container_add_region"
data-header="{{:: 'pci_projects_project_storages_containers_add_region_title' | translate }}"
data-navigation="$ctrl.container.region"
data-navigation="$ctrl.container.region && !$ctrl.isDiscoveryProject"
data-on-focus="$ctrl.onRegionsFocus()"
data-on-submit="$ctrl.onRegionChange()"
data-editable="!$ctrl.isLoading"
Expand All @@ -321,6 +334,8 @@ <h2 class="oui-header__description mb-5">
data-project-id="$ctrl.projectId"
data-reload="$ctrl.reloadRegions"
data-load-end="$ctrl.reloadRegionsEnd()"
data-is-discovery-project="$ctrl.isDiscoveryProject"
data-project-activation-page-href="$ctrl.projectActivationPageHref"
></pci-project-regions-list>
</oui-step-form>

Expand Down Expand Up @@ -364,7 +379,7 @@ <h2 class="oui-header__description mb-5">
<!--Create/Linked user-->
<oui-step-form
data-position="3"
data-ng-if="!$ctrl.archive && $ctrl.isRightOffer()"
data-ng-if="!$ctrl.archive && $ctrl.isRightOffer() && !$ctrl.isLocalZone()"
data-header="{{:: 'pci_projects_project_storages_containers_add_create_or_linked_user_title' | translate }}"
data-navigation="$ctrl.isReadyForValidation()"
data-name="storage_container_add_user"
Expand All @@ -387,7 +402,7 @@ <h2 class="oui-header__description mb-5">

<oui-step-form
data-position="4"
data-ng-if="!$ctrl.archive && $ctrl.isRightOffer()"
data-ng-if="!$ctrl.archive && $ctrl.isRightOffer() && !$ctrl.isLocalZone()"
data-header="{{:: 'pci_projects_project_storages_containers_bucket_versioning_title' | translate }}"
data-editable="!$ctrl.isLoading"
data-name="storage_container_bucket_versioning"
Expand All @@ -401,7 +416,7 @@ <h2 class="oui-header__description mb-5">
<!-- Data encryption -->
<oui-step-form
data-position="{{!$ctrl.archive && $ctrl.isRightOffer() ? 5 : 4}}"
data-ng-if="!$ctrl.archive && $ctrl.encryptionAvailable && $ctrl.isRightOffer()"
data-ng-if="!$ctrl.archive && $ctrl.encryptionAvailable && $ctrl.isRightOffer() && !$ctrl.isLocalZone()"
data-header="{{:: 'pci_projects_project_storages_containers_data_encryption_title' | translate }}"
data-editable="!$ctrl.isLoading"
data-name="storage_container_data_encryption"
Expand All @@ -424,13 +439,13 @@ <h2 class="oui-header__description mb-5">
data-cancel-text="{{:: 'pci_projects_project_storages_containers_add_cancel_label' | translate }}"
data-submit-text="{{:: 'pci_projects_project_storages_containers_add_submit_label' | translate }}"
name="storage_container_add_name"
data-valid="!$ctrl.isDiscoveryProject"
data-valid="!$ctrl.isDiscoveryProject && !$ctrl.isAddingRegion && !$ctrl.isAddingRegionError"
data-prevent-next
>
<oui-field
data-size="xl"
data-help-text="{{ ::'pci_projects_project_storages_containers_add_pattern_help_storage-s3' | translate }}"
data-ng-if="$ctrl.isRightOffer() ? !$ctrl.archive && $ctrl.currentStep > 4 : !$ctrl.archive"
data-ng-if="$ctrl.shouldDisplayContainerName()"
>
<input
class="oui-input"
Expand All @@ -441,6 +456,10 @@ <h2 class="oui-header__description mb-5">
data-ng-required="true"
/>
</oui-field>
<oui-spinner
data-size="s"
data-ng-if="$ctrl.isAddingRegion"
></oui-spinner>
</oui-step-form>

<!--Archive container steps-->
Expand Down
Loading
Loading