How to use the @alfresco/adf-core.ObjectDataRow function in @alfresco/adf-core

To help you get started, we’ve selected a few @alfresco/adf-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Alfresco / alfresco-ng2-components / lib / process-services / src / lib / process-list / components / process-list.component.spec.ts View on Github external
it('should NOT emit row click event on every other key', async(() => {
        let triggered = false;
        const keyEvent = new CustomEvent('Keyboard event', { detail: {
            keyboardEvent: { key: 'Space' },
            row: new ObjectDataRow({ id: 999 })
        }});

        component.rowClick.subscribe(() => triggered = true);
        component.onRowKeyUp(keyEvent);

        fixture.whenStable().then(() => {
            expect(triggered).toBeFalsy();
        });
    }));
github Alfresco / alfresco-ng2-components / lib / process-services / src / lib / task-list / components / task-list.component.spec.ts View on Github external
it('should emit row click event', (done) => {
        const row = new ObjectDataRow({
            id: '999'
        });
        const rowEvent = new DataRowEvent(row, null);

        component.rowClick.subscribe((taskId) => {
            expect(taskId).toEqual('999');
            expect(component.getCurrentId()).toEqual('999');
            done();
        });

        component.onRowClick(rowEvent);
    });
github Alfresco / alfresco-ng2-components / lib / process-services / src / lib / people / components / people-list / people-list.component.spec.ts View on Github external
it('should emit row click event', (done) => {
        const row = new ObjectDataRow(fakeUser);
        const rowEvent = new DataRowEvent(row, null);

        peopleListComponent.clickRow.subscribe((selectedUser) => {
            expect(selectedUser.id).toEqual(1);
            expect(selectedUser.email).toEqual('fake@mail.com');
            expect(peopleListComponent.user.id).toEqual(1);
            expect(peopleListComponent.user.email).toEqual('fake@mail.com');
            done();
        });

        peopleListComponent.selectUser(rowEvent);
    });
github Alfresco / alfresco-ng2-components / lib / process-services-cloud / src / lib / process / process-list / components / process-list-cloud.component.spec.ts View on Github external
it('should emit row click event', (done) => {
        const row = new ObjectDataRow({
            entry: {
                id: '999'
            }
        });
        const rowEvent = new DataRowEvent(row, null);
        component.rowClick.subscribe((taskId) => {
            expect(taskId).toEqual('999');
            expect(component.getCurrentId()).toEqual('999');
            done();
        });
        component.onRowClick(rowEvent);
    });
github Alfresco / alfresco-ng2-components / lib / process-services-cloud / src / lib / task / task-list / components / task-list-cloud.component.spec.ts View on Github external
it('should emit row click event', (done) => {
        let row = new ObjectDataRow({
            entry: {
                id: '999'
            }
        });
        let rowEvent = new DataRowEvent(row, null);
        component.rowClick.subscribe((taskId) => {
            expect(taskId).toEqual('999');
            expect(component.getCurrentId()).toEqual('999');
            done();
        });
        component.onRowClick(rowEvent);
    });
github Alfresco / alfresco-ng2-components / lib / process-services / src / lib / people / components / people-list / people-list.component.spec.ts View on Github external
it('should emit row action event', (done) => {
        const row = new ObjectDataRow(fakeUser);
        const removeObj = {
            name: 'remove',
            title: 'Remove'
        };
        const rowActionEvent = new DataRowActionEvent(row, removeObj);

        peopleListComponent.clickAction.subscribe((selectedAction: UserEventModel) => {
            expect(selectedAction.type).toEqual('remove');
            expect(selectedAction.value.id).toEqual(1);
            expect(selectedAction.value.email).toEqual('fake@mail.com');
            done();
        });

        peopleListComponent.onExecuteRowAction(rowActionEvent);
    });
});
github Alfresco / alfresco-ng2-components / lib / process-services / src / lib / process-list / components / process-list.component.spec.ts View on Github external
it('should emit row click event', (done) => {
        const row = new ObjectDataRow({
            id: '999'
        });
        const rowEvent = new DataRowEvent(row, null);

        component.rowClick.subscribe((taskId) => {
            expect(taskId).toEqual('999');
            expect(component.getCurrentId()).toEqual('999');
            done();
        });

        component.onRowClick(rowEvent);
    });
github Alfresco / alfresco-ng2-components / demo-shell / src / app / components / datatable / datatable.component.ts View on Github external
addRow() {
        const id = this.data.getRows().length + 1;
        const row = new ObjectDataRow({
            id: id,
            name: 'Name ' + id,
            createdOn: new Date(),
            icon: 'material-icons://extension',
            createdBy: this._createdBy
        });
        this.data.getRows().push(row);
        this.data.sort();
    }
github Alfresco / adf-examples / ADF_2.0.0 / upgrade-from-1-9-0 / app / components / activiti / activiti-demo.component.ts View on Github external
onProcessDetailsTaskClick(event: TaskDetailsEvent): void {
        event.preventDefault();
        this.activeTab = this.tabs.tasks;

        const taskId = event.value.id;
        const processTaskDataRow = new ObjectDataRow({
            id: taskId,
            name: event.value.name || 'No name',
            created: event.value.created
        });
        this.activitifilter.selectFilter(null);
        if (this.taskList) {
            this.taskList.setCustomDataSource([processTaskDataRow]);
            this.taskList.selectTask(taskId);
        }
        this.currentTaskId = taskId;
    }
github Alfresco / alfresco-ng2-components / demo-shell / src / app / components / datatable / datatable.component.ts View on Github external
        const rows = objects.map((obj) => new ObjectDataRow(obj));
        this.data.setRows(rows);