summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models/onboard-vendor
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/view-models/onboard-vendor')
-rw-r--r--catalog-ui/src/app/view-models/onboard-vendor/onboard-vendor-view-model.ts10
-rw-r--r--catalog-ui/src/app/view-models/onboard-vendor/onboard-vendor-view.html2
2 files changed, 9 insertions, 3 deletions
diff --git a/catalog-ui/src/app/view-models/onboard-vendor/onboard-vendor-view-model.ts b/catalog-ui/src/app/view-models/onboard-vendor/onboard-vendor-view-model.ts
index 37b9b9db9c..f77a29b003 100644
--- a/catalog-ui/src/app/view-models/onboard-vendor/onboard-vendor-view-model.ts
+++ b/catalog-ui/src/app/view-models/onboard-vendor/onboard-vendor-view-model.ts
@@ -22,6 +22,7 @@
import {IUserProperties} from "app/models";
import {MenuItemGroup, MenuItem} from "app/utils";
import {CacheService} from "app/services";
+declare var PunchOutRegistry;
export class BreadcrumbsMenuItem {
key:string;
@@ -48,7 +49,7 @@ export interface IOnboardVendorViewModelScope extends ng.IScope {
topNavRootMenu:MenuItemGroup;
user:IUserProperties;
version:string;
- isLoading: boolean;
+ isLoading:boolean;
}
export class OnboardVendorViewModel {
@@ -66,10 +67,13 @@ export class OnboardVendorViewModel {
this.$scope.isLoading = true;
- $.getScript("/onboarding/punch-outs_en.js", () => {
+ PunchOutRegistry.loadOnBoarding(()=> {
this.$scope.isLoading = false;
});
+ this.initScope();
+ }
+ private initScope = ():void => {
this.$scope.vendorData = {
breadcrumbs: {
selectedKeys: []
@@ -89,6 +93,7 @@ export class OnboardVendorViewModel {
this.$scope.topNavMenuModel = [];
this.$scope.user = this.cacheService.get('user');
+
}
updateBreadcrumbsPath = (selectedKeys:Array<string>):ng.IPromise<boolean> => {
@@ -140,6 +145,7 @@ export class OnboardVendorViewModel {
let topNavRootMenu = topNavMenuModel[0];
let onboardItem = topNavRootMenu.menuItems[topNavRootMenu.selectedIndex];
let originalCallback = onboardItem.callback;
+ //noinspection TypeScriptValidateTypes
onboardItem.callback = (...args) => {
let ret = this.updateBreadcrumbsPath([]);
return originalCallback && originalCallback.apply(undefined, args) || ret;
diff --git a/catalog-ui/src/app/view-models/onboard-vendor/onboard-vendor-view.html b/catalog-ui/src/app/view-models/onboard-vendor/onboard-vendor-view.html
index 56a36863e1..eec7c4758d 100644
--- a/catalog-ui/src/app/view-models/onboard-vendor/onboard-vendor-view.html
+++ b/catalog-ui/src/app/view-models/onboard-vendor/onboard-vendor-view.html
@@ -1,6 +1,6 @@
<div class="sdc-catalog-container">
- <loader ng-init="isLoading=true" data-display="isLoading"></loader>
+ <loader data-display="isLoading"></loader>
<div class="w-sdc-main-container">
<punch-out name="'onboarding/vendor'" data="vendorData" user="user" on-event="onVendorEvent"></punch-out>
</div>