Skip to content

Commit b97283d

Browse files
authored
Merge pull request #447 from devtron-labs/fix/approval-policy
fix: migrate to use isApprovalPolicyApplicable
2 parents 18b9705 + 0c269e0 commit b97283d

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
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": "1.2.7",
3+
"version": "1.2.6-beta-1",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/Helper.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ import { getIsRequestAborted } from './Api'
5454
export function showError(serverError, showToastOnUnknownError = true, hideAccessError = false) {
5555
if (serverError instanceof ServerErrors && Array.isArray(serverError.errors)) {
5656
serverError.errors.map(({ userMessage, internalMessage }) => {
57+
const userMessageInLowercase = userMessage?.toLowerCase()
58+
5759
if (
5860
serverError.code === 403 &&
59-
(userMessage === ERROR_EMPTY_SCREEN.UNAUTHORIZED || userMessage === ERROR_EMPTY_SCREEN.FORBIDDEN)
61+
(userMessageInLowercase === ERROR_EMPTY_SCREEN.UNAUTHORIZED.toLowerCase() ||
62+
userMessageInLowercase === ERROR_EMPTY_SCREEN.FORBIDDEN.toLowerCase())
6063
) {
6164
if (!hideAccessError) {
6265
ToastManager.showToast({

src/Shared/Services/app.types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ export interface DraftMetadataDTO {
182182
dataEncrypted: boolean
183183
isAppAdmin: boolean
184184
userApprovalMetadata: UserApprovalMetadataType
185+
/**
186+
* User id of the user who has requested the data
187+
*
188+
* This would be the id of the user whose token is sent in the cookie
189+
*/
190+
requestedUserId: number
185191
}
186192

187193
export enum CMSecretExternalType {

src/Shared/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export interface AppDetails {
227227
clusterName?: string
228228
dockerRegistryId?: string
229229
deploymentAppDeleteRequest?: boolean
230-
approvalConfigData?: ApprovalConfigDataType
230+
isApprovalPolicyApplicable?: boolean
231231
isVirtualEnvironment?: boolean
232232
imageTag?: string
233233
helmPackageName?: string

0 commit comments

Comments
 (0)