Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 22dddb73bd | |||
| cb49c69662 | |||
| f18ae545d8 | |||
| 3003ced157 |
+1
-1
@@ -1,2 +1,2 @@
|
||||
parameters:
|
||||
app.version: '1.9.42'
|
||||
app.version: '1.9.44'
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
<IconLucideEye v-else class="w-5 h-5 mr-2" aria-hidden="true" />
|
||||
{{ isEditMode ? 'Voir détails' : 'Modifier' }}
|
||||
</button>
|
||||
<NuxtLink :to="backDestination" class="btn btn-ghost btn-sm md:btn-md">
|
||||
<button type="button" class="btn btn-ghost btn-sm md:btn-md" @click="goBack">
|
||||
<IconLucideArrowLeft class="w-4 h-4 mr-1" aria-hidden="true" />
|
||||
{{ backLabel }}
|
||||
</NuxtLink>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -29,6 +29,7 @@ import IconLucideEye from '~icons/lucide/eye'
|
||||
import IconLucideArrowLeft from '~icons/lucide/arrow-left'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
const props = defineProps<{
|
||||
title: string
|
||||
@@ -43,12 +44,20 @@ defineEmits<{
|
||||
'toggle-edit': []
|
||||
}>()
|
||||
|
||||
const backDestination = computed(() => {
|
||||
// Retour : on revient à l'URL précédente pour préserver l'état de la liste
|
||||
// (recherche, tri, pagination persistés en query params). Fallback sur le
|
||||
// backLink si pas d'historique applicatif (accès direct, refresh, lien partagé).
|
||||
const goBack = () => {
|
||||
if (route.query.from === 'machine' && route.query.machineId) {
|
||||
return `/machine/${route.query.machineId}`
|
||||
router.push(`/machine/${route.query.machineId}`)
|
||||
return
|
||||
}
|
||||
return props.backLink
|
||||
})
|
||||
if (window.history.state?.back) {
|
||||
router.back()
|
||||
return
|
||||
}
|
||||
router.push(props.backLink)
|
||||
}
|
||||
|
||||
const backLabel = computed(() => {
|
||||
if (route.query.from === 'machine') {
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
>
|
||||
<IconLucidePrinter class="w-4 h-4" aria-hidden="true" />
|
||||
</button>
|
||||
<NuxtLink to="/machines" class="btn btn-ghost btn-sm md:btn-md">
|
||||
<button type="button" class="btn btn-ghost btn-sm md:btn-md" @click="goBack">
|
||||
<IconLucideArrowLeft class="w-4 h-4 mr-1" aria-hidden="true" />
|
||||
Parc machines
|
||||
</NuxtLink>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -52,6 +52,18 @@ import IconLucidePrinter from '~icons/lucide/printer'
|
||||
import IconLucideArrowLeft from '~icons/lucide/arrow-left'
|
||||
|
||||
const { canEdit } = usePermissions()
|
||||
const router = useRouter()
|
||||
|
||||
// Retour : revient à l'URL précédente pour préserver la recherche/filtres du
|
||||
// parc machines (persistés en query params). Fallback vers /machines si pas
|
||||
// d'historique applicatif (accès direct, refresh, lien partagé).
|
||||
const goBack = () => {
|
||||
if (window.history.state?.back) {
|
||||
router.back()
|
||||
return
|
||||
}
|
||||
router.push('/machines')
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
title: string
|
||||
|
||||
@@ -281,7 +281,10 @@ const doRefresh = async ({ resetOffset = false }: { resetOffset?: boolean } = {}
|
||||
limit.value = response.limit
|
||||
}
|
||||
catch (error: unknown) {
|
||||
if (error && typeof error === 'object' && (error as { name?: string }).name === 'AbortError') return
|
||||
// Requête annulée volontairement (nouvelle recherche / démontage) : pas une
|
||||
// vraie erreur. On teste le signal car ofetch encapsule l'AbortError dans
|
||||
// une FetchError, donc error.name n'est pas fiable.
|
||||
if (controller.signal.aborted) return
|
||||
showError(extractErrorMessage(error))
|
||||
}
|
||||
finally {
|
||||
|
||||
@@ -18,6 +18,7 @@ use DateTimeInterface;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\Common\EventSubscriber;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityNotFoundException;
|
||||
use Doctrine\ORM\Event\OnFlushEventArgs;
|
||||
use Doctrine\ORM\Events;
|
||||
use Doctrine\ORM\UnitOfWork;
|
||||
@@ -432,7 +433,12 @@ abstract class AbstractAuditSubscriber implements EventSubscriber
|
||||
return;
|
||||
}
|
||||
|
||||
$fieldName = 'customField:'.$cfv->getCustomField()->getName();
|
||||
try {
|
||||
$cfName = $cfv->getCustomField()->getName();
|
||||
} catch (EntityNotFoundException) {
|
||||
return;
|
||||
}
|
||||
$fieldName = 'customField:'.$cfName;
|
||||
$diff = [$fieldName => ['from' => $from, 'to' => $to]];
|
||||
|
||||
$pendingUpdates[$ownerId] = $this->mergeDiffs($pendingUpdates[$ownerId] ?? [], $diff);
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace App\Service;
|
||||
use App\Entity\Composant;
|
||||
use App\Entity\CustomFieldValue;
|
||||
use App\Entity\Piece;
|
||||
use Doctrine\ORM\EntityNotFoundException;
|
||||
|
||||
class ReferenceAutoGenerator
|
||||
{
|
||||
@@ -48,8 +49,12 @@ class ReferenceAutoGenerator
|
||||
|
||||
/** @var CustomFieldValue $cfv */
|
||||
foreach ($entity->getCustomFieldValues() as $cfv) {
|
||||
$normalized = mb_strtoupper(trim($cfv->getValue()));
|
||||
$map[$cfv->getCustomField()->getName()] = $normalized;
|
||||
try {
|
||||
$name = $cfv->getCustomField()->getName();
|
||||
} catch (EntityNotFoundException) {
|
||||
continue;
|
||||
}
|
||||
$map[$name] = mb_strtoupper(trim($cfv->getValue()));
|
||||
}
|
||||
|
||||
return $map;
|
||||
|
||||
Reference in New Issue
Block a user