Skip to content

Commit fe371fc

Browse files
authored
Change Advanced search to no preview (#284)
* Change Advanced search to no preview
1 parent 358611b commit fe371fc

File tree

7 files changed

+35
-64
lines changed

7 files changed

+35
-64
lines changed

api/requirements.txt

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
# The Python Worker is managed by Azure Functions platform
33
# Manually managing azure-functions-worker may cause unexpected issues
44

5-
azure-functions
6-
pint>=0.20.1
7-
recipe-scrapers>=14.24.0
8-
python-multipart>=0.0.5
9-
Pillow>=9.2.0
10-
pillow-avif-plugin>=1.4.3
11-
pytest
12-
openai
13-
azure-cosmos
14-
jsonschema
15-
azure-search-documents
5+
azure-functions~=1.18
6+
pint~=0.20
7+
recipe-scrapers~=14.55
8+
python-multipart~=0.0.5
9+
Pillow~=9.2
10+
pillow-avif-plugin~=1.4
11+
pytest~=8.1
12+
azure-cosmos~=4.6
13+
jsonschema~=4.21
14+
lxml==5.1.0

public/locales/en/translation.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
"storageDescription": "Space used {{used}} of {{remaining}} available.",
6262
"enableRecipeHighlighting": "Enable recipe highlighting",
6363
"enableRecipeHighlightingDescription": "Highlight ingredient quantities and UOMs and step details",
64-
"enableAdvancedSearch": "Enable advanced search (preview)",
65-
"enableAdvancedSearchDescription": "Allows searching through recipe title, ingredients and steps",
6664
"enableYoutubeVideos": "Enable YouTube videos (preview)",
6765
"enableYoutubeVideosDescription": "Allows for adding YouTube videos to recipes in addition to images",
6866
"enableCloudShare": "Enable cloud share (preview)",

public/locales/pt/translation.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
"storageDescription": "Espaço usado {{used}} de {{remaining}} disponível.",
6262
"enableRecipeHighlighting": "Ativar o realce da receita",
6363
"enableRecipeHighlightingDescription": "Realce quantidades de ingredientes, unidades de medida e detalhes da etapa",
64-
"enableAdvancedSearch": "Ativar pesquisa avançada (preview)",
65-
"enableAdvancedSearchDescription": "Permite pesquisar pelo título da receita, ingredientes e etapas",
6664
"enableYoutubeVideos": "Ativar videos do YouTube (preview)",
6765
"enableYoutubeVideosDescription": "Permite adicionar vídeos do YouTube em receitas",
6866
"enableCloudShare": "Ativar compartilhamento na nuvem (preview)",

src/pages/index.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ let allRecipes = [] as RecipeViewModel[];
2020
let debouncedWatch: (currentValue: string, oldValue: string) => void;
2121
let debouncedScroll: (currentValue: number) => void;
2222
const addOptions = ref([] as Array<{ name: string, text: string, action: () => void }>);
23-
let enableAdvancedSearch = false;
2423
let enableCloudShare = false;
2524
2625
function sortByTitle(items: Array<RecipeViewModel>) {
@@ -70,8 +69,6 @@ async function sort(type: string, items: Array<RecipeViewModel>, saveSort: boole
7069
}
7170
7271
onMounted(async () => {
73-
const enableAdvancedSearchSetting = await getSetting("EnableAdvancedSearch", "false");
74-
enableAdvancedSearch = enableAdvancedSearchSetting == "true";
7572
const enableCloudShareSetting = await getSetting("EnableCloudShare", "false");
7673
enableCloudShare = enableCloudShareSetting == "true";
7774
@@ -261,7 +258,7 @@ function simpleSearchInText(a: string, b: string) {
261258
<div class="flex flex-col mb-2">
262259
<input ref="searchInput" type="search" data-testid="search-input" :placeholder="t('pages.index.search')"
263260
v-model="searchText" class="p-2 my-2 rounded text-black" />
264-
<div v-if="enableAdvancedSearch" class="flex">
261+
<div class="flex">
265262
<button type="button" data-testid="search-by-title"
266263
class="bg-theme-primary hover:bg-theme-secondary text-white font-bold p-2 my-2 rounded"
267264
@click="setSearchType(t('pages.index.filterByTitle'))">{{ t("pages.index.filterByTitle") }}</button>

src/pages/options.vue

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const state = useState()!;
1414
const router = useRouter()!;
1515
const version = ref("");
1616
const useFractions = ref(false);
17-
const enableAdvancedSearch = ref(false);
1817
const enableYoutubeVideos = ref(false);
1918
const enableCloudShare = ref(false);
2019
const enableNutritionFacts = ref(false);
@@ -33,14 +32,12 @@ onMounted(async () => {
3332
3433
const stepsInvervalValue = await getSetting("StepsInterval", "5");
3534
const useFractionsValue = await getSetting("UseFractions", "false");
36-
const enableAdvancedSearchValue = await getSetting("EnableAdvancedSearch", "false");
3735
const enableYoutubeVideosValue = await getSetting("EnableYoutubeVideos", "false");
3836
const enableCloudShareValue = await getSetting("EnableCloudShare", "false");
3937
const enableNutritionFactsValue = await getSetting("EnableNutritionFacts", "false");
4038
4139
stepsInterval.value = parseInt(stepsInvervalValue);
4240
useFractions.value = useFractionsValue === "true";
43-
enableAdvancedSearch.value = enableAdvancedSearchValue === "true";
4441
enableYoutubeVideos.value = enableYoutubeVideosValue === "true";
4542
enableCloudShare.value = enableCloudShareValue === "true";
4643
enableNutritionFacts.value = enableNutritionFactsValue === "true";
@@ -108,10 +105,6 @@ function updateUseFractions() {
108105
saveSetting("UseFractions", `${useFractions.value}`);
109106
}
110107
111-
function updateEnableAdvancedSearch() {
112-
saveSetting("EnableAdvancedSearch", `${enableAdvancedSearch.value}`);
113-
}
114-
115108
function updateEnableYoutubeVideos() {
116109
saveSetting("EnableYoutubeVideos", `${enableYoutubeVideos.value}`);
117110
}
@@ -187,16 +180,6 @@ async function setSelectedLanguage() {
187180
<span class="text-gray-500 text-sm">{{ t("pages.options.multiplierTypeDescription") }}</span>
188181
</div>
189182
</div>
190-
<div class="mt-4 p-2 rounded cursor-pointer active:bg-theme-secondary">
191-
<span class="dark:text-white">{{ t("pages.options.enableAdvancedSearch") }}</span>
192-
<label data-testid="enable-advanced-search-toggle" class="switch float-right align-middle">
193-
<input v-model="enableAdvancedSearch" type="checkbox" @change="updateEnableAdvancedSearch">
194-
<span class="slider round"></span>
195-
</label>
196-
<div>
197-
<span class="text-gray-500 text-sm">{{ t("pages.options.enableAdvancedSearchDescription") }}</span>
198-
</div>
199-
</div>
200183
<div class="mt-4 p-2 rounded cursor-pointer active:bg-theme-secondary">
201184
<span class="dark:text-white">{{ t("pages.options.enableYoutubeVideos") }}</span>
202185
<label data-testid="enable-youtube-videos-toggle" class="switch float-right align-middle">

tests/main.spec.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,7 @@ test('search simple', async ({ page, isMobile }) => {
120120
await expect(names.first()).toHaveText('Favorite cookie');
121121
});
122122

123-
async function enableAdvancedSearch(page: any) {
124-
await page.goto('#/options');
125-
await page.getByTestId('enable-advanced-search-toggle').click();
126-
}
127-
128123
test('search advanced by typing title', async ({ page, isMobile }) => {
129-
await enableAdvancedSearch(page);
130124
await createRecipe(page, 2, "Favorite cookie", 5, ["1 cookie dough"], ["Bake it!"]);
131125
await page.goto('/');
132126

@@ -139,7 +133,6 @@ test('search advanced by typing title', async ({ page, isMobile }) => {
139133
});
140134

141135
test('search advanced by typing ingredient', async ({ page, isMobile }) => {
142-
await enableAdvancedSearch(page);
143136
await createRecipe(page, 2, "Favorite cookie", 5, ["1 cookie dough"], ["Bake it!"]);
144137
await page.goto('/');
145138

@@ -152,7 +145,6 @@ test('search advanced by typing ingredient', async ({ page, isMobile }) => {
152145
});
153146

154147
test('search advanced by typing step', async ({ page, isMobile }) => {
155-
await enableAdvancedSearch(page);
156148
await createRecipe(page, 2, "Favorite cookie", 5, ["1 cookie dough"], ["Bake at 354F it!"]);
157149
await page.goto('/');
158150

@@ -166,7 +158,6 @@ test('search advanced by typing step', async ({ page, isMobile }) => {
166158

167159

168160
test('search advanced by selecting title', async ({ page, isMobile }) => {
169-
await enableAdvancedSearch(page);
170161
await createRecipe(page, 2, "Favorite cookie", 5, ["1 cookie dough"], ["Bake it!"]);
171162
await page.goto('/');
172163

@@ -180,7 +171,6 @@ test('search advanced by selecting title', async ({ page, isMobile }) => {
180171
});
181172

182173
test('search advanced by selecting ingredient', async ({ page, isMobile }) => {
183-
await enableAdvancedSearch(page);
184174
await createRecipe(page, 2, "Favorite cookie", 5, ["1 cookie dough"], ["Bake it!"]);
185175
await page.goto('/');
186176

@@ -194,7 +184,6 @@ test('search advanced by selecting ingredient', async ({ page, isMobile }) => {
194184
});
195185

196186
test('search advanced by selecting step', async ({ page, isMobile }) => {
197-
await enableAdvancedSearch(page);
198187
await createRecipe(page, 2, "Favorite cookie", 5, ["1 cookie dough"], ["Bake at 354F it!"]);
199188
await page.goto('/');
200189

vite.config.ts

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default defineConfig({
1515
},
1616
registerType: 'autoUpdate',
1717
manifest: {
18+
id: 'lpains.sharpcooking',
1819
name: 'Sharp Cooking',
1920
short_name: 'Sharp Cooking',
2021
description: 'Your recipe book app',
@@ -32,29 +33,35 @@ export default defineConfig({
3233
type: 'image/png',
3334
}
3435
],
35-
"shortcuts": [
36+
shortcuts: [
3637
{
37-
"name": "New Manual Recipe",
38-
"short_name": "New Manual Recipe",
39-
"description": "Create a new recipe manually",
40-
"url": "/#/recipe/0/edit?fromShortcut=1",
41-
"icons": [{ "src": "/shortcut-add-manual.png", "sizes": "192x192" }]
38+
name: "New Manual Recipe",
39+
short_name: "New Manual Recipe",
40+
description: "Create a new recipe manually",
41+
url: "/#/recipe/0/edit?fromShortcut=1",
42+
icons: [{ "src": "/shortcut-add-manual.png", "sizes": "192x192" }]
4243
},
4344
{
44-
"name": "Import From URL",
45-
"short_name": "New Recipe",
46-
"description": "Create a new recipe from a URL",
47-
"url": "/#/recipe/0/edit?import=1&fromShortcut=1",
48-
"icons": [{ "src": "/shortcut-add-url.png", "sizes": "192x192" }]
45+
name: "Import From URL",
46+
short_name: "New Recipe",
47+
description: "Create a new recipe from a URL",
48+
url: "/#/recipe/0/edit?import=1&fromShortcut=1",
49+
icons: [{ "src": "/shortcut-add-url.png", "sizes": "192x192" }]
4950
},
5051
{
51-
"name": "Scan a Recipe",
52-
"short_name": "New Recipe",
53-
"description": "Create a new recipe by scanning from an image",
54-
"url": "/#/recipe/import-ocr?fromShortcut=1",
55-
"icons": [{ "src": "/shortcut-add-scan.png", "sizes": "192x192" }]
52+
name: "Scan a Recipe",
53+
short_name: "New Recipe",
54+
description: "Create a new recipe by scanning from an image",
55+
url: "/#/recipe/import-ocr?fromShortcut=1",
56+
icons: [{ "src": "/shortcut-add-scan.png", "sizes": "192x192" }]
5657
}
57-
]
58+
],
59+
launch_handler: {
60+
client_mode: "focus-existing"
61+
},
62+
orientation: "portrait-primary",
63+
categories: ["food_and_drink"],
64+
dir: "ltr",
5865
}
5966
}),
6067
Pages({

0 commit comments

Comments
 (0)