Skip to content

Commit

Permalink
Support #35284 - Add attachments on MolecularAnalysisRun
Browse files Browse the repository at this point in the history
- Added attachments relationship to the type.
- Removed duplicate types and merged them into one type for each. Changed imports to use the merged version.
  • Loading branch information
brandonandre committed Dec 3, 2024
1 parent ca0eb9c commit 0bd8bd4
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PcrBatchItem, SeqReaction } from "../../types/seqdb-api";
import { MolecularAnalysisRunItem } from "../..//types/seqdb-api/resources/MolecularAnalysisRunItem";
import { useEffect, useState } from "react";
import {
BulkGetOptions,
Expand All @@ -12,14 +11,15 @@ import {
useStringComparator
} from "common-ui";
import { StorageUnitUsage } from "../../types/collection-api/resources/StorageUnitUsage";
import { MolecularAnalysisRun } from "../../types/seqdb-api/resources/MolecularAnalysisRun";
import { KitsuResource, PersistedResource } from "kitsu";
import { MaterialSampleSummary } from "../../types/collection-api";
import { useDinaIntl } from "../../intl/dina-ui-intl";
import { ColumnDef } from "@tanstack/react-table";
import Link from "next/link";
import { attachGenericMolecularAnalysisItems } from "../seqdb/molecular-analysis-workflow/useGenericMolecularAnalysisRun";
import { GenericMolecularAnalysisItem } from "packages/dina-ui/types/seqdb-api/resources/GenericMolecularAnalysisItem";
import { MolecularAnalysisRunItem } from "packages/dina-ui/types/seqdb-api/resources/molecular-analysis/MolecularAnalysisRunItem";
import { MolecularAnalysisRun } from "packages/dina-ui/types/seqdb-api/resources/molecular-analysis/MolecularAnalysisRun";

export interface UseMolecularAnalysisRunProps {
seqBatchId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { SeqdbMessage } from "../../../intl/seqdb-intl";
import { useMaterialSampleRelationshipColumns } from "../../collection/material-sample/useMaterialSampleRelationshipColumns";
import { GenericMolecularAnalysis } from "packages/dina-ui/types/seqdb-api/resources/GenericMolecularAnalysis";
import { GenericMolecularAnalysisItem } from "packages/dina-ui/types/seqdb-api/resources/GenericMolecularAnalysisItem";
import { MolecularAnalysisRunItem } from "packages/dina-ui/types/seqdb-api/resources/MolecularAnalysisRunItem";
import { MolecularAnalysisRunItem } from "packages/dina-ui/types/seqdb-api/resources/molecular-analysis/MolecularAnalysisRunItem";

export interface MolecularAnalysisSampleSelectionStepProps {
molecularAnalysisId: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { MolecularAnalysisRunItem } from "packages/dina-ui/types/seqdb-api/resources/MolecularAnalysisRunItem";
import { useEffect, useState } from "react";
import { filterBy, SaveArgs, useApiClient, useQuery } from "common-ui";
import { StorageUnitUsage } from "packages/dina-ui/types/collection-api/resources/StorageUnitUsage";
import { MolecularAnalysisRun } from "packages/dina-ui/types/seqdb-api/resources/MolecularAnalysisRun";
import { PersistedResource } from "kitsu";
import { MaterialSampleSummary } from "packages/dina-ui/types/collection-api";
import { useDinaIntl } from "../../../intl/dina-ui-intl";
import { GenericMolecularAnalysisItem } from "packages/dina-ui/types/seqdb-api/resources/GenericMolecularAnalysisItem";
import { GenericMolecularAnalysis } from "packages/dina-ui/types/seqdb-api/resources/GenericMolecularAnalysis";
import { MolecularAnalysisRunItem } from "packages/dina-ui/types/seqdb-api/resources/molecular-analysis/MolecularAnalysisRunItem";
import { MolecularAnalysisRun } from "packages/dina-ui/types/seqdb-api/resources/molecular-analysis/MolecularAnalysisRun";

export interface UseGenericMolecularAnalysisRunProps {
molecularAnalysis: GenericMolecularAnalysis;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { SeqReactionDndTable } from "./seq-reaction-step/SeqReactionDndTable";
import { ColumnDef } from "@tanstack/react-table";
import { useSeqReactionState } from "./seq-reaction-step/useSeqReactionState";
import { StorageUnitUsage } from "packages/dina-ui/types/collection-api/resources/StorageUnitUsage";
import { MolecularAnalysisRunItem } from "packages/dina-ui/types/seqdb-api/resources/MolecularAnalysisRunItem";
import { MolecularAnalysisRunItem } from "packages/dina-ui/types/seqdb-api/resources/molecular-analysis/MolecularAnalysisRunItem";

export interface SangerSeqReactionStepProps {
seqBatch?: SeqBatch;
Expand Down
4 changes: 1 addition & 3 deletions packages/dina-ui/pages/seqdb/molecular-analysis-run/list.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import {
ColumnDefinition,
CreateButton,
FieldHeader,
ListPageLayout,
dateCell,
descriptionCell,
titleCell
} from "common-ui";
import Link from "next/link";
import { groupCell } from "../../../components";
import PageLayout from "../../../components/page/PageLayout";
import { MolecularAnalysisRun } from "../../../types/seqdb-api/resources/MolecularAnalysisRun";
import { MolecularAnalysisRun } from "../../../types/seqdb-api/resources/molecular-analysis/MolecularAnalysisRun";

const MOLECULAR_ANALYSIS_RUN_FILTER_ATTRIBUTES = ["name"];
const MOLECULAR_ANALYSIS_RUN_TABLE_COLUMNS: ColumnDefinition<MolecularAnalysisRun>[] =
Expand Down
4 changes: 1 addition & 3 deletions packages/dina-ui/pages/seqdb/molecular-analysis-run/view.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { DinaForm, DeleteButton, useApiClient, Operation } from "common-ui";
import { DinaForm } from "common-ui";
import { ViewPageLayout } from "../../../components";
import { MolecularAnalysisRun } from "../../../types/seqdb-api/resources/molecular-analysis/MolecularAnalysisRun";
import { MolecularAnalysisRunFormFields } from "../../../components/molecular-analysis/MolecularAnalysisRunFormFields";
import { MolecularAnalysisRunItem } from "../../../types/seqdb-api/resources/MolecularAnalysisRunItem";

export default function MolecularAnalysisRunViewPage() {
const { doOperations, apiClient } = useApiClient();
return (
<ViewPageLayout<MolecularAnalysisRun>
form={(props) => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { KitsuResource } from "kitsu";
import { ResourceIdentifierObject } from "jsonapi-typescript";
import { GenericMolecularAnalysis } from "./GenericMolecularAnalysis";
import { MolecularAnalysisRunItem } from "./MolecularAnalysisRunItem";
import { StorageUnitUsage } from "../../collection-api/resources/StorageUnitUsage";
import { MolecularAnalysisRunItem } from "./molecular-analysis/MolecularAnalysisRunItem";

export interface GenericMolecularAnalysisItemAttributes {
type: "generic-molecular-analysis-item";
Expand Down

This file was deleted.

12 changes: 0 additions & 12 deletions packages/dina-ui/types/seqdb-api/resources/MolecularAnalysisRun.ts

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion packages/dina-ui/types/seqdb-api/resources/SeqReaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PcrBatchItem } from "./PcrBatchItem";
import { PcrPrimer } from "./PcrPrimer";
import { SeqBatch } from "./SeqBatch";
import { StorageUnitUsage } from "../../collection-api/resources/StorageUnitUsage";
import { MolecularAnalysisRunItem } from "./MolecularAnalysisRunItem";
import { MolecularAnalysisRunItem } from "./molecular-analysis/MolecularAnalysisRunItem";

export interface SeqReactionAttributes {
type: "seq-reaction";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { ResourceIdentifierObject } from "jsonapi-typescript";
import { KitsuResource } from "kitsu";

export interface MolecularAnalysisRunAttributes {
type: "molecular-analysis-run";
name?: string;
group?: string;
createdBy?: string;
createdOn?: string;
group?: string;
name?: string;
}

export interface MolecularAnalysisRunRelationships {
attachments?: ResourceIdentifierObject[];
}

export type MolecularAnalysisRun = KitsuResource &
MolecularAnalysisRunAttributes;
MolecularAnalysisRunAttributes &
MolecularAnalysisRunRelationships;
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ export interface MolecularAnalysisRunItemAttributes {
type: "molecular-analysis-run-item";
createdBy?: string;
createdOn?: string;
usageType: string;
}

export interface MolecularAnalysisRunItemRelationships {
run: MolecularAnalysisRun;
run?: MolecularAnalysisRun;
result?: MolecularAnalysisResult;
}

Expand Down

0 comments on commit 0bd8bd4

Please sign in to comment.