this.deleteAnnotationLayerIfConfirmed(readableName, layer)}>
+ getDeleteAnnotationLayerDropdownOption = (
+ readableName: string,
+ type: AnnotationLayerType,
+ tracingId: string,
+ layer?: APIDataLayer,
+ ) => (
+
this.deleteAnnotationLayerIfConfirmed(readableName, type, tracingId, layer)}
+ >
Delete this annotation layer
);
deleteAnnotationLayerIfConfirmed = async (
- readableAnnoationLayerName: string,
+ readableAnnotationLayerName: string,
+ type: AnnotationLayerType,
+ tracingId: string,
layer?: APIDataLayer,
) => {
const fallbackLayerNote =
@@ -481,7 +495,7 @@ class DatasetSettings extends React.PureComponent
{
: "";
const shouldDelete = await confirmAsync({
title: `Deleting an annotation layer makes its content and history inaccessible. ${fallbackLayerNote}This cannot be undone. Are you sure you want to delete this layer?`,
- okText: `Yes, delete annotation layer “${readableAnnoationLayerName}”`,
+ okText: `Yes, delete annotation layer “${readableAnnotationLayerName}”`,
cancelText: "Cancel",
maskClosable: true,
closable: true,
@@ -495,12 +509,8 @@ class DatasetSettings extends React.PureComponent {
},
});
if (!shouldDelete) return;
+ this.props.deleteAnnotationLayer(tracingId, type, readableAnnotationLayerName);
await Model.ensureSavedState();
- await deleteAnnotationLayer(
- this.props.tracing.annotationId,
- this.props.tracing.annotationType,
- readableAnnoationLayerName,
- );
location.reload();
};
@@ -619,6 +629,8 @@ class DatasetSettings extends React.PureComponent {
const { intensityRange } = layerSettings;
const layer = getLayerByName(dataset, layerName);
const isSegmentation = layer.category === "segmentation";
+ const layerType =
+ layer.category === "segmentation" ? AnnotationLayerEnum.Volume : AnnotationLayerEnum.Skeleton;
const canBeMadeEditable =
isSegmentation && layer.tracingId == null && this.props.controlMode === "TRACE";
const isVolumeTracing = isSegmentation ? layer.tracingId != null : false;
@@ -683,7 +695,12 @@ class DatasetSettings extends React.PureComponent {
? {
label: (
- {this.getDeleteAnnotationLayerDropdownOption(readableName, layer)}
+ {this.getDeleteAnnotationLayerDropdownOption(
+ readableName,
+ layerType,
+ layer.tracingId,
+ layer,
+ )}
),
key: "deleteAnnotationLayer",
@@ -1136,21 +1153,12 @@ class DatasetSettings extends React.PureComponent {
}
return (
-
- this.showDownsampleVolumeModal(volumeTracing)}>
-
-
+
+
);
};
@@ -1167,7 +1175,7 @@ class DatasetSettings extends React.PureComponent {
const readableName = "Skeleton";
const skeletonTracing = enforceSkeletonTracing(tracing);
const isOnlyAnnotationLayer = tracing.annotationLayers.length === 1;
- const { showSkeletons } = skeletonTracing;
+ const { showSkeletons, tracingId } = skeletonTracing;
const activeNodeRadius = getActiveNode(skeletonTracing)?.radius ?? 0;
return (
@@ -1218,7 +1226,13 @@ class DatasetSettings extends React.PureComponent {
}}
>
- {!isOnlyAnnotationLayer ? this.getDeleteAnnotationLayerButton(readableName) : null}
+ {!isOnlyAnnotationLayer
+ ? this.getDeleteAnnotationLayerButton(
+ readableName,
+ AnnotationLayerEnum.Skeleton,
+ tracingId,
+ )
+ : null}
{showSkeletons ? (
@@ -1292,18 +1306,6 @@ class DatasetSettings extends React.PureComponent