Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(private elementRef: ElementRef,
private route: ActivatedRoute,
private router: Router,
private taskListService: TaskListService,
private apiService: AlfrescoApiService,
formRenderingService: FormRenderingService,
formService: FormService) {
this.dataTasks = new ObjectDataTableAdapter();
this.dataTasks.setSorting(new DataSorting('created', 'desc'));
this.dataProcesses = new ObjectDataTableAdapter(
[],
[
{ type: 'text', key: 'name', title: 'Name', cssClass: 'full-width name-column', sortable: true },
{ type: 'text', key: 'started', title: 'Started', cssClass: 'hidden', sortable: true }
]
);
this.dataProcesses.setSorting(new DataSorting('started', 'desc'));
// Uncomment this line to replace all 'text' field editors with custom component
// formRenderingService.setComponentTypeResolver('text', () => CustomEditorComponent, true);
// Uncomment this line to map 'custom_stencil_01' to local editor component
formRenderingService.setComponentTypeResolver('custom_stencil_01', () => CustomStencil01, true);
constructor(private auth: AuthenticationService) {
this.data = new ObjectDataTableAdapter(
// data
[
{id: 1, name: 'Name 1'},
{id: 2, name: 'Name 2'}
],
// schema
[
{
type: 'text',
key: 'id',
title: 'Id',
sortable: true
},
{
type: 'text',
key: 'name',
it('should return the process instances list in original order when datalist passed non-existent columns', async(() => {
component.data = new ObjectDataTableAdapter(
[],
[
{type: 'text', key: 'fake-id', title: 'Name'}
]
);
component.appId = 1;
component.state = 'open';
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');
expect(component.rows[1]['name']).toEqual('Process 382927392');
});
fixture.detectChanges();
let alfrescoPackages = Object.keys(response.json().dependencies).filter((val) => {
return regexp.test(val);
});
let alfrescoPackagesTableRepresentation = [];
alfrescoPackages.forEach((val) => {
alfrescoPackagesTableRepresentation.push({
name: val,
version: response.json().dependencies[val].version
});
});
this.gitHubLinkCreation(alfrescoPackagesTableRepresentation);
this.data = new ObjectDataTableAdapter(alfrescoPackagesTableRepresentation, [
{type: 'text', key: 'name', title: 'Name', sortable: true},
{type: 'text', key: 'version', title: 'Version', sortable: true}
]);
});
ngOnInit() {
this.data = new ObjectDataTableAdapter(
[
{
id: 1,
name: `Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum.`,
createdOn: new Date(2016, 6, 2, 15, 8, 1),
createdBy,
icon: 'material-icons://folder_open',
json: null
},
{
id: 2,
this.discovery.getEcmProductInfo().subscribe((ecmVers) => {
this.ecmVersion = ecmVers;
this.modules = new ObjectDataTableAdapter(this.ecmVersion.modules, [
{type: 'text', key: 'id', title: 'ID', sortable: true},
{type: 'text', key: 'title', title: 'Title', sortable: true},
{type: 'text', key: 'version', title: 'Description', sortable: true},
{type: 'text', key: 'installDate', title: 'Install Date', sortable: true},
{type: 'text', key: 'installState', title: 'Install State', sortable: true},
{type: 'text', key: 'versionMin', title: 'Version Minor', sortable: true},
{type: 'text', key: 'versionMax', title: 'Version Max', sortable: true}
]);
this.status = new ObjectDataTableAdapter([this.ecmVersion.status], [
{type: 'text', key: 'isReadOnly', title: 'ReadOnly', sortable: true},
{type: 'text', key: 'isAuditEnabled', title: 'Is Audit Enable', sortable: true},
{type: 'text', key: 'isQuickShareEnabled', title: 'Is quick shared enable', sortable: true},
{type: 'text', key: 'isThumbnailGenerationEnabled', title: 'Thumbnail Generation', sortable: true}
]);
this.license = new ObjectDataTableAdapter([this.ecmVersion.license], [
{type: 'text', key: 'issuedAt', title: 'Issued At', sortable: true},
{type: 'text', key: 'expiresAt', title: 'Expires At', sortable: true},
{type: 'text', key: 'remainingDays', title: 'Remaining Days', sortable: true},
{type: 'text', key: 'holder', title: 'Holder', sortable: true},
{type: 'text', key: 'mode', title: 'Is Cluster Enabled', sortable: true},
{type: 'text', key: 'isClusterEnabled', title: 'Is Cluster Enabled', sortable: true},
{type: 'text', key: 'isCryptodocEnabled', title: 'Is Cryptodoc Enable', sortable: true}
]);
});
showDataAsDataTable(data: any) {
const datatableData: any = null;
try {
if (!data.schema) {
data.schema = ObjectDataTableAdapter.generateSchema(data.data);
}
if (data.schema && data.schema.length > 0) {
this.data = new ObjectDataTableAdapter(data.data, data.schema);
}
} catch (error) {
this.logService.error('error during the cast as datatable');
}
return datatableData;
}
showDataAsDataTable(data: any) {
const datatableData: any = null;
try {
if (!data.schema) {
data.schema = ObjectDataTableAdapter.generateSchema(data.data);
}
if (data.schema && data.schema.length > 0) {
this.data = new ObjectDataTableAdapter(data.data, data.schema);
}
} catch (error) {
this.logService.error('error during the cast as datatable');
}
return datatableData;
}
ngAfterViewChecked(): void {
this.defaultDocumentListComponent.dataTable.loading = true;
this.customLoadingDocumentList.dataTable.loading = true;
this.customEmptyDocumentList.dataTable.data = new ObjectDataTableAdapter();
this.defaultEmptyDocumentList.dataTable.data = new ObjectDataTableAdapter();
this.customNoPermissionDocumentList.dataTable.noPermission = true;
this.defaultNoPermissionDocumentList.dataTable.noPermission = true;
}
}