mirror of https://github.com/langgenius/dify.git
chore: remove unused link icon type (#30469)
This commit is contained in:
parent
7e3bfb9250
commit
eccf79a710
|
|
@ -70,6 +70,7 @@ class AppMode(StrEnum):
|
||||||
class IconType(StrEnum):
|
class IconType(StrEnum):
|
||||||
IMAGE = auto()
|
IMAGE = auto()
|
||||||
EMOJI = auto()
|
EMOJI = auto()
|
||||||
|
LINK = auto()
|
||||||
|
|
||||||
|
|
||||||
class App(Base):
|
class App(Base):
|
||||||
|
|
@ -81,7 +82,7 @@ class App(Base):
|
||||||
name: Mapped[str] = mapped_column(String(255))
|
name: Mapped[str] = mapped_column(String(255))
|
||||||
description: Mapped[str] = mapped_column(LongText, default=sa.text("''"))
|
description: Mapped[str] = mapped_column(LongText, default=sa.text("''"))
|
||||||
mode: Mapped[str] = mapped_column(String(255))
|
mode: Mapped[str] = mapped_column(String(255))
|
||||||
icon_type: Mapped[str | None] = mapped_column(String(255)) # image, emoji
|
icon_type: Mapped[str | None] = mapped_column(String(255)) # image, emoji, link
|
||||||
icon = mapped_column(String(255))
|
icon = mapped_column(String(255))
|
||||||
icon_background: Mapped[str | None] = mapped_column(String(255))
|
icon_background: Mapped[str | None] = mapped_column(String(255))
|
||||||
app_model_config_id = mapped_column(StringUUID, nullable=True)
|
app_model_config_id = mapped_column(StringUUID, nullable=True)
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ from extensions.ext_redis import redis_client
|
||||||
from factories import variable_factory
|
from factories import variable_factory
|
||||||
from libs.datetime_utils import naive_utc_now
|
from libs.datetime_utils import naive_utc_now
|
||||||
from models import Account, App, AppMode
|
from models import Account, App, AppMode
|
||||||
from models.model import AppModelConfig
|
from models.model import AppModelConfig, IconType
|
||||||
from models.workflow import Workflow
|
from models.workflow import Workflow
|
||||||
from services.plugin.dependencies_analysis import DependenciesAnalysisService
|
from services.plugin.dependencies_analysis import DependenciesAnalysisService
|
||||||
from services.workflow_draft_variable_service import WorkflowDraftVariableService
|
from services.workflow_draft_variable_service import WorkflowDraftVariableService
|
||||||
|
|
@ -428,10 +428,10 @@ class AppDslService:
|
||||||
|
|
||||||
# Set icon type
|
# Set icon type
|
||||||
icon_type_value = icon_type or app_data.get("icon_type")
|
icon_type_value = icon_type or app_data.get("icon_type")
|
||||||
if icon_type_value in ["emoji", "link", "image"]:
|
if icon_type_value in [IconType.EMOJI.value, IconType.IMAGE.value, IconType.LINK.value]:
|
||||||
icon_type = icon_type_value
|
icon_type = icon_type_value
|
||||||
else:
|
else:
|
||||||
icon_type = "emoji"
|
icon_type = IconType.EMOJI.value
|
||||||
icon = icon or str(app_data.get("icon", ""))
|
icon = icon or str(app_data.get("icon", ""))
|
||||||
|
|
||||||
if app:
|
if app:
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ class TestAppModelValidation:
|
||||||
def test_icon_type_validation(self):
|
def test_icon_type_validation(self):
|
||||||
"""Test icon type enum values."""
|
"""Test icon type enum values."""
|
||||||
# Assert
|
# Assert
|
||||||
assert {t.value for t in IconType} == {"image", "emoji"}
|
assert {t.value for t in IconType} == {"image", "emoji", "link"}
|
||||||
|
|
||||||
def test_app_desc_or_prompt_with_description(self):
|
def test_app_desc_or_prompt_with_description(self):
|
||||||
"""Test desc_or_prompt property when description exists."""
|
"""Test desc_or_prompt property when description exists."""
|
||||||
|
|
|
||||||
|
|
@ -316,7 +316,7 @@ export type SiteConfig = {
|
||||||
use_icon_as_answer_icon: boolean
|
use_icon_as_answer_icon: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AppIconType = 'image' | 'emoji'
|
export type AppIconType = 'image' | 'emoji' | 'link'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* App
|
* App
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue