mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-15 07:31:53 +03:00
refactor: improves readability
This commit is contained in:
parent
7b543ec2c1
commit
c347878f23
@ -57,15 +57,15 @@ const isValueBelongOption = (
|
|||||||
option: KanbanGroup
|
option: KanbanGroup
|
||||||
) => {
|
) => {
|
||||||
switch (propertyValue.type) {
|
switch (propertyValue.type) {
|
||||||
case PropertyType.Select: {
|
case PropertyType.Select || PropertyType.Status: {
|
||||||
return propertyValue.value === option.id;
|
return propertyValue.value === option.id;
|
||||||
}
|
}
|
||||||
case PropertyType.MultiSelect: {
|
case PropertyType.MultiSelect: {
|
||||||
return propertyValue.value.some(i => i === option.id);
|
return propertyValue.value.some(i => i === option.id);
|
||||||
}
|
}
|
||||||
case PropertyType.Status: {
|
// case PropertyType.Status: {
|
||||||
return propertyValue.value === option.id;
|
// return propertyValue.value === option.id;
|
||||||
}
|
// }
|
||||||
// case PropertyType.Text: {
|
// case PropertyType.Text: {
|
||||||
// TOTODO:DO support this type
|
// TOTODO:DO support this type
|
||||||
// }
|
// }
|
||||||
|
@ -276,12 +276,12 @@ export const getRecastItemValue = (block: RecastItem | AsyncBlock) => {
|
|||||||
|
|
||||||
const isSelectLikeProperty = (
|
const isSelectLikeProperty = (
|
||||||
metaProperty?: RecastMetaProperty
|
metaProperty?: RecastMetaProperty
|
||||||
): metaProperty is SelectProperty | MultiSelectProperty => {
|
): metaProperty is SelectProperty | MultiSelectProperty | StatusProperty => {
|
||||||
return !(
|
return (
|
||||||
!metaProperty ||
|
metaProperty &&
|
||||||
(metaProperty.type !== PropertyType.Status &&
|
(metaProperty.type === PropertyType.Status ||
|
||||||
metaProperty.type !== PropertyType.Select &&
|
metaProperty.type === PropertyType.Select ||
|
||||||
metaProperty.type !== PropertyType.MultiSelect)
|
metaProperty.type === PropertyType.MultiSelect)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user