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:
@@ -15,13 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/** @deprecated in 2.3.0, part of the module moved in the core */
|
||||
export { CommentsModule } from '@alfresco/adf-core';
|
||||
/** @deprecated in 2.3.0, component moved in the core */
|
||||
export { CommentListComponent } from '@alfresco/adf-core';
|
||||
/** @deprecated in 2.3.0, component moved in the core */
|
||||
export { CommentsComponent } from '@alfresco/adf-core';
|
||||
|
||||
export * from './process-list/index';
|
||||
export * from './task-list/index';
|
||||
export * from './app-list/index';
|
||||
|
@@ -116,7 +116,6 @@ describe('ProcessInstanceListComponent', () => {
|
||||
let emitSpy = spyOn(component.success, 'emit');
|
||||
component.appId = 1;
|
||||
component.state = 'open';
|
||||
component.processDefinitionKey = null;
|
||||
fixture.detectChanges();
|
||||
tick();
|
||||
expect(emitSpy).toHaveBeenCalledWith(fakeProcessInstance);
|
||||
@@ -131,7 +130,6 @@ describe('ProcessInstanceListComponent', () => {
|
||||
);
|
||||
component.appId = 1;
|
||||
component.state = 'open';
|
||||
component.processDefinitionKey = null;
|
||||
component.success.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(component.rows).toBeDefined();
|
||||
@@ -147,7 +145,6 @@ describe('ProcessInstanceListComponent', () => {
|
||||
getProcessInstancesSpy = getProcessInstancesSpy.and.returnValue(of(fakeProcessInstancesWithNoName));
|
||||
component.appId = 1;
|
||||
component.state = 'open';
|
||||
component.processDefinitionKey = 'fakeprocess';
|
||||
component.success.subscribe( (res) => {
|
||||
expect(component.rows[0]['name']).toEqual('Fake Process Name - Nov 9, 2017, 12:36:14 PM');
|
||||
expect(component.rows[1]['name']).toEqual('Fake Process Name - Nov 9, 2017, 12:37:25 PM');
|
||||
@@ -198,7 +195,6 @@ describe('ProcessInstanceListComponent', () => {
|
||||
it('should emit onSuccess event when reload() called', fakeAsync(() => {
|
||||
component.appId = 1;
|
||||
component.state = 'open';
|
||||
component.processDefinitionKey = null;
|
||||
fixture.detectChanges();
|
||||
tick();
|
||||
let emitSpy = spyOn(component.success, 'emit');
|
||||
@@ -308,22 +304,6 @@ describe('ProcessInstanceListComponent', () => {
|
||||
component.ngOnChanges({'appId': change});
|
||||
});
|
||||
|
||||
it('should reload the list when the processDefinitionKey parameter changes', (done) => {
|
||||
const processDefinitionKey = 'fakeprocess';
|
||||
let change = new SimpleChange(null, processDefinitionKey, true);
|
||||
|
||||
component.success.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(component.rows).toBeDefined();
|
||||
expect(component.isListEmpty()).not.toBeTruthy();
|
||||
expect(component.rows.length).toEqual(2);
|
||||
expect(component.rows[0]['name']).toEqual('Process 773443333');
|
||||
done();
|
||||
});
|
||||
|
||||
component.ngOnChanges({'processDefinitionKey': change});
|
||||
});
|
||||
|
||||
it('should reload the list when the state parameter changes', (done) => {
|
||||
const state = 'open';
|
||||
let change = new SimpleChange(null, state, true);
|
||||
@@ -356,38 +336,6 @@ describe('ProcessInstanceListComponent', () => {
|
||||
component.ngOnChanges({'sort': change});
|
||||
});
|
||||
|
||||
it('should reload the process list when the processDefinitionKey parameter changes', (done) => {
|
||||
const processDefinitionKey = 'SimpleProcess';
|
||||
let change = new SimpleChange(null, processDefinitionKey, true);
|
||||
|
||||
component.success.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(component.rows).toBeDefined();
|
||||
expect(component.isListEmpty()).not.toBeTruthy();
|
||||
expect(component.rows.length).toEqual(2);
|
||||
expect(component.rows[0].name).toEqual('Process 773443333');
|
||||
done();
|
||||
});
|
||||
|
||||
component.ngOnChanges({'processDefinitionKey': change});
|
||||
});
|
||||
|
||||
it('should reload the process list when the processDefinitionKey parameter changes to null', (done) => {
|
||||
const processDefinitionKey = null;
|
||||
let change = new SimpleChange('SimpleProcess', processDefinitionKey, false);
|
||||
|
||||
component.success.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(component.rows).toBeDefined();
|
||||
expect(component.isListEmpty()).not.toBeTruthy();
|
||||
expect(component.rows.length).toEqual(2);
|
||||
expect(component.rows[0].name).toEqual('Process 773443333');
|
||||
done();
|
||||
});
|
||||
|
||||
component.ngOnChanges({'processDefinitionKey': change});
|
||||
});
|
||||
|
||||
it('should reload the process list when the processDefinitionId parameter changes', (done) => {
|
||||
const processDefinitionId = 'SimpleProcess:1:10';
|
||||
let change = new SimpleChange(null, processDefinitionId, true);
|
||||
|
@@ -62,12 +62,6 @@ export class ProcessInstanceListComponent extends DataTableSchema implements On
|
||||
@Input()
|
||||
appId: number;
|
||||
|
||||
/** The Definition Key of the process.
|
||||
* @deprecated 2.4.0
|
||||
*/
|
||||
@Input()
|
||||
processDefinitionKey: string;
|
||||
|
||||
/** The Definition Id of the process. */
|
||||
@Input()
|
||||
processDefinitionId: string;
|
||||
@@ -175,7 +169,6 @@ export class ProcessInstanceListComponent extends DataTableSchema implements On
|
||||
let changed: boolean = false;
|
||||
|
||||
let appId = changes['appId'];
|
||||
let processDefinitionKey = changes['processDefinitionKey'];
|
||||
let processDefinitionId = changes['processDefinitionId'];
|
||||
let processInstanceId = changes['processInstanceId'];
|
||||
let state = changes['state'];
|
||||
@@ -185,8 +178,6 @@ export class ProcessInstanceListComponent extends DataTableSchema implements On
|
||||
|
||||
if (appId && appId.currentValue) {
|
||||
changed = true;
|
||||
} else if (processDefinitionKey) {
|
||||
changed = true;
|
||||
} else if (processDefinitionId) {
|
||||
changed = true;
|
||||
} else if (processInstanceId) {
|
||||
@@ -210,7 +201,7 @@ export class ProcessInstanceListComponent extends DataTableSchema implements On
|
||||
|
||||
private load(requestNode: ProcessFilterParamRepresentationModel) {
|
||||
this.isLoading = true;
|
||||
this.processService.getProcesses(requestNode, this.processDefinitionKey)
|
||||
this.processService.getProcesses(requestNode)
|
||||
.subscribe(
|
||||
(response) => {
|
||||
this.rows = this.optimizeProcessDetails(response.data);
|
||||
|
@@ -66,7 +66,7 @@ export class ProcessService {
|
||||
* @returns List of processes
|
||||
*/
|
||||
getProcesses(requestNode: ProcessFilterParamRepresentationModel, processDefinitionKey?: string): Observable<ProcessListModel> {
|
||||
return this.getProcessInstances(requestNode, processDefinitionKey || null)
|
||||
return this.getProcessInstances(requestNode, processDefinitionKey)
|
||||
.pipe(catchError(() => {
|
||||
return of(new ProcessListModel({}));
|
||||
}));
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LogService, UserPreferencesService, UserProcessModel, FormFieldModel, FormModel } from '@alfresco/adf-core';
|
||||
import { LogService, UserPreferencesService, UserPreferenceValues, UserProcessModel, FormFieldModel, FormModel } from '@alfresco/adf-core';
|
||||
import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
||||
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
||||
import { MOMENT_DATE_FORMATS, MomentDateAdapter } from '@alfresco/adf-core';
|
||||
@@ -79,7 +79,7 @@ export class StartTaskComponent implements OnInit {
|
||||
*/
|
||||
constructor(private taskService: TaskListService,
|
||||
private dateAdapter: DateAdapter<Moment>,
|
||||
private preferences: UserPreferencesService,
|
||||
private userPreferencesService: UserPreferencesService,
|
||||
private formBuilder: FormBuilder,
|
||||
private logService: LogService) {
|
||||
}
|
||||
@@ -92,7 +92,7 @@ export class StartTaskComponent implements OnInit {
|
||||
this.validateMaxTaskNameLength();
|
||||
|
||||
this.field = new FormFieldModel(new FormModel(), { id: this.assigneeId, value: this.assigneeId, placeholder: 'Assignee' });
|
||||
this.preferences.locale$.subscribe((locale) => {
|
||||
this.userPreferencesService.select(UserPreferenceValues.Locale).subscribe((locale) => {
|
||||
this.dateAdapter.setLocale(locale);
|
||||
});
|
||||
|
||||
|
@@ -23,11 +23,8 @@ import { TaskFilterService } from './../services/task-filter.service';
|
||||
import { TaskListService } from './../services/tasklist.service';
|
||||
import { IconModel } from '../../app-list/icon.model';
|
||||
|
||||
/**
|
||||
* @deprecated: in 2.4.0 'adf-filters' selector was deprecated, use adf-task-filters instead.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'adf-task-filters, adf-filters',
|
||||
selector: 'adf-task-filters',
|
||||
templateUrl: './task-filters.component.html',
|
||||
styleUrls: ['task-filters.component.scss']
|
||||
})
|
||||
|
@@ -56,13 +56,6 @@ export class TaskListComponent extends DataTableSchema implements OnChanges, Aft
|
||||
@Input()
|
||||
processDefinitionId: string;
|
||||
|
||||
/**
|
||||
* The Definition Key of the process.
|
||||
* @deprecated 2.4.0
|
||||
*/
|
||||
@Input()
|
||||
processDefinitionKey: string;
|
||||
|
||||
/** Current state of the process. Possible values are: `completed`, `active`. */
|
||||
@Input()
|
||||
state: string;
|
||||
@@ -373,7 +366,6 @@ export class TaskListComponent extends DataTableSchema implements OnChanges, Aft
|
||||
dueBefore: this.dueBefore ? moment(this.dueBefore).toDate() : null,
|
||||
processInstanceId: this.processInstanceId,
|
||||
processDefinitionId: this.processDefinitionId,
|
||||
processDefinitionKey: this.processDefinitionKey,
|
||||
text: this.name,
|
||||
assignment: this.assignment,
|
||||
state: this.state,
|
||||
|
Reference in New Issue
Block a user