Merge branch 'VM/RED-9201' into 'master'
RED-9201 - fixed sorting and search by name Closes RED-9201 See merge request redactmanager/red-ui!452
This commit is contained in:
commit
072d9e3538
@ -1,22 +1,18 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { EntitiesService, QueryParam } from '@iqser/common-ui';
|
import { EntitiesService, QueryParam } from '@iqser/common-ui';
|
||||||
import { ComponentMapping, IComponentMapping, IComponentMappingList } from '@red/domain';
|
import { ComponentMapping, ComponentMappingList, IComponentMapping, IComponentMappingList } from '@red/domain';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { HeadersConfiguration, List } from '@common-ui/utils';
|
import { List } from '@common-ui/utils';
|
||||||
|
import { map } from 'rxjs/operators';
|
||||||
interface CreateMappingParams {
|
|
||||||
dossierTemplateId: string;
|
|
||||||
name: string;
|
|
||||||
encoding: string;
|
|
||||||
delimiter: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class ComponentMappingsService extends EntitiesService<IComponentMapping, ComponentMapping> {
|
export class ComponentMappingsService extends EntitiesService<IComponentMapping, ComponentMapping> {
|
||||||
getComponentMappings(dossierTemplateId: string): Observable<IComponentMappingList> {
|
getComponentMappings(dossierTemplateId: string): Observable<IComponentMappingList> {
|
||||||
return this._http.get<IComponentMappingList>(`/api/dossier-templates/${dossierTemplateId}/component-mappings`);
|
return this._http
|
||||||
|
.get<IComponentMappingList>(`/api/dossier-templates/${dossierTemplateId}/component-mappings`)
|
||||||
|
.pipe(map(componentMappingList => this.#mapEntities(componentMappingList)));
|
||||||
}
|
}
|
||||||
|
|
||||||
createUpdateComponentMapping(
|
createUpdateComponentMapping(
|
||||||
@ -57,4 +53,12 @@ export class ComponentMappingsService extends EntitiesService<IComponentMapping,
|
|||||||
responseType: 'text',
|
responseType: 'text',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#mapEntities(componentMappingList: IComponentMappingList) {
|
||||||
|
const componentMappings = componentMappingList.componentMappingList.map(m => new ComponentMapping(m));
|
||||||
|
return new ComponentMappingList({
|
||||||
|
dossierTemplateId: componentMappingList.dossierTemplateId,
|
||||||
|
componentMappingList: componentMappings,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user