fix search type

This commit is contained in:
Mario Romano 2016-08-26 16:53:31 +01:00
parent c5817b7011
commit 3894ad5a40
3 changed files with 9 additions and 9 deletions

View File

@ -1,9 +1,9 @@
<div class="activiti-form-viewer" *ngIf="taskId">
<activiti-form [taskId]="taskId"></activiti-form>
<!--<activiti-form [formName]="'activitiForms:patientFolder'"
[saveMetadata]="true"
[path]="'/Sites/swsdp/documentLibrary'"
[nameNode]="'test'"></activiti-form>-->
<!--<activiti-form [formName]="'activitiForms:patientFolder'"-->
<!--[saveMetadata]="true"-->
<!--[path]="'/Sites/swsdp/documentLibrary'"-->
<!--[nameNode]="'test'"></activiti-form>-->
<!--<activiti-form [nodeId]="'e280be3a-6584-45a1-8bb5-89bfe070262e'"-->
<!--[saveMetadata]="true"-->
<!--[path]="'/Sites/swsdp/documentLibrary'">-->

View File

@ -86,7 +86,7 @@ export class EcmModelService {
private createFomType(formName: string, form: FormModel): Observable<any> {
return Observable.create(observer => {
this.searchFormType(formName).subscribe(
this.searchEcmType(formName, EcmModelService.MODEL_NAME).subscribe(
ecmType => {
console.log('custom types', ecmType);
if (!ecmType) {
@ -121,9 +121,9 @@ export class EcmModelService {
});
}
public searchFormType(formName: string): Observable<any> {
return this.getEcmType(EcmModelService.MODEL_NAME).map(function (customTypes: any) {
return customTypes.list.entries.find(type => type.entry.prefixedName === formName);
public searchEcmType(typeName: string, modelName: string): Observable<any> {
return this.getEcmType(modelName).map(function (customTypes: any) {
return customTypes.list.entries.find(type => type.entry.prefixedName === typeName || type.entry.title === typeName);
});
}

View File

@ -40,7 +40,7 @@ export class FormService {
return Observable.create(observer => {
this.createForm(formName).subscribe(
form => {
this.ecmModelService.searchFormType(formName).subscribe(
this.ecmModelService.searchEcmType(formName, EcmModelService.MODEL_NAME).subscribe(
customType => {
let formDefinitionModel = new FormDefinitionModel(form.id, form.name, form.lastUpdatedByFullName, form.lastUpdated, customType.entry.properties);
this.addFieldsNodeTypePropertiesToTheForm(form.id, formDefinitionModel).subscribe(formData => {