feature/835 add support for deploying taskana web app on a relative path
This commit is contained in:
parent
1fc1c92c75
commit
f34aeaae77
|
@ -171,7 +171,11 @@
|
|||
<artifactId>spring-ldap-core</artifactId>
|
||||
<version>${spring.ldap.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
Since taskana-web packs its content in /static, we do not have to unpack it again.
|
||||
However, when any local change has to be done to that folder you have to copy
|
||||
target/classes/static manually from taskana-web.
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-web</artifactId>
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
@Controller
|
||||
public class ViewController {
|
||||
|
||||
@RequestMapping({"", "/administration*/**", "/workplace*/**", "/monitor*/**", "/history*/**", "/no-role*/**"})
|
||||
@RequestMapping({"", "taskana/**"})
|
||||
public String index() {
|
||||
return "forward:/index.html";
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"taskanaRestUrl": ""
|
||||
"taskanaRestUrl": ""
|
||||
}
|
||||
|
|
|
@ -98,16 +98,7 @@
|
|||
<version>9.4.1212</version>
|
||||
</dependency>
|
||||
-->
|
||||
<!--
|
||||
Since taskana-web packs its content in /static, we do not have to unpack it again.
|
||||
However, when any local change has to be done to that folder you have to copy
|
||||
target/classes/static manually from taskana-web.
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-web</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-core</artifactId>
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
taskana {
|
||||
pro.taskana.rest.security.SampleLoginModule required;
|
||||
};
|
|
@ -41,7 +41,6 @@ import pro.taskana.sampledata.SampleDataGenerator;
|
|||
*/
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
@ComponentScan(basePackages = "pro.taskana")
|
||||
@Import({TransactionalJobsConfiguration.class, LdapConfiguration.class, RestConfiguration.class, WebMvcConfig.class})
|
||||
public class TaskanaWildFlyApplication extends SpringBootServletInitializer {
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"taskanaRestUrl": "http://localhost:8080/web-application/other-route"
|
||||
}
|
|
@ -3,5 +3,5 @@
|
|||
xmlns="http://www.jboss.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_7_2.xsd">
|
||||
<context-root>/</context-root>
|
||||
<context-root>/web-application/other-route</context-root>
|
||||
</jboss-web>
|
|
@ -9,39 +9,46 @@ import { NoAccessComponent } from './components/no-access/no-access.component';
|
|||
|
||||
const appRoutes: Routes = [
|
||||
{
|
||||
canActivate: [BusinessAdminGuard],
|
||||
path: 'administration',
|
||||
loadChildren: './administration/administration.module#AdministrationModule',
|
||||
path: 'taskana',
|
||||
children: [
|
||||
{
|
||||
canActivate: [BusinessAdminGuard],
|
||||
path: 'administration',
|
||||
loadChildren: './administration/administration.module#AdministrationModule',
|
||||
},
|
||||
{
|
||||
canActivate: [MonitorGuard],
|
||||
path: 'monitor',
|
||||
loadChildren: './monitor/monitor.module#MonitorModule',
|
||||
},
|
||||
{
|
||||
canActivate: [UserGuard],
|
||||
path: 'workplace',
|
||||
loadChildren: './workplace/workplace.module#WorkplaceModule'
|
||||
},
|
||||
{
|
||||
canActivate: [HistoryGuard],
|
||||
path: 'history',
|
||||
loadChildren: './history/history.module#HistoryModule'
|
||||
},
|
||||
{
|
||||
path: 'no-role',
|
||||
component: NoAccessComponent
|
||||
},
|
||||
{
|
||||
path: 'administration',
|
||||
redirectTo: 'administration/workbaskets',
|
||||
},
|
||||
{
|
||||
path: '**',
|
||||
redirectTo: 'workplace'
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
canActivate: [MonitorGuard],
|
||||
path: 'monitor',
|
||||
loadChildren: './monitor/monitor.module#MonitorModule',
|
||||
},
|
||||
{
|
||||
canActivate: [UserGuard],
|
||||
path: 'workplace',
|
||||
loadChildren: './workplace/workplace.module#WorkplaceModule'
|
||||
},
|
||||
{
|
||||
canActivate: [HistoryGuard],
|
||||
path: 'history',
|
||||
loadChildren: './history/history.module#HistoryModule'
|
||||
},
|
||||
{
|
||||
path: 'no-role',
|
||||
component: NoAccessComponent
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
redirectTo: 'workplace',
|
||||
pathMatch: 'full'
|
||||
},
|
||||
{
|
||||
path: 'administration',
|
||||
redirectTo: 'administration/workbaskets',
|
||||
}
|
||||
|
||||
{
|
||||
path: '**',
|
||||
redirectTo: 'taskana/workplace'
|
||||
},
|
||||
];
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
|
|
@ -50,7 +50,6 @@ import { DomainGuard } from './guards/domain.guard';
|
|||
import { BusinessAdminGuard } from './guards/business-admin.guard';
|
||||
import { MonitorGuard } from './guards/monitor.guard';
|
||||
import { UserGuard } from './guards/user.guard';
|
||||
import { APP_BASE_HREF } from '@angular/common';
|
||||
|
||||
|
||||
const MODULES = [
|
||||
|
@ -86,7 +85,6 @@ export function startupServiceFactory(startupService: StartupService): () => Pro
|
|||
imports: MODULES,
|
||||
providers: [
|
||||
WindowRefService,
|
||||
{ provide: APP_BASE_HREF, useValue: '/' },
|
||||
DomainService,
|
||||
GeneralModalService,
|
||||
RequestInProgressService,
|
||||
|
@ -111,7 +109,7 @@ export function startupServiceFactory(startupService: StartupService): () => Pro
|
|||
TaskanaEngineService,
|
||||
RemoveConfirmationService,
|
||||
FormsValidatorService,
|
||||
UploadService
|
||||
UploadService,
|
||||
],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
|
|
|
@ -45,18 +45,18 @@
|
|||
<div class="nav-content">
|
||||
<taskana-user-information></taskana-user-information>
|
||||
<div *ngIf="administrationAccess" class="row menu">
|
||||
<span (click)="toogleNavBar()" routerLink="administration/workbaskets" aria-controls="administration"
|
||||
<span (click)="toogleNavBar()" routerLink="taskana/administration/workbaskets" aria-controls="administration"
|
||||
routerLinkActive="active">Administration</span>
|
||||
<div class="row submenu" [ngClass]="{'selected': selectedRoute.indexOf('workbaskets') !== -1 }">
|
||||
<span (click)="toogleNavBar()" class="col-xs-6" routerLink="administration/workbaskets" aria-controls="Workbaskets"
|
||||
<span (click)="toogleNavBar()" class="col-xs-6" routerLink="taskana/administration/workbaskets" aria-controls="Workbaskets"
|
||||
routerLinkActive="active">Workbaskets</span>
|
||||
</div>
|
||||
<div class="row submenu" [ngClass]="{'selected': selectedRoute.indexOf('classifications') !== -1}">
|
||||
<span (click)="toogleNavBar()" class="col-xs-6" routerLink="administration/classifications" aria-controls="Classifications"
|
||||
<span (click)="toogleNavBar()" class="col-xs-6" routerLink="taskana/administration/classifications" aria-controls="Classifications"
|
||||
routerLinkActive="active">Classifications</span>
|
||||
</div>
|
||||
<div class="row submenu" [ngClass]="{'selected': selectedRoute.indexOf('access-items-management') !== -1}">
|
||||
<span (click)="toogleNavBar()" class="col-xs-6" routerLink="administration/access-items-management"
|
||||
<span (click)="toogleNavBar()" class="col-xs-6" routerLink="taskana/administration/access-items-management"
|
||||
aria-controls="Access items" routerLinkActive="active">Access items</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -75,4 +75,4 @@
|
|||
</div>
|
||||
</div>
|
||||
<div *ngIf="showNavbar" class="backdrop" (click)="toogleNavBar()"></div>
|
||||
</nav>
|
||||
</nav>
|
||||
|
|
|
@ -33,10 +33,10 @@ export class NavBarComponent implements OnInit, OnDestroy {
|
|||
selectedDomain: string;
|
||||
version: string;
|
||||
|
||||
adminUrl = './administration';
|
||||
monitorUrl = './monitor';
|
||||
workplaceUrl = './workplace';
|
||||
historyUrl = './history';
|
||||
adminUrl = 'taskana/administration';
|
||||
monitorUrl = 'taskana/monitor';
|
||||
workplaceUrl = 'taskana/workplace';
|
||||
historyUrl = 'taskana/history';
|
||||
|
||||
administrationAccess = false;
|
||||
monitorAccess = false;
|
||||
|
|
|
@ -27,12 +27,12 @@ export class StartupService {
|
|||
).then(
|
||||
() => this.taskanaEngineService.getUserInformation()
|
||||
).catch(error => {
|
||||
this.window.nativeWindow.location.href = environment.taskanaRestUrl + '/login';
|
||||
this.window.nativeWindow.location.href = environment.taskanaRestUrl + '/login';
|
||||
});
|
||||
}
|
||||
|
||||
getEnvironmentFilePromise() {
|
||||
return this.httpClient.get<any>('/environments/data-sources/environment-information.json').pipe(map(jsonFile => {
|
||||
return this.httpClient.get<any>('environments/data-sources/environment-information.json').pipe(map(jsonFile => {
|
||||
if (jsonFile && environment.taskanaRestUrl === '') {
|
||||
environment.taskanaRestUrl = jsonFile.taskanaRestUrl === '' ?
|
||||
window.location.protocol + '//' + window.location.host : jsonFile.taskanaRestUrl;
|
||||
|
|
|
@ -4,12 +4,23 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Taskana</title>
|
||||
<base href="/">
|
||||
<base href="/" id="baseHref">
|
||||
<!--This is used for change the base Href of the application, if the application is not located at / folder it will change the href path to whatever precedes to taskana in the url
|
||||
for instance if the application is running at http://localhost:8080/some-path/taskana, the href will be some-path-->
|
||||
<script>
|
||||
(function () {
|
||||
const hrefUrl = window.location.pathname.split('taskana')[0];
|
||||
document.getElementById('baseHref').href =
|
||||
window.location.port != 4200 ?
|
||||
hrefUrl :
|
||||
"/";
|
||||
})();
|
||||
</script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" type="image/x-icon" href="assets/icons/taskana.png">
|
||||
</head>
|
||||
<body>
|
||||
<taskana-root></taskana-root>
|
||||
<taskana-root></taskana-root>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue