Skip to content

Commit 751127b

Browse files
fix: Apsara v1 migration fixes and minor UI refinements (#1034)
* fix (Button & InputField): Non editable text and button wrong variant * fix: z-index and other button fixes * refactor (Link): migrate a to Link * fix (plans): upgrade/downgrade button styling * fix (profile): email incorrectly displayed in profile section * fix: plan info button variant incorrect * refactor: button loading state with inbuilt prop * fix: dialog spacing * fix: skeleton and dialog * fix: team page * fix: project page * fix: security page * fix: tokens page * fix: ui shift on upload image hover * fix: plans page fixes * fix: dialog padding spacing * feat: add disabled state for add member button * fix: typo * fix: disable button when no permission in teams * chore: remove brackets from text * chore: remove separator * chore: typo fix * fix: invite css fixes * fix: add border radius to sidebar * style: css changes * style: fix image crop overflowing when big image * chore: spelling * fix: api contract * style: match switch to button style * fix (EmptyState): copy change suggestions (#1043) * fix: copy change suggestions * fix: service accounts table overflow issue * fix: select not working inside form (#1044) * Update sdks/js/packages/core/react/components/organization/domain/verify-domain.tsx * Update sdks/js/packages/core/react/components/organization/domain/delete.tsx * Update sdks/js/packages/core/react/components/organization/domain/add-domain.tsx * Update sdks/js/packages/core/react/components/organization/domain/domain.columns.tsx * Update sdks/js/packages/core/react/components/organization/domain/add-domain.tsx * refactor (Amount): Migrate Amount component to v1 in Frontier (#1030) * chore: deprecate amount component * Update sdks/js/packages/core/react/components/helpers/Amount/index.tsx * refactor: migrate Amount component * Update sdks/js/packages/core/react/components/organization/plans/pricing-column.tsx * fix: remove old path --------- Co-authored-by: Rohan Chakraborty <[email protected]>
1 parent d862899 commit 751127b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+835
-519
lines changed

sdks/js/packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"devDependencies": {
6262
"@jest/globals": "^29.7.0",
6363
"@radix-ui/react-icons": "^1.3.2",
64-
"@raystack/apsara": "0.46.0-rc.5",
64+
"@raystack/apsara": "0.47.0",
6565
"@raystack/eslint-config": "workspace:^",
6666
"@raystack/frontier-tsconfig": "workspace:^",
6767
"@size-limit/preset-small-lib": "^8.2.6",

sdks/js/packages/core/react/components/avatar-upload/avatar-upload.module.css

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
display: flex;
1111
width: 80px;
1212
height: 80px;
13+
box-sizing: border-box;
1314
gap: var(--rs-space-5);
1415
justify-content: center;
1516
align-items: center;
@@ -29,18 +30,15 @@
2930
}
3031

3132
.overlay {
32-
z-index: 55;
3333
background-color: rgba(104, 112, 118, 0.5);
3434
}
3535

3636
.cropModal {
3737
padding: 0;
38-
max-width: 400px;
39-
max-height: 400px;
38+
max-width: 600px;
39+
max-height: fit-content;
4040
width: 100%;
4141
height: 100%;
42-
z-index: 60;
43-
4442
display: flex;
4543
flex-direction: column;
4644
justify-content: space-between;

sdks/js/packages/core/react/components/avatar-upload/index.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import styles from './avatar-upload.module.css';
1414
interface CropModalProps {
1515
imgSrc?: string;
1616
onClose: () => void;
17+
// eslint-disable-next-line no-unused-vars
1718
onSave: (data: string) => void;
1819
}
1920

@@ -88,10 +89,7 @@ function CropModal({ onClose, imgSrc, onSave }: CropModalProps) {
8889
<Dialog open={true}>
8990
<Dialog.Content overlayClassName={styles.overlay} className={styles.cropModal}>
9091
<Dialog.Header>
91-
<Flex justify="between" style={{
92-
padding: 'var(--rs-space-5) var(--rs-space-7)',
93-
borderBottom: '1px solid var(--rs-color-border-base-primary)'
94-
}}>
92+
<Flex justify="between" align="center" style={{ width: '100%' }}>
9593
<Text size="large" weight="medium">
9694
Crop your photo
9795
</Text>
@@ -108,7 +106,7 @@ function CropModal({ onClose, imgSrc, onSave }: CropModalProps) {
108106
<Dialog.Body>
109107
<Flex
110108
direction="column"
111-
style={{ padding: 'var(--rs-space-5) var(--rs-space-9)', maxHeight: '280px', height: '100%' }}
109+
style={{ maxHeight: '280px', height: '100%' }}
112110
justify={'center'}
113111
align={'center'}
114112
>
@@ -135,11 +133,7 @@ function CropModal({ onClose, imgSrc, onSave }: CropModalProps) {
135133
<Dialog.Footer>
136134
<Flex
137135
justify="end"
138-
style={{
139-
padding: 'var(--rs-space-5)',
140-
borderTop: '1px solid var(--rs-color-border-base-primary)'
141-
}}
142-
gap="medium"
136+
gap={5}
143137
>
144138
<Button
145139
variant="outline"

sdks/js/packages/core/react/components/helpers/Amount/index.tsx

Lines changed: 0 additions & 57 deletions
This file was deleted.

sdks/js/packages/core/react/components/organization/api-keys/add.tsx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
Flex,
44
Text,
55
toast,
6-
Separator,
76
Image,
87
Skeleton,
98
Dialog,
@@ -21,6 +20,7 @@ import { V1Beta1CreatePolicyForProjectBody, V1Beta1Project } from '~/src';
2120
import { PERMISSIONS } from '~/utils';
2221
import cross from '~/react/assets/cross.svg';
2322
import styles from './styles.module.css';
23+
import { handleSelectValueChange } from '~/react/utils';
2424

2525
const DEFAULT_KEY_NAME = 'Initial Generated Key';
2626

@@ -137,7 +137,7 @@ export const AddServiceAccount = () => {
137137
>
138138
<form onSubmit={handleSubmit(onSubmit)}>
139139
<Dialog.Header>
140-
<Flex justify="between" className={styles.addDialogForm}>
140+
<Flex justify="between" align="center" style={{ width: '100%' }}>
141141
<Text size={6} weight={500}>
142142
New Service Account
143143
</Text>
@@ -149,15 +149,10 @@ export const AddServiceAccount = () => {
149149
data-test-id="frontier-sdk-new-service-account-close-btn"
150150
/>
151151
</Flex>
152-
<Separator />
153152
</Dialog.Header>
154153

155154
<Dialog.Body>
156-
<Flex
157-
direction="column"
158-
gap={5}
159-
className={styles.addDialogFormContent}
160-
>
155+
<Flex direction="column" gap={5}>
161156
<Text>
162157
Create a dedicated service account to facilitate secure API
163158
interactions on behalf of the organization.
@@ -182,13 +177,14 @@ export const AddServiceAccount = () => {
182177
render={({ field }) => {
183178
const { ref, onChange, ...rest } = field;
184179
return (
185-
<Select {...rest} onValueChange={onChange}>
180+
<Select
181+
{...rest}
182+
onValueChange={handleSelectValueChange(onChange)}
183+
>
186184
<Select.Trigger ref={ref}>
187185
<Select.Value placeholder="Select a project" />
188186
</Select.Trigger>
189-
<Select.Content
190-
style={{ width: '100% !important', zIndex: 65 }}
191-
>
187+
<Select.Content style={{ width: '100% !important' }}>
192188
<Select.Viewport style={{ maxHeight: '300px' }}>
193189
{projects.map(project => (
194190
<Select.Item
@@ -215,7 +211,7 @@ export const AddServiceAccount = () => {
215211
</Dialog.Body>
216212

217213
<Dialog.Footer>
218-
<Flex justify="end" className={styles.addDialogFormBtnWrapper}>
214+
<Flex justify="end">
219215
<Button
220216
variant="solid"
221217
color="accent"

sdks/js/packages/core/react/components/organization/api-keys/delete.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
Flex,
55
Text,
66
toast,
7-
Separator,
87
Image,
98
Dialog
109
} from '@raystack/apsara/v1';
@@ -52,7 +51,7 @@ export const DeleteServiceAccount = () => {
5251
className={styles.addDialogContent}
5352
>
5453
<Dialog.Header>
55-
<Flex justify="between" className={styles.addDialogForm}>
54+
<Flex justify="between" align="center" style={{ width: '100%' }}>
5655
<Text size="large" weight="medium">
5756
Delete Service Account
5857
</Text>
@@ -65,28 +64,24 @@ export const DeleteServiceAccount = () => {
6564
data-test-id="frontier-sdk-delete-service-account-close-btn"
6665
/>
6766
</Flex>
68-
<Separator />
6967
</Dialog.Header>
7068

7169
<Dialog.Body>
7270
<Flex
7371
direction="column"
7472
gap={5}
75-
className={styles.addDialogFormContent}
7673
>
7774
<Text>
7875
This is an irreversible and permanent action doing this might
7976
result in deletion of the service account and the keys associated
8077
with it. Do you wish to proceed?
8178
</Text>
8279
</Flex>
83-
<Separator />
8480
</Dialog.Body>
8581

8682
<Dialog.Footer>
8783
<Flex
8884
justify="end"
89-
className={styles.addDialogFormBtnWrapper}
9085
gap={5}
9186
>
9287
<Button

sdks/js/packages/core/react/components/organization/api-keys/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const NoServiceAccounts = ({
3535
<Flex justify="center" align="center" className={styles.stateContent}>
3636
<EmptyState
3737
icon={<Image src={keyIcon as unknown as string} alt="keyIcon" />}
38-
heading="No service account"
38+
heading="No service account found"
3939
subHeading={`Create a new account to use the APIs of ${appName} platform`}
4040
primaryAction={
4141
<Button
@@ -58,7 +58,7 @@ const NoAccess = () => {
5858
<EmptyState
5959
icon={<ExclamationTriangleIcon />}
6060
heading="Restricted Access"
61-
subHeading={`Admin access required, please reach out to your admin incase you want to generate a key.`}
61+
subHeading='Admin access required, please reach out to your admin incase you want to generate a key'
6262
/>
6363
</Flex>
6464
);

sdks/js/packages/core/react/components/organization/api-keys/service-user/delete.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
Flex,
55
Text,
66
toast,
7-
Separator,
87
Image,
98
Dialog
109
} from '@raystack/apsara/v1';
@@ -64,7 +63,7 @@ export const DeleteServiceAccountKey = () => {
6463
className={styles.addDialogContent}
6564
>
6665
<Dialog.Header>
67-
<Flex justify="between" className={styles.addDialogForm}>
66+
<Flex justify="between" align="center" style={{ width: '100%' }}>
6867
<Text size="large" weight="medium">
6968
Revoke API Key
7069
</Text>
@@ -77,28 +76,24 @@ export const DeleteServiceAccountKey = () => {
7776
data-test-id="frontier-sdk-revoke-service-account-key-close-btn"
7877
/>
7978
</Flex>
80-
<Separator />
8179
</Dialog.Header>
8280

8381
<Dialog.Body>
8482
<Flex
8583
direction="column"
8684
gap={5}
87-
className={styles.addDialogFormContent}
8885
>
8986
<Text>
9087
This is an irreversible action doing this might lead to
9188
discontinuation of access to the {appName} features. Do you wish
9289
to proceed?
9390
</Text>
9491
</Flex>
95-
<Separator />
9692
</Dialog.Body>
9793

9894
<Dialog.Footer>
9995
<Flex
10096
justify="end"
101-
className={styles.addDialogFormBtnWrapper}
10297
gap={5}
10398
>
10499
<Button

sdks/js/packages/core/react/components/organization/api-keys/service-user/projects.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
Flex,
44
Spinner,
55
Text,
6-
Separator,
76
toast,
87
Image,
98
Dialog,
@@ -210,7 +209,7 @@ export default function ManageServiceUserProjects() {
210209
className={styles.manageProjectDialogContent}
211210
>
212211
<Dialog.Header>
213-
<Flex justify="between" style={{ padding: '16px 24px' }}>
212+
<Flex justify="between" align="center" style={{ width: '100%' }}>
214213
<Text size="large" weight="medium">
215214
Manage Project Access
216215
</Text>
@@ -223,13 +222,12 @@ export default function ManageServiceUserProjects() {
223222
data-test-id="frontier-sdk-service-account-manage-access-close-btn"
224223
/>
225224
</Flex>
226-
<Separator />
227225
</Dialog.Header>
228226

229227
<Dialog.Body>
230228
<Flex
231229
className={styles.manageProjectDialogWrapper}
232-
gap="large"
230+
gap={9}
233231
direction={'column'}
234232
>
235233
<Text size="small" variant="secondary">

sdks/js/packages/core/react/components/organization/api-keys/service-user/styles.module.css

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,32 +70,13 @@
7070
padding: 0;
7171
max-width: 400px;
7272
width: 100%;
73-
z-index: 60;
7473
}
7574

7675
.overlay {
77-
z-index: 55;
7876
background-color: rgba(104, 112, 118, 0.5);
7977
}
8078

81-
.addDialogForm {
82-
padding: var(--rs-space-5) var(--rs-space-7);
83-
}
84-
85-
.addDialogFormContent {
86-
padding: var(--rs-space-9) var(--rs-space-7);
87-
}
88-
89-
.addDialogFormBtnWrapper {
90-
padding: var(--rs-space-5);
91-
}
92-
93-
.manageProjectDialog {
94-
padding: var(--rs-space-5) var(--rs-space-7);
95-
}
96-
9779
.manageProjectDialogWrapper {
98-
padding: var(--rs-space-5) var(--rs-space-7);
9980
height: calc(100% - var(--rs-space-9) - var(--rs-space-9));
10081
overflow: hidden;
10182
}

0 commit comments

Comments
 (0)