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">
|
<div class="activiti-form-viewer" *ngIf="taskId">
|
||||||
<activiti-form [taskId]="taskId"></activiti-form>
|
<activiti-form [taskId]="taskId"></activiti-form>
|
||||||
<!--<activiti-form [formName]="'activitiForms:patientFolder'"
|
<!--<activiti-form [formName]="'activitiForms:patientFolder'"-->
|
||||||
[saveMetadata]="true"
|
<!--[saveMetadata]="true"-->
|
||||||
[path]="'/Sites/swsdp/documentLibrary'"
|
<!--[path]="'/Sites/swsdp/documentLibrary'"-->
|
||||||
[nameNode]="'test'"></activiti-form>-->
|
<!--[nameNode]="'test'"></activiti-form>-->
|
||||||
<!--<activiti-form [nodeId]="'e280be3a-6584-45a1-8bb5-89bfe070262e'"-->
|
<!--<activiti-form [nodeId]="'e280be3a-6584-45a1-8bb5-89bfe070262e'"-->
|
||||||
<!--[saveMetadata]="true"-->
|
<!--[saveMetadata]="true"-->
|
||||||
<!--[path]="'/Sites/swsdp/documentLibrary'">-->
|
<!--[path]="'/Sites/swsdp/documentLibrary'">-->
|
||||||
|
@ -86,7 +86,7 @@ export class EcmModelService {
|
|||||||
|
|
||||||
private createFomType(formName: string, form: FormModel): Observable<any> {
|
private createFomType(formName: string, form: FormModel): Observable<any> {
|
||||||
return Observable.create(observer => {
|
return Observable.create(observer => {
|
||||||
this.searchFormType(formName).subscribe(
|
this.searchEcmType(formName, EcmModelService.MODEL_NAME).subscribe(
|
||||||
ecmType => {
|
ecmType => {
|
||||||
console.log('custom types', ecmType);
|
console.log('custom types', ecmType);
|
||||||
if (!ecmType) {
|
if (!ecmType) {
|
||||||
@ -121,9 +121,9 @@ export class EcmModelService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public searchFormType(formName: string): Observable<any> {
|
public searchEcmType(typeName: string, modelName: string): Observable<any> {
|
||||||
return this.getEcmType(EcmModelService.MODEL_NAME).map(function (customTypes: any) {
|
return this.getEcmType(modelName).map(function (customTypes: any) {
|
||||||
return customTypes.list.entries.find(type => type.entry.prefixedName === formName);
|
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 => {
|
return Observable.create(observer => {
|
||||||
this.createForm(formName).subscribe(
|
this.createForm(formName).subscribe(
|
||||||
form => {
|
form => {
|
||||||
this.ecmModelService.searchFormType(formName).subscribe(
|
this.ecmModelService.searchEcmType(formName, EcmModelService.MODEL_NAME).subscribe(
|
||||||
customType => {
|
customType => {
|
||||||
let formDefinitionModel = new FormDefinitionModel(form.id, form.name, form.lastUpdatedByFullName, form.lastUpdated, customType.entry.properties);
|
let formDefinitionModel = new FormDefinitionModel(form.id, form.name, form.lastUpdatedByFullName, form.lastUpdated, customType.entry.properties);
|
||||||
this.addFieldsNodeTypePropertiesToTheForm(form.id, formDefinitionModel).subscribe(formData => {
|
this.addFieldsNodeTypePropertiesToTheForm(form.id, formDefinitionModel).subscribe(formData => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user