diff --git a/rest/pom.xml b/rest/pom.xml
index bcde72aaa..c56bb565b 100644
--- a/rest/pom.xml
+++ b/rest/pom.xml
@@ -1,19 +1,20 @@
- 4.0.0
- pro.taskana
- taskana-rest-parent
- 0.1.4-SNAPSHOT
- pom
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
+ pro.taskana
+ taskana-rest-parent
+ 0.1.4-SNAPSHOT
+ pom
- This pom is parent to all taskana rest modules and serves the common build.
+ This pom is parent to all taskana rest modules and serves the common build.
-
- 1.8
-
+
+ 1.8
+
-
- taskana-rest-spring
- taskana-rest-spring-example
-
+
+ taskana-rest-spring
+ ../web
+ taskana-rest-spring-example
+
diff --git a/rest/taskana-rest-spring-example/pom.xml b/rest/taskana-rest-spring-example/pom.xml
index 5a97c9e33..9f77a3502 100644
--- a/rest/taskana-rest-spring-example/pom.xml
+++ b/rest/taskana-rest-spring-example/pom.xml
@@ -52,7 +52,16 @@
h2
1.4.197
-
+
+
+ pro.taskana
+ taskana-web
+ ${project.version}
+
org.springframework.boot
@@ -60,7 +69,6 @@
test
-
@@ -69,4 +77,5 @@
+
diff --git a/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/controllers/ViewController.java b/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/controllers/ViewController.java
new file mode 100644
index 000000000..fec77dea9
--- /dev/null
+++ b/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/controllers/ViewController.java
@@ -0,0 +1,12 @@
+package pro.taskana.rest.controllers;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+public class ViewController {
+ @RequestMapping({ "/administration*/**", "/workplace*/**", "/monitor*/**" })
+ public String index() {
+ return "forward:/index.html";
+ }
+}
diff --git a/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/models/User.java b/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/models/User.java
new file mode 100644
index 000000000..8faf5081a
--- /dev/null
+++ b/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/models/User.java
@@ -0,0 +1,25 @@
+package pro.taskana.rest.models;
+
+public class User {
+
+ private String username;
+ private String password;
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+
+}
diff --git a/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/security/SampleLoginModule.java b/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/security/SampleLoginModule.java
index 039901085..ada436e6f 100644
--- a/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/security/SampleLoginModule.java
+++ b/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/security/SampleLoginModule.java
@@ -10,13 +10,14 @@ import javax.security.auth.callback.PasswordCallback;
import javax.security.auth.login.LoginException;
import javax.security.auth.spi.LoginModule;
+import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import pro.taskana.security.GroupPrincipal;
import pro.taskana.security.UserPrincipal;
/**
* TODO.
*/
-public class SampleLoginModule implements LoginModule {
+public class SampleLoginModule extends UsernamePasswordAuthenticationFilter implements LoginModule {
private NameCallback nameCallback;
@@ -24,6 +25,7 @@ public class SampleLoginModule implements LoginModule {
private Subject subject;
+
@Override
public boolean abort() throws LoginException {
return true;
diff --git a/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/security/WebSecurityConfig.java b/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/security/WebSecurityConfig.java
index bc81494a9..0d6e7893b 100644
--- a/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/security/WebSecurityConfig.java
+++ b/rest/taskana-rest-spring-example/src/main/java/pro/taskana/rest/security/WebSecurityConfig.java
@@ -1,5 +1,6 @@
package pro.taskana.rest.security;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -11,13 +12,16 @@ import org.springframework.security.authentication.jaas.JaasAuthenticationProvid
import org.springframework.security.authentication.jaas.JaasNameCallbackHandler;
import org.springframework.security.authentication.jaas.JaasPasswordCallbackHandler;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.web.jaasapi.JaasApiIntegrationFilter;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@@ -28,26 +32,43 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
+ @Value("${devMode}")
+ private boolean devMode;
+
@Override
protected void configure(HttpSecurity http) throws Exception {
+
http.csrf()
- .disable()
- .authenticationProvider(jaasAuthProvider())
- .authorizeRequests()
- .antMatchers(HttpMethod.GET, "/**")
- .authenticated()
- .and()
- .httpBasic()
- .and()
- .addFilter(new JaasApiIntegrationFilter());
+ .disable()
+ .authenticationProvider(jaasAuthProvider())
+ .authorizeRequests()
+ .antMatchers(HttpMethod.GET, "/**")
+ .authenticated()
+ .and()
+ .httpBasic()
+ .and()
+ .addFilter(new JaasApiIntegrationFilter());
+
+ if (devMode) {
+ return;
+ }
+ http
+ .authorizeRequests()
+ .anyRequest().authenticated()
+ .and()
+ .formLogin()
+ .permitAll()
+ .and()
+ .logout()
+ .permitAll();
}
@Bean
public JaasAuthenticationProvider jaasAuthProvider() {
JaasAuthenticationProvider authenticationProvider = new JaasAuthenticationProvider();
- authenticationProvider.setAuthorityGranters(new AuthorityGranter[] {new SampleRoleGranter()});
- authenticationProvider.setCallbackHandlers(new JaasAuthenticationCallbackHandler[] {
- new JaasNameCallbackHandler(), new JaasPasswordCallbackHandler()});
+ authenticationProvider.setAuthorityGranters(new AuthorityGranter[]{new SampleRoleGranter()});
+ authenticationProvider.setCallbackHandlers(new JaasAuthenticationCallbackHandler[]{
+ new JaasNameCallbackHandler(), new JaasPasswordCallbackHandler()});
authenticationProvider.setLoginContextName("taskana");
authenticationProvider.setLoginConfig(new ClassPathResource("pss_jaas.config"));
return authenticationProvider;
@@ -72,6 +93,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
config.addAllowedOrigin("*");
config.addAllowedHeader("*");
config.addAllowedMethod("*");
+ config.addAllowedMethod("POST");
source.registerCorsConfiguration("/**", config);
FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
bean.setOrder(0);
diff --git a/rest/taskana-rest-spring-example/src/main/resources/application.properties b/rest/taskana-rest-spring-example/src/main/resources/application.properties
index fac752926..79b9d9cd7 100644
--- a/rest/taskana-rest-spring-example/src/main/resources/application.properties
+++ b/rest/taskana-rest-spring-example/src/main/resources/application.properties
@@ -4,3 +4,4 @@ datasource.url=jdbc:h2:mem:taskana;IGNORECASE=TRUE;LOCK_MODE=0;INIT=CREATE SCHEM
datasource.driverClassName=org.h2.Driver
datasource.username=sa
datasource.password=sa
+devMode=false
\ No newline at end of file
diff --git a/rest/taskana-rest-spring-example/src/main/resources/templates/customlogin.html b/rest/taskana-rest-spring-example/src/main/resources/templates/customlogin.html
new file mode 100644
index 000000000..93fe839e4
--- /dev/null
+++ b/rest/taskana-rest-spring-example/src/main/resources/templates/customlogin.html
@@ -0,0 +1,27 @@
+
+
+ Custom Login Page
+
+
+
+
+
\ No newline at end of file
diff --git a/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/ClassificationControllerIntTest.java b/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/ClassificationControllerIntTest.java
index f7dee0ac1..3cacfb5c6 100644
--- a/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/ClassificationControllerIntTest.java
+++ b/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/ClassificationControllerIntTest.java
@@ -39,7 +39,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import pro.taskana.rest.resource.ClassificationSummaryResource;
@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
+@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = {"devMode=true"})
@Import(RestConfiguration.class)
public class ClassificationControllerIntTest {
diff --git a/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/TaskControllerIntTest.java b/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/TaskControllerIntTest.java
index fca416a2a..e15cfcc54 100644
--- a/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/TaskControllerIntTest.java
+++ b/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/TaskControllerIntTest.java
@@ -43,7 +43,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import pro.taskana.rest.resource.TaskSummaryResource;
@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
+@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = {"devMode=true"})
@Import(RestConfiguration.class)
public class TaskControllerIntTest {
diff --git a/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/TaskanaEngineControllerIntTest.java b/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/TaskanaEngineControllerIntTest.java
index e2d3695d1..fafae2556 100644
--- a/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/TaskanaEngineControllerIntTest.java
+++ b/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/TaskanaEngineControllerIntTest.java
@@ -32,7 +32,7 @@ import pro.taskana.TaskanaRole;
import pro.taskana.rest.resource.TaskanaUserInfoResource;
@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
+@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = {"devMode=true"})
@Import(RestConfiguration.class)
public class TaskanaEngineControllerIntTest {
diff --git a/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/WorkbasketControllerIntTest.java b/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/WorkbasketControllerIntTest.java
index 9b4064f1c..2daa41590 100644
--- a/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/WorkbasketControllerIntTest.java
+++ b/rest/taskana-rest-spring-example/src/test/java/pro/taskana/rest/WorkbasketControllerIntTest.java
@@ -40,7 +40,7 @@ import pro.taskana.rest.resource.DistributionTargetResource;
import pro.taskana.rest.resource.WorkbasketSummaryResource;
@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
+@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = {"devMode=true"})
@Import(RestConfiguration.class)
public class WorkbasketControllerIntTest {
diff --git a/web/package-lock.json b/web/package-lock.json
index 64ae6775b..27da3c403 100644
--- a/web/package-lock.json
+++ b/web/package-lock.json
@@ -1221,7 +1221,17 @@
"boom": {
"version": "2.10.1",
"resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz",
- "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8="
+ "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=",
+ "requires": {
+ "hoek": "2.16.3"
+ },
+ "dependencies": {
+ "hoek": {
+ "version": "2.16.3",
+ "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
+ "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0="
+ }
+ }
},
"bootstrap": {
"version": "3.3.7",
@@ -5168,7 +5178,15 @@
"requires": {
"boom": "2.10.1",
"cryptiles": "2.0.5",
+ "hoek": "2.16.3",
"sntp": "1.0.9"
+ },
+ "dependencies": {
+ "hoek": {
+ "version": "2.16.3",
+ "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
+ "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0="
+ }
}
},
"he": {
@@ -10004,7 +10022,17 @@
"sntp": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz",
- "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg="
+ "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=",
+ "requires": {
+ "hoek": "2.16.3"
+ },
+ "dependencies": {
+ "hoek": {
+ "version": "2.16.3",
+ "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
+ "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0="
+ }
+ }
},
"socket.io": {
"version": "2.0.4",
diff --git a/web/src/app/administration/administration-routing.module.ts b/web/src/app/administration/administration-routing.module.ts
index 5268f4cf2..dcd809a91 100644
--- a/web/src/app/administration/administration-routing.module.ts
+++ b/web/src/app/administration/administration-routing.module.ts
@@ -41,7 +41,7 @@ const routes: Routes = [
{
path: 'classifications',
component: MasterAndDetailComponent,
- canActivate: [DomainGuard],
+ canActivate: [DomainGuard],
children: [
{
path: '',
diff --git a/web/src/app/administration/administration.module.ts b/web/src/app/administration/administration.module.ts
index d347cfdc9..7abeb9776 100644
--- a/web/src/app/administration/administration.module.ts
+++ b/web/src/app/administration/administration.module.ts
@@ -3,7 +3,6 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { Ng2AutoCompleteModule } from 'ng2-auto-complete';
-import { HttpClientModule } from '@angular/common/http';
import { AngularSvgIconModule } from 'angular-svg-icon';
import { AlertModule } from 'ngx-bootstrap';
import { SharedModule } from 'app/shared/shared.module';
@@ -45,11 +44,10 @@ const MODULES = [
CommonModule,
FormsModule,
Ng2AutoCompleteModule,
- HttpClientModule,
AngularSvgIconModule,
AlertModule,
SharedModule,
- AdministrationRoutingModule,
+ AdministrationRoutingModule
];
const DECLARATIONS = [
diff --git a/web/src/app/administration/services/classification-categories-service/classification-categories.service.ts b/web/src/app/administration/services/classification-categories-service/classification-categories.service.ts
index ce3e40c6e..7fc7cb886 100644
--- a/web/src/app/administration/services/classification-categories-service/classification-categories.service.ts
+++ b/web/src/app/administration/services/classification-categories-service/classification-categories.service.ts
@@ -4,23 +4,19 @@ import { Injectable } from '@angular/core';
import { environment } from 'environments/environment';
import { Observable } from 'rxjs/Observable';
import { ReplaySubject } from 'rxjs/ReplaySubject';
+
@Injectable()
export class ClassificationCategoriesService {
private url = environment.taskanaRestUrl + '/v1/classification-categories';
- httpOptions = {
- headers: new HttpHeaders({
- 'Content-Type': 'application/json',
- 'Authorization': 'Basic VEVBTUxFQURfMTpURUFNTEVBRF8x'
- })
- };
private dataObs$ = new ReplaySubject>(1);
- constructor(private httpClient: HttpClient) { }
+ constructor(
+ private httpClient: HttpClient) { }
getCategories(forceRefresh = false): Observable> {
if (!this.dataObs$.observers.length || forceRefresh) {
- this.httpClient.get>(this.url, this.httpOptions).subscribe(
+ this.httpClient.get>(this.url).subscribe(
data => this.dataObs$.next(data),
error => {
this.dataObs$.error(error);
diff --git a/web/src/app/administration/services/classification-definition/classification-definition.service.ts b/web/src/app/administration/services/classification-definition/classification-definition.service.ts
index 41dc28d9b..0f8bc9b17 100644
--- a/web/src/app/administration/services/classification-definition/classification-definition.service.ts
+++ b/web/src/app/administration/services/classification-definition/classification-definition.service.ts
@@ -11,21 +11,16 @@ import { TaskanaDate } from 'app/shared/util/taskana.date';
export class ClassificationDefinitionService {
url = environment.taskanaRestUrl + '/v1/classificationdefinitions';
-
- httpOptions = {
- headers: new HttpHeaders({
- 'Content-Type': 'application/json',
- 'Authorization': 'Basic VEVBTUxFQURfMTpURUFNTEVBRF8x'
- })
- };
-
- constructor(private httpClient: HttpClient, private alertService: AlertService) {
+ constructor(
+ private httpClient: HttpClient,
+ private alertService: AlertService
+ ) {
}
// GET
exportClassifications(domain: string) {
domain = (domain === '' ? '' : '?domain=' + domain);
- this.httpClient.get(this.url + domain, this.httpOptions)
+ this.httpClient.get(this.url + domain)
.subscribe(
response => saveAs(new Blob([JSON.stringify(response)], { type: 'text/plain;charset=utf-8' }),
'Classifications_' + TaskanaDate.getDate() + '.json')
@@ -36,7 +31,7 @@ export class ClassificationDefinitionService {
// TODO handle error
importClassifications(classifications: any) {
this.httpClient.post(this.url + '/import',
- JSON.parse(classifications), this.httpOptions).subscribe(
+ JSON.parse(classifications)).subscribe(
classificationsUpdated => this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, 'Import was successful')),
error => this.alertService.triggerAlert(new AlertModel(AlertType.DANGER, 'Import was not successful'))
);
diff --git a/web/src/app/administration/services/classification-types/classification-types.service.ts b/web/src/app/administration/services/classification-types/classification-types.service.ts
index 8b4b8beb7..d4ba39341 100644
--- a/web/src/app/administration/services/classification-types/classification-types.service.ts
+++ b/web/src/app/administration/services/classification-types/classification-types.service.ts
@@ -9,22 +9,17 @@ import { ReplaySubject } from 'rxjs/ReplaySubject';
@Injectable()
export class ClassificationTypesService {
private url = environment.taskanaRestUrl + '/v1/classification-types';
- httpOptions = {
- headers: new HttpHeaders({
- 'Content-Type': 'application/json',
- 'Authorization': 'Basic VEVBTUxFQURfMTpURUFNTEVBRF8x'
- })
- };
private classificationTypeSelectedValue = 'TASK';
private classificationTypeSelected = new BehaviorSubject(this.classificationTypeSelectedValue);
private dataObs$ = new ReplaySubject>(1);
- constructor(private httpClient: HttpClient) { }
+ constructor(private httpClient: HttpClient
+ ) { }
getClassificationTypes(forceRefresh = false): Observable> {
if (!this.dataObs$.observers.length || forceRefresh) {
- this.httpClient.get>(this.url, this.httpOptions).subscribe(
+ this.httpClient.get>(this.url).subscribe(
data => this.dataObs$.next(data),
error => {
this.dataObs$.error(error);
diff --git a/web/src/app/administration/services/classifications/classifications.service.ts b/web/src/app/administration/services/classifications/classifications.service.ts
index cd944ad04..a48e0d246 100644
--- a/web/src/app/administration/services/classifications/classifications.service.ts
+++ b/web/src/app/administration/services/classifications/classifications.service.ts
@@ -22,13 +22,6 @@ export class ClassificationsService {
private classificationSelected = new Subject();
private classificationSaved = new Subject();
- httpOptions = {
- headers: new HttpHeaders({
- 'Content-Type': 'application/json',
- 'Authorization': 'Basic VEVBTUxFQURfMTpURUFNTEVBRF8x'
- })
- };
-
private classificationTypes: Array;
constructor(
@@ -42,8 +35,7 @@ export class ClassificationsService {
return this.domainService.getSelectedDomain().mergeMap(domain => {
const classificationTypes = this.classificationTypeService.getSelectedClassificationType();
return this.getClassificationObservable(this.httpClient.get(
- `${environment.taskanaRestUrl}/v1/classifications/?domain=${domain}`,
- this.httpOptions));
+ `${environment.taskanaRestUrl}/v1/classifications/?domain=${domain}`));
}).do(() => {
this.domainService.domainChangedComplete();
@@ -52,7 +44,7 @@ export class ClassificationsService {
// GET
getClassification(id: string): Observable {
- return this.httpClient.get(`${environment.taskanaRestUrl}/v1/classifications/${id}`, this.httpOptions)
+ return this.httpClient.get(`${environment.taskanaRestUrl}/v1/classifications/${id}`)
.do((classification: ClassificationDefinition) => {
if (classification) {
this.classificationTypeService.selectClassificationType(classification.type);
@@ -63,18 +55,17 @@ export class ClassificationsService {
// POST
postClassification(classification: Classification): Observable {
- return this.httpClient.post(`${environment.taskanaRestUrl}/v1/classifications`, classification,
- this.httpOptions);
+ return this.httpClient.post(`${environment.taskanaRestUrl}/v1/classifications`, classification);
}
// PUT
putClassification(url: string, classification: Classification): Observable {
- return this.httpClient.put(url, classification, this.httpOptions);
+ return this.httpClient.put(url, classification);
}
// DELETE
deleteClassification(url: string): Observable {
- return this.httpClient.delete(url, this.httpOptions);
+ return this.httpClient.delete(url);
}
// #region "Service extras"
diff --git a/web/src/app/administration/services/workbasket-definition/workbasket-definition.service.ts b/web/src/app/administration/services/workbasket-definition/workbasket-definition.service.ts
index e52845455..11fe5ea55 100644
--- a/web/src/app/administration/services/workbasket-definition/workbasket-definition.service.ts
+++ b/web/src/app/administration/services/workbasket-definition/workbasket-definition.service.ts
@@ -1,37 +1,29 @@
-import {Injectable} from '@angular/core';
-import {HttpClient, HttpHeaders} from '@angular/common/http';
-import {environment} from 'app/../environments/environment';
-import {saveAs} from 'file-saver/FileSaver';
-import {AlertService} from 'app/services/alert/alert.service';
-import {WorkbasketDefinition} from 'app/models/workbasket-definition';
-import {AlertModel, AlertType} from 'app/models/alert';
-import {TaskanaDate} from 'app/shared/util/taskana.date';
-import {ErrorModel} from 'app/models/modal-error';
-import {ErrorModalService} from 'app/services/errorModal/error-modal.service';
+import { Injectable } from '@angular/core';
+import { HttpClient, HttpHeaders } from '@angular/common/http';
+import { environment } from 'app/../environments/environment';
+import { saveAs } from 'file-saver/FileSaver';
+import { AlertService } from 'app/services/alert/alert.service';
+import { WorkbasketDefinition } from 'app/models/workbasket-definition';
+import { AlertModel, AlertType } from 'app/models/alert';
+import { TaskanaDate } from 'app/shared/util/taskana.date';
+import { ErrorModel } from 'app/models/modal-error';
+import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
@Injectable()
export class WorkbasketDefinitionService {
url: string = environment.taskanaRestUrl + '/v1/workbasketdefinitions';
- httpOptions = {
- headers: new HttpHeaders({
- 'Content-Type': 'application/json',
- 'Authorization': 'Basic VEVBTUxFQURfMTpURUFNTEVBRF8x'
- })
- };
-
-
constructor(private httpClient: HttpClient, private alertService: AlertService,
- private errorModalService: ErrorModalService) {
- }
+ private errorModalService: ErrorModalService) {
+ }
// GET
exportWorkbaskets(domain: string) {
domain = (domain === '' ? '' : '?domain=' + domain);
- this.httpClient.get(this.url + domain, this.httpOptions).subscribe(
+ this.httpClient.get(this.url + domain).subscribe(
response => {
- saveAs(new Blob([JSON.stringify(response)], {type: 'text/plain;charset=utf-8'}),
+ saveAs(new Blob([JSON.stringify(response)], { type: 'text/plain;charset=utf-8' }),
'Workbaskets_' + TaskanaDate.getDate() + '.json');
}
);
@@ -40,10 +32,10 @@ export class WorkbasketDefinitionService {
// POST
importWorkbasketDefinitions(workbasketDefinitions: any) {
this.httpClient.post(environment.taskanaRestUrl + '/v1/workbasketdefinitions/import',
- JSON.parse(workbasketDefinitions), this.httpOptions).subscribe(
- workbasketsUpdated => this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, 'Import was successful')),
- error => this.errorModalService.triggerError(new ErrorModel(
- `There was an error importing workbaskets`, error.message))
- );
+ JSON.parse(workbasketDefinitions)).subscribe(
+ workbasketsUpdated => this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, 'Import was successful')),
+ error => this.errorModalService.triggerError(new ErrorModel(
+ `There was an error importing workbaskets`, error.message))
+ );
}
}
diff --git a/web/src/app/administration/services/workbasket/workbasket.service.ts b/web/src/app/administration/services/workbasket/workbasket.service.ts
index 8b6c9b6cf..ce5bc11b6 100644
--- a/web/src/app/administration/services/workbasket/workbasket.service.ts
+++ b/web/src/app/administration/services/workbasket/workbasket.service.ts
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
-import { HttpClient, HttpHeaders } from '@angular/common/http';
+import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { environment } from 'app/../environments/environment';
@@ -43,12 +43,6 @@ export class WorkbasketService {
// Domain
readonly DOMAIN = 'domain';
- httpOptions = {
- headers: new HttpHeaders({
- 'Content-Type': 'application/json',
- 'Authorization': 'Basic VEVBTUxFQURfMTpURUFNTEVBRF8x'
- })
- };
page = 1;
pageSize = 9;
@@ -86,7 +80,7 @@ export class WorkbasketService {
`${environment.taskanaRestUrl}/v1/workbaskets/${this.getWorkbasketSummaryQueryParameters(
sortBy, order, name,
nameLike, descLike, owner, ownerLike, type, key, keyLike, requiredPermission,
- !allPages ? this.page : undefined, !allPages ? this.pageSize : undefined, domain)}`, this.httpOptions)
+ !allPages ? this.page : undefined, !allPages ? this.pageSize : undefined, domain)}`)
.do(workbaskets => {
return workbaskets;
});
@@ -96,51 +90,50 @@ export class WorkbasketService {
}
// GET
getWorkBasket(id: string): Observable {
- return this.httpClient.get(`${environment.taskanaRestUrl}/v1/workbaskets/${id}`, this.httpOptions);
+ return this.httpClient.get(`${environment.taskanaRestUrl}/v1/workbaskets/${id}`);
}
// POST
createWorkbasket(workbasket: Workbasket): Observable {
return this.httpClient
- .post(`${environment.taskanaRestUrl}/v1/workbaskets`, workbasket, this.httpOptions);
+ .post(`${environment.taskanaRestUrl}/v1/workbaskets`, workbasket);
}
// PUT
updateWorkbasket(url: string, workbasket: Workbasket): Observable {
return this.httpClient
- .put(url, workbasket, this.httpOptions)
+ .put(url, workbasket)
.catch(this.handleError);
}
// DELETE
deleteWorkbasket(url: string) {
- return this.httpClient.delete(url, this.httpOptions);
+ return this.httpClient.delete(url);
}
// GET
getWorkBasketAccessItems(url: string): Observable {
- return this.httpClient.get(url, this.httpOptions);
+ return this.httpClient.get(url);
}
// POST
createWorkBasketAccessItem(url: string, workbasketAccessItem: WorkbasketAccessItems): Observable {
- return this.httpClient.post(url, workbasketAccessItem, this.httpOptions);
+ return this.httpClient.post(url, workbasketAccessItem);
}
// PUT
updateWorkBasketAccessItem(url: string, workbasketAccessItem: Array): Observable {
return this.httpClient.put(url,
- workbasketAccessItem,
- this.httpOptions);
+ workbasketAccessItem);
}
// GET
getWorkBasketsDistributionTargets(url: string): Observable {
- return this.httpClient.get(url, this.httpOptions);
+ return this.httpClient.get(url);
}
// PUT
updateWorkBasketsDistributionTargets(url: string, distributionTargetsIds: Array):
Observable {
- return this.httpClient.put(url, distributionTargetsIds, this.httpOptions);
+ return this.httpClient.put(url, distributionTargetsIds);
}
// DELETE
removeDistributionTarget(url: string) {
- return this.httpClient.delete(url, this.httpOptions);
+ return this.httpClient.delete(url);
}
@@ -214,5 +207,6 @@ export class WorkbasketService {
return Observable.throw(errMsg);
}
+
// #endregion
}
diff --git a/web/src/app/administration/workbasket/details/workbasket-details.component.html b/web/src/app/administration/workbasket/details/workbasket-details.component.html
index c83676a5e..747b75d2f 100644
--- a/web/src/app/administration/workbasket/details/workbasket-details.component.html
+++ b/web/src/app/administration/workbasket/details/workbasket-details.component.html
@@ -1,6 +1,6 @@