Compare commits
7 Commits
feat/DayOf
...
2eabca5a31
| Author | SHA1 | Date | |
|---|---|---|---|
| 2eabca5a31 | |||
| 50ce471623 | |||
|
|
52e78d4ea5 | ||
|
|
a9fe369abc | ||
|
|
ea9fe980f0 | ||
|
|
d367826ce0 | ||
|
|
fdf1ae938f |
@@ -190,6 +190,13 @@ function App() {
|
|||||||
}
|
}
|
||||||
}, [auth?.login, easterEgg?.duration, easterEgg?.url, eggImage]);
|
}, [auth?.login, easterEgg?.duration, easterEgg?.url, eggImage]);
|
||||||
|
|
||||||
|
const doAddClickFoodChoice = async (location: Locations, foodIndex: number) => {
|
||||||
|
const locationKey = Object.keys(Locations).find(key => Locations[key as keyof typeof Locations] === location) as LocationKey;
|
||||||
|
if (auth?.login) {
|
||||||
|
await errorHandler(() => addChoice(locationKey, foodIndex, dayIndex));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const doAddChoice = async (event: React.ChangeEvent<HTMLSelectElement>) => {
|
const doAddChoice = async (event: React.ChangeEvent<HTMLSelectElement>) => {
|
||||||
const locationKey = event.target.value as LocationKey;
|
const locationKey = event.target.value as LocationKey;
|
||||||
if (auth?.login) {
|
if (auth?.login) {
|
||||||
@@ -332,15 +339,15 @@ function App() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderFoodTable = (name: string, menu: DayMenu) => {
|
const renderFoodTable = (name: string, location: Locations, menu: DayMenu) => {
|
||||||
let content;
|
let content;
|
||||||
if (menu?.closed) {
|
if (menu?.closed) {
|
||||||
content = <h3>Zavřeno</h3>
|
content = <h3>Zavřeno</h3>
|
||||||
} else if (menu?.food?.length > 0) {
|
} else if (menu?.food?.length > 0) {
|
||||||
content = <Table striped bordered hover>
|
content = <Table striped bordered hover>
|
||||||
<tbody>
|
<tbody style={{ cursor: 'pointer' }}>
|
||||||
{menu.food.filter(f => (settings?.hideSoups ? !f.isSoup : true)).map((f: any, index: number) =>
|
{menu.food.filter(f => (settings?.hideSoups ? !f.isSoup : true)).map((f: any, index: number) =>
|
||||||
<tr key={index}>
|
<tr key={index} onClick={() => doAddClickFoodChoice(location, index)}>
|
||||||
<td>{f.amount}</td>
|
<td>{f.amount}</td>
|
||||||
<td>{f.name}</td>
|
<td>{f.name}</td>
|
||||||
<td>{f.price}</td>
|
<td>{f.price}</td>
|
||||||
@@ -351,7 +358,7 @@ function App() {
|
|||||||
} else {
|
} else {
|
||||||
content = <h3>Chyba načtení dat</h3>
|
content = <h3>Chyba načtení dat</h3>
|
||||||
}
|
}
|
||||||
return <Col md={12} lg={4} className='mt-3'>
|
return <Col md={12} lg={3} className='mt-3'>
|
||||||
<h3>{name}</h3>
|
<h3>{name}</h3>
|
||||||
{menu?.lastUpdate && <small>Poslední aktualizace: {getHumanDateTime(new Date(menu.lastUpdate))}</small>}
|
{menu?.lastUpdate && <small>Poslední aktualizace: {getHumanDateTime(new Date(menu.lastUpdate))}</small>}
|
||||||
{content}
|
{content}
|
||||||
@@ -402,8 +409,8 @@ function App() {
|
|||||||
<img src='snowman.png' style={{ position: "absolute", height: "110px", right: 10, top: 5 }} />
|
<img src='snowman.png' style={{ position: "absolute", height: "110px", right: 10, top: 5 }} />
|
||||||
Poslední změny:
|
Poslední změny:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Zimní atmosféra</li>
|
<li>Přidání restaurací Zastávka u Michala a Pivovarský šenk Šeříková</li>
|
||||||
<li>Odstranění podniku U Motlíků</li>
|
<li>Možnost výběru restaurace a jídel kliknutím v tabulce</li>
|
||||||
</ul>
|
</ul>
|
||||||
</Alert>
|
</Alert>
|
||||||
{dayIndex != null &&
|
{dayIndex != null &&
|
||||||
@@ -414,10 +421,11 @@ function App() {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<Row className='food-tables'>
|
<Row className='food-tables'>
|
||||||
{food[Restaurants.SLADOVNICKA] && renderFoodTable('Sladovnická', food[Restaurants.SLADOVNICKA])}
|
{food[Restaurants.SLADOVNICKA] && renderFoodTable('Sladovnická', Locations.SLADOVNICKA, food[Restaurants.SLADOVNICKA])}
|
||||||
{/* {food[Restaurants.UMOTLIKU] && renderFoodTable('U Motlíků', food[Restaurants.UMOTLIKU])} */}
|
{/* {food[Restaurants.UMOTLIKU] && renderFoodTable('U Motlíků', food[Restaurants.UMOTLIKU])} */}
|
||||||
{food[Restaurants.TECHTOWER] && renderFoodTable('TechTower', food[Restaurants.TECHTOWER])}
|
{food[Restaurants.TECHTOWER] && renderFoodTable('TechTower', Locations.TECHTOWER, food[Restaurants.TECHTOWER])}
|
||||||
{food[Restaurants.ZASTAVKAUMICHALA] && renderFoodTable('Zastávka u Michala', food[Restaurants.ZASTAVKAUMICHALA])}
|
{food[Restaurants.ZASTAVKAUMICHALA] && renderFoodTable('Zastávka u Michala', Locations.ZASTAVKAUMICHALA, food[Restaurants.ZASTAVKAUMICHALA])}
|
||||||
|
{food[Restaurants.SENKSERIKOVA] && renderFoodTable('Pivovarský šenk Šeříková', Locations.SENKSERIKOVA, food[Restaurants.SENKSERIKOVA])}
|
||||||
</Row>
|
</Row>
|
||||||
<div className='content-wrapper'>
|
<div className='content-wrapper'>
|
||||||
<div className='content'>
|
<div className='content'>
|
||||||
|
|||||||
@@ -53,7 +53,12 @@ export function isInTheFuture(time: DepartureTime) {
|
|||||||
const now = new Date();
|
const now = new Date();
|
||||||
const currentHours = now.getHours();
|
const currentHours = now.getHours();
|
||||||
const currentMinutes = now.getMinutes();
|
const currentMinutes = now.getMinutes();
|
||||||
|
const currentDate = now.toDateString();
|
||||||
const [hours, minutes] = time.split(':').map(Number);
|
const [hours, minutes] = time.split(':').map(Number);
|
||||||
|
|
||||||
|
if (currentDate === now.toDateString()) {
|
||||||
return hours > currentHours || (hours === currentHours && minutes > currentMinutes);
|
return hours > currentHours || (hours === currentHours && minutes > currentMinutes);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -517,7 +517,91 @@ const MOCK_DATA = {
|
|||||||
isSoup: false,
|
isSoup: false,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
]
|
],
|
||||||
|
'senkSerikova': [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
amount: "-",
|
||||||
|
name: "Drůbeží vývar s masem a nudlemi",
|
||||||
|
price: "45\xA0Kč",
|
||||||
|
isSoup: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
amount: "-",
|
||||||
|
name: "Vepřová pečeně se zelím a houskovým knedlíkem",
|
||||||
|
price: "155\xA0Kč",
|
||||||
|
isSoup: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
amount: "-",
|
||||||
|
name: "Špagety s kuřecím masem, špenátem a smetanou",
|
||||||
|
price: "145\xA0Kč",
|
||||||
|
isSoup: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
amount: "-",
|
||||||
|
name: "Medailonky z vepřové panenky s fazolkami se slaninou, šťouchané brambory",
|
||||||
|
price: "185\xA0Kč",
|
||||||
|
isSoup: false,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
amount: "-",
|
||||||
|
name: "Mrkvová polévka se zázvorem a kokosovým mlékem",
|
||||||
|
price: "45\xA0Kč",
|
||||||
|
isSoup: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
amount: "-",
|
||||||
|
name: "Hovězí po Burgundsku, bramborová kaše",
|
||||||
|
price: "155\xA0Kč",
|
||||||
|
isSoup: false,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
amount: "-",
|
||||||
|
name: "Hovězí vývar s játrovými knedlíčky",
|
||||||
|
price: "45\xA0Kč",
|
||||||
|
isSoup: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
amount: "-",
|
||||||
|
name: "Kuřecí plátky na sušených rajčatech, bylinkách a česneku, bramborová kaše",
|
||||||
|
price: "155\xA0Kč",
|
||||||
|
isSoup: false,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
amount: "-",
|
||||||
|
name: "Kuřecí vývar s rýží",
|
||||||
|
price: "45\xA0Kč",
|
||||||
|
isSoup: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
amount: "-",
|
||||||
|
name: "Rajská s plněnou paprikou, knedlík",
|
||||||
|
price: "170\xA0Kč",
|
||||||
|
isSoup: false,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
amount: "-",
|
||||||
|
name: "Mexická fazolová polévka",
|
||||||
|
price: "45\xA0Kč",
|
||||||
|
isSoup: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
amount: "-",
|
||||||
|
name: "Ragú z trhané kachny, onsen vejce, soté ze špenátu a ředkvičky, bramborové pyré, lanýžová sůl, zelený olej",
|
||||||
|
price: "189\xA0Kč",
|
||||||
|
isSoup: false,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mockovací data pro Pizza day
|
// Mockovací data pro Pizza day
|
||||||
@@ -1293,6 +1377,10 @@ export const getMenuZastavkaUmichalaMock = () => {
|
|||||||
return MOCK_DATA['zastavkaUmichala'];
|
return MOCK_DATA['zastavkaUmichala'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getMenuSenkSerikovaMock = () => {
|
||||||
|
return MOCK_DATA['senkSerikova'];
|
||||||
|
}
|
||||||
|
|
||||||
export const getPizzaListMock = () => {
|
export const getPizzaListMock = () => {
|
||||||
return MOCK_PIZZA_LIST;
|
return MOCK_PIZZA_LIST;
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { load } from 'cheerio';
|
import { load } from 'cheerio';
|
||||||
import { Food } from "../../types";
|
import { Food } from "../../types";
|
||||||
import {getMenuSladovnickaMock, getMenuTechTowerMock, getMenuUMotlikuMock, getMenuZastavkaUmichalaMock} from "./mock";
|
import {getMenuSladovnickaMock, getMenuTechTowerMock, getMenuUMotlikuMock, getMenuZastavkaUmichalaMock, getMenuSenkSerikovaMock} from "./mock";
|
||||||
import {formatDate, getDayOfWeekIndex, getIsWeekend} from "./utils";
|
import {formatDate} from "./utils";
|
||||||
|
|
||||||
// Fráze v názvech jídel, které naznačují že se jedná o polévku
|
// Fráze v názvech jídel, které naznačují že se jedná o polévku
|
||||||
const SOUP_NAMES = [
|
const SOUP_NAMES = [
|
||||||
@@ -344,13 +344,16 @@ export const getMenuZastavkaUmichala = async (firstDayOfWeek: Date, mock: boolea
|
|||||||
}
|
}
|
||||||
|
|
||||||
const nowDate = new Date().getDate();
|
const nowDate = new Date().getDate();
|
||||||
|
const headers = {
|
||||||
|
"Cookie": "_nss=1; PHPSESSID=9e37de17e0326b0942613d6e67a30e69",
|
||||||
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36",
|
||||||
|
};
|
||||||
const result: Food[][] = [];
|
const result: Food[][] = [];
|
||||||
for (let dayIndex = 0; dayIndex < 5; dayIndex++) {
|
for (let dayIndex = 0; dayIndex < 5; dayIndex++) {
|
||||||
const currentDate = new Date(firstDayOfWeek);
|
const currentDate = new Date(firstDayOfWeek);
|
||||||
currentDate.setDate(firstDayOfWeek.getDate() + dayIndex);
|
currentDate.setDate(firstDayOfWeek.getDate() + dayIndex);
|
||||||
|
|
||||||
// if (currentDate < now) {
|
if (currentDate.getDate() < nowDate || (currentDate.getDate() === nowDate && new Date().getHours() >= 14)) {
|
||||||
if (currentDate.getDate() !== nowDate) {
|
|
||||||
result[dayIndex] = [{
|
result[dayIndex] = [{
|
||||||
amount: undefined,
|
amount: undefined,
|
||||||
name: "Pro tento den není uveřejněna nabídka jídel",
|
name: "Pro tento den není uveřejněna nabídka jídel",
|
||||||
@@ -359,13 +362,13 @@ export const getMenuZastavkaUmichala = async (firstDayOfWeek: Date, mock: boolea
|
|||||||
}];
|
}];
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
// let dateString = formatDate(currentDate, 'DD.MM.YYYY');
|
const url = (currentDate.getDate() === nowDate) ?
|
||||||
// const html = await getHtml(ZASTAVKAUMICHALA_URL + '/?do=dailyMenu-changeDate&dailyMenu-dateString=' + dateString);
|
ZASTAVKAUMICHALA_URL : ZASTAVKAUMICHALA_URL + '/?do=dailyMenu-changeDate&dailyMenu-dateString=' + formatDate(currentDate, 'DD.MM.YYYY');
|
||||||
const html = await getHtml(ZASTAVKAUMICHALA_URL);
|
const html = await axios.get(url, {
|
||||||
|
headers,
|
||||||
|
}).then(res => res.data).then(content => content);
|
||||||
const $ = load(html);
|
const $ = load(html);
|
||||||
|
|
||||||
// const row = $($('.foodsList li')[0]).text();
|
|
||||||
|
|
||||||
const currentDayFood: Food[] = [];
|
const currentDayFood: Food[] = [];
|
||||||
$('.foodsList li').each((index, element) => {
|
$('.foodsList li').each((index, element) => {
|
||||||
currentDayFood.push({
|
currentDayFood.push({
|
||||||
@@ -380,3 +383,52 @@ export const getMenuZastavkaUmichala = async (firstDayOfWeek: Date, mock: boolea
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Získá obědovou nabídku SenkSerikova pro jeden týden.
|
||||||
|
*
|
||||||
|
* @param firstDayOfWeek první den v týdnu, pro který získat menu
|
||||||
|
* @param mock zda vrátit mock data
|
||||||
|
* @returns seznam jídel pro dané datum
|
||||||
|
*/
|
||||||
|
export const getMenuSenkSerikova = async (firstDayOfWeek: Date, mock: boolean = false): Promise<Food[][]> => {
|
||||||
|
if (mock) {
|
||||||
|
return getMenuSenkSerikovaMock();
|
||||||
|
}
|
||||||
|
|
||||||
|
const decoder = new TextDecoder('windows-1250');
|
||||||
|
const html = await axios.get(SENKSERIKOVA_URL, {
|
||||||
|
responseType: 'arraybuffer',
|
||||||
|
responseEncoding: 'binary'
|
||||||
|
}).then(res => decoder.decode(new Uint8Array(res.data))).then(content => content);
|
||||||
|
const $ = load(html);
|
||||||
|
|
||||||
|
const nowDate = new Date().getDate();
|
||||||
|
const currentDate = new Date(firstDayOfWeek);
|
||||||
|
const result: Food[][] = [];
|
||||||
|
let dayIndex = 0;
|
||||||
|
while(currentDate.getDate() < nowDate) {
|
||||||
|
result[dayIndex] = [{
|
||||||
|
amount: undefined,
|
||||||
|
name: "Pro tento den není uveřejněna nabídka jídel",
|
||||||
|
price: "",
|
||||||
|
isSoup: false,
|
||||||
|
}];
|
||||||
|
dayIndex = dayIndex + 1;
|
||||||
|
currentDate.setDate(firstDayOfWeek.getDate() + dayIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.menicka').each((i, element) => {
|
||||||
|
const currentDayFood: Food[] = [];
|
||||||
|
$(element).find('.popup-gallery li').each((j, element) => {
|
||||||
|
currentDayFood.push({
|
||||||
|
amount: '-',
|
||||||
|
name: $(element).children('div.polozka').text(),
|
||||||
|
price: $(element).children('div.cena').text().replace(/ /g, '\xA0'),
|
||||||
|
isSoup: $(element).hasClass('polevka'),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
result[dayIndex++] = currentDayFood;
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { InsufficientPermissions, formatDate, getDayOfWeekIndex, getFirstWorkDayOfWeek, getHumanDate, getIsWeekend, getWeekNumber } from "./utils";
|
import { InsufficientPermissions, formatDate, getDayOfWeekIndex, getFirstWorkDayOfWeek, getHumanDate, getIsWeekend, getWeekNumber } from "./utils";
|
||||||
import { ClientData, Restaurants, DayMenu, DepartureTime, DayData, WeekMenu, LocationKey } from "../../types";
|
import { ClientData, Restaurants, DayMenu, DepartureTime, DayData, WeekMenu, LocationKey } from "../../types";
|
||||||
import getStorage from "./storage";
|
import getStorage from "./storage";
|
||||||
import { getMenuSladovnicka, getMenuTechTower, getMenuUMotliku, getMenuZastavkaUmichala } from "./restaurants";
|
import { getMenuSladovnicka, getMenuTechTower, getMenuUMotliku, getMenuZastavkaUmichala, getMenuSenkSerikova } from "./restaurants";
|
||||||
import { getTodayMock } from "./mock";
|
import { getTodayMock } from "./mock";
|
||||||
|
|
||||||
const storage = getStorage();
|
const storage = getStorage();
|
||||||
@@ -62,6 +62,7 @@ export async function getData(date?: Date): Promise<ClientData> {
|
|||||||
// [Restaurants.UMOTLIKU]: await getRestaurantMenu(Restaurants.UMOTLIKU, date),
|
// [Restaurants.UMOTLIKU]: await getRestaurantMenu(Restaurants.UMOTLIKU, date),
|
||||||
[Restaurants.TECHTOWER]: await getRestaurantMenu(Restaurants.TECHTOWER, date),
|
[Restaurants.TECHTOWER]: await getRestaurantMenu(Restaurants.TECHTOWER, date),
|
||||||
[Restaurants.ZASTAVKAUMICHALA]: await getRestaurantMenu(Restaurants.ZASTAVKAUMICHALA, date),
|
[Restaurants.ZASTAVKAUMICHALA]: await getRestaurantMenu(Restaurants.ZASTAVKAUMICHALA, date),
|
||||||
|
[Restaurants.SENKSERIKOVA]: await getRestaurantMenu(Restaurants.SENKSERIKOVA, date),
|
||||||
}
|
}
|
||||||
clientData = await addVolatileData(clientData);
|
clientData = await addVolatileData(clientData);
|
||||||
return clientData;
|
return clientData;
|
||||||
@@ -182,6 +183,19 @@ export async function getRestaurantMenu(restaurant: Restaurants, date?: Date): P
|
|||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.error("Selhalo načtení jídel pro podnik Zastávka u Michala", e);
|
console.error("Selhalo načtení jídel pro podnik Zastávka u Michala", e);
|
||||||
}
|
}
|
||||||
|
case Restaurants.SENKSERIKOVA:
|
||||||
|
try {
|
||||||
|
const senkSerikovaFood = await getMenuSenkSerikova(firstDay, mock);
|
||||||
|
for (let i = 0; i < senkSerikovaFood.length; i++) {
|
||||||
|
menus[i][restaurant]!.food = senkSerikovaFood[i];
|
||||||
|
if (senkSerikovaFood[i]?.length === 1 && senkSerikovaFood[i][0].name === 'Pro tento den nebylo zadáno menu.') {
|
||||||
|
menus[i][restaurant]!.closed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
} catch (e: any) {
|
||||||
|
console.error("Selhalo načtení jídel pro podnik Pivovarský šenk Šeříková", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await storage.setData(getMenuKey(usedDate), menus);
|
await storage.setData(getMenuKey(usedDate), menus);
|
||||||
}
|
}
|
||||||
@@ -254,14 +268,19 @@ export async function removeChoice(login: string, trusted: boolean, locationKey:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Odstraní kompletně volbu uživatele.
|
* Odstraní kompletně volbu uživatele, vyjma ignoredLocationKey (pokud byla předána a existuje).
|
||||||
*
|
*
|
||||||
* @param login login uživatele
|
* @param login login uživatele
|
||||||
|
* @param date datum, ke kterému se volby vztahují
|
||||||
|
* @param ignoredLocationKey volba, která nebude odstraněna, pokud existuje
|
||||||
*/
|
*/
|
||||||
async function removeChoiceIfPresent(login: string, date: string) {
|
async function removeChoiceIfPresent(login: string, date: string, ignoredLocationKey?: LocationKey) {
|
||||||
let data: DayData = await storage.getData(date);
|
let data: DayData = await storage.getData(date);
|
||||||
for (const key of Object.keys(data.choices)) {
|
for (const key of Object.keys(data.choices)) {
|
||||||
const locationKey = key as LocationKey;
|
const locationKey = key as LocationKey;
|
||||||
|
if (ignoredLocationKey != null && ignoredLocationKey == locationKey) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (data.choices[locationKey] && login in data.choices[locationKey]) {
|
if (data.choices[locationKey] && login in data.choices[locationKey]) {
|
||||||
delete data.choices[locationKey][login];
|
delete data.choices[locationKey][login];
|
||||||
if (Object.keys(data.choices[locationKey]).length === 0) {
|
if (Object.keys(data.choices[locationKey]).length === 0) {
|
||||||
@@ -315,6 +334,9 @@ export async function addChoice(login: string, trusted: boolean, locationKey: Lo
|
|||||||
// Pokud měníme pouze lokaci, mažeme případné předchozí
|
// Pokud měníme pouze lokaci, mažeme případné předchozí
|
||||||
if (foodIndex == null) {
|
if (foodIndex == null) {
|
||||||
data = await removeChoiceIfPresent(login, selectedDate);
|
data = await removeChoiceIfPresent(login, selectedDate);
|
||||||
|
} else {
|
||||||
|
// Mažeme případné ostatní volby (měla by být maximálně jedna)
|
||||||
|
removeChoiceIfPresent(login, selectedDate, locationKey);
|
||||||
}
|
}
|
||||||
// TODO vytáhnout inicializaci "prázdné struktury" do vlastní funkce
|
// TODO vytáhnout inicializaci "prázdné struktury" do vlastní funkce
|
||||||
if (!(data.choices[locationKey])) {
|
if (!(data.choices[locationKey])) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export enum Restaurants {
|
|||||||
// UMOTLIKU = 'uMotliku',
|
// UMOTLIKU = 'uMotliku',
|
||||||
TECHTOWER = 'techTower',
|
TECHTOWER = 'techTower',
|
||||||
ZASTAVKAUMICHALA = 'zastavkaUmichala',
|
ZASTAVKAUMICHALA = 'zastavkaUmichala',
|
||||||
|
SENKSERIKOVA = 'senkSerikova',
|
||||||
}
|
}
|
||||||
|
|
||||||
export type FoodChoices = {
|
export type FoodChoices = {
|
||||||
@@ -110,11 +111,13 @@ export type Food = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO tohle je dost špatné pojmenování, vzhledem k tomu co to obsahuje
|
// TODO tohle je dost špatné pojmenování, vzhledem k tomu co to obsahuje
|
||||||
|
// TODO pokud by se použilo ovládáni výběru obědu kliknutím, pak bych restaurace z tohoto výčtu vyhodil
|
||||||
export enum Locations {
|
export enum Locations {
|
||||||
SLADOVNICKA = 'Sladovnická',
|
SLADOVNICKA = 'Sladovnická',
|
||||||
// UMOTLIKU = 'U Motlíků',
|
// UMOTLIKU = 'U Motlíků',
|
||||||
TECHTOWER = 'TechTower',
|
TECHTOWER = 'TechTower',
|
||||||
ZASTAVKAUMICHALA = 'Zastávka u Michala',
|
ZASTAVKAUMICHALA = 'Zastávka u Michala',
|
||||||
|
SENKSERIKOVA = 'Pivovarský šenk Šeříková',
|
||||||
SPSE = 'SPŠE',
|
SPSE = 'SPŠE',
|
||||||
PIZZA = 'Pizza day',
|
PIZZA = 'Pizza day',
|
||||||
OBJEDNAVAM = 'Budu objednávat',
|
OBJEDNAVAM = 'Budu objednávat',
|
||||||
|
|||||||
Reference in New Issue
Block a user