@devtron-labs/devtron-fe-common-lib 1.3.8-beta-1 → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/{@code-editor-BTdeB8Tp.js → @code-editor--JGVkfVq.js} +5661 -5505
  2. package/dist/{@common-rjsf-Cc6HRMyo.js → @common-rjsf-BJZae-C6.js} +1 -1
  3. package/dist/Common/Common.service.d.ts +2 -1
  4. package/dist/Common/Constants.d.ts +1 -1
  5. package/dist/Common/Types.d.ts +49 -40
  6. package/dist/Pages/Applications/DevtronApps/Details/CDPipeline/types.d.ts +1 -2
  7. package/dist/Shared/Components/FeatureDescription/FeatureDescriptionModal.d.ts +1 -1
  8. package/dist/Shared/Components/FeatureDescription/FeatureTitleWithInfo.d.ts +1 -1
  9. package/dist/Shared/Components/FeatureDescription/types.d.ts +34 -6
  10. package/dist/Shared/Components/ImageCardAccordion/ImageCardAccordion.d.ts +1 -1
  11. package/dist/Shared/Components/ImageCardAccordion/types.d.ts +3 -2
  12. package/dist/Shared/Components/Security/SecurityModal/config/CodeScan.d.ts +2 -2
  13. package/dist/Shared/Components/Security/SecurityModal/config/EmptyState.d.ts +2 -2
  14. package/dist/Shared/Components/Security/SecurityModal/config/ImageScan.d.ts +2 -2
  15. package/dist/Shared/Components/Security/SecurityModal/config/InfoCard.d.ts +2 -2
  16. package/dist/Shared/Components/Security/SecurityModal/config/KubernetesManifest.d.ts +2 -2
  17. package/dist/Shared/Components/Security/SecurityModal/config/Sidebar.d.ts +2 -2
  18. package/dist/Shared/Components/Security/SecurityModal/config/Table.d.ts +2 -2
  19. package/dist/Shared/Components/Security/SecurityModal/config/index.d.ts +1 -1
  20. package/dist/Shared/Components/Security/SecurityModal/constants.d.ts +5 -5
  21. package/dist/Shared/Components/Security/SecurityModal/index.d.ts +4 -4
  22. package/dist/Shared/Components/Security/SecurityModal/service.d.ts +2 -2
  23. package/dist/Shared/Components/Security/SecurityModal/types.d.ts +19 -12
  24. package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +4 -3
  25. package/dist/Shared/Components/Security/SecuritySummaryCard/SecuritySummaryCard.d.ts +1 -1
  26. package/dist/Shared/Components/Security/SecuritySummaryCard/types.d.ts +4 -2
  27. package/dist/Shared/Components/Security/Vulnerabilities/Vulnerabilities.d.ts +1 -1
  28. package/dist/Shared/Components/Security/Vulnerabilities/types.d.ts +17 -1
  29. package/dist/Shared/Components/Security/Vulnerabilities/utils.d.ts +5 -0
  30. package/dist/Shared/Components/Security/utils.d.ts +3 -6
  31. package/dist/Shared/Helpers.d.ts +4 -3
  32. package/dist/Shared/Providers/types.d.ts +0 -1
  33. package/dist/Shared/Services/app.types.d.ts +8 -1
  34. package/dist/Shared/constants.d.ts +7 -0
  35. package/dist/Shared/types.d.ts +19 -5
  36. package/dist/assets/{ic-arrow-square-out.1be837ac.svg → ic-arrow-square-out.3d1a0d41.svg} +1 -1
  37. package/dist/assets/ic-check-circle-dots.6229180e.svg +4 -0
  38. package/dist/assets/{ic-edit-file.a782640f.svg → ic-edit-file.aea811d8.svg} +3 -3
  39. package/dist/index.d.ts +2 -0
  40. package/dist/index.js +673 -662
  41. package/package.json +2 -2
  42. package/dist/assets/ic-stamp.526499d2.svg +0 -7
@@ -3,7 +3,7 @@ import { Pair } from 'yaml';
3
3
  import { StrictRJSFSchema } from '@rjsf/utils';
4
4
  import { MaterialHistoryType } from '@Shared/Services/app.types';
5
5
  import { PromptProps } from 'react-router-dom';
