Skip to content
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
f828ca1
Merge branch 'chore/copyright' of github.com:devtron-labs/devtron-fe-…
eshankvaish Aug 8, 2024
565a02d
feat: add enum for image promotion
eshankvaish Aug 8, 2024
b459767
fix: add configuration menu position for select picker
eshankvaish Aug 8, 2024
0de46bc
fix: naming for descriptor typing
eshankvaish Aug 9, 2024
e522fd4
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
eshankvaish Sep 26, 2024
ed6981f
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
eshankvaish Oct 4, 2024
e0abda1
fix: update the policy kind type
eshankvaish Oct 4, 2024
12a15c0
feat: expose formatOptionLabel in select picker
eshankvaish Oct 4, 2024
513902c
feat: show the info icon based on prop in feature description modal
eshankvaish Oct 7, 2024
dc875ac
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
eshankvaish Oct 8, 2024
f833d34
fix: icon re-rendering in select picker
eshankvaish Oct 8, 2024
d90dbe5
chore: bump common
eshankvaish Oct 8, 2024
cb65b13
feat: add flag for cd mandatory plugin
AbhishekA1509 Oct 8, 2024
670b6ca
feat: expose size for getPluginStoreData
eshankvaish Oct 9, 2024
c7eef17
fix: conditionally hide label for date time picker
eshankvaish Oct 9, 2024
77d7ebc
Merge branch 'feat/plugin-policy' into feat/ci-pipeline-mandatory-plu…
AbhishekA1509 Oct 10, 2024
6d80311
feat: expose getOptionLabel in filter select picker
eshankvaish Oct 10, 2024
b98a365
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
eshankvaish Oct 10, 2024
9b5df6e
feat: add validateDateAndTime validator
eshankvaish Oct 10, 2024
c6f8689
fix: styling for toast manager and button
eshankvaish Oct 14, 2024
c0dcb90
feat: update the value for policy kind type enum
eshankvaish Oct 14, 2024
acb396f
feat: hide start icon in option in case of multi select
eshankvaish Oct 14, 2024
3132227
feat: expose parentPluginIdentifier
eshankvaish Oct 14, 2024
bbc63db
feat: update DefinitionSourceType for v2
AbhishekA1509 Oct 14, 2024
64d65f8
feat: Add ProcessPluginDataParamsType for CI and CD pipelines
AbhishekA1509 Oct 14, 2024
27df864
feat: add ci-pipeline to resource kind
eshankvaish Oct 15, 2024
36553e5
feat: add type ALL query param to getParentPluginList
eshankvaish Oct 15, 2024
a03f125
feat: add shouldShowNoOptionsMessage in select picker
eshankvaish Oct 15, 2024
62a43fb
fix: optional arg for getParentPluginList
eshankvaish Oct 15, 2024
b53af78
doc: add js docs for consequence action
eshankvaish Oct 15, 2024
085837b
feat: pre cd and post cd
eshankvaish Oct 15, 2024
2994ec0
chore: Remove isMandatory property from StepType interface
AbhishekA1509 Oct 15, 2024
c6eb6c0
feat: Add TaskActionModalType and TaskActionModalStateType interfaces
AbhishekA1509 Oct 15, 2024
4dc9d3d
fix: handling for option comparison
eshankvaish Oct 16, 2024
50117b7
chore: version bump
eshankvaish Oct 16, 2024
d2ac10c
feat: add types related to mandatory plugin consequences
AbhishekA1509 Oct 16, 2024
47c151f
chore: remove dead code
AbhishekA1509 Oct 16, 2024
d85eb0d
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
eshankvaish Oct 17, 2024
f0e0aa4
Merge branch 'feat/plugin-policy' into feat/ci-pipeline-mandatory-plu…
AbhishekA1509 Oct 17, 2024
5e37188
fix: remove duplicated enums
AbhishekA1509 Oct 17, 2024
abf00c9
fix: add tooltip on filter chip truncation
eshankvaish Oct 18, 2024
92e7cc8
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
eshankvaish Oct 18, 2024
723a29e
Merge branch 'feat/plugin-policy' into feat/ci-pipeline-mandatory-plu…
AbhishekA1509 Oct 18, 2024
6d23d75
Update package version to 0.5.2-beta-6
AbhishekA1509 Oct 18, 2024
653aea6
fix: start and end icon size
eshankvaish Oct 18, 2024
176073f
chore: rename mandatory plugin types
AbhishekA1509 Oct 20, 2024
592f0c8
refactor: Update import statements in Policy.Types.ts
AbhishekA1509 Oct 20, 2024
f748a0f
fix: remove showOnTruncate
eshankvaish Oct 21, 2024
1f06094
fix: typing for consequence type
eshankvaish Oct 21, 2024
fdfebbb
fix: typing for ci block state
eshankvaish Oct 21, 2024
d3bd35f
Merge branch 'feat/plugin-policy' into feat/ci-pipeline-mandatory-plu…
AbhishekA1509 Oct 21, 2024
2e4ccc5
Update version in package-lock.json and package.json
AbhishekA1509 Oct 21, 2024
fbbf8a2
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
eshankvaish Oct 22, 2024
869458c
Merge branch 'feat/plugin-policy' into feat/ci-pipeline-mandatory-plu…
AbhishekA1509 Oct 22, 2024
64f026b
Update version in package-lock.json and package.json
AbhishekA1509 Oct 22, 2024
ceb1f64
fix: button width issue in toast
eshankvaish Oct 22, 2024
89dc9f9
chore: add a comment for CDPipeline build stage
AbhishekA1509 Oct 23, 2024
463d2eb
fix: add prevent default on selection of plugin
eshankvaish Oct 23, 2024
840efff
fix: remove isLatest from plugin info due to volatile nature
AbhishekA1509 Oct 23, 2024
ed901b4
Merge pull request #355 from devtron-labs/feat/ci-pipeline-mandatory-…
AbhishekA1509 Oct 23, 2024
486034e
chore: update devtron-fe-common-lib version to 0.5.8-beta-4
AbhishekA1509 Oct 23, 2024
e3bb51b
chore: update devtron-fe-common-lib version to 0.5.8-beta-5
AbhishekA1509 Oct 23, 2024
5871194
fix: group env options by cluster
eshankvaish Oct 28, 2024
14f1913
Merge pull request #374 from devtron-labs/fix/plugin-policy-uat
eshankvaish Oct 28, 2024
bb122ac
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
eshankvaish Nov 4, 2024
c117dbc
fix: formatting issues
eshankvaish Nov 4, 2024
b341c9e
fix: add sorting for parent plugin list and env list
eshankvaish Nov 4, 2024
0ebde91
chore: bump version to 0.6.1-beta-10
eshankvaish Nov 4, 2024
c6333b2
Merge branch 'fix/plugin-policy-qa' into feat/plugin-policy
eshankvaish Nov 4, 2024
9d23477
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
eshankvaish Nov 4, 2024
0122713
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
eshankvaish Nov 4, 2024
0b0d348
Merge branch 'develop' of https://github.com/devtron-labs/devtron-fe-…
arunjaindev Nov 5, 2024
58f92af
Merge pull request #385 from devtron-labs/chore/sync-persist-filters
arunjaindev Nov 5, 2024
8e47a1c
Merge pull request #392 from devtron-labs/release-candidate-v0.22.0
vivek-devtron Nov 7, 2024
cf8c413
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
eshankvaish Nov 7, 2024
f4e572b
Merge branch 'main' of github.com:devtron-labs/devtron-fe-common-lib …
eshankvaish Nov 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtron-labs/devtron-fe-common-lib",
"version": "0.5.8",
"version": "0.5.8-beta-5",
"description": "Supporting common component library",
"type": "module",
"main": "dist/index.js",
Expand Down
1 change: 0 additions & 1 deletion src/Common/CIPipeline.Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ export interface StepType {
inlineStepDetail?: InlineStepDetailType
pluginRefStepDetail?: PluginRefStepDetailType
triggerIfParentStageFail: boolean
isMandatory?: boolean
}

