feat(client): show actionable customs count on sidebar
This commit is contained in:
@@ -10,7 +10,7 @@ function harness(t) {
|
||||
const code = ts.transpileModule(source + '\nexport { loadDetail, detail, clearanceResults, loading, errorMessage, selectedInboundIds, clearanceError, clearanceLoading, retryClearanceResults, close }', { compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022 } }).outputText
|
||||
const props = vue.reactive({ modelValue: false, orderId: 'A', canEdit: true }), requests = [], clearances = [], updates = [], view = {}
|
||||
const unmounts = []
|
||||
const dependencies = { vue: { ...vue, onBeforeUnmount: fn => unmounts.push(fn) }, 'element-plus': { ElMessage: {} }, '@/modules/first-leg/api/customs': {
|
||||
const dependencies = { '../store/customsPending': { useCustomsPendingStore: () => ({ refresh: async () => {} }) }, vue: { ...vue, onBeforeUnmount: fn => unmounts.push(fn) }, 'element-plus': { ElMessage: {} }, '@/modules/first-leg/api/customs': {
|
||||
getMerchantCustomsForOrder: id => { const pending = deferred(); requests.push({ id, ...pending }); return pending.promise },
|
||||
getMerchantClearanceResults: id => { const pending = deferred(); clearances.push({ id, ...pending }); return pending.promise },
|
||||
merchantCustomsErrorMessage: error => error.message,
|
||||
|
||||
@@ -22,6 +22,9 @@ import {
|
||||
type MerchantClearanceResult,
|
||||
} from '@/modules/first-leg/api/customs'
|
||||
|
||||
import { useCustomsPendingStore } from '../store/customsPending'
|
||||
|
||||
const customsPending = useCustomsPendingStore()
|
||||
const props = defineProps<{
|
||||
modelValue: boolean
|
||||
orderId: string
|
||||
@@ -104,6 +107,7 @@ async function retryClearanceResults() {
|
||||
|
||||
async function loadDetail() {
|
||||
if (disposed || !props.modelValue || !props.orderId) return
|
||||
void customsPending.refresh(true)
|
||||
const request = ++detailRequest
|
||||
resetClearanceResults()
|
||||
const orderId = props.orderId
|
||||
|
||||
Reference in New Issue
Block a user