DEV Community

iron_man
iron_man

Posted on Edited on

PlanH


const remainingInvalidKeys = new Set(
    (run?.objects || []).map(object => object.name + '\u0000' + object.type)
);

const invalidActions = (run?.actions || []).filter(
    action =>
        action.source === 'COMPILE' &&
        remainingInvalidKeys.has(
            action.objectName + '\u0000' + action.objectType
        )
);

const availableObjectTypes = Array.from(
    new Set(invalidActions.map(action => action.objectType))
).sort();

const matchingInvalidActions = invalidActions.filter(action => {
    const matchesType =
        objectType === 'ALL' || action.objectType === objectType;

    const matchesSearch =
        (action.objectName + ' ' + action.objectType)
            .toLowerCase()
            .includes(filter.toLowerCase());

    return matchesType && matchesSearch;
});

const visible = matchingInvalidActions.slice(0, shownObjects);






setShownObjects(100);

const remainingKeys = new Set(
    result.run.objects.map(object => object.name + '\u0000' + object.type)
);

const nextSelected = result.run.actions.find(
    action =>
        action.source === 'COMPILE' &&
        remainingKeys.has(action.objectName + '\u0000' + action.objectType)
);

setSelected(nextSelected || null);



Enter fullscreen mode Exit fullscreen mode

Top comments (0)