Skip to content

Commit 851bf31

Browse files
authored
fix: small fixes (#608)
* Fix images again * small fixes * fix deprecated tracing
1 parent e5346aa commit 851bf31

File tree

24 files changed

+83
-86
lines changed

24 files changed

+83
-86
lines changed
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
11
import AesProviderBase from '@beak/common-host/providers/encryption-aes';
2-
import crypto, { Cipher, Decipher } from 'crypto';
3-
import { promisify } from 'util';
2+
import crypto, { Cipher, Decipher } from 'node:crypto';
3+
import { promisify } from 'node:util';
44

55
const scrypt = promisify(crypto.scrypt);
66

77
export default class AesProvider extends AesProviderBase {
8-
async generateKey(): Promise<string> {
9-
const password = crypto.randomBytes(32);
10-
const salt = crypto.randomBytes(16);
11-
const key = await scrypt(password, salt, 32) as Buffer;
8+
async generateKey(): Promise<string> {
9+
const password = crypto.randomBytes(32);
10+
const salt = crypto.randomBytes(16);
11+
const key = await scrypt(password, salt, 32) as Buffer;
1212

13-
return key.toString('base64');
14-
}
13+
return key.toString('base64');
14+
}
1515

16-
async generateIv(): Promise<string> {
17-
const iv = crypto.randomBytes(16);
16+
async generateIv(): Promise<string> {
17+
const iv = crypto.randomBytes(16);
1818

19-
return iv.toString('base64');
20-
}
19+
return iv.toString('base64');
20+
}
2121

22-
async encrypt(payload: Uint8Array, key: string, iv: string): Promise<string> {
23-
const keyBuffer = Buffer.from(key, 'base64');
24-
const ivBuffer = Buffer.from(iv, 'base64');
22+
async encrypt(payload: Uint8Array, key: string, iv: string): Promise<string> {
23+
const keyBuffer = Buffer.from(key, 'base64');
24+
const ivBuffer = Buffer.from(iv, 'base64');
2525

26-
const cipher = crypto.createCipheriv(this.aesAlgo, keyBuffer, ivBuffer, void 0) as Cipher;
27-
const update = cipher.update(payload);
28-
const final = Buffer.concat([update, cipher.final()]);
26+
const cipher = crypto.createCipheriv(this.aesAlgo, keyBuffer, ivBuffer, void 0) as Cipher;
27+
const update = cipher.update(payload);
28+
const final = Buffer.concat([update, cipher.final()]);
2929

30-
return final.toString('base64');
31-
}
30+
return final.toString('base64');
31+
}
3232

33-
async decrypt(payload: Uint8Array, key: string, iv: string): Promise<string> {
34-
const keyBuffer = Buffer.from(key, 'base64');
35-
const ivBuffer = Buffer.from(iv, 'base64');
33+
async decrypt(payload: Uint8Array, key: string, iv: string): Promise<string> {
34+
const keyBuffer = Buffer.from(key, 'base64');
35+
const ivBuffer = Buffer.from(iv, 'base64');
3636

37-
const decipher = crypto.createDecipheriv(this.aesAlgo, keyBuffer, ivBuffer, void 0) as Decipher;
38-
const update = decipher.update(payload);
39-
const final = Buffer.concat([update, decipher.final()]);
37+
const decipher = crypto.createDecipheriv(this.aesAlgo, keyBuffer, ivBuffer, void 0) as Decipher;
38+
const update = decipher.update(payload);
39+
const final = Buffer.concat([update, decipher.final()]);
4040

41-
return final.toString('utf-8');
42-
}
41+
return final.toString('utf-8');
42+
}
4343

44-
async encryptString(payload: string, key: string, iv: string): Promise<string> {
45-
const buf = Buffer.from(payload, 'utf-8');
44+
async encryptString(payload: string, key: string, iv: string): Promise<string> {
45+
const buf = Buffer.from(payload, 'utf-8');
4646

47-
return await this.encrypt(buf, key, iv);
48-
}
47+
return await this.encrypt(buf, key, iv);
48+
}
4949

50-
async decryptString(payload: string, key: string, iv: string): Promise<string> {
51-
if (payload === '')
52-
return '';
50+
async decryptString(payload: string, key: string, iv: string): Promise<string> {
51+
if (payload === '')
52+
return '';
5353

54-
const buf = Buffer.from(payload, 'base64');
54+
const buf = Buffer.from(payload, 'base64');
5555

56-
return await this.decrypt(buf, key, iv);
57-
}
56+
return await this.decrypt(buf, key, iv);
57+
}
5858
}

apps-web/share/src/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { createRoot } from 'react-dom/client';
33
import { BrowserRouter, Route, Routes } from 'react-router-dom';
44
import { DesignSystemProvider } from '@beak/design-system';
55
import * as Sentry from '@sentry/react';
6-
import { Integrations } from '@sentry/tracing';
76

87
import Redirect from './components/atoms/Redirect';
98
import AppContainer from './containers/App';
@@ -37,7 +36,7 @@ const EntryPoint: React.FC<React.PropsWithChildren<unknown>> = () => (
3736
if (import.meta.env.MODE !== 'development') {
3837
Sentry.init({
3938
dsn: 'https://f70de5e39405453594ebd9d7712d113a@o988021.ingest.sentry.io/6320237',
40-
integrations: [new Integrations.BrowserTracing()],
39+
integrations: [],
4140

4241
environment: import.meta.env.ENVIRONMENT,
4342
release: import.meta.env.RELEASE_IDENTIFIER,

packages/ui/src/components/atoms/Input.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import styled from 'styled-components';
22

33
interface InputProps {
4-
beakSize?: 'sm' | 'md';
4+
$beakSize?: 'sm' | 'md';
55
$noStretch?: boolean;
66
}
77

@@ -11,9 +11,9 @@ const Input = styled.input<InputProps>`
1111
border: 1px solid ${p => p.theme.ui.primaryFill};
1212
box-sizing: border-box;
1313
14-
font-size: ${p => (p.beakSize || 'md') === 'md' ? '15px' : '13px'};
15-
padding: ${p => (p.beakSize || 'md') === 'md' ? '3px 5px' : '2px 3px'};
16-
border-radius: ${p => (p.beakSize || 'md') === 'md' ? '4px' : '3px'};
14+
font-size: ${p => (p.$beakSize || 'md') === 'md' ? '15px' : '13px'};
15+
padding: ${p => (p.$beakSize || 'md') === 'md' ? '3px 5px' : '2px 3px'};
16+
border-radius: ${p => (p.$beakSize || 'md') === 'md' ? '4px' : '3px'};
1717
1818
${p => !p.$noStretch && 'width: 100%;'}
1919
`;
@@ -24,9 +24,9 @@ export const Select = styled.select<InputProps>`
2424
border: 1px solid ${p => p.theme.ui.backgroundBorderSeparator};
2525
box-sizing: border-box;
2626
27-
font-size: ${p => (p.beakSize || 'md') === 'md' ? '15px' : '13px'};
28-
padding: ${p => (p.beakSize || 'md') === 'md' ? '3px 5px' : '2px 3px'};
29-
border-radius: ${p => (p.beakSize || 'md') === 'md' ? '4px' : '3px'};
27+
font-size: ${p => (p.$beakSize || 'md') === 'md' ? '15px' : '13px'};
28+
padding: ${p => (p.$beakSize || 'md') === 'md' ? '3px 5px' : '2px 3px'};
29+
border-radius: ${p => (p.$beakSize || 'md') === 'md' ? '4px' : '3px'};
3030
3131
${p => !p.$noStretch && 'width: 100%;'}
3232
${p => p.$noStretch && 'width: fit-content;'}

packages/ui/src/components/atoms/TabBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import styled from 'styled-components';
22

33
export interface TabBarProps {
4-
centered?: boolean;
4+
$centered?: boolean;
55
}
66

77
const TabBar = styled.div<TabBarProps>`
88
display: flex;
99
flex-direction: row;
1010
align-items: flex-end;
1111
12-
justify-content: ${props => props.centered ? 'center' : 'initial'};
12+
justify-content: ${props => props.$centered ? 'center' : 'initial'};
1313
overflow-x: overlay;
1414
1515
min-width: 100%;

packages/ui/src/components/molecules/PendingSplash.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const Wrapper = styled.div`
6969
const FadedLogo = styled.div`
7070
width: 200px;
7171
height: 200px;
72-
background: url('./images/logo-blank.png');
72+
background: url('images/logo-blank.png');
7373
background-repeat: no-repeat;
7474
background-position: center;
7575
background-size: contain;

packages/ui/src/components/molecules/ProjectLoading.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,24 @@ import React, { useState } from 'react';
22
import { renderPlainTextDefinition } from '@beak/ui/utils/keyboard-rendering';
33
import styled from 'styled-components';
44

5-
const hints: string[] = [
6-
`You can collapse the sidebar by clicking the same icon again, or pressing ${renderPlainTextDefinition('sidebar.toggle-view')}`,
7-
'You can use variables to make request bodies more dynamic',
8-
`Use the omni bar to get around Beak quickly... ${renderPlainTextDefinition('omni-bar.launch.commands')} or ${renderPlainTextDefinition('omni-bar.launch.finder')}`,
9-
'Keep an eye out for easter eggs...',
10-
`Quickly run a request from anywhere by pressing ${renderPlainTextDefinition('global.execute-request')}`,
11-
'Check out the preferences to make Beak more you',
12-
'Consectetur velit consequat minim dolor ex mollit amet',
13-
'Eiusmod culpa anim id consequat nisi nisi do sint deserunt irure officia',
14-
'Aliqua deserunt sunt excepteur non duis ad',
15-
];
16-
175
const ProjectLoading: React.FC<React.PropsWithChildren<unknown>> = () => {
6+
const hints: string[] = [
7+
`You can collapse the sidebar by clicking the same icon again, or pressing ${renderPlainTextDefinition('sidebar.toggle-view')}`,
8+
'You can use variables to make request bodies more dynamic',
9+
`Use the omni bar to get around Beak quickly... ${renderPlainTextDefinition('omni-bar.launch.commands')} or ${renderPlainTextDefinition('omni-bar.launch.finder')}`,
10+
'Keep an eye out for easter eggs...',
11+
`Quickly run a request from anywhere by pressing ${renderPlainTextDefinition('global.execute-request')}`,
12+
'Check out the preferences to make Beak a little more... you',
13+
];
14+
1815
const [hintIndex] = useState<number>(() => Math.floor(Math.random() * hints.length));
1916

2017
return (
2118
<Wrapper>
2219
<div>
2320
<Logo
2421
width={60}
25-
src={'./images/logo-tile.png'}
22+
src={'images/logo-tile.png'}
2623
/>
2724

2825
<Header>{'Did you know?'}</Header>

packages/ui/src/components/molecules/Tooltips.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ const tooltips: TooltipDefinition[] = [{
1919
content: 'Go to previous item in flight history',
2020
}, {
2121
anchor: '#tt-action-bar-next-flight-history',
22-
placement: 'bottom',
22+
placement: 'bottom-end',
2323
content: 'Go to next item in flight history',
2424
}, {
2525
anchor: '#tt-action-bar-alert-button',
26-
placement: 'bottom',
26+
placement: 'bottom-end',
2727
content: 'Shows possible errors with your project',
2828
}, {
2929
anchor: '#tt-action-bar-flight-status-pending',
@@ -62,6 +62,7 @@ const tooltips: TooltipDefinition[] = [{
6262
anchor: 'tt-response-header-url-bar',
6363
}, {
6464
anchor: 'tt-action-bar-omni-search',
65+
placement: 'bottom-end',
6566
}, {
6667
anchor: 'tt-omni-bar-finder-request-uri',
6768
}, {

packages/ui/src/containers/WebProjectMain.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const Background = styled.div`
1717
height: 100vh;
1818
width: 100vw;
1919
20-
background: url('./images/backgrounds/temp.jpg');
20+
background: url('images/backgrounds/temp.jpg');
2121
background-repeat: no-repeat;
2222
background-size: cover;
2323
`;

packages/ui/src/containers/WebWelcome.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const Background = styled.div`
2020
height: 100vh;
2121
width: 100vw;
2222
23-
background: url('./images/backgrounds/temp.jpg');
23+
background: url('images/backgrounds/temp.jpg');
2424
background-repeat: no-repeat;
2525
background-size: cover;
2626
`;

packages/ui/src/features/portal/components/CreateTrial.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const CreateTrial: React.FC<React.PropsWithChildren<CreateTrialProps>> = ({ onCh
4444
<ArrowButton onClick={() => onChangeToDefault()}>
4545
{'Go back'}
4646
</ArrowButton>
47-
<Logo src={'./images/logo-tile.png'} />
47+
<Logo src={'images/logo-tile.png'} />
4848
<Title>{'Start your free Beak trial'}</Title>
4949
<SubTitle>
5050
{'No credit card, no fuss, no limits... Just 14 days of the full Beak experience.'}

0 commit comments

Comments
 (0)