Skip to content

Commit

Permalink
conditional to hide import from text if OpenAI isn't enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
domezi committed Dec 3, 2024
1 parent 4cf74f9 commit e0be273
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/pages/g/_groupSlug/r/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export default defineComponent({
const { $auth, $globals, i18n } = useContext();
const appInfo = useAppInfo();
const enableOpenAI = computed(() => appInfo.value?.enableOpenai);
const enableOpenAIImages = computed(() => appInfo.value?.enableOpenaiImageServices);
const subpages = computed<MenuItem[]>(() => [
Expand All @@ -62,6 +63,7 @@ export default defineComponent({
icon: $globals.icons.text,
text: i18n.tc("recipe.import-from-plaintext"),
value: "plaintext",
hide: !enableOpenAI.value,
},
{
icon: $globals.icons.fileImage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from tests.utils.factories import random_int, random_string
from tests.utils.fixture_schemas import TestUser


def test_openai_create_recipe_from_text(
api_client: TestClient,
monkeypatch: pytest.MonkeyPatch,
Expand Down Expand Up @@ -50,6 +51,7 @@ async def mock_get_response(self, prompt: str, message: str, *args, **kwargs) ->
r = api_client.get(api_routes.recipes_slug(slug), headers=unique_user.token)
assert r.status_code == 200


def test_openai_create_recipe_from_text_with_translation(
api_client: TestClient,
monkeypatch: pytest.MonkeyPatch,
Expand Down

0 comments on commit e0be273

Please sign in to comment.