mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-27 19:28:11 +08:00
Improve label picking (#1179)
* add simple error message helper * port all label name pickers to use the new LabelInput component * use pure components where possible * cleanup * more cleanup * lint * change new label prompt
This commit is contained in:
@@ -55,46 +55,40 @@ const Annotations = (
|
||||
}
|
||||
|
||||
/* CATEGORY */
|
||||
case "annotation: activate add new label mode":
|
||||
case "annotation: activate add new label mode": {
|
||||
return {
|
||||
...state,
|
||||
isAddingNewLabel: true,
|
||||
categoryAddingNewLabel: action.data
|
||||
};
|
||||
case "annotation: activate add new ontology label mode":
|
||||
return {
|
||||
...state,
|
||||
isAddingNewLabelFromOntology: true,
|
||||
categoryAddingNewLabelFromOntology: action.data
|
||||
};
|
||||
case "annotation: disable add new ontology label mode":
|
||||
return {
|
||||
...state,
|
||||
isAddingNewLabelFromOntology: false,
|
||||
categoryAddingNewLabelFromOntology: null
|
||||
};
|
||||
}
|
||||
|
||||
case "annotation: disable add new label mode":
|
||||
case "annotation: disable add new label mode": {
|
||||
return {
|
||||
...state,
|
||||
isAddingNewLabel: false,
|
||||
categoryAddingNewLabel: null
|
||||
};
|
||||
case "annotation: activate category edit mode":
|
||||
}
|
||||
|
||||
case "annotation: activate category edit mode": {
|
||||
return {
|
||||
...state,
|
||||
isEditingCategoryName: true,
|
||||
categoryBeingEdited: action.data
|
||||
};
|
||||
case "annotation: disable category edit mode":
|
||||
}
|
||||
|
||||
case "annotation: disable category edit mode": {
|
||||
return {
|
||||
...state,
|
||||
isEditingCategoryName: false,
|
||||
categoryBeingEdited: null
|
||||
};
|
||||
}
|
||||
|
||||
/* LABEL */
|
||||
case "annotation: activate edit label mode":
|
||||
case "annotation: activate edit label mode": {
|
||||
return {
|
||||
...state,
|
||||
isEditingLabelName: true,
|
||||
@@ -103,12 +97,16 @@ const Annotations = (
|
||||
label: action.categoryIndex
|
||||
}
|
||||
};
|
||||
case "annotation: cancel edit label mode":
|
||||
}
|
||||
|
||||
case "annotation: cancel edit label mode": {
|
||||
return {
|
||||
...state,
|
||||
isEditingLabelName: false,
|
||||
labelEditable: { category: null, label: null }
|
||||
};
|
||||
}
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user