Skip to content

Commit 2dc865c

Browse files
klopfdrehjvalkeal
authored andcommitted
Fix some leftovers from dynamic base paths
- Relates #747 - Some polish for linting, left html linting errors in place as that part needs some changes in eslint config.
1 parent 63d57f4 commit 2dc865c

9 files changed

+18
-11
lines changed

ui/src/app/about/user/user.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
<ng-template #logIn>
1414
<div>
15-
<a href="/login" class="nav-link nav-icon-text"> Log In </a>
15+
<a href="{{ baseApiUrl }}login" class="nav-link nav-icon-text"> Log In </a>
1616
</div>
1717
</ng-template>

ui/src/app/about/user/user.component.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import {Component, OnInit} from '@angular/core';
22
import {Router} from '@angular/router';
33
import {SecurityService} from '../../security/service/security.service';
4+
import {UrlUtilities} from '../../url-utilities.service';
45

56
@Component({
67
selector: 'app-user',
78
templateUrl: './user.component.html'
89
})
910
export class UserComponent {
1011
loggedinUser$ = this.securityService.loggedinUser();
12+
baseApiUrl = UrlUtilities.calculateBaseApiUrl();
1113

1214
constructor(private securityService: SecurityService, private router: Router) {}
1315

ui/src/app/app.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h3 class="welcome">Welcome to</h3>
66
<h5 class="hint">You have to log in to access the application.</h5>
77
</section>
88
<div style="padding-bottom: 50px">
9-
<a href="/login" class="btn btn-primary"> Log In </a>
9+
<a href="{{ baseApiUrl }}login" class="btn btn-primary"> Log In </a>
1010
</div>
1111
</form>
1212
</div>

ui/src/app/app.component.ts

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {Component} from '@angular/core';
22
import {SecurityService} from './security/service/security.service';
33
import {ModalService} from './shared/service/modal.service';
44
import {SettingsComponent} from './settings/settings/settings.component';
5+
import {UrlUtilities} from './url-utilities.service';
56

67
@Component({
78
selector: 'app-root',
@@ -10,6 +11,7 @@ import {SettingsComponent} from './settings/settings/settings.component';
1011
export class AppComponent {
1112
shouldProtect = this.securityService.shouldProtect();
1213
securityEnabled = this.securityService.securityEnabled();
14+
baseApiUrl = UrlUtilities.calculateBaseApiUrl();
1315

1416
constructor(private securityService: SecurityService, private modalService: ModalService) {}
1517

ui/src/app/manage/tools/tools.component.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ <h1>Tools</h1>
66
<ng-template>
77
<div>
88
<clr-icon shape="angle" style="transform: rotate(90deg)"></clr-icon>
9-
<a href="/#" (click)="run('export-stream')">Export stream(s): Create a JSON file with the selected streams</a>
9+
<a href="{{ baseApiUrl }}#" (click)="run('export-stream')">Export stream(s): Create a JSON file with the selected streams</a>
1010
</div>
1111
<div [appRole]="['ROLE_CREATE']">
1212
<clr-icon shape="angle" style="transform: rotate(90deg)"></clr-icon>
13-
<a href="/#" (click)="run('import-stream')">Import stream(s): Import streams from a JSON file</a>
13+
<a href="{{ baseApiUrl }}#" (click)="run('import-stream')">Import stream(s): Import streams from a JSON file</a>
1414
</div>
1515
</ng-template>
1616
</app-view-card>
@@ -19,11 +19,11 @@ <h1>Tools</h1>
1919
<ng-template>
2020
<div>
2121
<clr-icon shape="angle" style="transform: rotate(90deg)"></clr-icon>
22-
<a href="/#" (click)="run('cleanup-all')">Clean up all task/job executions</a>
22+
<a href="{{ baseApiUrl }}#" (click)="run('cleanup-all')">Clean up all task/job executions</a>
2323
</div>
2424
<div>
2525
<clr-icon shape="angle" style="transform: rotate(90deg)"></clr-icon>
26-
<a href="/#" (click)="run('cleanup-completed')">Clean up all completed task/job executions</a>
26+
<a href="{{ baseApiUrl }}#" (click)="run('cleanup-completed')">Clean up all completed task/job executions</a>
2727
</div>
2828
</ng-template>
2929
</app-view-card>
@@ -33,11 +33,11 @@ <h1>Tools</h1>
3333
<ng-template>
3434
<div>
3535
<clr-icon shape="angle" style="transform: rotate(90deg)"></clr-icon>
36-
<a href="/#" (click)="run('export-task')">Export task(s): Create a JSON file with the selected tasks</a>
36+
<a href="{{ baseApiUrl }}#" (click)="run('export-task')">Export task(s): Create a JSON file with the selected tasks</a>
3737
</div>
3838
<div [appRole]="['ROLE_CREATE']">
3939
<clr-icon shape="angle" style="transform: rotate(90deg)"></clr-icon>
40-
<a href="/#" (click)="run('import-task')">Import task(s): Import tasks from a JSON file</a>
40+
<a href="{{ baseApiUrl }}#" (click)="run('import-task')">Import task(s): Import tasks from a JSON file</a>
4141
</div>
4242
</ng-template>
4343
</app-view-card>

ui/src/app/manage/tools/tools.component.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {StreamExportComponent} from './stream/export.component';
55
import {StreamImportComponent} from './stream/import.component';
66
import {TaskExportComponent} from './task/export.component';
77
import {TaskImportComponent} from './task/import.component';
8+
import {UrlUtilities} from '../../url-utilities.service';
89

910
@Component({
1011
selector: 'app-tools',
@@ -21,6 +22,7 @@ export class ToolsComponent {
2122
taskImportModal: TaskImportComponent;
2223
@ViewChild('cleanupModal', {static: true})
2324
cleanupModal: CleanupComponent;
25+
baseApiUrl = UrlUtilities.calculateBaseApiUrl();
2426

2527
constructor(private notificationService: NotificationService) {}
2628

ui/src/app/shared/component/card/card.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="card dataflow-card" [class.active]="active">
22
<div class="card-header">
3-
<a href="/#" (click)="toggle()">
3+
<a href="{{ baseApiUrl }}#" (click)="toggle()">
44
<clr-icon class="icon" shape="angle"></clr-icon>
55
{{ titleModal }}
66
</a>

ui/src/app/shared/component/card/card.component.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {AfterContentInit, Component, ContentChild, EventEmitter, Input, Output, TemplateRef} from '@angular/core';
22
import get from 'lodash.get';
33
import {map, mergeMap} from 'rxjs/operators';
4-
import {SettingModel} from '../../model/setting.model';
54
import {ContextService} from '../../service/context.service';
65
import {ContextModel} from '../../model/context.model';
6+
import {UrlUtilities} from '../../../url-utilities.service';
77

88
@Component({
99
selector: 'app-view-card',
@@ -20,6 +20,7 @@ export class CardComponent implements AfterContentInit {
2020
@Output() onChange = new EventEmitter();
2121

2222
context: ContextModel[];
23+
baseApiUrl = UrlUtilities.calculateBaseApiUrl();
2324

2425
constructor(private contextService: ContextService) {}
2526

ui/src/logout-success-oauth.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<head>
44
<meta charset="utf-8">
55
<title>Spring Cloud Data Flow</title>
6-
<base href="/">
76
<meta name="viewport" content="width=device-width, initial-scale=1">
87
<link rel="icon" type="image/x-icon" href="favicon.ico">
98
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
@@ -36,6 +35,7 @@ <h4>
3635
provider. Therefore, going to the main Dashboard URL will log you back in,
3736
unless you also log out from your oauth provider.
3837
</p>
38+
</div>
3939
</div>
4040
</div>
4141
</body>

0 commit comments

Comments
 (0)