chore: remove unused link icon type (#30469)

This commit is contained in:
ga_o 2026-01-06 11:10:06 +09:00 committed by GitHub
parent 7e3bfb9250
commit eccf79a710
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 6 deletions

View File

@ -70,6 +70,7 @@ class AppMode(StrEnum):
class IconType(StrEnum):
IMAGE = auto()
EMOJI = auto()
LINK = auto()
class App(Base):
@ -81,7 +82,7 @@ class App(Base):
name: Mapped[str] = mapped_column(String(255))
description: Mapped[str] = mapped_column(LongText, default=sa.text("''"))
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_background: Mapped[str | None] = mapped_column(String(255))
app_model_config_id = mapped_column(StringUUID, nullable=True)

View File

@ -32,7 +32,7 @@ from extensions.ext_redis import redis_client
from factories import variable_factory
from libs.datetime_utils import naive_utc_now
from models import Account, App, AppMode
from models.model import AppModelConfig
from models.model import AppModelConfig, IconType
from models.workflow import Workflow
from services.plugin.dependencies_analysis import DependenciesAnalysisService
from services.workflow_draft_variable_service import WorkflowDraftVariableService
@ -428,10 +428,10 @@ class AppDslService:
# Set 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
else:
icon_type = "emoji"
icon_type = IconType.EMOJI.value
icon = icon or str(app_data.get("icon", ""))
if app:

View File

@ -114,7 +114,7 @@ class TestAppModelValidation:
def test_icon_type_validation(self):
"""Test icon type enum values."""
# 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):
"""Test desc_or_prompt property when description exists."""

View File

@ -316,7 +316,7 @@ export type SiteConfig = {
use_icon_as_answer_icon: boolean
}
export type AppIconType = 'image' | 'emoji'
export type AppIconType = 'image' | 'emoji' | 'link'
/**
* App