mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-1873] Remove all deprecated code from ADF (#4145)
* remove deprecated code part 1 * remove deprecation step 2 * fix spellcheck * fix * fix lint * fix not used import * remove deprecation * fix test first part after remove deprecation * fix test * fix sidebar demo shell
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { Response, ResponseOptions } from '@angular/http';
|
||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||
import { FormDefinitionModel } from '../models/form-definition.model';
|
||||
import { formModelTabs, AlfrescoApiServiceMock } from '../../mock';
|
||||
import { FormService } from './form.service';
|
||||
import { setupTestBed } from '../../testing/setupTestBed';
|
||||
@@ -359,25 +358,6 @@ describe('Form service', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should add form fields to a form', (done) => {
|
||||
let formId = 100;
|
||||
let name = 'testName';
|
||||
let data = [{ name: 'name' }, { name: 'email' }];
|
||||
let formDefinitionModel = new FormDefinitionModel(formId.toString(), name, 'testUserName', '2016-09-05T14:41:19.049Z', data);
|
||||
|
||||
service.addFieldsToAForm(formId, formDefinitionModel).subscribe((result) => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/form-models/' + formId)).toBeTruthy();
|
||||
expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).formRepresentation.name).toEqual(name);
|
||||
done();
|
||||
});
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
'status': 200,
|
||||
contentType: 'application/json',
|
||||
responseText: JSON.stringify(simpleResponseBody)
|
||||
});
|
||||
});
|
||||
|
||||
it('should return list of people', (done) => {
|
||||
spyOn(service, 'getUserProfileImageApi').and.returnValue('/app/rest/users/2002/picture');
|
||||
let fakeFilter: string = 'whatever';
|
||||
|
@@ -129,7 +129,9 @@ export class FormService {
|
||||
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.addFieldsToAForm(form.id, formDefinitionModel).subscribe((formData) => {
|
||||
from(
|
||||
this.editorApi.saveForm(form.id, formDefinitionModel)
|
||||
).subscribe((formData) => {
|
||||
observer.next(formData);
|
||||
observer.complete();
|
||||
}, (err) => this.handleError(err));
|
||||
@@ -170,19 +172,6 @@ export class FormService {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Fields to a form
|
||||
* @deprecated in 1.7.0, use saveForm API instead
|
||||
* @param formId ID of the form
|
||||
* @param formModel Form definition
|
||||
*/
|
||||
addFieldsToAForm(formId: number, formModel: FormDefinitionModel): Observable<any> {
|
||||
this.logService.log('addFieldsToAForm is deprecated in 1.7.0, use saveForm API instead');
|
||||
return from(
|
||||
this.editorApi.saveForm(formId, formModel)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches for a form by name.
|
||||
* @param name The form name to search for
|
||||
|
Reference in New Issue
Block a user