mirror of
https://github.com/faiztyanirh/clqms-shadcn-v1.git
synced 2026-04-22 17:19:52 +07:00
change container using label
This commit is contained in:
parent
7f052986b3
commit
32c20ccd16
@ -117,16 +117,16 @@
|
||||
tempMap,
|
||||
});
|
||||
console.log(payload)
|
||||
const result = await formState.save(masterDetail.mode, payload);
|
||||
// const result = await formState.save(masterDetail.mode, payload);
|
||||
|
||||
if (result.status === 'success') {
|
||||
toast('Test Map Created!');
|
||||
masterDetail?.exitForm(true);
|
||||
} else {
|
||||
console.error('Failed to save test map');
|
||||
const errorMessages = result.messages ? Object.values(result.messages).join('\n') : 'Failed to save test map';
|
||||
toast.error(errorMessages)
|
||||
}
|
||||
// if (result.status === 'success') {
|
||||
// toast('Test Map Created!');
|
||||
// masterDetail?.exitForm(true);
|
||||
// } else {
|
||||
// console.error('Failed to save test map');
|
||||
// const errorMessages = result.messages ? Object.values(result.messages).join('\n') : 'Failed to save test map';
|
||||
// toast.error(errorMessages)
|
||||
// }
|
||||
}
|
||||
|
||||
const primaryAction = $derived({
|
||||
@ -262,6 +262,12 @@
|
||||
}))
|
||||
})
|
||||
|
||||
function getLabel(fieldKey, value) {
|
||||
const opts = testMapDetailFormState.selectOptions[fieldKey] ?? [];
|
||||
const found = opts.find((o) => o.value == value);
|
||||
return found ? found.rawItem.ConName : value;
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
masterDetail.registerExtraState({
|
||||
key: 'tempMap',
|
||||
@ -269,7 +275,7 @@
|
||||
reset: () => { tempMap = []; idCounter = 0; editingId = null; },
|
||||
});
|
||||
});
|
||||
$inspect(testMapDetailFormState.errors)
|
||||
$inspect(testMapDetailFormState.selectOptions)
|
||||
</script>
|
||||
|
||||
<FormPageContainer title="Create Test Map" {primaryAction} {secondaryActions} {actions}>
|
||||
@ -331,7 +337,7 @@
|
||||
<Table.Cell>{row.HostTestName}</Table.Cell>
|
||||
<Table.Cell>{row.ClientTestCode}</Table.Cell>
|
||||
<Table.Cell>{row.ClientTestName}</Table.Cell>
|
||||
<Table.Cell>{row.ConDefID}</Table.Cell>
|
||||
<Table.Cell>{row.ConDefID ? getLabel('ConDefID', row.ConDefID) : '-'}</Table.Cell>
|
||||
<Table.Cell>
|
||||
<div class="flex gap-1">
|
||||
<Tooltip.Provider>
|
||||
|
||||
@ -379,6 +379,7 @@
|
||||
reset: () => { tempMap = []; idCounter = 0; editingId = null; },
|
||||
});
|
||||
});
|
||||
$inspect(tempMap)
|
||||
</script>
|
||||
|
||||
<FormPageContainer title="Edit Test Map" {primaryAction} {secondaryActions}>
|
||||
@ -438,7 +439,7 @@
|
||||
<Table.Cell>{row.HostTestName}</Table.Cell>
|
||||
<Table.Cell>{row.ClientTestCode}</Table.Cell>
|
||||
<Table.Cell>{row.ClientTestName}</Table.Cell>
|
||||
<Table.Cell>{row.ConDefID}</Table.Cell>
|
||||
<Table.Cell>{row.ContainerLabel}</Table.Cell>
|
||||
<Table.Cell>
|
||||
<div class="flex gap-1">
|
||||
<Tooltip.Provider>
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
<Table.Cell>{row.HostTestName ?? '-'}</Table.Cell>
|
||||
<Table.Cell>{row.ClientTestCode ?? '-'}</Table.Cell>
|
||||
<Table.Cell>{row.ClientTestName ?? '-'}</Table.Cell>
|
||||
<Table.Cell>{row.ConDefID ?? '-'}</Table.Cell>
|
||||
<Table.Cell>{row.ContainerLabel ?? '-'}</Table.Cell>
|
||||
</Table.Row>
|
||||
{/each}
|
||||
</Table.Body>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user