Fixed merge

This commit is contained in:
Giuseppe Digilio
2018-05-08 11:28:12 +02:00
parent f8b3cc516c
commit 5682c8146c
4 changed files with 12 additions and 12 deletions

View File

@@ -14,7 +14,7 @@ import {
import { hasValue, isEmpty, isNotEmpty, } from '../../../shared/empty.util'; import { hasValue, isEmpty, isNotEmpty, } from '../../../shared/empty.util';
import { SearchFilterConfig } from '../../search-service/search-filter-config.model'; import { SearchFilterConfig } from '../../search-service/search-filter-config.model';
import { SearchService } from '../../search-service/search.service'; import { SearchService } from '../../search-service/search.service';
import { RouteService } from '../../../shared/route.service'; import { RouteService } from '../../../shared/services/route.service';
import ObjectExpression from 'rollup/dist/typings/ast/nodes/ObjectExpression'; import ObjectExpression from 'rollup/dist/typings/ast/nodes/ObjectExpression';
import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model'; import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model';
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';

View File

@@ -12,14 +12,14 @@ import { AuthStatusResponse, ErrorResponse, RestResponse } from '../cache/respon
import { HttpOptions } from '../dspace-rest-v2/dspace-rest-v2.service'; import { HttpOptions } from '../dspace-rest-v2/dspace-rest-v2.service';
@Injectable() @Injectable()
export class AuthRequestService extends HALEndpointService { export class AuthRequestService {
protected linkName = 'authn'; protected linkName = 'authn';
protected browseEndpoint = ''; protected browseEndpoint = '';
constructor(protected responseCache: ResponseCacheService, constructor(@Inject(GLOBAL_CONFIG) protected EnvConfig: GlobalConfig,
protected requestService: RequestService, protected halService: HALEndpointService,
@Inject(GLOBAL_CONFIG) protected EnvConfig: GlobalConfig) { protected responseCache: ResponseCacheService,
super(); protected requestService: RequestService) {
} }
protected fetchRequest(request: RestRequest): Observable<any> { protected fetchRequest(request: RestRequest): Observable<any> {
@@ -42,7 +42,7 @@ export class AuthRequestService extends HALEndpointService {
} }
public postToEndpoint(method: string, body: any, options?: HttpOptions): Observable<any> { public postToEndpoint(method: string, body: any, options?: HttpOptions): Observable<any> {
return this.getEndpoint() return this.halService.getEndpoint(this.linkName)
.filter((href: string) => isNotEmpty(href)) .filter((href: string) => isNotEmpty(href))
.map((endpointURL) => this.getEndpointByMethod(endpointURL, method)) .map((endpointURL) => this.getEndpointByMethod(endpointURL, method))
.distinctUntilChanged() .distinctUntilChanged()
@@ -53,7 +53,7 @@ export class AuthRequestService extends HALEndpointService {
} }
public getRequest(method: string, options?: HttpOptions): Observable<any> { public getRequest(method: string, options?: HttpOptions): Observable<any> {
return this.getEndpoint() return this.halService.getEndpoint(this.linkName)
.filter((href: string) => isNotEmpty(href)) .filter((href: string) => isNotEmpty(href))
.map((endpointURL) => this.getEndpointByMethod(endpointURL, method)) .map((endpointURL) => this.getEndpointByMethod(endpointURL, method))
.distinctUntilChanged() .distinctUntilChanged()

View File

@@ -277,7 +277,7 @@ export class AuthService {
*/ */
public storeToken(token: AuthTokenInfo) { public storeToken(token: AuthTokenInfo) {
// Add 1 day to the current date // Add 1 day to the current date
const expireDate = Date.now() + (1000 * 60 * 60 * 24 * 1); const expireDate = Date.now() + (1000 * 60 * 60 * 24);
// Set the cookie expire date // Set the cookie expire date
const expires = new Date(expireDate); const expires = new Date(expireDate);
@@ -371,8 +371,8 @@ export class AuthService {
* Set redirect url * Set redirect url
*/ */
setRedirectUrl(url: string) { setRedirectUrl(url: string) {
// Add 1 day to the current date // Add 1 hour to the current date
const expireDate = Date.now() + (1000 * 60 * 60 * 24 * 1); const expireDate = Date.now() + (1000 * 60 * 60);
// Set the cookie expire date // Set the cookie expire date
const expires = new Date(expireDate); const expires = new Date(expireDate);

View File

@@ -95,7 +95,7 @@ export class HostWindowService {
isMobileView(): Observable<boolean> { isMobileView(): Observable<boolean> {
return this.getWidthObs() return this.getWidthObs()
.map((width) => width < GridBreakpoint.MD) .map((width) => width < GridBreakpoint.MD_MIN)
.distinctUntilChanged(); .distinctUntilChanged();
} }
} }