refactor: improves readability

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

View File

@ -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
// }

View File

@ -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)
);
};