users worden nu beter geresolved
linter / quality (push) Failing after 1m5s
tests / ci (8.3) (push) Failing after 49s
tests / ci (8.4) (push) Failing after 1m7s
tests / ci (8.5) (push) Failing after 1m6s

This commit is contained in:
Daan Meijer
2026-07-06 16:51:34 +02:00
parent b2a7e2557e
commit 1be49133a0
14 changed files with 112 additions and 235 deletions
@@ -39,11 +39,11 @@ const parsedContent = computed(() => {
let content = props.message.content;
// 1. Replace <user:id> placeholders with links to their dynamic profile
const userRegex = /<user:(\d+)>/g;
const userRegex = /<user:([0-9a-f-]+)>/g;
content = content.replace(userRegex, (match, userId) => {
const user = props.participantsById[Number(userId)];
const user = props.participantsById[(userId)];
if (user) {
const url = route('dynamics.users.show', [props.dynamicId, Number(userId)]);
const url = route('dynamics.users.show', [props.dynamicId, (userId)]);
return `<a href="${url}" class="c-chat__user-link font-semibold text-blue-500 hover:underline">${
user.pivot?.display_name ?? user.name
}</a>`;
@@ -77,7 +77,7 @@ const parsedContent = computed(() => {
/[-\/\\^$*+?.()|[\]{}]/g,
'\\$&',
);
const nameRegex = new RegExp(`"${escapedName}"`, 'g');
content = content.replace(
nameRegex,
@@ -49,15 +49,21 @@ const parsedContent = computed(() => {
let content = props.message.content;
// 1. Replace <user:id> placeholders with links to their dynamic profile
const userRegex = /<user:(\d+)>/g;
const userRegex = /<user:([0-9a-f-]+)>/g;
content = content.replace(userRegex, (match, userId) => {
const user = props.participantsById[Number(userId)];
const user = props.participantsById[(userId)];
if (user) {
const url = route('dynamics.users.show', [props.dynamicId, Number(userId)]);
const url = route('dynamics.users.show', [
props.dynamicId,
(userId),
]);
return `<a href="${url}" class="c-chat__user-link font-semibold text-blue-500 hover:underline">${
user.pivot?.display_name ?? user.name
}</a>`;
}
return `User #${userId}`;
});
@@ -87,7 +93,7 @@ const parsedContent = computed(() => {
/[-\/\\^$*+?.()|[\]{}]/g,
'\\$&',
);
const nameRegex = new RegExp(`"${escapedName}"`, 'g');
content = content.replace(
nameRegex,
@@ -104,9 +110,7 @@ const parsedContent = computed(() => {
<template>
<div>
<div class="c-chat__message-header">
<span class="c-chat__message-author">{{
message.user?.name
}}</span>
<span class="c-chat__message-author">{{ message.user?.name }}</span>
<span
class="c-chat__message-time"
:title="formatTimestamp(message.created_at).full"
@@ -138,10 +142,7 @@ const parsedContent = computed(() => {
class="relative cursor-pointer transition-opacity hover:opacity-90"
@click="emit('open-lightbox', item.url, item.mime_type)"
>
<video
:src="item.url"
class="c-chat__video"
></video>
<video :src="item.url" class="c-chat__video"></video>
<div class="c-chat__play-overlay"></div>
</div>
</div>