Fix dashboard production builds and default list pages to 24 items.
Unblock business/customer deploys and match the 24-per-page list rule in Super Admin. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
cc94b929e0
commit
c16ec3787b
@@ -1,7 +1,7 @@
|
|||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import { Pencil, MessageSquare, Trash2, Play } from 'lucide-react'
|
import { Pencil, MessageSquare, Trash2, Play } from 'lucide-react'
|
||||||
import { useLocale } from '@meshkee/dashboard-ui'
|
import { useLocale } from '@meshkee/dashboard-ui'
|
||||||
import type { Video } from '../types/instruction'
|
import type { Instruction } from '../types/instruction'
|
||||||
import {
|
import {
|
||||||
formatInstructionAuthor,
|
formatInstructionAuthor,
|
||||||
formatInstructionCardDate,
|
formatInstructionCardDate,
|
||||||
@@ -14,7 +14,7 @@ import cardStyles from './BlogCard.module.css'
|
|||||||
import controlStyles from './ProductCard.module.css'
|
import controlStyles from './ProductCard.module.css'
|
||||||
|
|
||||||
interface InstructionCardProps {
|
interface InstructionCardProps {
|
||||||
video: Video
|
video: Instruction
|
||||||
commentCount: number
|
commentCount: number
|
||||||
onEdit: (id: string) => void
|
onEdit: (id: string) => void
|
||||||
onComments: (id: string) => void
|
onComments: (id: string) => void
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import {
|
|||||||
Store,
|
Store,
|
||||||
Users,
|
Users,
|
||||||
Settings,
|
Settings,
|
||||||
FileText,
|
|
||||||
Briefcase,
|
Briefcase,
|
||||||
Globe,
|
Globe,
|
||||||
Layers,
|
Layers,
|
||||||
|
|||||||
@@ -67,12 +67,6 @@ const en = {
|
|||||||
'nav.instructions.new': 'Add New Instruction',
|
'nav.instructions.new': 'Add New Instruction',
|
||||||
'nav.instructions.categories': 'Categories',
|
'nav.instructions.categories': 'Categories',
|
||||||
'nav.instructions.settings': 'Settings',
|
'nav.instructions.settings': 'Settings',
|
||||||
'nav.instructions': 'Instructions',
|
|
||||||
'nav.instructions.overview': 'Overview',
|
|
||||||
'nav.instructions.list': 'My Instructions',
|
|
||||||
'nav.instructions.new': 'Add New Instruction',
|
|
||||||
'nav.instructions.categories': 'Categories',
|
|
||||||
'nav.instructions.settings': 'Settings',
|
|
||||||
'nav.website': 'Website',
|
'nav.website': 'Website',
|
||||||
'nav.website.overview': 'Overview',
|
'nav.website.overview': 'Overview',
|
||||||
'nav.website.sliders': 'Sliders',
|
'nav.website.sliders': 'Sliders',
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { FileText, Play, GraduationCap } from 'lucide-react'
|
import { FileText, GraduationCap } from 'lucide-react'
|
||||||
import { SectionCard } from '../components/SectionCard'
|
import { SectionCard } from '../components/SectionCard'
|
||||||
import { Breadcrumbs } from '../components/Breadcrumbs'
|
import { Breadcrumbs } from '../components/Breadcrumbs'
|
||||||
import { PageTitle } from '../components/PageTitle'
|
import { PageTitle } from '../components/PageTitle'
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {
|
|||||||
listInstructions,
|
listInstructions,
|
||||||
resolveInstructionTitle,
|
resolveInstructionTitle,
|
||||||
} from '../services/instructionService'
|
} from '../services/instructionService'
|
||||||
import type { Video } from '../types/instruction'
|
import type { Instruction } from '../types/instruction'
|
||||||
import pageStyles from '../components/PageContent.module.css'
|
import pageStyles from '../components/PageContent.module.css'
|
||||||
import styles from './BlogPage.module.css'
|
import styles from './BlogPage.module.css'
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ export function InstructionListPage() {
|
|||||||
const { showToast } = useToast()
|
const { showToast } = useToast()
|
||||||
const t = useT()
|
const t = useT()
|
||||||
const { locale } = useLocale()
|
const { locale } = useLocale()
|
||||||
const [videos, setInstructions] = useState<Video[]>([])
|
const [videos, setInstructions] = useState<Instruction[]>([])
|
||||||
const [totalInstructions, setTotalVideos] = useState(0)
|
const [totalInstructions, setTotalVideos] = useState(0)
|
||||||
const [currentPage, setCurrentPage] = useState(1)
|
const [currentPage, setCurrentPage] = useState(1)
|
||||||
const [isLoading, setIsLoading] = useState(true)
|
const [isLoading, setIsLoading] = useState(true)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { Switch } from '../components/Switch'
|
|||||||
import { Tooltip } from '../components/Tooltip'
|
import { Tooltip } from '../components/Tooltip'
|
||||||
import { useToast } from '../context/ToastContext'
|
import { useToast } from '../context/ToastContext'
|
||||||
import { useT } from '../i18n/useT'
|
import { useT } from '../i18n/useT'
|
||||||
|
import type { BusinessMessageKey } from '../i18n/messages'
|
||||||
import { ApiError } from '../lib/api'
|
import { ApiError } from '../lib/api'
|
||||||
import {
|
import {
|
||||||
DEFAULT_EPAYMENT_SETTINGS,
|
DEFAULT_EPAYMENT_SETTINGS,
|
||||||
@@ -19,8 +20,8 @@ import styles from './WebsiteEPaymentPage.module.css'
|
|||||||
|
|
||||||
const COMING_SOON_GATEWAYS: {
|
const COMING_SOON_GATEWAYS: {
|
||||||
id: Exclude<PaymentGatewayId, 'mellat'>
|
id: Exclude<PaymentGatewayId, 'mellat'>
|
||||||
nameKey: string
|
nameKey: BusinessMessageKey
|
||||||
descKey: string
|
descKey: BusinessMessageKey
|
||||||
}[] = [
|
}[] = [
|
||||||
{
|
{
|
||||||
id: 'sep',
|
id: 'sep',
|
||||||
@@ -199,7 +200,7 @@ export function WebsiteEPaymentPage() {
|
|||||||
id="epayment-master"
|
id="epayment-master"
|
||||||
checked={ePayment.enabled}
|
checked={ePayment.enabled}
|
||||||
disabled={savingKey !== null}
|
disabled={savingKey !== null}
|
||||||
onCheckedChange={(checked) => void handleMasterToggle(checked)}
|
onChange={(checked) => void handleMasterToggle(checked)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -218,7 +219,7 @@ export function WebsiteEPaymentPage() {
|
|||||||
id="epayment-mellat"
|
id="epayment-mellat"
|
||||||
checked={ePayment.gateways.mellat.enabled}
|
checked={ePayment.gateways.mellat.enabled}
|
||||||
disabled={savingKey !== null || !ePayment.enabled}
|
disabled={savingKey !== null || !ePayment.enabled}
|
||||||
onCheckedChange={(checked) => void handleMellatToggle(checked)}
|
onChange={(checked) => void handleMellatToggle(checked)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ export function CheckoutResultStep() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const paymentStatus = status
|
||||||
const controller = new AbortController()
|
const controller = new AbortController()
|
||||||
|
|
||||||
async function load() {
|
async function load() {
|
||||||
@@ -53,7 +54,7 @@ export function CheckoutResultStep() {
|
|||||||
setPlacedOrder(data.order)
|
setPlacedOrder(data.order)
|
||||||
setPayment(
|
setPayment(
|
||||||
buildPaymentInfoFromOrder(data.order, {
|
buildPaymentInfoFromOrder(data.order, {
|
||||||
status,
|
status: paymentStatus,
|
||||||
transactionId,
|
transactionId,
|
||||||
trackId,
|
trackId,
|
||||||
message,
|
message,
|
||||||
@@ -63,7 +64,7 @@ export function CheckoutResultStep() {
|
|||||||
if (isAbortError(err)) return
|
if (isAbortError(err)) return
|
||||||
// Still show result shell with query payment data if order fetch fails
|
// Still show result shell with query payment data if order fetch fails
|
||||||
setPayment({
|
setPayment({
|
||||||
status: status!,
|
status: paymentStatus,
|
||||||
transactionId,
|
transactionId,
|
||||||
trackId,
|
trackId,
|
||||||
message:
|
message:
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ import { Pagination } from '@meshkee/dashboard-ui'
|
|||||||
import pageStyles from '../components/PageContent.module.css'
|
import pageStyles from '../components/PageContent.module.css'
|
||||||
import styles from './BusinessesPage.module.css'
|
import styles from './BusinessesPage.module.css'
|
||||||
|
|
||||||
const DEFAULT_PAGE_SIZE = 10
|
const DEFAULT_PAGE_SIZE = 24
|
||||||
const DEFAULT_LOCALE: DashboardLocale = 'fa'
|
const DEFAULT_LOCALE: DashboardLocale = 'fa'
|
||||||
const DEFAULT_THEME_MODE: DashboardThemeMode = 'light'
|
const DEFAULT_THEME_MODE: DashboardThemeMode = 'light'
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import pageStyles from '../components/PageContent.module.css'
|
|||||||
import tableStyles from './BusinessesPage.module.css'
|
import tableStyles from './BusinessesPage.module.css'
|
||||||
import styles from './WebsitesPage.module.css'
|
import styles from './WebsitesPage.module.css'
|
||||||
|
|
||||||
const PAGE_SIZE = 10
|
const PAGE_SIZE = 24
|
||||||
|
|
||||||
function daysUntilExpiry(expiresAt: string | null) {
|
function daysUntilExpiry(expiresAt: string | null) {
|
||||||
if (!expiresAt) return null
|
if (!expiresAt) return null
|
||||||
|
|||||||
Reference in New Issue
Block a user