Skip to content

Commit 767dc00

Browse files
authored
feat(public-cloud): display survey only for FR (#652)
* feat(public-cloud): display survey only for FR * fix(public-cloud): remove unused import
1 parent 06be278 commit 767dc00

File tree

5 files changed

+31
-7
lines changed

5 files changed

+31
-7
lines changed

packages/manager/apps/public-cloud/src/index.controller.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default class PublicCloudController {
1616
CloudSidebar,
1717
ovhUserPref,
1818
publicCloud,
19+
SessionService,
1920
) {
2021
this.$scope = $scope;
2122
this.$state = $state;
@@ -29,8 +30,7 @@ export default class PublicCloudController {
2930
this.feedback = feedback;
3031
this.ovhUserPref = ovhUserPref;
3132
this.publicCloud = publicCloud;
32-
33-
33+
this.sessionService = SessionService;
3434
this.navbarOptions = options;
3535

3636
$scope.$on('oui-step-form.submit', (event, { form }) => {
@@ -45,6 +45,10 @@ export default class PublicCloudController {
4545
this.$translate.refresh()
4646
.then(() => {
4747
this.sidebarLinks = this.CloudSidebar.getSidebarLinks(this.$stateParams);
48+
this.sessionService.getUser()
49+
.then((user) => {
50+
this.user = user;
51+
});
4852
});
4953
}
5054

packages/manager/apps/public-cloud/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</div>
2424
</div>
2525
</div>
26-
<a data-ng-if="$ctrl.feedbackUrl" data-ng-href="{{ $ctrl.feedbackUrl }}" rel="noopener" target="_blank" style="position: fixed; right: 2rem; bottom: 2rem;">
26+
<a data-ng-if="$ctrl.feedbackUrl && $ctrl.user.ovhSubsidiary === 'FR'" data-ng-href="{{ $ctrl.feedbackUrl }}" rel="noopener" target="_blank" style="position: fixed; right: 2rem; bottom: 2rem;">
2727
<img alt="Feedback" data-ng-src="{{ $ctrl.feedback }}" />
2828
</a>
2929
<div id="managerPreload"

packages/manager/modules/pci/src/projects/project/sidebar/sidebar.controller.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import isEmpty from 'lodash/isEmpty';
22
import isNil from 'lodash/isNil';
33
import set from 'lodash/set';
4+
import get from 'lodash/get';
45

56
import { MENU } from './sidebar.constant';
7+
import { LEGACY_URLS } from './legacy-forward/forward.constants';
68

79
export default class SidebarController {
810
/* @ngInject */
@@ -17,6 +19,7 @@ export default class SidebarController {
1719
coreConfig,
1820
OvhApiServices,
1921
OvhApiCloudProject,
22+
SessionService,
2023
) {
2124
this.$translate = $translate;
2225
this.$transitions = $transitions;
@@ -28,6 +31,7 @@ export default class SidebarController {
2831
this.OvhApiServices = OvhApiServices;
2932
this.OvhApiCloudProject = OvhApiCloudProject;
3033
this.CloudSidebar = CloudSidebar;
34+
this.sessionService = SessionService;
3135

3236
this.isOpen = false;
3337
this.isLoading = false;
@@ -78,6 +82,12 @@ export default class SidebarController {
7882
}
7983
this.isDisplayingProjectsList = false;
8084
});
85+
86+
this.sessionService.getUser()
87+
.then((user) => {
88+
this.user = user;
89+
this.legacyUrl = get(LEGACY_URLS, this.coreConfig.getRegion());
90+
});
8191
}
8292

8393
onMenuItemClick({ id }) {

packages/manager/modules/pci/src/projects/project/sidebar/sidebar.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,20 @@ <h2 class="mb-0 d-inline-block" style="font-weight: 400;" data-ng-bind="$ctrl.pr
5050
</li>
5151
<li class="oui-sidebar-list__item sidebar-menu-orphan-item">
5252
<button class="oui-sidebar-link"
53+
data-ng-if="$ctrl.user.ovhSubsidiary === 'FR'"
5354
type="button"
5455
data-ng-click="$ctrl.CloudSidebar.goToLegacy()"
5556
data-translate="cloud_sidebar_public_cloud_project_forward_legacy">
5657
</button>
58+
59+
<a class="oui-sidebar-link"
60+
data-ng-if="$ctrl.user.ovhSubsidiary !== 'FR'"
61+
data-track-on="click"
62+
data-track-name="public-cloud_menu_back-to-cloud"
63+
data-track-type="action"
64+
data-ng-href="{{$ctrl.legacyUrl}}">
65+
<span data-translate="cloud_sidebar_public_cloud_project_forward_legacy"></span>
66+
</a>
5767
</li>
5868
</ul>
5969
</div>

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,10 +1655,10 @@
16551655
rollup-pluginutils "^2.3.3"
16561656
slash "^2.0.0"
16571657

1658-
"@ovh-ux/manager-pci@^0.8.0":
1659-
version "0.8.0"
1660-
resolved "https://registry.yarnpkg.com/@ovh-ux/manager-pci/-/manager-pci-0.8.0.tgz#e8e57d49c925d6c35aa37b35e40afdd7c8475f12"
1661-
integrity sha512-8rSYpebUmFYgMEu71nq96oEg3RQqKQZIayVmANpd5SY0iJxDSuHFCe/TdB43V7Xwy8o1TeJ9ZDQ4t28tQoXEZQ==
1658+
"@ovh-ux/manager-pci@^0.9.0":
1659+
version "0.9.1"
1660+
resolved "https://registry.yarnpkg.com/@ovh-ux/manager-pci/-/manager-pci-0.9.1.tgz#afa2e590565f48854f65c71021bbecb74594acb9"
1661+
integrity sha512-+3GTHssQcjghKvxlUrR3PXpQ0ze3qUzpiwqRkSlFH7qANG9AyC9opgbwsHDI1Lb6YPORCpbv4FkfnLSlwEXIdw==
16621662
dependencies:
16631663
"@fortawesome/fontawesome-free" "^5.8.2"
16641664
"@ovh-ux/manager-config" "^0.2.0"

0 commit comments

Comments
 (0)