Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/builder/messages/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -2293,6 +2293,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "رمز المستخدم"
}
},
"flows": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "Brugerkode"
}
},
"flows": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "Benutzercode"
}
},
"flows": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2293,6 +2293,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "User Code"
}
},
"metaConversions": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2293,6 +2293,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "Código de usuario"
}
},
"flows": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "Käyttäjäkoodi"
}
},
"flows": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "Code utilisateur"
}
},
"flows": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -4843,6 +4843,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "קוד משתמש"
}
},
"billing": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "Kode pengguna"
}
},
"flows": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "Codice utente"
}
},
"actions": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "ユーザーコード"
}
},
"flows": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1969,6 +1969,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "Gebruikerscode"
}
},
"condition": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "Código do usuário"
}
},
"flows": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "Código do utilizador"
}
},
"flows": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -2940,6 +2940,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "Cod utilizator"
}
},
"channels": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -2991,6 +2991,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "Användarkod"
}
},
"flowAnalytics": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2293,6 +2293,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "Kullanıcı kodu"
}
},
"flows": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2293,6 +2293,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "Mã người dùng"
}
},
"flows": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -2994,6 +2994,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "用户代码"
}
},
"flowAnalytics": {
Expand Down
3 changes: 3 additions & 0 deletions apps/builder/messages/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,9 @@
},
"adSource": {
"label": "Ad source"
},
"userCode": {
"label": "使用者代碼"
}
},
"messages": {
Expand Down
33 changes: 27 additions & 6 deletions apps/builder/src/features/contacts/contact-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,26 @@ const scopedIdentityRowsByChannel: Partial<
],
}

const buildUserCodeField = (
contactInbox: ContactInboxResource | undefined,
t: (key: string) => string,
): ContactEditableField[] => {
const value = contactInbox?.sourceId
if (!value) {
return []
}
return [
{
key: "sourceId",
icon: PhoneIcon,
label: t("fields.userCode.label"),
value,
type: "shortText",
readOnly: true,
},
]
}

const buildScopedIdentityFields = (
contactInbox: ContactInboxResource | undefined,
t: (key: string) => string,
Expand All @@ -174,8 +194,7 @@ const buildScopedIdentityFields = (
const rows = scopedIdentityRowsByChannel[parsedChannel.data] ?? []
return rows.flatMap((row): ContactEditableField[] => {
const value = contactInbox[row.key]
// Skip absent values, and a value that IS the Contact ID shown above
// (a scoped-id-keyed contact) — no duplicate row.
// Skip absent values, and scoped ids that duplicate {{user_code}} (sourceId).
if (!value || value === contactInbox.sourceId) {
return []
}
Expand Down Expand Up @@ -318,7 +337,8 @@ export const ContactDetail = ({

if (conversation?.contact) {
const activeContactInbox = conversation.contactInboxes[0]
const channelContactId = activeContactInbox?.sourceId
// {{user_id}} — workspace contact record id for API calls (GET /v1/contacts/id:{id}).
const userId = conversation.contact.id
// The ad the contact clicked from (any ad-attributed inbox), shown as
// a link right under Contact ID. Guarded to http(s) so a non-navigable
// / `javascript:` referral value never becomes an anchor href.
Expand All @@ -331,13 +351,14 @@ export const ContactDetail = ({
: null
const tmpContactFields: ContactEditableField[] = [
{
key: "channelContactId",
key: "userId",
icon: IdCardIcon,
label: t("fields.contactId.label"),
value: channelContactId,
label: t("fields.userId.label"),
value: userId,
type: "shortText",
readOnly: true,
},
...buildUserCodeField(activeContactInbox, t),
...(adSourceUrl
? [
{
Expand Down