From 56f9d378137bb497bc816a1bd9a07f6869327411 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 27 Jun 2018 08:35:08 -0500 Subject: [PATCH] Consolidate navigation functions We had getBaseHref and getBaseHrefFromPath in two places, but also it looked like they needed to do exactly the same thing. We need getApiBaseHref to be a function so we can all it in the app.module provider. We also want it to return a path, not a URL. (Ignore the 'href' in the name) We need to be able to get the base URL to use for API calls - and we need, for now, while we have links being made outside of angular, to be able to get something similar to getApiBaseHref but that returns a url and not a path. Change-Id: I7457a7b160a312ea3eec74b8a4f3380a1f95d8e1 --- web/app.module.ts | 4 +- web/navigation/navigation.component.html | 2 +- web/status/jquery.zuul.js | 4 +- web/status/zuulStart.js | 2 +- web/util.ts | 31 ---------- web/zuul/zuul.service.ts | 77 ++++++++++++++---------- 6 files changed, 51 insertions(+), 69 deletions(-) delete mode 100644 web/util.ts diff --git a/web/app.module.ts b/web/app.module.ts index 1834b0ee99..754de7b6a2 100644 --- a/web/app.module.ts +++ b/web/app.module.ts @@ -24,7 +24,7 @@ import { FormsModule } from '@angular/forms' import { AppRoutingModule } from './app-routing.module' import { AppComponent } from './app.component' -import { getBaseHref } from './util' +import { getAppBaseHref } from './zuul/zuul.service' import BuildsComponent from './builds/builds.component' import NavigationComponent from './navigation/navigation.component' @@ -61,7 +61,7 @@ import ZuulService from './zuul/zuul.service' ], providers: [ ZuulService, - {provide: APP_BASE_HREF, useValue: getBaseHref()} + {provide: APP_BASE_HREF, useValue: getAppBaseHref()} ], bootstrap: [ AppComponent diff --git a/web/navigation/navigation.component.html b/web/navigation/navigation.component.html index 3c514fdd5c..626b89c2f0 100644 --- a/web/navigation/navigation.component.html +++ b/web/navigation/navigation.component.html @@ -16,7 +16,7 @@ under the License.