Release 2025-05-25-GgNU
This commit is contained in:
@@ -261,6 +261,7 @@ if (!service) return Astro.rewrite('/404')
|
||||
inputProps={{
|
||||
rows: 3,
|
||||
placeholder: 'https://example1.com/tos\nhttps://example2.com/tos',
|
||||
required: true,
|
||||
}}
|
||||
value={service.tosUrls.join('\n')}
|
||||
error={serviceInputErrors.tosUrls}
|
||||
@@ -298,16 +299,26 @@ if (!service) return Astro.rewrite('/404')
|
||||
error={serviceInputErrors.referral}
|
||||
/>
|
||||
|
||||
<InputImageFile
|
||||
label="Image"
|
||||
name="imageFile"
|
||||
description="Square image. At least 192x192px. Transparency supported. Leave empty to keep current image."
|
||||
error={serviceInputErrors.imageFile}
|
||||
square
|
||||
value={service.imageUrl}
|
||||
/>
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<InputImageFile
|
||||
label="Image"
|
||||
name="imageFile"
|
||||
description="Square image. At least 192x192px. Transparency supported. Leave empty to keep current image."
|
||||
error={serviceInputErrors.imageFile}
|
||||
square
|
||||
value={service.imageUrl}
|
||||
downloadButton
|
||||
removeCheckbox={service.imageUrl
|
||||
? {
|
||||
name: 'removeImage',
|
||||
label: 'Remove image',
|
||||
}
|
||||
: undefined}
|
||||
class="grow"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 items-stretch gap-x-4 gap-y-6 sm:grid-cols-[1fr_2fr]">
|
||||
<div class="xs:grid-cols-[1fr_2fr] grid grid-cols-1 items-stretch gap-x-4 gap-y-6">
|
||||
<InputCheckboxGroup
|
||||
name="categories"
|
||||
label="Categories"
|
||||
@@ -320,6 +331,7 @@ if (!service) return Astro.rewrite('/404')
|
||||
}))}
|
||||
selectedValues={service.categories.map((c) => c.id.toString())}
|
||||
error={serviceInputErrors.categories}
|
||||
class="min-w-auto"
|
||||
/>
|
||||
|
||||
<InputCheckboxGroup
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
---
|
||||
import { ServiceVisibility } from '@prisma/client'
|
||||
import { z } from 'astro:schema'
|
||||
import { groupBy, omit, orderBy, uniq } from 'lodash-es'
|
||||
import seedrandom from 'seedrandom'
|
||||
@@ -223,7 +222,7 @@ const where = {
|
||||
in: includeScams ? uniq([...filters.verification, 'VERIFICATION_FAILED'] as const) : filters.verification,
|
||||
},
|
||||
serviceVisibility: {
|
||||
in: [ServiceVisibility.PUBLIC, ServiceVisibility.ARCHIVED],
|
||||
in: ['PUBLIC', 'ARCHIVED'],
|
||||
},
|
||||
overallScore: { gte: filters['min-score'] },
|
||||
acceptedCurrencies: filters.currencies.length
|
||||
@@ -326,7 +325,9 @@ const [categories, [services, totalServices], countCommunityOnly, attributes] =
|
||||
select: {
|
||||
services: {
|
||||
where: {
|
||||
serviceVisibility: 'PUBLIC',
|
||||
serviceVisibility: {
|
||||
in: ['PUBLIC', 'ARCHIVED'],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
import { Icon } from 'astro-icon/components'
|
||||
import { actions, isInputError } from 'astro:actions'
|
||||
import { orderBy } from 'lodash-es'
|
||||
|
||||
import {
|
||||
SUGGESTION_DESCRIPTION_MAX_LENGTH,
|
||||
@@ -16,6 +17,8 @@ import InputImageFile from '../../components/InputImageFile.astro'
|
||||
import InputSubmitButton from '../../components/InputSubmitButton.astro'
|
||||
import InputText from '../../components/InputText.astro'
|
||||
import InputTextArea from '../../components/InputTextArea.astro'
|
||||
import { getAttributeCategoryInfo } from '../../constants/attributeCategories'
|
||||
import { getAttributeTypeInfo } from '../../constants/attributeTypes'
|
||||
import { currencies } from '../../constants/currencies'
|
||||
import { kycLevels } from '../../constants/kycLevels'
|
||||
import BaseLayout from '../../layouts/BaseLayout.astro'
|
||||
@@ -55,6 +58,8 @@ const [categories, attributes] = await Astro.locals.banners.tryMany([
|
||||
select: {
|
||||
id: true,
|
||||
title: true,
|
||||
category: true,
|
||||
type: true,
|
||||
},
|
||||
}),
|
||||
[],
|
||||
@@ -241,27 +246,41 @@ const [categories, attributes] = await Astro.locals.banners.tryMany([
|
||||
error={inputErrors.kycLevel}
|
||||
/>
|
||||
|
||||
<InputCheckboxGroup
|
||||
name="categories"
|
||||
label="Categories"
|
||||
required
|
||||
options={categories.map((category) => ({
|
||||
label: category.name,
|
||||
value: category.id.toString(),
|
||||
icon: category.icon,
|
||||
}))}
|
||||
error={inputErrors.categories}
|
||||
/>
|
||||
<div class="xs:grid-cols-[1fr_2fr] grid grid-cols-1 items-stretch gap-x-4 gap-y-6">
|
||||
<InputCheckboxGroup
|
||||
name="categories"
|
||||
label="Categories"
|
||||
required
|
||||
options={categories.map((category) => ({
|
||||
label: category.name,
|
||||
value: category.id.toString(),
|
||||
icon: category.icon,
|
||||
}))}
|
||||
size="lg"
|
||||
error={inputErrors.categories}
|
||||
class="min-w-auto"
|
||||
/>
|
||||
|
||||
<InputCheckboxGroup
|
||||
name="attributes"
|
||||
label="Attributes"
|
||||
options={attributes.map((attribute) => ({
|
||||
label: attribute.title,
|
||||
value: attribute.id.toString(),
|
||||
}))}
|
||||
error={inputErrors.attributes}
|
||||
/>
|
||||
<InputCheckboxGroup
|
||||
name="attributes"
|
||||
label="Attributes"
|
||||
options={orderBy(
|
||||
attributes.map((attribute) => ({
|
||||
...attribute,
|
||||
categoryInfo: getAttributeCategoryInfo(attribute.category),
|
||||
typeInfo: getAttributeTypeInfo(attribute.type),
|
||||
})),
|
||||
['categoryInfo.order', 'typeInfo.order']
|
||||
).map((attribute) => ({
|
||||
label: attribute.title,
|
||||
value: attribute.id.toString(),
|
||||
icon: [attribute.categoryInfo.icon, attribute.typeInfo.icon],
|
||||
iconClassName: [attribute.categoryInfo.classNames.icon, attribute.typeInfo.classNames.icon],
|
||||
}))}
|
||||
error={inputErrors.attributes}
|
||||
size="lg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<InputCardGroup
|
||||
name="acceptedCurrencies"
|
||||
|
||||
Reference in New Issue
Block a user