refactor: improves readability

This commit is contained in:
QiShaoXuan committed 2022-08-03 18:02:28 +08:00
1 parent 7b543ec2c1
commit c347878f23
2 files changed
+10 -10

No files matched your search

@@ -57,15 +57,15 @@ const isValueBelongOption = (
option: KanbanGroup
) => {
switch (propertyValue.type) {
case PropertyType.Select: {
case PropertyType.Select || PropertyType.Status: {
return propertyValue.value === option.id;
}
case PropertyType.MultiSelect: {
return propertyValue.value.some(i => i === option.id);
}
case PropertyType.Status: {
return propertyValue.value === option.id;
}
// case PropertyType.Status: {
// return propertyValue.value === option.id;
// }
// case PropertyType.Text: {
// TOTODO:DO support this type
// }
@@ -276,12 +276,12 @@ export const getRecastItemValue = (block: RecastItem | AsyncBlock) => {
const isSelectLikeProperty = (
metaProperty?: RecastMetaProperty
): metaProperty is SelectProperty | MultiSelectProperty => {
return !(
!metaProperty ||
(metaProperty.type !== PropertyType.Status &&
metaProperty.type !== PropertyType.Select &&
metaProperty.type !== PropertyType.MultiSelect)
): metaProperty is SelectProperty | MultiSelectProperty | StatusProperty => {
return (
metaProperty &&
(metaProperty.type === PropertyType.Status ||
metaProperty.type === PropertyType.Select ||
metaProperty.type === PropertyType.MultiSelect)
);
};