Skip to content

Molecule and PS bulk import by file#1998

Open
XingY wants to merge 18 commits into
developfrom
fb_moleculeImport
Open

Molecule and PS bulk import by file#1998
XingY wants to merge 18 commits into
developfrom
fb_moleculeImport

Conversation

@XingY
Copy link
Copy Markdown
Contributor

@XingY XingY commented May 7, 2026

Rationale

Modified utils to query for imported dataclass counts after cross-type imports (e.g., Molecule imports that create NucSequence, Compound, and MolecularSpecies rows).

Related Pull Requests

Changes

  • getGridIdsFromTransactionId return type changed from string[] to DataTypeRowIdsFromTransactionIds (includes rowIds, dataTypeRowCounts)
  • selectGridIdsFromTransactionId updated to match new return type
  • getSampleTypesFromTransactionIds refactored to delegate to shared getDataTypesFromTransactionId helper; return type uses generic dataTypes field instead of sampleTypes
  • New getDataClassesFromTransactionIds function — resolves DataClass names and builds per-type row counts from transaction audit IDs
  • New DataTypeRowIdsFromTransactionIds type exported

@XingY XingY requested a review from labkey-nicka May 14, 2026 20:57
async function getDataTypesFromTransactionId(
transactionAuditId: number | string,
auditDataType: string,
schemaName: string,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to accept a SchemaQuery. Trying to no longer pass schema/query as separate arguments.

return { rowIds, dataTypeRowCounts, dataTypes: distinct.values };
}

export function getSampleTypesFromTransactionIds(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think getSampleTypesFromTransactionIds and getDataClassesFromTransactionIds should be moved to entities/actions folder.

const rowIds = response.rowIds.map(rowId => rowId.toString());
return {
rowIds,
dataTypeRowCounts: response['dataTypeRowCounts'],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just escaping the typings. I would consider declaring a new type

type GetTransactionRowIdsResponse = {
    dataTypeRowCounts: Record<number, number>;
    rowIds: number[];
    success: boolean;
};

using that on request:

const response = await request<GetTransactionRowIdsResponse>({
    url: ActionURL.buildURL('audit', 'getTransactionRowIds.api'),
    params: {
        containerFilter: getContainerFilterForFolder(containerPath),
        dataType,
        transactionAuditId,
    },
    errorLogMsg,
});

and use a normal dereference:

return { dataTypeRowCounts: response.dataTypeRowCounts, rowIds };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants