Skip to content

Commit f1a34ec

Browse files
feat(resident-app): INFRA-1489 add voip page (#7218)
* fix(ui): INFRA-1489 fix css start warnings * feat(icons): INFRA-1489 add missing icons * feat(resident-app): INFRA-1489 added VoIP incoming call page * feat(miniapp-utils): INFRA-1489 separate tracing utils from apollo * feat(ui): INFRA-1489 export analytic utils at /events * feat(resident-app): INFRA-1489 add analytics to buttons * feat(resident-app): INFRA-1489 sync module to main * fix(miniapp-utils): INFRA-1489 tracing headers * fix(miniapp-utils): INFRA-1489 tracing headers and build fixes * fix(condo): INFRA-1489 sync schema
1 parent 6685cbf commit f1a34ec

15 files changed

Lines changed: 259 additions & 57 deletions

File tree

apps/condo/schema.graphql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72081,6 +72081,8 @@ enum B2BAppIconType {
7208172081
Market
7208272082
Menu
7208372083
Meters
72084+
Mic
72085+
MicOff
7208472086
MinusCircle
7208572087
Monitor
7208672088
MoreHorizontal
@@ -72127,6 +72129,8 @@ enum B2BAppIconType {
7212772129
Unlock
7212872130
User
7212972131
UserSquare
72132+
Volume
72133+
VolumeOff
7213072134
Wallet
7213172135
XCircle
7213272136
}

apps/condo/schema.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5205,6 +5205,8 @@ export enum B2BAppIconType {
52055205
Market = 'Market',
52065206
Menu = 'Menu',
52075207
Meters = 'Meters',
5208+
Mic = 'Mic',
5209+
MicOff = 'MicOff',
52085210
MinusCircle = 'MinusCircle',
52095211
Monitor = 'Monitor',
52105212
MoreHorizontal = 'MoreHorizontal',
@@ -5251,6 +5253,8 @@ export enum B2BAppIconType {
52515253
Unlock = 'Unlock',
52525254
User = 'User',
52535255
UserSquare = 'UserSquare',
5256+
Volume = 'Volume',
5257+
VolumeOff = 'VolumeOff',
52545258
Wallet = 'Wallet',
52555259
XCircle = 'XCircle'
52565260
}

apps/resident-app

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/** This file is auto-generated, do not edit it manually **/
2+
import React from 'react'
3+
4+
import { IconWrapper, IconProps } from '../wrappers'
5+
6+
export const Mic: React.FC<IconProps> = ({ svgProps: props, ...restProps }) => {
7+
return (
8+
<IconWrapper
9+
icon={
10+
<svg
11+
width='inherit'
12+
height='inherit'
13+
fill='none'
14+
xmlns='http://www.w3.org/2000/svg'
15+
viewBox='0 0 24 24'
16+
{...props}
17+
>
18+
<path
19+
d='M12 19v3M19 10v2a7 7 0 1 1-14 0v-2'
20+
stroke='#000'
21+
strokeWidth={2}
22+
strokeLinecap='round'
23+
strokeLinejoin='round'
24+
/>
25+
<path
26+
d='M15 5a3 3 0 1 0-6 0v7a3 3 0 1 0 6 0V5Z'
27+
stroke='#000'
28+
strokeWidth={2}
29+
strokeLinecap='round'
30+
strokeLinejoin='round'
31+
/>
32+
</svg>
33+
}
34+
{...restProps}
35+
/>
36+
)
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/** This file is auto-generated, do not edit it manually **/
2+
import React from 'react'
3+
4+
import { IconWrapper, IconProps } from '../wrappers'
5+
6+
export const MicOff: React.FC<IconProps> = ({ svgProps: props, ...restProps }) => {
7+
return (
8+
<IconWrapper
9+
icon={
10+
<svg
11+
width='inherit'
12+
height='inherit'
13+
fill='none'
14+
xmlns='http://www.w3.org/2000/svg'
15+
viewBox='0 0 24 24'
16+
{...props}
17+
>
18+
<path
19+
d='M12 19v3M15 9.34V5a3 3 0 0 0-5.68-1.33M16.95 16.95A7 7 0 0 1 5 12v-2M18.89 13.23c.073-.406.11-.818.11-1.23v-2M2 2l20 20'
20+
stroke='#000'
21+
strokeWidth={2}
22+
strokeLinecap='round'
23+
strokeLinejoin='round'
24+
/>
25+
<path
26+
d='M9 9v3a3 3 0 0 0 5.12 2.12'
27+
stroke='#000'
28+
strokeWidth={2}
29+
strokeLinecap='round'
30+
strokeLinejoin='round'
31+
/>
32+
</svg>
33+
}
34+
{...restProps}
35+
/>
36+
)
37+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/** This file is auto-generated, do not edit it manually **/
2+
import React from 'react'
3+
4+
import { IconWrapper, IconProps } from '../wrappers'
5+
6+
export const Volume: React.FC<IconProps> = ({ svgProps: props, ...restProps }) => {
7+
return (
8+
<IconWrapper
9+
icon={
10+
<svg
11+
width='inherit'
12+
height='inherit'
13+
fill='none'
14+
xmlns='http://www.w3.org/2000/svg'
15+
viewBox='0 0 24 24'
16+
{...props}
17+
>
18+
<path
19+
d='M11 4.702a.706.706 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V4.702ZM16 9a5 5 0 0 1 0 6M19.364 18.364a9 9 0 0 0 0-12.728'
20+
stroke='#000'
21+
strokeWidth={2}
22+
strokeLinecap='round'
23+
strokeLinejoin='round'
24+
/>
25+
</svg>
26+
}
27+
{...restProps}
28+
/>
29+
)
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/** This file is auto-generated, do not edit it manually **/
2+
import React from 'react'
3+
4+
import { IconWrapper, IconProps } from '../wrappers'
5+
6+
export const VolumeOff: React.FC<IconProps> = ({ svgProps: props, ...restProps }) => {
7+
return (
8+
<IconWrapper
9+
icon={
10+
<svg
11+
width='inherit'
12+
height='inherit'
13+
fill='none'
14+
xmlns='http://www.w3.org/2000/svg'
15+
viewBox='0 0 24 24'
16+
{...props}
17+
>
18+
<path
19+
d='M16 9a5 5 0 0 1 .95 2.293M19.364 5.636a9 9 0 0 1 1.889 9.96M2 2l20 20M7 7l-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11M9.828 4.172A.686.686 0 0 1 11 4.657v.686'
20+
stroke='#000'
21+
strokeWidth={2}
22+
strokeLinecap='round'
23+
strokeLinejoin='round'
24+
/>
25+
</svg>
26+
}
27+
{...restProps}
28+
/>
29+
)
30+
}

packages/icons/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ export { Mail } from './components/Mail'
6464
export { Market } from './components/Market'
6565
export { Menu } from './components/Menu'
6666
export { Meters } from './components/Meters'
67+
export { Mic } from './components/Mic'
68+
export { MicOff } from './components/MicOff'
6769
export { MinusCircle } from './components/MinusCircle'
6870
export { Monitor } from './components/Monitor'
6971
export { MoreHorizontal } from './components/MoreHorizontal'
@@ -110,5 +112,7 @@ export { Trash } from './components/Trash'
110112
export { Unlock } from './components/Unlock'
111113
export { User } from './components/User'
112114
export { UserSquare } from './components/UserSquare'
115+
export { Volume } from './components/Volume'
116+
export { VolumeOff } from './components/VolumeOff'
113117
export { Wallet } from './components/Wallet'
114118
export { XCircle } from './components/XCircle'

packages/miniapp-utils/package.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,15 @@
7272
"helpers/sender": [
7373
"dist/helpers/sender.d.ts"
7474
],
75-
"helpers/uuid": [
76-
"dist/helpers/uuid.d.ts"
75+
"helpers/tracing": [
76+
"dist/helpers/tracing.d.ts"
7777
],
7878
"helpers/urls": [
7979
"dist/helpers/urls.d.ts"
8080
],
81+
"helpers/uuid": [
82+
"dist/helpers/uuid.d.ts"
83+
],
8184
"helpers/webpack": [
8285
"dist/helpers/webpack.d.ts"
8386
],
@@ -155,16 +158,21 @@
155158
"require": "./dist/helpers/sender.js",
156159
"import": "./dist/helpers/sender.mjs"
157160
},
158-
"./helpers/uuid": {
159-
"types": "./dist/helpers/uuid.d.ts",
160-
"require": "./dist/helpers/uuid.js",
161-
"import": "./dist/helpers/uuid.mjs"
161+
"./helpers/tracing": {
162+
"types": "./dist/helpers/tracing.d.ts",
163+
"require": "./dist/helpers/tracing.js",
164+
"import": "./dist/helpers/tracing.mjs"
162165
},
163166
"./helpers/urls": {
164167
"types": "./dist/helpers/urls.d.ts",
165168
"require": "./dist/helpers/urls.js",
166169
"import": "./dist/helpers/urls.mjs"
167170
},
171+
"./helpers/uuid": {
172+
"types": "./dist/helpers/uuid.d.ts",
173+
"require": "./dist/helpers/uuid.js",
174+
"import": "./dist/helpers/uuid.mjs"
175+
},
168176
"./helpers/webpack": {
169177
"types": "./dist/helpers/webpack.d.ts",
170178
"require": "./dist/helpers/webpack.js",

packages/miniapp-utils/src/helpers/apollo.ts

Lines changed: 6 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import { parse as parseCookieString, serialize as serializeCookie } from 'cookie'
1+
import { serialize as serializeCookie } from 'cookie'
22
import { setCookie, getCookies } from 'cookies-next'
33

44
import { getProxyHeadersForIp } from './proxying'
55
import { getRequestIp } from './proxying'
66
import {
77
FINGERPRINT_ID_COOKIE_NAME,
88
generateFingerprint,
9-
getClientSideFingerprint,
109
} from './sender'
11-
import { generateUUIDv4 } from './uuid'
10+
import { getAppTracingHeaders } from './tracing'
1211

1312
import type { DefaultContext, RequestHandler } from '@apollo/client'
1413
import type { IncomingMessage, ServerResponse } from 'http'
@@ -20,16 +19,6 @@ type SSRContext = {
2019
defaultContext: DefaultContext
2120
}
2221

23-
const SSR_DEFAULT_FINGERPRINT = 'webAppSSR'
24-
const COOKIE_HEADER_NAME = 'cookie'
25-
const REMOTE_APP_HEADER_NAME = 'x-remote-app'
26-
const REMOTE_VERSION_HEADER_NAME = 'x-remote-version'
27-
const REMOTE_CLIENT_HEADER_NANE = 'x-remote-client'
28-
const REMOTE_ENV_HEADER_NAME = 'x-remote-env'
29-
const TARGET_HEADER_NAME = 'x-target'
30-
const START_REQUEST_ID_HEADER_NAME = 'x-start-request-id'
31-
const PARENT_REQUEST_ID_HEADER_NAME = 'x-parent-request-id'
32-
3322
export type TracingMiddlewareOptions = {
3423
serviceUrl: string
3524
codeVersion: string
@@ -42,46 +31,17 @@ export type SSRProxyingMiddlewareOptions = {
4231
proxySecret?: string
4332
}
4433

45-
function generateRequestId () {
46-
return `BR${generateUUIDv4().replaceAll('-', '')}`
47-
}
48-
4934
export function getTracingMiddleware (options: TracingMiddlewareOptions): RequestHandler {
5035
return function (operation, forward) {
5136
operation.setContext((previousContext: DefaultContext) => {
5237
const { headers: previousHeaders } = previousContext
5338

54-
const reqId = generateRequestId()
55-
56-
const headers = {
57-
...previousHeaders,
58-
[REMOTE_APP_HEADER_NAME]: options.serviceUrl,
59-
[REMOTE_VERSION_HEADER_NAME]: options.codeVersion,
60-
[PARENT_REQUEST_ID_HEADER_NAME]: reqId,
61-
[START_REQUEST_ID_HEADER_NAME]: reqId,
62-
}
63-
64-
if (options.target) {
65-
headers[TARGET_HEADER_NAME] = options.target
66-
}
67-
68-
headers[REMOTE_ENV_HEADER_NAME] = typeof document === 'undefined' ? 'SSR' : 'CSR'
69-
70-
71-
72-
// NOTE: CSR
73-
if (typeof document !== 'undefined' && document.cookie) {
74-
headers[REMOTE_CLIENT_HEADER_NANE] = getClientSideFingerprint()
75-
} else if (headers[COOKIE_HEADER_NAME]) {
76-
const ssrCookies = parseCookieString(headers[COOKIE_HEADER_NAME])
77-
78-
headers[REMOTE_CLIENT_HEADER_NANE] = ssrCookies[FINGERPRINT_ID_COOKIE_NAME] || SSR_DEFAULT_FINGERPRINT
79-
}
80-
81-
8239
return {
8340
...previousContext,
84-
headers,
41+
headers: getAppTracingHeaders({
42+
...options,
43+
previousHeaders,
44+
}),
8545
}
8646
})
8747

0 commit comments

Comments
 (0)