mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Fixed errors after upgrade to angular 7
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { DynamicInputModel, DynamicTextAreaModel } from '@ng-dynamic-forms/core';
|
||||
import { DynamicFormControlModel } from '@ng-dynamic-forms/core/src/model/dynamic-form-control.model';
|
||||
import { DynamicFormControlModel, DynamicInputModel, DynamicTextAreaModel } from '@ng-dynamic-forms/core';
|
||||
import { Collection } from '../../core/shared/collection.model';
|
||||
import { ComColFormComponent } from '../../shared/comcol-forms/comcol-form/comcol-form.component';
|
||||
import { NormalizedCollection } from '../../core/cache/models/normalized-collection.model';
|
||||
|
||||
/**
|
||||
* Form used for creating and editing collections
|
||||
|
@@ -1,8 +1,6 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { DynamicInputModel, DynamicTextAreaModel } from '@ng-dynamic-forms/core';
|
||||
import { DynamicFormControlModel } from '@ng-dynamic-forms/core/src/model/dynamic-form-control.model';
|
||||
import { DynamicFormControlModel, DynamicInputModel, DynamicTextAreaModel } from '@ng-dynamic-forms/core';
|
||||
import { Community } from '../../core/shared/community.model';
|
||||
import { ResourceType } from '../../core/shared/resource-type';
|
||||
import { ComColFormComponent } from '../../shared/comcol-forms/comcol-form/comcol-form.component';
|
||||
|
||||
/**
|
||||
|
@@ -312,7 +312,7 @@ export class CommunityListService {
|
||||
|
||||
hasColls$ = this.collectionDataService.findByParent(community.uuid, { elementsPerPage: 1 })
|
||||
.pipe(
|
||||
filter((rd: RemoteData<PaginatedList<Community>>) => rd.hasSucceeded),
|
||||
filter((rd: RemoteData<PaginatedList<Collection>>) => rd.hasSucceeded),
|
||||
take(1),
|
||||
map((results) => results.payload.totalElements > 0),
|
||||
);
|
||||
@@ -320,8 +320,8 @@ export class CommunityListService {
|
||||
let hasChildren$: Observable<boolean>;
|
||||
hasChildren$ = observableCombineLatest(hasSubcoms$, hasColls$).pipe(
|
||||
take(1),
|
||||
map((result: [boolean]) => {
|
||||
if (result[0] || result[1]) {
|
||||
map(([hasSubcoms, hasColls]: [boolean, boolean]) => {
|
||||
if (hasSubcoms || hasColls) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@@ -5,7 +5,6 @@ import { RequestService } from './request.service';
|
||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||
import { NormalizedObjectBuildService } from '../cache/builders/normalized-object-build.service';
|
||||
import { createSelector, select, Store } from '@ngrx/store';
|
||||
import { CoreState } from '../core.reducers';
|
||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
@@ -43,7 +42,7 @@ export class BitstreamFormatDataService extends DataService<BitstreamFormat> {
|
||||
protected requestService: RequestService,
|
||||
protected rdbService: RemoteDataBuildService,
|
||||
protected dataBuildService: NormalizedObjectBuildService,
|
||||
protected store: Store<CoreState>,
|
||||
protected store: Store<AppState>,
|
||||
protected objectCache: ObjectCacheService,
|
||||
protected halService: HALEndpointService,
|
||||
protected notificationsService: NotificationsService,
|
||||
@@ -55,6 +54,7 @@ export class BitstreamFormatDataService extends DataService<BitstreamFormat> {
|
||||
/**
|
||||
* Get the endpoint for browsing bitstream formats
|
||||
* @param {FindListOptions} options
|
||||
* @param {string} linkPath
|
||||
* @returns {Observable<string>}
|
||||
*/
|
||||
getBrowseEndpoint(options: FindListOptions = {}, linkPath?: string): Observable<string> {
|
||||
@@ -99,7 +99,7 @@ export class BitstreamFormatDataService extends DataService<BitstreamFormat> {
|
||||
|
||||
/**
|
||||
* Create a new BitstreamFormat
|
||||
* @param BitstreamFormat
|
||||
* @param {BitstreamFormat} bitstreamFormat
|
||||
*/
|
||||
public createBitstreamFormat(bitstreamFormat: BitstreamFormat): Observable<RestResponse> {
|
||||
const requestId = this.requestService.generateRequestId();
|
||||
|
@@ -6,7 +6,6 @@ import { Store } from '@ngrx/store';
|
||||
|
||||
import { hasValue, isNotEmpty, isNotEmptyOperator } from '../../shared/empty.util';
|
||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||
import { CoreState } from '../core.reducers';
|
||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||
import { URLCombiner } from '../url-combiner/url-combiner';
|
||||
import { PaginatedList } from './paginated-list';
|
||||
@@ -14,9 +13,9 @@ import { RemoteData } from './remote-data';
|
||||
import {
|
||||
CreateRequest,
|
||||
DeleteByIDRequest,
|
||||
FindByIDRequest,
|
||||
FindListOptions,
|
||||
FindListRequest,
|
||||
FindByIDRequest,
|
||||
GetRequest
|
||||
} from './request.models';
|
||||
import { RequestService } from './request.service';
|
||||
@@ -42,7 +41,7 @@ export abstract class DataService<T extends CacheableObject> {
|
||||
protected abstract requestService: RequestService;
|
||||
protected abstract rdbService: RemoteDataBuildService;
|
||||
protected abstract dataBuildService: NormalizedObjectBuildService;
|
||||
protected abstract store: Store<CoreState>;
|
||||
protected abstract store: Store<any>;
|
||||
protected abstract linkPath: string;
|
||||
protected abstract halService: HALEndpointService;
|
||||
protected abstract objectCache: ObjectCacheService;
|
||||
@@ -231,7 +230,7 @@ export abstract class DataService<T extends CacheableObject> {
|
||||
*/
|
||||
update(object: T): Observable<RemoteData<T>> {
|
||||
const oldVersion$ = this.objectCache.getObjectBySelfLink(object.self);
|
||||
return oldVersion$.pipe(take(1), mergeMap((oldVersion: T) => {
|
||||
return oldVersion$.pipe(take(1), mergeMap((oldVersion: NormalizedObject<T>) => {
|
||||
const operations = this.comparator.diff(oldVersion, object);
|
||||
if (isNotEmpty(operations)) {
|
||||
this.objectCache.addPatch(object.self, operations);
|
||||
|
@@ -5,8 +5,6 @@ import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store';
|
||||
import { Observable, race as observableRace } from 'rxjs';
|
||||
import { filter, map, mergeMap, take } from 'rxjs/operators';
|
||||
import { cloneDeep, remove } from 'lodash';
|
||||
|
||||
import { AppState } from '../../app.reducer';
|
||||
import { hasValue, isEmpty, isNotEmpty } from '../../shared/empty.util';
|
||||
import { CacheableObject } from '../cache/object-cache.reducer';
|
||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||
@@ -19,7 +17,7 @@ import {
|
||||
} from '../index/index.selectors';
|
||||
import { UUIDService } from '../shared/uuid.service';
|
||||
import { RequestConfigureAction, RequestExecuteAction, RequestRemoveAction } from './request.actions';
|
||||
import { GetRequest, RestRequest, SubmissionRequest } from './request.models';
|
||||
import { GetRequest, RestRequest } from './request.models';
|
||||
import { RequestEntry, RequestState } from './request.reducer';
|
||||
import { CommitSSBAction } from '../cache/server-sync-buffer.actions';
|
||||
import { RestRequestMethod } from './rest-request-method';
|
||||
@@ -52,7 +50,7 @@ const entryFromUUIDSelector = (uuid: string): MemoizedSelector<CoreState, Reques
|
||||
* @param href Substring that the request's href should contain
|
||||
*/
|
||||
const uuidsFromHrefSubstringSelector =
|
||||
(selector: MemoizedSelector<AppState, IndexState>, href: string): MemoizedSelector<AppState, string[]> => createSelector(
|
||||
(selector: MemoizedSelector<CoreState, IndexState>, href: string): MemoizedSelector<CoreState, string[]> => createSelector(
|
||||
selector,
|
||||
(state: IndexState) => getUuidsFromHrefSubstring(state, href)
|
||||
);
|
||||
|
@@ -1,5 +1,4 @@
|
||||
import { createSelector, MemoizedSelector } from '@ngrx/store';
|
||||
import { AppState } from '../../app.reducer';
|
||||
import { hasValue } from '../../shared/empty.util';
|
||||
import { CoreState } from '../core.reducers';
|
||||
import { coreSelector } from '../core.selectors';
|
||||
@@ -11,7 +10,7 @@ import { IndexName, IndexState, MetaIndexState } from './index.reducer';
|
||||
* @returns
|
||||
* a MemoizedSelector to select the MetaIndexState
|
||||
*/
|
||||
export const metaIndexSelector: MemoizedSelector<AppState, MetaIndexState> = createSelector(
|
||||
export const metaIndexSelector: MemoizedSelector<CoreState, MetaIndexState> = createSelector(
|
||||
coreSelector,
|
||||
(state: CoreState) => state.index
|
||||
);
|
||||
@@ -23,7 +22,7 @@ export const metaIndexSelector: MemoizedSelector<AppState, MetaIndexState> = cre
|
||||
* @returns
|
||||
* a MemoizedSelector to select the object index
|
||||
*/
|
||||
export const objectIndexSelector: MemoizedSelector<AppState, IndexState> = createSelector(
|
||||
export const objectIndexSelector: MemoizedSelector<CoreState, IndexState> = createSelector(
|
||||
metaIndexSelector,
|
||||
(state: MetaIndexState) => state[IndexName.OBJECT]
|
||||
);
|
||||
@@ -34,7 +33,7 @@ export const objectIndexSelector: MemoizedSelector<AppState, IndexState> = creat
|
||||
* @returns
|
||||
* a MemoizedSelector to select the request index
|
||||
*/
|
||||
export const requestIndexSelector: MemoizedSelector<AppState, IndexState> = createSelector(
|
||||
export const requestIndexSelector: MemoizedSelector<CoreState, IndexState> = createSelector(
|
||||
metaIndexSelector,
|
||||
(state: MetaIndexState) => state[IndexName.REQUEST]
|
||||
);
|
||||
@@ -45,7 +44,7 @@ export const requestIndexSelector: MemoizedSelector<AppState, IndexState> = crea
|
||||
* @returns
|
||||
* a MemoizedSelector to select the request UUID mapping
|
||||
*/
|
||||
export const requestUUIDIndexSelector: MemoizedSelector<AppState, IndexState> = createSelector(
|
||||
export const requestUUIDIndexSelector: MemoizedSelector<CoreState, IndexState> = createSelector(
|
||||
metaIndexSelector,
|
||||
(state: MetaIndexState) => state[IndexName.UUID_MAPPING]
|
||||
);
|
||||
@@ -53,14 +52,13 @@ export const requestUUIDIndexSelector: MemoizedSelector<AppState, IndexState> =
|
||||
/**
|
||||
* Return the self link of an object in the object-cache based on its UUID
|
||||
*
|
||||
* @param id
|
||||
* @param uuid
|
||||
* the UUID for which you want to find the matching self link
|
||||
* @param identifierType the type of index, used to select index from state
|
||||
* @returns
|
||||
* a MemoizedSelector to select the self link
|
||||
*/
|
||||
export const selfLinkFromUuidSelector =
|
||||
(uuid: string): MemoizedSelector<AppState, string> => createSelector(
|
||||
(uuid: string): MemoizedSelector<CoreState, string> => createSelector(
|
||||
objectIndexSelector,
|
||||
(state: IndexState) => hasValue(state) ? state[uuid] : undefined
|
||||
);
|
||||
@@ -74,7 +72,7 @@ export const selfLinkFromUuidSelector =
|
||||
* a MemoizedSelector to select the UUID
|
||||
*/
|
||||
export const uuidFromHrefSelector =
|
||||
(href: string): MemoizedSelector<AppState, string> => createSelector(
|
||||
(href: string): MemoizedSelector<CoreState, string> => createSelector(
|
||||
requestIndexSelector,
|
||||
(state: IndexState) => hasValue(state) ? state[href] : undefined
|
||||
);
|
||||
@@ -89,7 +87,7 @@ export const uuidFromHrefSelector =
|
||||
* a MemoizedSelector to select the UUID of the cached request
|
||||
*/
|
||||
export const originalRequestUUIDFromRequestUUIDSelector =
|
||||
(uuid: string): MemoizedSelector<AppState, string> => createSelector(
|
||||
(uuid: string): MemoizedSelector<CoreState, string> => createSelector(
|
||||
requestUUIDIndexSelector,
|
||||
(state: IndexState) => hasValue(state) ? state[uuid] : undefined
|
||||
);
|
||||
|
@@ -17,7 +17,6 @@ import {
|
||||
} from './json-patch-operations.actions';
|
||||
import { JsonPatchOperationModel } from './json-patch.model';
|
||||
import { getResponseFromEntry } from '../shared/operators';
|
||||
import { ObjectCacheEntry } from '../cache/object-cache.reducer';
|
||||
|
||||
/**
|
||||
* An abstract class that provides methods to make JSON Patch requests.
|
||||
@@ -88,8 +87,8 @@ export abstract class JsonPatchOperationsService<ResponseDefinitionDomain, Patch
|
||||
flatMap(() => {
|
||||
const [successResponse$, errorResponse$] = partition((response: RestResponse) => response.isSuccessful)(this.requestService.getByUUID(requestId).pipe(
|
||||
getResponseFromEntry(),
|
||||
find((entry: ObjectCacheEntry) => startTransactionTime < entry.timeAdded),
|
||||
map((entry: ObjectCacheEntry) => entry),
|
||||
find((entry: RestResponse) => startTransactionTime < entry.timeAdded),
|
||||
map((entry: RestResponse) => entry),
|
||||
));
|
||||
return observableMerge(
|
||||
errorResponse$.pipe(
|
||||
|
@@ -1,12 +1,6 @@
|
||||
import { distinctUntilChanged, filter, map, tap } from 'rxjs/operators';
|
||||
import { distinctUntilChanged, filter, map } from 'rxjs/operators';
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
ActivatedRoute,
|
||||
NavigationEnd,
|
||||
Params,
|
||||
Router,
|
||||
RouterStateSnapshot,
|
||||
} from '@angular/router';
|
||||
import { ActivatedRoute, NavigationEnd, Params, Router, RouterStateSnapshot, } from '@angular/router';
|
||||
|
||||
import { combineLatest, Observable } from 'rxjs';
|
||||
import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store';
|
||||
@@ -18,6 +12,7 @@ import { SetParametersAction, SetQueryParametersAction } from './route.actions';
|
||||
import { CoreState } from '../core.reducers';
|
||||
import { hasValue } from '../../shared/empty.util';
|
||||
import { coreSelector } from '../core.selectors';
|
||||
import { AppState } from '../../app.reducer';
|
||||
|
||||
/**
|
||||
* Selector to select all route parameters from the store
|
||||
@@ -67,7 +62,7 @@ export function parameterSelector(key: string, paramsSelector: (state: CoreState
|
||||
*/
|
||||
@Injectable()
|
||||
export class RouteService {
|
||||
constructor(private route: ActivatedRoute, private router: Router, private store: Store<CoreState>) {
|
||||
constructor(private route: ActivatedRoute, private router: Router, private store: Store<AppState|CoreState>) {
|
||||
this.saveRouting();
|
||||
}
|
||||
|
||||
|
@@ -1,12 +1,13 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { Location } from '@angular/common';
|
||||
import {
|
||||
DynamicFormControlModel,
|
||||
DynamicFormService,
|
||||
DynamicInputModel
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { DynamicFormControlModel } from '@ng-dynamic-forms/core/src/model/dynamic-form-control.model';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||
import { MetadataMap, MetadataValue } from '../../../core/shared/metadata.models';
|
||||
import { ResourceType } from '../../../core/shared/resource-type';
|
||||
@@ -82,7 +83,7 @@ export class ComColFormComponent<T extends DSpaceObject> implements OnInit {
|
||||
* Checks which new fields were added and sends the updated version of the DSO to the parent component
|
||||
*/
|
||||
onSubmit() {
|
||||
const formMetadata = new Object() as MetadataMap;
|
||||
const formMetadata = {} as MetadataMap;
|
||||
this.formModel.forEach((fieldModel: DynamicInputModel) => {
|
||||
const value: MetadataValue = {
|
||||
value: fieldModel.value as string,
|
||||
|
@@ -30,7 +30,7 @@ import {
|
||||
DynamicFormControl,
|
||||
DynamicFormControlContainerComponent,
|
||||
DynamicFormControlEvent,
|
||||
DynamicFormControlModel,
|
||||
DynamicFormControlModel, DynamicFormInstancesService,
|
||||
DynamicFormLayout,
|
||||
DynamicFormLayoutService,
|
||||
DynamicFormValidationService,
|
||||
@@ -168,12 +168,13 @@ export class DsDynamicFormControlContainerComponent extends DynamicFormControlCo
|
||||
protected test: boolean;
|
||||
constructor(
|
||||
protected componentFactoryResolver: ComponentFactoryResolver,
|
||||
protected dynamicFormInstanceService: DynamicFormInstancesService,
|
||||
protected layoutService: DynamicFormLayoutService,
|
||||
protected validationService: DynamicFormValidationService,
|
||||
protected translateService: TranslateService
|
||||
) {
|
||||
|
||||
super(componentFactoryResolver, layoutService, validationService);
|
||||
super(componentFactoryResolver, layoutService, validationService, dynamicFormInstanceService);
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@@ -1,5 +1,10 @@
|
||||
import { DynamicDateControlModel, DynamicFormControlLayout, serializable } from '@ng-dynamic-forms/core';
|
||||
import { DynamicDateControlModelConfig } from '@ng-dynamic-forms/core/src/model/dynamic-date-control.model';
|
||||
import {
|
||||
DynamicDateControlModel,
|
||||
DynamicDateControlModelConfig,
|
||||
DynamicFormControlLayout,
|
||||
serializable
|
||||
} from '@ng-dynamic-forms/core';
|
||||
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
export const DYNAMIC_FORM_CONTROL_TYPE_DSDATEPICKER = 'DATE';
|
||||
|
@@ -1,7 +1,12 @@
|
||||
import { DynamicFormControlLayout, DynamicFormGroupModel, serializable } from '@ng-dynamic-forms/core';
|
||||
import {
|
||||
DynamicFormControlLayout,
|
||||
DynamicFormGroupModel,
|
||||
DynamicFormGroupModelConfig,
|
||||
serializable
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { DsDynamicInputModel } from './ds-dynamic-input.model';
|
||||
import { Subject } from 'rxjs';
|
||||
import { DynamicFormGroupModelConfig } from '@ng-dynamic-forms/core/src/model/form-group/dynamic-form-group.model';
|
||||
|
||||
import { LanguageCode } from '../../models/form-field-language-value.model';
|
||||
|
||||
export const QUALDROP_GROUP_SUFFIX = '_QUALDROP_GROUP';
|
||||
|
@@ -11,8 +11,7 @@ import {
|
||||
DynamicFormControlModel,
|
||||
DynamicFormGroupModel,
|
||||
DynamicFormService, DynamicFormValidationService,
|
||||
DynamicPathable,
|
||||
JSONUtils,
|
||||
DynamicPathable, parseReviver,
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { isObject, isString, mergeWith } from 'lodash';
|
||||
|
||||
@@ -207,7 +206,7 @@ export class FormBuilderService extends DynamicFormService {
|
||||
|
||||
modelFromConfiguration(submissionId: string, json: string | SubmissionFormsModel, scopeUUID: string, sectionData: any = {}, submissionScope?: string, readOnly = false): DynamicFormControlModel[] | never {
|
||||
let rows: DynamicFormControlModel[] = [];
|
||||
const rawData = typeof json === 'string' ? JSON.parse(json, JSONUtils.parseReviver) : json;
|
||||
const rawData = typeof json === 'string' ? JSON.parse(json, parseReviver) : json;
|
||||
|
||||
if (rawData.rows && !isEmpty(rawData.rows)) {
|
||||
rawData.rows.forEach((currentRow) => {
|
||||
|
@@ -1,24 +1,35 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MemoizedSelector, select, Store } from '@ngrx/store';
|
||||
import { MenuSection, MenuSectionIndex, MenuSections, MenusState, MenuState } from './menu.reducer';
|
||||
import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store';
|
||||
import { MenuSection, MenuSections, MenuState } from './menu.reducer';
|
||||
import { AppState, keySelector } from '../../app.reducer';
|
||||
import { MenuID } from './initial-menus-state';
|
||||
import { Observable } from 'rxjs';
|
||||
import { combineLatest as observableCombineLatest, Observable } from 'rxjs';
|
||||
import { map, switchMap } from 'rxjs/operators';
|
||||
import {
|
||||
ActivateMenuSectionAction,
|
||||
AddMenuSectionAction,
|
||||
CollapseMenuAction, CollapseMenuPreviewAction,
|
||||
CollapseMenuAction,
|
||||
CollapseMenuPreviewAction,
|
||||
DeactivateMenuSectionAction,
|
||||
ExpandMenuAction, ExpandMenuPreviewAction,
|
||||
ExpandMenuAction,
|
||||
ExpandMenuPreviewAction,
|
||||
HideMenuAction,
|
||||
RemoveMenuSectionAction,
|
||||
ShowMenuAction,
|
||||
ToggleActiveMenuSectionAction,
|
||||
ToggleMenuAction,
|
||||
} from './menu.actions';
|
||||
import { hasNoValue, isNotEmpty } from '../empty.util';
|
||||
import { combineLatest as observableCombineLatest } from 'rxjs';
|
||||
import { hasNoValue, hasValue, isNotEmpty } from '../empty.util';
|
||||
|
||||
export function menuKeySelector<T>(key: string, selector): MemoizedSelector<MenuState, T> {
|
||||
return createSelector(selector, (state) => {
|
||||
if (hasValue(state)) {
|
||||
return state[key];
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const menusStateSelector = (state) => state.menus;
|
||||
|
||||
@@ -28,20 +39,20 @@ const menuByIDSelector = (menuID: MenuID): MemoizedSelector<AppState, MenuState>
|
||||
|
||||
const menuSectionStateSelector = (state: MenuState) => state.sections;
|
||||
|
||||
const menuSectionByIDSelector = (id: string): MemoizedSelector<AppState, MenuSection> => {
|
||||
return keySelector<MenuSection>(id, menuSectionStateSelector);
|
||||
const menuSectionByIDSelector = (id: string): MemoizedSelector<MenuState, MenuSection> => {
|
||||
return menuKeySelector<MenuSection>(id, menuSectionStateSelector);
|
||||
};
|
||||
|
||||
const menuSectionIndexStateSelector = (state: MenuState) => state.sectionToSubsectionIndex;
|
||||
|
||||
const getSubSectionsFromSectionSelector = (id: string): MemoizedSelector<AppState, MenuSectionIndex> => {
|
||||
return keySelector<MenuSectionIndex>(id, menuSectionIndexStateSelector);
|
||||
const getSubSectionsFromSectionSelector = (id: string): MemoizedSelector<MenuState, string[]> => {
|
||||
return menuKeySelector<string[]>(id, menuSectionIndexStateSelector);
|
||||
};
|
||||
|
||||
@Injectable()
|
||||
export class MenuService {
|
||||
|
||||
constructor(private store: Store<MenusState>) {
|
||||
constructor(private store: Store<any>) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -16,7 +16,7 @@ import { hasValue } from '../../empty.util';
|
||||
@Injectable()
|
||||
export class SidebarFilterService {
|
||||
|
||||
constructor(private store:Store<SidebarFilterState>) {
|
||||
constructor(private store:Store<SidebarFiltersState>) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -3,14 +3,7 @@ import { HttpHeaders } from '@angular/common/http';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { Observable, of as observableOf, Subscription, timer as observableTimer } from 'rxjs';
|
||||
import {
|
||||
catchError, concatMap,
|
||||
distinctUntilChanged,
|
||||
filter,
|
||||
find,
|
||||
map,
|
||||
startWith, take, tap
|
||||
} from 'rxjs/operators';
|
||||
import { catchError, concatMap, distinctUntilChanged, filter, find, map, startWith, take, tap } from 'rxjs/operators';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
@@ -50,11 +43,7 @@ import { WorkspaceitemSectionsObject } from '../core/submission/models/workspace
|
||||
import { RemoteData } from '../core/data/remote-data';
|
||||
import { ErrorResponse } from '../core/cache/response.models';
|
||||
import { RemoteDataError } from '../core/data/remote-data-error';
|
||||
import {
|
||||
createFailedRemoteDataObject$,
|
||||
createSuccessfulRemoteDataObject,
|
||||
createSuccessfulRemoteDataObject$
|
||||
} from '../shared/testing/utils';
|
||||
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject } from '../shared/testing/utils';
|
||||
import { SearchService } from '../+search-page/search-service/search.service';
|
||||
import { RequestService } from '../core/data/request.service';
|
||||
|
||||
@@ -117,8 +106,8 @@ export class SubmissionService {
|
||||
*/
|
||||
createSubmission(): Observable<SubmissionObject> {
|
||||
return this.restService.postToEndpoint('workspaceitems', {}).pipe(
|
||||
map((workspaceitem: SubmissionObject) => workspaceitem[0]),
|
||||
catchError(() => observableOf({})))
|
||||
map((workspaceitem: SubmissionObject[]) => workspaceitem[0] as SubmissionObject),
|
||||
catchError(() => observableOf({} as SubmissionObject)))
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user