Skip to content

Commit 67a7b4c

Browse files
author
Quentin Pavy
committed
feat(dedicated.netapp): fix no replication destination services
ref: #MANAGER-18706 Signed-off-by: Quentin Pavy <quentin.pavy.ext@ovhcloud.com>
1 parent c648d49 commit 67a7b4c

8 files changed

Lines changed: 14 additions & 16 deletions

File tree

packages/manager/modules/netapp/src/dashboard/service.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,4 @@ export default class NetAppDashboardService {
381381
});
382382
}
383383

384-
hasAvailableReplicationsServices() {
385-
return !!this.replicationsAvaibleServices.length;
386-
}
387384
}

packages/manager/modules/netapp/src/dashboard/volumes/component.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default {
2424
totalVolumesStorage: '<',
2525
goToCreateReplications: '<',
2626
replicationsAvaibleServices: '<',
27+
hasAvailableReplicationsServices: '<',
2728
isNetworkAvailable: '<',
2829
},
2930
template,

packages/manager/modules/netapp/src/dashboard/volumes/controller.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ export default class {
22
/* @ngInject */
33
constructor(NetAppDashboardService) {
44
this.NetAppDashboardService = NetAppDashboardService;
5-
this.hasAvailableReplicationsServices =
6-
NetAppDashboardService.hasAvailableReplicationsServices;
75
this.selectedReplicationsCheckboxes = {};
86
this.AWAITING_REPLICATION_STATUS = 'awaiting_replication';
97
}

packages/manager/modules/netapp/src/dashboard/volumes/create-replications/component.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import controller from './controller';
44
export default {
55
bindings: {
66
replicationsAvaibleServices: '<',
7+
hasAvailableReplicationsServices: '<',
78
goToOrder: '<',
89
goToVolumes: '<',
910
postReplications: '<',

packages/manager/modules/netapp/src/dashboard/volumes/create-replications/controller.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
export default class NetappVolumesCreateReplicationsCtrl {
2-
/* @ngInject */ constructor(NetAppDashboardService, $translate) {
3-
this.hasAvailableReplicationsServices =
4-
NetAppDashboardService.hasAvailableReplicationsServices;
2+
/* @ngInject */
3+
constructor(NetAppDashboardService, $translate) {
54
this.optionsReplicationsAvaibleServices = [];
65
this.onPostLoad = false;
76
this.replicationsSelectedVolumes =
@@ -61,7 +60,7 @@ export default class NetappVolumesCreateReplicationsCtrl {
6160
isPrimaryButtonDisabled() {
6261
return (
6362
this.onPostLoad ||
64-
(this.hasAvailableReplicationsServices() && !this.destinationServiceId)
63+
(this.hasAvailableReplicationsServices && !this.destinationServiceId)
6564
);
6665
}
6766
}

packages/manager/modules/netapp/src/dashboard/volumes/create-replications/template.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
data-loading="$ctrl.onPostLoad"
33
data-on-dismiss="$ctrl.goToVolumes()"
44
data-heading="{{:: 'netapp_network_volumes_replications_title' | translate }}"
5-
data-primary-label="{{:: !$ctrl.isNetworkAvailable && $ctrl.hasAvailableReplicationsServices() ? 'netapp_network_volumes_replications_button_sync' : 'netapp_network_volumes_replications_button_buy' | translate }}"
5+
data-primary-label="{{:: !$ctrl.isNetworkAvailable && $ctrl.hasAvailableReplicationsServices ? 'netapp_network_volumes_replications_button_sync' : 'netapp_network_volumes_replications_button_buy' | translate }}"
66
data-primary-action="$ctrl.onPrimaryClick()"
77
data-secondary-label="{{:: 'netapp_network_volumes_replications_button_cancel' | translate }}"
88
data-secondary-action="$ctrl.goToVolumes()"
99
data-primary-disabled="$ctrl.isPrimaryButtonDisabled()"
1010
>
1111
<div
12-
data-ng-if="!$ctrl.replicationsSelectedVolumes.length && $ctrl.hasAvailableReplicationsServices()"
12+
data-ng-if="!$ctrl.replicationsSelectedVolumes.length && $ctrl.hasAvailableReplicationsServices"
1313
>
1414
<strong
1515
data-translate="netapp_network_volumes_no_selected_volume_replications_subtitle"
@@ -18,7 +18,7 @@
1818
data-translate="netapp_network_volumes_no_selected_volume_replications_description"
1919
></p>
2020
</div>
21-
<div data-ng-if="!$ctrl.hasAvailableReplicationsServices()">
21+
<div data-ng-if="!$ctrl.hasAvailableReplicationsServices">
2222
<strong
2323
data-translate="netapp_network_volumes_no_replications_subtitle"
2424
></strong>
@@ -27,7 +27,7 @@
2727
></p>
2828
</div>
2929
<div
30-
data-ng-if="$ctrl.hasAvailableReplicationsServices() && $ctrl.replicationsSelectedVolumes.length"
30+
data-ng-if="$ctrl.hasAvailableReplicationsServices && $ctrl.replicationsSelectedVolumes.length"
3131
>
3232
<p data-translate="netapp_network_volumes_replications_description"></p>
3333
<p

packages/manager/modules/netapp/src/dashboard/volumes/routing.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ export default /* @ngInject */ ($stateProvider) => {
179179
)
180180
.then(({ data = [] }) => data)
181181
.catch(() => []),
182+
hasAvailableReplicationsServices: /* @ngInject */ (replicationsAvaibleServices) =>
183+
!!replicationsAvaibleServices.length
182184
},
183185
atInternet: {
184186
ignore: true,

packages/manager/modules/netapp/src/dashboard/volumes/template.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
data-icon-left="oui-icon oui-icon-arrow-transfer"
2323
class="mr-2"
2424
ng-if="!$ctrl.isNetworkAvailable"
25-
data-disabled="$ctrl.hasAvailableReplicationsServices() && !$ctrl.NetAppDashboardService.replicationsSelectedVolumes.length"
25+
data-disabled="$ctrl.hasAvailableReplicationsServices && !$ctrl.NetAppDashboardService.replicationsSelectedVolumes.length"
2626
>
2727
<span data-translate="netapp_volumes_button_replications"></span>
2828
</oui-button>
@@ -38,7 +38,7 @@
3838
data-ng-if="!$ctrl.isNetworkAvailable"
3939
data-model="$ctrl.selectedReplicationsCheckboxes[$row.id]"
4040
data-on-change="$ctrl.handleCheckboxChange({volumeId: $row.id, checked: modelValue})"
41-
data-disabled="$row.status === $ctrl.AWAITING_REPLICATION_STATUS || !$ctrl.hasAvailableReplicationsServices()"
41+
data-disabled="$row.status === $ctrl.AWAITING_REPLICATION_STATUS"
4242
></oui-checkbox>
4343
</oui-datagrid-column>
4444
<oui-datagrid-column
@@ -99,7 +99,7 @@
9999
<span data-translate="netapp_volumes_edit_volume"></span>
100100
</oui-action-menu-item>
101101
<oui-action-menu-item
102-
data-ng-if="$ctrl.hasAvailableReplicationsServices() && !$ctrl.isNetworkAvailable"
102+
data-ng-if="!$ctrl.isNetworkAvailable"
103103
data-disabled="$row.status === $ctrl.AWAITING_REPLICATION_STATUS"
104104
data-on-click="$ctrl.goToSingleReplication($row.id)"
105105
>

0 commit comments

Comments
 (0)