Skip to content

Commit bba9411

Browse files
committed
fix: remove the api token prefix from option
1 parent ab51d99 commit bba9411

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.2.6-beta-3",
3+
"version": "0.2.6-beta-4",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Pages/GlobalConfigurations/Authorization/service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { get } from '@Common/index'
22
import { SelectPickerCustomOptionType } from '@Shared/Components'
3+
import { API_TOKEN_PREFIX } from '@Shared/constants'
34
import { stringComparatorBySortOrder } from '@Shared/Helpers'
45
import { DefaultUserKey } from '@Shared/types'
56
import { GroupBase } from 'react-select'
@@ -26,7 +27,8 @@ export const getUserAndApiTokenOptions = async (): Promise<GroupBase<SelectPicke
2627
options: (apiTokenResponse ?? [])
2728
.sort((a, b) => stringComparatorBySortOrder(a.userIdentifier, b.userIdentifier))
2829
.map(({ userIdentifier }) => ({
29-
label: userIdentifier,
30+
// Remove the API Token Prefix
31+
label: userIdentifier.startsWith(API_TOKEN_PREFIX) ? userIdentifier.split(':')[1] : userIdentifier,
3032
value: userIdentifier,
3133
})),
3234
},

0 commit comments

Comments
 (0)