mirror of
https://github.com/pretix/pretix.git
synced 2026-06-10 01:15:05 +00:00
use camelCase
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { rules as rawRules, active_items, allProducts, limitProducts } from './django-interop'
|
import { rules as rawRules, allItems, activeItems, allProducts, limitProducts } from './django-interop'
|
||||||
import { convertToDNF } from './jsonlogic-boolalg'
|
import { convertToDNF } from './jsonlogic-boolalg'
|
||||||
|
|
||||||
import RulesEditor from './checkin-rules-editor.vue'
|
import RulesEditor from './checkin-rules-editor.vue'
|
||||||
@@ -53,7 +53,7 @@ const missingItems = computed(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let missing = []
|
let missing = []
|
||||||
for (const item of active_items.value) {
|
for (const item of activeItems.value) {
|
||||||
if (productsSeen[item.id]) continue
|
if (productsSeen[item.id]) continue
|
||||||
if (!allProducts.value && !limitProducts.value.includes(item.id)) continue
|
if (!allProducts.value && !limitProducts.value.includes(item.id)) continue
|
||||||
if (item.variations.length > 0) {
|
if (item.variations.length > 0) {
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ watch(rules, (newVal) => {
|
|||||||
rulesInput.value = JSON.stringify(newVal)
|
rulesInput.value = JSON.stringify(newVal)
|
||||||
}, { deep: true })
|
}, { deep: true })
|
||||||
|
|
||||||
export const active_items = ref<any[]>([])
|
export const activeItems = ref<any[]>([])
|
||||||
export const all_items = ref<any[]>([])
|
export const allItems = ref<any[]>([])
|
||||||
|
|
||||||
const itemsEl = document.querySelector('#items')
|
const itemsEl = document.querySelector('#items')
|
||||||
if (itemsEl?.textContent) {
|
if (itemsEl?.textContent) {
|
||||||
all_items.value = JSON.parse(itemsEl.textContent || '[]');
|
allItems.value = JSON.parse(itemsEl.textContent || '[]');
|
||||||
active_items.value = all_items.value.filter(item => item.active);
|
activeItems.value = allItems.value.filter(item => item.active);
|
||||||
|
|
||||||
function checkForInvalidIds (validProducts: Record<string, string>, validVariations: Record<string, string>, rule: any) {
|
function checkForInvalidIds (validProducts: Record<string, string>, validVariations: Record<string, string>, rule: any) {
|
||||||
if (rule['and']) {
|
if (rule['and']) {
|
||||||
@@ -59,8 +59,8 @@ if (itemsEl?.textContent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkForInvalidIds(
|
checkForInvalidIds(
|
||||||
Object.fromEntries(all_items.value.map(p => [p.id, p.name])),
|
Object.fromEntries(allItems.value.map(p => [p.id, p.name])),
|
||||||
Object.fromEntries(all_items.value.flatMap(p => p.variations?.map(v => [v.id, p.name + ' – ' + v.name]) ?? [])),
|
Object.fromEntries(allItems.value.flatMap(p => p.variations?.map(v => [v.id, p.name + ' – ' + v.name]) ?? [])),
|
||||||
rules.value
|
rules.value
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user