mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
fix search type
This commit is contained in:
parent
c5817b7011
commit
3894ad5a40
@ -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'">-->
|
||||
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -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 => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user