-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Undo changes for transforming annotations and add new callout f…
…or mismatched alignments (#1191) #1046 Transforming annotations is now out of scope. Alignment of annotation has not been integrated with the BE yet, since that requires migrating the entire annotations query. <img width="684" alt="image" src="https://github.com/user-attachments/assets/c613c6f5-c496-4e19-aab8-901c2a8efb73"> <img width="694" alt="image" src="https://github.com/user-attachments/assets/3458a9eb-8b6c-41a6-9fa4-5097d0ab5062">
- Loading branch information
Showing
5 changed files
with
98 additions
and
67 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
frontend/packages/data-portal/app/components/Download/AnnotationAlignmentCallout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { Callout, CalloutTitle } from '@czi-sds/components' | ||
|
||
import { IdPrefix } from 'app/constants/idPrefixes' | ||
import { useI18n } from 'app/hooks/useI18n' | ||
import { TomogramV2 } from 'app/types/gqlResponseTypes' | ||
import { getTomogramName } from 'app/utils/tomograms' | ||
|
||
import { CopyBox } from '../CopyBox' | ||
import { I18n } from '../I18n' | ||
|
||
export interface AnnotationAlignmentCalloutProps { | ||
alignmentId: number | ||
initialState: 'open' | 'closed' | ||
misalignedTomograms: TomogramV2[] | ||
} | ||
|
||
export function AnnotationAlignmentCallout({ | ||
alignmentId, | ||
initialState, | ||
misalignedTomograms, | ||
}: AnnotationAlignmentCalloutProps) { | ||
const { t } = useI18n() | ||
|
||
return ( | ||
<Callout | ||
className="!w-full !mt-sds-xl !mb-sds-xxs" | ||
intent="notice" | ||
expandable | ||
sdsStage={initialState} | ||
> | ||
<CalloutTitle> | ||
<p className="text-sds-body-xs leading-sds-body-xs"> | ||
{t('annotationsMayRequireTransformation')} | ||
</p> | ||
</CalloutTitle> | ||
<p className="text-sds-header-xs leading-sds-header-xs mt-sds-default font-semibold"> | ||
{t('alignmentId')} | ||
</p> | ||
<CopyBox content={alignmentId} /> | ||
<p className="text-sds-body-xs leading-sds-body-xs mt-[10px]"> | ||
<I18n i18nKey="thisAnnotationRequiresTransformation" /> | ||
</p> | ||
<div className="bg-[#ffdb97] flex flex-col gap-[12px] mt-sds-xxs p-sds-s rounded-[2px]"> | ||
{misalignedTomograms?.map((tomogram) => ( | ||
<div className="text-sds-body-xxs !leading-[18px]"> | ||
<div className="font-semibold">{getTomogramName(tomogram)}</div> | ||
<div> | ||
Tomogram ID: {IdPrefix.Tomogram}-{tomogram.id} | ||
</div> | ||
{tomogram.alignment != null && ( | ||
<div> | ||
Alignment ID: {IdPrefix.Alignment}-{tomogram.alignment.id} | ||
</div> | ||
)} | ||
</div> | ||
))} | ||
</div> | ||
</Callout> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters