Skip to content

Commit 8f9b859

Browse files
emir-karabegcursoragentwaleedlatif1
authored
improvement(credentials): ui (#3322)
* improvement(credentials): ui * fix: credentials logic * improvement(credentials): ui * improvement(credentials): members UI * improvement(secrets): ui * fix(credentials): show error when OAuth deletion fails due to missing fields - Add deleteError state to track and display deletion errors - Keep confirmation dialog open when deletion fails - Show user-friendly error message when accountId or providerId is missing - Add loading state to delete button during deletion - Display error message in confirmation dialog with proper styling Co-authored-by: Emir Karabeg <emir-karabeg@users.noreply.github.com> * ran lint * removed worktree file --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Emir Karabeg <emir-karabeg@users.noreply.github.com> Co-authored-by: Waleed Latif <walif6@gmail.com>
1 parent 60f9eb2 commit 8f9b859

File tree

6 files changed

+862
-647
lines changed

6 files changed

+862
-647
lines changed

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/api-keys/api-keys.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export function ApiKeys({ onOpenChange }: ApiKeysProps) {
142142
strokeWidth={2}
143143
/>
144144
<Input
145-
placeholder='Search API keys...'
145+
placeholder='Search Sim keys...'
146146
value={searchTerm}
147147
onChange={(e) => setSearchTerm(e.target.value)}
148148
className='h-auto flex-1 border-0 bg-transparent p-0 font-base leading-none placeholder:text-[var(--text-tertiary)] focus-visible:ring-0 focus-visible:ring-offset-0'
@@ -195,7 +195,7 @@ export function ApiKeys({ onOpenChange }: ApiKeysProps) {
195195
</div>
196196
{workspaceKeys.length === 0 ? (
197197
<div className='text-[13px] text-[var(--text-muted)]'>
198-
No workspace API keys yet
198+
No workspace Sim keys yet
199199
</div>
200200
) : (
201201
workspaceKeys.map((key) => (
@@ -301,7 +301,7 @@ export function ApiKeys({ onOpenChange }: ApiKeysProps) {
301301
</div>
302302
{isConflict && (
303303
<div className='text-[12px] text-[var(--text-error)] leading-tight'>
304-
Workspace API key with the same name overrides this. Rename your
304+
Workspace Sim key with the same name overrides this. Rename your
305305
personal key to use it.
306306
</div>
307307
)}
@@ -317,7 +317,7 @@ export function ApiKeys({ onOpenChange }: ApiKeysProps) {
317317
filteredWorkspaceKeys.length === 0 &&
318318
(personalKeys.length > 0 || workspaceKeys.length > 0) && (
319319
<div className='py-[16px] text-center text-[13px] text-[var(--text-muted)]'>
320-
No API keys found matching "{searchTerm}"
320+
No Sim keys found matching "{searchTerm}"
321321
</div>
322322
)}
323323
</>
@@ -331,7 +331,7 @@ export function ApiKeys({ onOpenChange }: ApiKeysProps) {
331331
<div className='mt-auto flex items-center justify-between'>
332332
<div className='flex items-center gap-[8px]'>
333333
<span className='font-medium text-[13px] text-[var(--text-secondary)]'>
334-
Allow personal API keys
334+
Allow personal Sim keys
335335
</span>
336336
<Tooltip.Root>
337337
<Tooltip.Trigger asChild>
@@ -383,7 +383,7 @@ export function ApiKeys({ onOpenChange }: ApiKeysProps) {
383383
{/* Delete Confirmation Dialog */}
384384
<Modal open={showDeleteDialog} onOpenChange={setShowDeleteDialog}>
385385
<ModalContent size='sm'>
386-
<ModalHeader>Delete API key</ModalHeader>
386+
<ModalHeader>Delete Sim key</ModalHeader>
387387
<ModalBody>
388388
<p className='text-[12px] text-[var(--text-secondary)]'>
389389
Deleting{' '}

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/api-keys/components/create-api-key-modal/create-api-key-modal.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ export function CreateApiKeyModal({
6262
if (isDuplicate) {
6363
setCreateError(
6464
keyType === 'workspace'
65-
? `A workspace API key named "${trimmedName}" already exists. Please choose a different name.`
66-
: `A personal API key named "${trimmedName}" already exists. Please choose a different name.`
65+
? `A workspace Sim key named "${trimmedName}" already exists. Please choose a different name.`
66+
: `A personal Sim key named "${trimmedName}" already exists. Please choose a different name.`
6767
)
6868
return
6969
}
@@ -86,11 +86,11 @@ export function CreateApiKeyModal({
8686
} catch (error: unknown) {
8787
logger.error('API key creation failed:', { error })
8888
const errorMessage =
89-
error instanceof Error ? error.message : 'Failed to create API key. Please try again.'
89+
error instanceof Error ? error.message : 'Failed to create Sim key. Please try again.'
9090
if (errorMessage.toLowerCase().includes('already exists')) {
9191
setCreateError(errorMessage)
9292
} else {
93-
setCreateError('Failed to create API key. Please check your connection and try again.')
93+
setCreateError('Failed to create Sim key. Please check your connection and try again.')
9494
}
9595
}
9696
}
@@ -113,7 +113,7 @@ export function CreateApiKeyModal({
113113
{/* Create API Key Dialog */}
114114
<Modal open={open} onOpenChange={onOpenChange}>
115115
<ModalContent size='sm'>
116-
<ModalHeader>Create new API key</ModalHeader>
116+
<ModalHeader>Create new Sim key</ModalHeader>
117117
<ModalBody>
118118
<p className='text-[12px] text-[var(--text-secondary)]'>
119119
{keyType === 'workspace'
@@ -125,7 +125,7 @@ export function CreateApiKeyModal({
125125
{canManageWorkspaceKeys && (
126126
<div className='flex flex-col gap-[8px]'>
127127
<p className='font-medium text-[13px] text-[var(--text-secondary)]'>
128-
API Key Type
128+
Sim Key Type
129129
</p>
130130
<ButtonGroup
131131
value={keyType}
@@ -143,7 +143,7 @@ export function CreateApiKeyModal({
143143
)}
144144
<div className='flex flex-col gap-[8px]'>
145145
<p className='font-medium text-[13px] text-[var(--text-secondary)]'>
146-
Enter a name for your API key to help you identify it later.
146+
Enter a name for your Sim key to help you identify it later.
147147
</p>
148148
{/* Hidden decoy fields to prevent browser autofill */}
149149
<input
@@ -216,10 +216,10 @@ export function CreateApiKeyModal({
216216
}}
217217
>
218218
<ModalContent size='sm'>
219-
<ModalHeader>Your API key has been created</ModalHeader>
219+
<ModalHeader>Your Sim key has been created</ModalHeader>
220220
<ModalBody>
221221
<p className='text-[12px] text-[var(--text-secondary)]'>
222-
This is the only time you will see your API key.{' '}
222+
This is the only time you will see your Sim key.{' '}
223223
<span className='font-semibold text-[var(--text-primary)]'>
224224
Copy it now and store it securely.
225225
</span>

0 commit comments

Comments
 (0)