6
- import { MaterialInfo, SortingOrder, UserApprovalConfigType } from '../Common';
6
+ import { MaterialInfo, SortingOrder, UserApprovalConfigType, ApprovalConfigDataType, UserApprovalInfo } from '../Common';
7
7
  import { GitTriggers, IntersectionChangeHandler, IntersectionOptions, PreventOutsideFocusProps, WebhookEventNameType } from './types';
8
8
  import { AggregatedNodes, DeploymentStatusDetailsBreakdownDataType, DeploymentStatusDetailsType, PodMetadatum } from './Components';
9
9
  interface HighlightSearchTextProps {
@@ -42,12 +42,13 @@ export declare const decode: (data: any, isEncoded?: boolean) => {};
42
42
  export declare const isTimeStringAvailable: (time: string) => boolean;
43
43
  export declare const getTimeDifference: (startTime: string, endTime: string) => string;
44
44
  export declare const getFileNameFromHeaders: (headers: Headers) => string;
45
- export declare const sanitizeUserApprovalConfig: (userApprovalConfig: UserApprovalConfigType) => UserApprovalConfigType;
45
+ export declare const sanitizeUserApprovalList: (approverList: UserApprovalInfo["approverList"]) => UserApprovalInfo["approverList"];
46
+ export declare const sanitizeApprovalConfigData: (approvalConfigData: ApprovalConfigDataType | null) => ApprovalConfigDataType;
46
47
  /**
47
48
  * Manual approval is considered configured only if the type is not notConfigured
48
49
  */
49
50
  export declare const getIsManualApprovalConfigured: (userApprovalConfig?: Pick<UserApprovalConfigType, "type">) => boolean;
50
- export declare const getIsManualApprovalSpecific: (userApprovalConfig?: Pick<UserApprovalConfigType, "type">) => boolean;
51
+ export declare const getIsApprovalPolicyConfigured: (approvalConfigData: ApprovalConfigDataType) => boolean;
51
52
  /**
52
53
  * @description - Function to open a new tab with the given url
53
54
  * @param url - url to be opened in new tab
@@ -22,7 +22,6 @@ export interface MainContext {
22
22
  };
23
23
  isAirgapped: boolean;
24
24
  isSuperAdmin: boolean;
25
- isManifestScanningEnabled: boolean;
26
25
  }
27
26
  export interface MainContextProviderProps {
28
27
  children: ReactNode;
@@ -1,5 +1,5 @@
1
1
  import { OverrideMergeStrategyType } from '../../Pages/Applications';
2
- import { ReleaseTag } from '../../Common';
2
+ import { ReleaseTag, UserApprovalMetadataType } from '../../Common';
3
3
  interface WebhookDataType {
4
4
  id: number;
5
5
  eventActionType: string;
@@ -133,6 +133,13 @@ export interface DraftMetadataDTO {
133
133
  commentsCount: number;
134
134
  dataEncrypted: boolean;
135
135
  isAppAdmin: boolean;
136
+ userApprovalMetadata: UserApprovalMetadataType;
137
+ /**
138
+ * User id of the user who has requested the data
139
+ *
140
+ * This would be the id of the user whose token is sent in the cookie
141
+ */
142
+ requestedUserId: number;
136
143
  }
