Skip to content

Commit

Permalink
fixes for updated linters / tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Ruf committed Feb 6, 2024
1 parent dced694 commit de74f50
Show file tree
Hide file tree
Showing 52 changed files with 185 additions and 178 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RUN apt-get update \
build-essential \
nodejs
WORKDIR var/www/html/src/Resources
RUN chown -R node /var/www/html/src/Resources/node_modules
COPY src/Resources/package.json src/Resources/yarn.lock ./
RUN yarn install
COPY src/Resources/ .
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/src/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Icons
icon="flag"
box="0 0 26 26"
class="inline-block h-[26px] w-[26px] fill-primary align-top"
class="inline-block size-[26px] fill-primary align-top"
/>
<span class="self-center align-top text-[14px] leading-[20px] text-primary">
{{ t('changeLanguage') }}
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/src/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<span class="sr-only">Open menu</span>
<MenuIcon
v-if="!open"
class="block h-6 w-6"
class="block size-6"
aria-hidden="true"
/>
<XIcon
v-else
class="block h-6 w-6"
class="block size-6"
aria-hidden="true"
/>
</MenuButton>
Expand Down Expand Up @@ -143,7 +143,7 @@
import EventIcon from './misc/EventIcon.vue';
import MealIcon from './menu/MealIcon.vue';
const { t } = useI18n();
const { t, locale } = useI18n();
withDefaults(defineProps<{
guest?: boolean
Expand All @@ -162,7 +162,7 @@
const getShowParticipationsError = computed(() => loadedState.error !== "");
const balanceString = computed(() => userDataStore.balanceToLocalString());
const balanceString = computed(() => userDataStore.balanceToLocalString(locale.value));
const user = computed(() => userDataStore.getState().user);
const isAuthenticated = computed(() => !userDataStore.getState().roles.includes('ROLE_GUEST'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</td>
<td>
<div
class="flex h-full w-full content-center justify-end text-primary"
class="flex size-full content-center justify-end text-primary"
>
<svg
v-if="(transaction as IUserTransaction).paymethod !== null && (transaction as IUserTransaction).paymethod === '0'"
Expand All @@ -29,7 +29,7 @@
y="0px"
viewBox="0 0 1000 1000"
xml:space="preserve"
class="h-[24px] w-[24px]"
class="size-[24px]"
>
<g>
<path d="M918,239.3c-9.2-11.4-20-21.8-31.9-31.1c1.6,29.5-1.1,61-8.3,94.2c-19.4,90.9-65.8,168.2-134.2,223.5c-68.4,55.2-153.7,84.4-246.8,84.4H361l-44,205.9c-8.6,40.4-44.9,69.7-86.2,69.7h-61.2l-11,50.6c-2.8,13,0.4,26.6,8.7,37c8.4,10.4,21,16.4,34.3,16.4h149.6c20.8,0,38.8-14.5,43.1-34.9l51.4-240.8h171.4c82.9,0,158.7-25.8,219.1-74.6c60.5-48.8,101.6-117.4,118.8-198.4C972.7,359.5,960.2,291.5,918,239.3z" />
Expand All @@ -38,7 +38,7 @@
</svg>
<CurrencyEuroIcon
v-else
class="h-8 w-8"
class="size-8"
/>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
class="cursor-pointer truncate text-[14px] text-[#9CA3AF] hover:bg-[#FAFAFA]"
>
<span
class="inline-block h-full w-full px-4 py-2"
class="inline-block size-full px-4 py-2"
:class="selected ? 'bg-[#F4F4F4] font-medium' : 'font-normal'"
>
{{ locale === 'en' ? category.titleEn : category.titleDe }}
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/src/components/costs/CashRegisterLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:to="'/cash-register'"
class="flex flex-row items-center gap-2 text-[#173D7A] hover:text-highlight"
>
<CurrencyEuroIcon class="h-6 w-6" />
<CurrencyEuroIcon class="size-6" />
<span>{{ t('costs.cashRegister') }}</span>
</router-link>
</template>
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/src/components/dashboard/CombiButtonGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
>
<div :class="[index === 0 ? 'rounded-t-md' : '', index === dishes.length - 1 ? 'rounded-b-md' : '', checked ? 'z-10 border-indigo-200 bg-indigo-50' : 'border-gray-200', 'relative flex cursor-pointer border p-4 focus:outline-none']">
<span
:class="[checked ? 'border-transparent bg-indigo-600' : 'border-gray-300 bg-white', active ? 'ring-2 ring-indigo-500 ring-offset-2' : '', 'mt-0.5 flex h-4 w-4 shrink-0 cursor-pointer items-center justify-center rounded-full border']"
:class="[checked ? 'border-transparent bg-indigo-600' : 'border-gray-300 bg-white', active ? 'ring-2 ring-indigo-500 ring-offset-2' : '', 'mt-0.5 flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-full border']"
aria-hidden="true"
>
<span class="h-1.5 w-1.5 rounded-full bg-white" />
<span class="size-1.5 rounded-full bg-white" />
</span>
<span class="ml-3 flex flex-col">
<RadioGroupLabel
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/src/components/dashboard/GuestButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Icons
icon="guest"
box="0 0 13 13"
class="h-[13px] w-[13px]"
class="size-[13px]"
:class="iconWhite ? 'fill-white' : 'fill-[#1c5298]'"
/>
</PopoverButton>
Expand Down
44 changes: 22 additions & 22 deletions src/Resources/src/components/dashboard/MealCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
>
<CheckIcon
v-if="isParticipating"
class="relative left-[10%] top-[10%] h-[80%] w-[80%] text-white"
class="relative left-[10%] top-[10%] size-[80%] text-white"
/>
</span>
<CombiModal
Expand Down Expand Up @@ -47,8 +47,8 @@ import { IMessage, isMessage } from '@/interfaces/IMessage';
import { FlashMessageType } from '@/enums/FlashMessage';
const props = defineProps<{
weekID: number | string,
dayID: number | string,
weekID: number | string | undefined,
dayID: number | string | undefined,
mealID: number | string,
variationID?: number | string | null,
meal: Meal,
Expand All @@ -57,18 +57,18 @@ const props = defineProps<{
const { sendFlashMessage } = useFlashMessage();
const day = props.day ? props.day : dashboardStore.getDay(props.weekID, props.dayID)
let meal: Meal;
let mealOrVariation: Meal;
let mealId: number | string;
if (props.variationID) {
meal = props.meal ? props.meal : dashboardStore.getVariation(props.weekID, props.dayID, props.mealID, props.variationID)
mealOrVariation = props.meal ? props.meal : dashboardStore.getVariation(props.weekID, props.dayID, props.mealID, props.variationID)
mealId = props.variationID
} else {
meal = props.meal ? props.meal : dashboardStore.getMeal(props.weekID, props.dayID, props.mealID)
mealOrVariation = props.meal ? props.meal : dashboardStore.getMeal(props.weekID, props.dayID, props.mealID)
mealId = props.mealID
}
const open = ref(false)
const isParticipating = computed(() => meal.isParticipating !== null)
const isParticipating = computed(() => mealOrVariation.isParticipating !== null)
const isCombiBox = props.day.meals[props.mealID].dishSlug === 'combined-dish'
const openPopover = ref(false)
Expand All @@ -83,10 +83,10 @@ const checkboxCSS = computed(() => {
let cssResult = 'rounded-md h-[30px] w-[30px] xl:h-[20px] xl:w-[20px] '
if (isParticipating.value === true) {
switch (meal.mealState) {
switch (mealOrVariation.mealState) {
case 'disabled':
cssResult += 'border-[0.5px] border-[#ABABAB]'
if (meal.isLocked === false) {
if (mealOrVariation.isLocked === false) {
cssResult += ' bg-[#80909F] cursor-pointer'
} else {
cssResult += ' bg-[#B4C1CE]'
Expand All @@ -103,7 +103,7 @@ const checkboxCSS = computed(() => {
return cssResult
}
} else if (isParticipating.value === false) {
switch (meal.mealState) {
switch (mealOrVariation.mealState) {
case 'disabled':
cssResult += 'bg-[#EDEDED] border-[0.5px] border-[#ABABAB]'
return cssResult
Expand All @@ -118,23 +118,23 @@ const checkboxCSS = computed(() => {
async function handle() {
// Meal is not locked
if (meal.isLocked === false) {
if (mealOrVariation.isLocked === false) {
// User is participating
if (isParticipating.value) {
await leaveMeal()
} else {
let slugs = [meal.dishSlug]
let slugs = [mealOrVariation.dishSlug]
if (isCombiBox === true) {
slugs = getDishSlugs()
if(slugs.length === 0) return
}
await joinMeal(slugs)
}
} else {
if (meal.mealState === 'offerable') {
if (mealOrVariation.mealState === 'offerable') {
await sendOffer()
} else if (meal.mealState === 'offering') {
} else if (mealOrVariation.mealState === 'offering') {
await cancelOffer()
}
}
Expand Down Expand Up @@ -162,7 +162,7 @@ async function joinMeal(dishSlugs) {
const { emit } = useEventsBus()
if (isCombiBox) emit('guestChosenCombi', dishSlugs)
emit('guestChosenMeals', mealId)
meal.isParticipating = -1
mealOrVariation.isParticipating = -1
} else {
let data = {
mealID: mealId,
Expand All @@ -173,8 +173,8 @@ async function joinMeal(dishSlugs) {
const { response, error } = await useJoinMeal(JSON.stringify(data))
if (error.value === false) {
day.activeSlot = (response.value as JoinMeal).slotId
meal.isParticipating = (response.value as JoinMeal).participantId
meal.mealState = (response.value as JoinMeal).mealState
mealOrVariation.isParticipating = (response.value as JoinMeal).participantId
mealOrVariation.mealState = (response.value as JoinMeal).mealState
} else if (isMessage(response.value) === true) {
sendFlashMessage({
type: FlashMessageType.ERROR,
Expand All @@ -191,7 +191,7 @@ async function leaveMeal() {
const dishSlugs = getDishSlugs()
if (isCombiBox) emit('guestChosenCombi', dishSlugs)
emit('guestChosenMeals', props.mealID)
meal.isParticipating = null
mealOrVariation.isParticipating = null
} else {
const data = {
mealId: mealId
Expand All @@ -200,8 +200,8 @@ async function leaveMeal() {
const {response, error} = await useLeaveMeal(JSON.stringify(data))
if (error.value === false) {
day.activeSlot = response.value.slotId;
meal.mealState = response.value.mealState;
meal.isParticipating = null;
mealOrVariation.mealState = response.value.mealState;
mealOrVariation.isParticipating = null;
}
}
}
Expand All @@ -213,7 +213,7 @@ async function sendOffer() {
const { error } = await useOfferMeal(JSON.stringify(data))
if (error.value === false) {
meal.mealState = 'offering'
mealOrVariation.mealState = 'offering'
const { emit } = useEventsBus()
emit('openOfferPanel_' + mealId)
}
Expand All @@ -226,7 +226,7 @@ async function cancelOffer() {
const { error } = await useCancelOffer(JSON.stringify(data))
if (error.value === false) {
meal.mealState = 'offerable'
mealOrVariation.mealState = 'offerable'
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/src/components/dashboard/MealData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ import { Day, Meal } from '@/api/getDashboardData';
import { useDishes } from '@/stores/dishesStore';
const props = defineProps<{
weekID: number | string,
dayID: number | string,
weekID: number | string | undefined,
dayID: number | string | undefined,
mealID: number | string,
meal: Meal,
day: Day
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/src/components/dashboard/Slots.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</span>
<span class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
<ChevronDownIcon
class="h-5 w-5 text-gray-400"
class="size-5 text-gray-400"
:class="open ? 'rotate-180 transform' : ''"
aria-hidden="true"
/>
Expand Down Expand Up @@ -70,7 +70,7 @@ import useEventsBus from 'tools/eventBus';
import { Day } from '@/api/getDashboardData';
const props = defineProps<{
dayID: number | string,
dayID: number | string | undefined,
day: Day
}>();
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/src/components/dishes/DishesCreationPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ const { fetchCategories } = useCategories();
const props = withDefaults(defineProps<{
titleDe?: string,
titleEn?: string,
descriptionDe?: string,
descriptionEn?: string,
categoryId?: number,
descriptionDe?: string | null,
descriptionEn?: string | null,
categoryId?: number | null,
oneSizeServing?: boolean,
dishId?: number,
dishId?: number | null,
edit?: boolean,
}>(),{
titleDe: '',
Expand Down
Loading

0 comments on commit de74f50

Please sign in to comment.