export interface BuildStageType {
Expand Down
91 changes: 68 additions & 23 deletions src/Common/Policy.Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,35 @@
* limitations under the License.
*/

import { PluginDataStoreType } from '../Shared'
import { PipelineFormType } from '@Pages/Applications'
import { PluginDataStoreType, PluginDetailPayloadType, ResourceKindType } from '../Shared'
import { VariableType } from './CIPipeline.Types'
import { ServerErrors } from './ServerError'
import { ResponseType } from './Types'

export enum ApplyPolicyToStage {
PRE_CI = 'PRE_CI',
POST_CI = 'POST_CI',
/**
* @deprecated in mandatory plugin policy v2
*/
PRE_OR_POST_CI = 'PRE_OR_POST_CI',
PRE_CD = 'PRE_CD',
POST_CD = 'POST_CD',
}

// FIXME: The name build is getting is used in CDPipeline.
// This enum is mapping values from BuildStageVariable
export enum PluginRequiredStage {
PRE_CI = 'preBuildStage',
POST_CI = 'postBuildStage',
PRE_OR_POST_CI = 'PRE_OR_POST_CI',
PRE_STAGE = 'preBuildStage',
POST_STAGE = 'postBuildStage',
PRE_OR_POST_STAGE = 'PRE_OR_POST_CI',
}

export interface DefinitionSourceType {
projectName: string
isDueToProductionEnvironment: boolean
isDueToLinkedPipeline: boolean
policyName: string
appName?: string
clusterName?: string
environmentName?: string
branchNames?: string[]
ciPipelineName?: string
policyNames: string[]
linkedCIPipelineNames?: string[]
}

export interface MandatoryPluginDetailType {
id: number
parentPluginId: number
Expand All @@ -52,7 +53,7 @@ export interface MandatoryPluginDetailType {
applied?: boolean
inputVariables?: VariableType[]
outputVariables?: VariableType[]
definitionSources?: DefinitionSourceType[]
definitionSources?: DefinitionSourceType
}
export interface MandatoryPluginDataType {
pluginData: MandatoryPluginDetailType[]
Expand All @@ -66,23 +67,67 @@ export interface ProcessPluginDataReturnType {
mandatoryPluginsError?: ServerErrors
}

export type ProcessPluginDataCIParamsType = {
resourceKind: ResourceKindType.ciPipeline
ciPipelineId: number
/**
* Comma separated branch names used for v1 api
* For v2 format is [branchName1],[branchName2]
*/
branchName?: string

envName?: never
}

export type ProcessPluginDataCDParamsType = {
resourceKind: ResourceKindType.cdPipeline
envName?: string

ciPipelineId?: never
branchName?: never
}

export type ProcessPluginDataParamsType = {
formData: PipelineFormType
pluginDataStoreState: PluginDataStoreType
appId: number
appName: string
/**
* Would be sent in case we have to get data for steps
*/
requiredPluginIds?: PluginDetailPayloadType['pluginId']
} & (ProcessPluginDataCIParamsType | ProcessPluginDataCDParamsType)

export enum ConsequenceAction {
/**
* This is used if the policy is enforced immediately.
*/
BLOCK = 'BLOCK',
/**
* This is used if the policy will be enforced after a certain timestamp.
*/
ALLOW_UNTIL_TIME = 'ALLOW_UNTIL_TIME',
/**
* This is used if the policy is not enforced yet (just to show waring).
*/
ALLOW_FOREVER = 'ALLOW_FOREVER',
}

export interface ConsequenceType {
action: ConsequenceAction
metadataField: string
}
export type ConsequenceType =
| {
action: Exclude<ConsequenceAction, ConsequenceAction.ALLOW_UNTIL_TIME>
metadataField?: never | null
}
| {
action: ConsequenceAction.ALLOW_UNTIL_TIME
/**
* Denotes the time till which the policy enforcement is relaxed
*/
metadataField: string
}

export interface BlockedStateData {
isOffendingMandatoryPlugin: boolean
isCITriggerBlocked: boolean
ciBlockState: ConsequenceType
}

export interface GetBlockedStateResponse extends ResponseType {
result?: BlockedStateData
}
36 changes: 20 additions & 16 deletions src/Common/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@ import React, { ReactNode, CSSProperties, ReactElement } from 'react'
import { Placement } from 'tippy.js'
import { UserGroupDTO } from '@Pages/GlobalConfigurations'
import { ImageComment, ReleaseTag } from './ImageTags.Types'
import { ACTION_STATE, DEPLOYMENT_WINDOW_TYPE, DockerConfigOverrideType, SortingOrder, TaskErrorObj } from '.'
import { RegistryType, RuntimeParamsListItemType, Severity } from '../Shared'
import { MandatoryPluginBaseStateType, RegistryType, RuntimeParamsListItemType, Severity } from '../Shared'
import {
ACTION_STATE,
ConsequenceType,
DEPLOYMENT_WINDOW_TYPE,
DockerConfigOverrideType,
SortingOrder,
TaskErrorObj,
} from '.'

/**
* Generic response type object with support for overriding the result type
Expand Down Expand Up @@ -450,12 +457,12 @@ export interface ArtifactReleaseMappingType {
}

export interface CDMaterialListModalServiceUtilProps {
artifacts: any[],
offset: number,
artifactId?: number,
artifactStatus?: string,
disableDefaultSelection?: boolean,
userApprovalConfig?: UserApprovalConfigType,
artifacts: any[]
offset: number
artifactId?: number
artifactStatus?: string
disableDefaultSelection?: boolean
userApprovalConfig?: UserApprovalConfigType
}

export interface CDMaterialType {
Expand Down Expand Up @@ -552,7 +559,7 @@ export interface DownstreamNodesEnvironmentsType {
environmentName: string
}

export interface CommonNodeAttr {
export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTriggerBlocked' | 'pluginBlockState'> {
connectingCiPipelineId?: number
parents: string | number[] | string[]
x: number
Expand Down Expand Up @@ -602,15 +609,10 @@ export interface CommonNodeAttr {
approvalUsers?: string[]
userApprovalConfig?: UserApprovalConfigType
requestedUserId?: number
showPluginWarning?: boolean
showPluginWarning: boolean
helmPackageName?: string
isVirtualEnvironment?: boolean
deploymentAppType?: DeploymentAppTypes
isCITriggerBlocked?: boolean
ciBlockState?: {
action: any
metadataField: string
}
appReleaseTagNames?: string[]
tagsEditable?: boolean
isGitOpsRepoNotConfigured?: boolean
Expand Down Expand Up @@ -793,7 +795,7 @@ export interface CDStageConfigMapSecretNames {
secrets: any[]
}

export interface PrePostDeployStageType {
export interface PrePostDeployStageType extends MandatoryPluginBaseStateType {
isValid: boolean
steps: TaskErrorObj[]
triggerType: string
Expand Down Expand Up @@ -831,6 +833,8 @@ export interface CdPipeline {
preDeployStage?: PrePostDeployStageType
postDeployStage?: PrePostDeployStageType
isProdEnv?: boolean
isGitOpsRepoNotConfigured?: boolean
isDeploymentBlocked?: boolean
}

export interface ExternalCiConfig {
Expand Down
4 changes: 2 additions & 2 deletions src/Pages/GlobalConfigurations/BuildInfra/Descriptor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { DescriptorProps } from './types'
import { BuildInfraDescriptorProps } from './types'
import { BreadCrumb, DOCUMENTATION } from '../../../Common'
import { BUILD_INFRA_TEXT } from './constants'
import { InfoIconTippy } from '../../../Shared'
Expand All @@ -25,7 +25,7 @@ const Descriptor = ({
children,
tippyInfoText,
tippyAdditionalContent,
}: DescriptorProps) => (
}: BuildInfraDescriptorProps) => (
<div className={`flexbox dc__content-space dc__align-items-center w-100 ${additionalContainerClasses ?? ''}`}>
<div className="flexbox dc__align-items-center dc__gap-4">
<BreadCrumb breadcrumbs={breadCrumbs} />
Expand Down
2 changes: 1 addition & 1 deletion src/Pages/GlobalConfigurations/BuildInfra/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export enum BuildInfraProfileVariants {
CUSTOM = 'CUSTOM',
}

export interface DescriptorProps {
export interface BuildInfraDescriptorProps {
/**
* In case we want to restrict the max-width
*/
Expand Down
8 changes: 5 additions & 3 deletions src/Shared/Components/DatePicker/DateTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ const DateTimePicker = ({

return (
<div className="date-time-picker">
<label className={`form__label ${required ? 'dc__required-field' : ''}`} htmlFor={id}>
{label}
</label>
{label && (
<label className={`form__label ${required ? 'dc__required-field' : ''}`} htmlFor={id}>
{label}
</label>
)}
<div className="flex left dc__gap-8">
<SingleDatePicker
id={id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const FeatureTitleWithInfo = ({
docLinkText = 'View Documentation',
dataTestId = 'feature-title-with-info',
additionalContent,
showInfoIcon = false,
}: DescriptorProps) => {
const [showFeatureDescriptionModal, setShowFeatureDescriptionModal] = useState(false)
const onClickInfoIcon = () => {
Expand Down Expand Up @@ -64,10 +65,14 @@ const FeatureTitleWithInfo = ({
</div>
)
}
if (breadCrumbs?.length > 0) {
if (breadCrumbs?.length > 0 || showInfoIcon) {
return (
<div className="flexbox dc__align-items-center dc__gap-4">
<BreadCrumb breadcrumbs={breadCrumbs} />
{showInfoIcon && breadCrumbs?.length === 0 ? (
<span className="fs-16 fw-6 cn-9 lh-32">{title}</span>
) : (
<BreadCrumb breadcrumbs={breadCrumbs} />
)}
<ICHelpOutline className={`${iconClassName} icon-dim-20 cursor fcn-6`} onClick={onClickInfoIcon} />
</div>
)
Expand Down
1 change: 1 addition & 0 deletions src/Shared/Components/FeatureDescription/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@

export * from './FeatureDescriptionModal'
export { default as FeatureTitleWithInfo } from './FeatureTitleWithInfo'
export * from './types'
6 changes: 6 additions & 0 deletions src/Shared/Components/FeatureDescription/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@ export interface DescriptorProps extends FeatureDescriptionModalProps {
docLinkText?: string
dataTestId?: string
additionalContent?: ReactNode
/**
* If true, the info icon is displayed which when clicked shows the feature description modal
*
* @default false
*/
showInfoIcon?: boolean
}
6 changes: 4 additions & 2 deletions src/Shared/Components/FilterChips/FilterChips.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { ReactComponent as CloseIcon } from '../../../Assets/Icon/ic-close.svg'
import { noop } from '../../../Common'
import { noop, Tooltip } from '../../../Common'
import { FilterChipProps, FilterChipsProps } from './types'

const FilterChip = ({
Expand Down Expand Up @@ -45,7 +45,9 @@ const FilterChip = ({
<span className="dc__divider h-24" />
</>
)}
<span className="dc__ellipsis-right">{valueToDisplay}</span>
<Tooltip content={valueToDisplay}>
<span className="dc__ellipsis-right dc__word-break dc__mxw-150">{valueToDisplay}</span>
</Tooltip>
{showRemoveIcon && (
<button
type="button"
Expand Down
2 changes: 2 additions & 0 deletions src/Shared/Components/InfoIconTippy/InfoIconTippy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ const InfoIconTippy = ({
placement = 'bottom',
dataTestid = 'info-tippy-button',
children,
headingInfo,
}: InfoIconTippyProps) => (
<TippyCustomized
theme={TippyTheme.white}
headingInfo={headingInfo}
className="w-300 h-100 dc__no-text-transform"
placement={placement}
Icon={HelpIcon}
Expand Down
2 changes: 2 additions & 0 deletions src/Shared/Components/Plugin/PluginCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const PluginCard = ({
pluginDataStore.pluginVersionStore[latestPluginId]

const handleSelection = (e: React.MouseEvent | React.KeyboardEvent) => {
// Added to ensure that the event is not bubbled to the div in case of click on the checkbox
e.preventDefault()
if ('key' in e && e.key !== 'Enter' && e.key !== ' ') {
return
}
Expand Down
5 changes: 4 additions & 1 deletion src/Shared/Components/Plugin/PluginImageContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ import { ImageWithFallback } from '../ImageWithFallback'
const PluginImageContainer = ({ imageProps, fallbackImageClassName }: PluginImageContainerProps) => (
<ImageWithFallback
fallbackImage={<ICLegoBlock className={`dc__no-shrink ${fallbackImageClassName}`} />}
imageProps={imageProps}
imageProps={{
loading: 'lazy',
...imageProps,
}}
/>
)

Expand Down
Loading