137
144
  export declare enum CMSecretExternalType {
138
145
  Internal = "",
@@ -417,6 +417,13 @@ export declare const ALL_RESOURCE_KIND_FILTER = "all";
417
417
  export declare const OPEN_NEW_TICKET = "https://enterprise.devtron.ai/portal/en/newticket";
418
418
  export declare const VIEW_ALL_TICKETS = "https://enterprise.devtron.ai/portal/en/myarea";
419
419
  export declare const RAISE_ISSUE = "https://github.com/devtron-labs/devtron/issues/new/choose";
420
+ export declare const TARGET_IDS: {
421
+ WORKFLOW_EDITOR_CONTAINER: string;
422
+ };
423
+ /**
424
+ * Env ID to get the data for base configuration
425
+ */
426
+ export declare const BASE_CONFIGURATION_ENV_ID = -1;
420
427
  export declare const DEVTRON_BASE_MAIN_ID = "devtron-base-main-identifier";
421
428
  export declare const SKIP_LABEL_KEY_VALIDATION_PREFIX = "devtron.ai/";
422
429
  export declare const UNSAVED_CHANGES_PROMPT_MESSAGE = "You have unsaved changes. Are you sure you want to leave?";
@@ -1,6 +1,7 @@
1
1
  import { Dayjs } from 'dayjs';
2
- import { OptionType, CommonNodeAttr, UserApprovalConfigType, VulnerabilityType, DeploymentAppTypes, ServerErrors, SortingParams, TriggerBlockType, ValueConstraintType, VariableType, RefVariableType, PluginType } from '../Common';
3
- import { EnvironmentTypeEnum, PatchOperationType } from './constants';
2
+ import { ApprovalConfigDataType } from '../Common/Types';
3
+ import { OptionType, CommonNodeAttr, ResponseType, VulnerabilityType, DeploymentAppTypes, ServerErrors, SortingParams, TriggerBlockType, ValueConstraintType, VariableType, RefVariableType, PluginType } from '../Common';
4
+ import { BASE_CONFIGURATION_ENV_ID, EnvironmentTypeEnum, PatchOperationType } from './constants';
4
5
  export declare enum EnvType {
5
6
  CHART = "helm_charts",
6
7
  APPLICATION = "apps"
@@ -185,7 +186,7 @@ export interface AppDetails {
185
186
  clusterName?: string;
186
187
  dockerRegistryId?: string;
187
188
  deploymentAppDeleteRequest?: boolean;
188
- userApprovalConfig?: string;
189
+ isApprovalPolicyApplicable?: boolean;
189
190
  isVirtualEnvironment?: boolean;
190
191
  imageTag?: string;
191
192
  helmPackageName?: string;
@@ -245,7 +246,7 @@ export interface WorkflowType {
245
246
  showTippy?: boolean;
246
247
  appId?: number;
247
248
  isSelected?: boolean;
248
- approvalConfiguredIdsMap?: Record<number, UserApprovalConfigType>;
249
+ approvalConfiguredIdsMap?: Record<number, ApprovalConfigDataType>;
249
250
  imageReleaseTags: string[];
250
251
  appReleaseTags?: string[];
251
252
  tagsEditable?: boolean;
@@ -418,7 +419,8 @@ export interface SeverityCount {
418
419
  export declare enum PolicyKindType {
419
420
  lockConfiguration = "lock-configuration",
420
421
  imagePromotion = "image-promotion",
421
- plugins = "plugin"
422
+ plugins = "plugin",
423
+ approval = "approval"
422
424
  }
423
425
  export interface LastExecutionResultType {
424
426
  lastExecution: string;
@@ -438,6 +440,8 @@ export interface LastExecutionResultType {
438
440
  scanToolId?: number;
439
441
  imageScanDeployInfoId?: number;
440
442
  }
443
+ export interface LastExecutionResponseType extends ResponseType<LastExecutionResultType> {
444
+ }
441
445
  export interface MaterialSecurityInfoType {
442
446
  isScanned: boolean;
443
447
  isScanEnabled: boolean;
@@ -746,6 +750,16 @@ export interface DynamicTabType extends CommonTabArgsType {
746
750
  */
747
751
  lastActiveTabId: string | null;
748
752
  }
753
+ export interface ResourceApprovalPolicyConfigDTO {
754
+ appId: number;
755
+ envId: number;
756
+ approvalConfigurations: ApprovalConfigDataType[];
757
+ }
758
+ export interface ResourceApprovalPolicyConfigType extends Omit<ResourceApprovalPolicyConfigDTO, 'state' | 'approvalConfigurations'> {
759
+ isApprovalApplicable: boolean;
760
+ approvalConfigurationMap: Record<ApprovalConfigDataType['kind'], ApprovalConfigDataType>;
761
+ }
762
+ export type ResourceIdToResourceApprovalPolicyConfigMapType = Record<ResourceApprovalPolicyConfigType['envId'] | typeof BASE_CONFIGURATION_ENV_ID, Pick<ResourceApprovalPolicyConfigType, 'isApprovalApplicable' | 'approvalConfigurationMap'>>;
749
763
  export interface PreventOutsideFocusProps {
750
764
  identifier: string;
751
765
  preventFocus: boolean;
@@ -15,5 +15,5 @@
15
15
  -->
16
16
 
17
17
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
18
- <path d="M13.5 6.25L13.4995 2.5005L9.75 2.5M8.99821 7.00179L13.4982 2.50179M11.5 9V13C11.5 13.1326 11.4473 13.2598 11.3536 13.3536C11.2598 13.4473 11.1326 13.5 11 13.5H3C2.86739 13.5 2.74021 13.4473 2.64645 13.3536C2.55268 13.2598 2.5 13.1326 2.5 13V5C2.5 4.86739 2.55268 4.74021 2.64645 4.64645C2.74021 4.55268 2.86739 4.5 3 4.5H7" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
18
+ <path d="M13.5 6.25L13.4995 2.5005L9.75 2.5M8.99821 7.00179L13.4982 2.50179M11.5 9V13C11.5 13.1326 11.4473 13.2598 11.3536 13.3536C11.2598 13.4473 11.1326 13.5 11 13.5H3C2.86739 13.5 2.74021 13.4473 2.64645 13.3536C2.55268 13.2598 2.5 13.1326 2.5 13V5C2.5 4.86739 2.55268 4.74021 2.64645 4.64645C2.74021 4.55268 2.86739 4.5 3 4.5H7" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
19
19
  </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
2
+ <circle cx="7.99998" cy="7.99967" r="6.66667" stroke="#664BEE" stroke-width="1.5" stroke-linecap="round" stroke-dasharray="2 4"/>
3
+ <path d="M10.6667 6L7.11115 9.5554L5.33337 7.77778" stroke="#664BEE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
+ </svg>
@@ -15,6 +15,6 @@
15
15
  -->
16
16
 
17
17
  <svg width="20.5" height="20" viewBox="0 0 20.5 24" fill="none" xmlns="http://www.w3.org/2000/svg">
18
- <path d="M12.7507 3H3.75C3.55109 3 3.36032 3.07902 3.21967 3.21967C3.07902 3.36032 3 3.55109 3 3.75V20.25C3 20.4489 3.07902 20.6397 3.21967 20.7803C3.36032 20.921 3.55109 21 3.75 21H8.50037M12.7507 3L18.0007 8.25M12.7507 3V8.25H18.0007M18.0007 8.25V11.25" stroke="#3B444C" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
19
- <path d="M15.7818 15.4289L18.5711 18.2182M13.7894 23H11.3985C11.2928 23 11.1914 22.958 11.1167 22.8833C11.042 22.8086 11 22.7072 11 22.6015V20.3757C11 20.3234 11.0103 20.2715 11.0303 20.2232C11.0504 20.1749 11.0797 20.1309 11.1167 20.0939L17.0939 14.1167C17.1687 14.042 17.27 14 17.3757 14C17.4814 14 17.5827 14.042 17.6575 14.1167L19.8833 16.3425C19.958 16.4173 20 16.5186 20 16.6243C20 16.73 19.958 16.8313 19.8833 16.9061L13.7894 23Z" stroke="#3B444C" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
20
- </svg>
18
+ <path d="M12.7507 3H3.75C3.55109 3 3.36032 3.07902 3.21967 3.21967C3.07902 3.36032 3 3.55109 3 3.75V20.25C3 20.4489 3.07902 20.6397 3.21967 20.7803C3.36032 20.921 3.55109 21 3.75 21H8.50037M12.7507 3L18.0007 8.25M12.7507 3V8.25H18.0007M18.0007 8.25V11.25" stroke="#3B444C" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke" />
19
+ <path d="M15.7818 15.4289L18.5711 18.2182M13.7894 23H11.3985C11.2928 23 11.1914 22.958 11.1167 22.8833C11.042 22.8086 11 22.7072 11 22.6015V20.3757C11 20.3234 11.0103 20.2715 11.0303 20.2232C11.0504 20.1749 11.0797 20.1309 11.1167 20.0939L17.0939 14.1167C17.1687 14.042 17.27 14 17.3757 14C17.4814 14 17.5827 14.042 17.6575 14.1167L19.8833 16.3425C19.958 16.4173 20 16.5186 20 16.6243C20 16.73 19.958 16.8313 19.8833 16.9061L13.7894 23Z" stroke="#3B444C" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke" />
20
+ </svg>
package/dist/index.d.ts CHANGED
@@ -56,7 +56,9 @@ export interface customEnv {
56
56
  API_BATCH_SIZE: number;
57
57
  SERVICE_WORKER_TIMEOUT?: string;
58
58
  HIDE_RELEASES?: boolean;
59
+ ENABLE_RESOURCE_SCAN?: boolean;
59
60
  FEATURE_USER_DEFINED_GITOPS_REPO_ENABLE: boolean;
61
+ ENABLE_RESOURCE_SCAN_V2?: boolean;
60
62
  HIDE_RESOURCE_WATCHER?: boolean;
61
63
  ORGANIZATION_NAME: string;
62
64
  FEATURE_EXTERNAL_FLUX_CD_ENABLE: boolean;