diff --git a/package-lock.json b/package-lock.json index 2f8afd806..28a6d7105 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.13.0-pre-3", + "version": "1.13.0-pre-4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.13.0-pre-3", + "version": "1.13.0-pre-4", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 47fbe8eeb..94f491c82 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.13.0-pre-3", + "version": "1.13.0-pre-4", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", diff --git a/src/Assets/Icon/ic-medal.svg b/src/Assets/Icon/ic-medal.svg deleted file mode 100644 index 60e5f8c63..000000000 --- a/src/Assets/Icon/ic-medal.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/Assets/IconV2/ic-cluster.svg b/src/Assets/IconV2/ic-cluster.svg new file mode 100644 index 000000000..f6aea37fd --- /dev/null +++ b/src/Assets/IconV2/ic-cluster.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/Assets/IconV2/ic-delete-dots.svg b/src/Assets/IconV2/ic-delete-dots.svg new file mode 100644 index 000000000..eba902e79 --- /dev/null +++ b/src/Assets/IconV2/ic-delete-dots.svg @@ -0,0 +1,62 @@ + + + + + + + diff --git a/src/Assets/IconV2/ic-enterprise-feat.svg b/src/Assets/IconV2/ic-enterprise-feat.svg new file mode 100644 index 000000000..f80863f34 --- /dev/null +++ b/src/Assets/IconV2/ic-enterprise-feat.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/Assets/IconV2/ic-enterprise-tag.svg b/src/Assets/IconV2/ic-enterprise-tag.svg new file mode 100644 index 000000000..8be0fb147 --- /dev/null +++ b/src/Assets/IconV2/ic-enterprise-tag.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Assets/IconV2/ic-login-devtron-logo.svg b/src/Assets/IconV2/ic-login-devtron-logo.svg deleted file mode 100644 index 0c054d6e6..000000000 --- a/src/Assets/IconV2/ic-login-devtron-logo.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/src/Common/Common.service.ts b/src/Common/Common.service.ts index c7d1a3f13..c99e0a6ff 100644 --- a/src/Common/Common.service.ts +++ b/src/Common/Common.service.ts @@ -45,6 +45,7 @@ import { GlobalVariableDTO, GlobalVariableOptionType, UserRole, + APIOptions, EnvAppsMetaDTO, GetAppsInfoForEnvProps, AppMeta, @@ -452,9 +453,9 @@ export function getClusterListMin() { export const getResourceGroupListRaw = (clusterId: string): Promise> => get(`${ROUTES.API_RESOURCE}/${ROUTES.GVK}/${clusterId}`) -export function getNamespaceListMin(clusterIdsCsv: string): Promise { +export function getNamespaceListMin(clusterIdsCsv: string, abortControllerRef?: APIOptions['abortControllerRef']): Promise { const URL = `${ROUTES.NAMESPACE}/autocomplete?ids=${clusterIdsCsv}` - return get(URL) + return get(URL, { abortControllerRef }) } export function getWebhookEventsForEventId(eventId: string | number) { const URL = `${ROUTES.GIT_HOST_EVENT}/${eventId}` diff --git a/src/Common/RJSF/templates/ObjectFieldTemplate.tsx b/src/Common/RJSF/templates/ObjectFieldTemplate.tsx index 825b18293..fffbd4bc5 100644 --- a/src/Common/RJSF/templates/ObjectFieldTemplate.tsx +++ b/src/Common/RJSF/templates/ObjectFieldTemplate.tsx @@ -76,8 +76,6 @@ const Field = ({ return true } }) - // NOTE: we probably should use uiSchema instead? - .sort((prop) => (schema.properties?.[prop.name]?.type === 'boolean' ? -1 : 1)) .map((prop) => prop.content) if (hasAdditionalProperties) { diff --git a/src/Common/Tooltip/ShortcutKeyComboTooltipContent.tsx b/src/Common/Tooltip/ShortcutKeyComboTooltipContent.tsx index 52cfa74d9..6d42138e4 100644 --- a/src/Common/Tooltip/ShortcutKeyComboTooltipContent.tsx +++ b/src/Common/Tooltip/ShortcutKeyComboTooltipContent.tsx @@ -24,8 +24,7 @@ const ShortcutKeyComboTooltipContent = ({ text, combo }: TooltipProps['shortcutK {!!combo?.length && (
{combo.map((key) => ( - // TODO: check styling for this since span was replaced by kbd - + {KEYBOARD_KEYS_MAP[key]} ))} diff --git a/src/Pages/GlobalConfigurations/ClustersAndEnvironments/index.ts b/src/Pages/GlobalConfigurations/ClustersAndEnvironments/index.ts new file mode 100644 index 000000000..51f25875e --- /dev/null +++ b/src/Pages/GlobalConfigurations/ClustersAndEnvironments/index.ts @@ -0,0 +1 @@ +export type { NewClusterFormFooterProps, NewClusterFormProps } from './types' diff --git a/src/Pages/GlobalConfigurations/ClustersAndEnvironments/types.ts b/src/Pages/GlobalConfigurations/ClustersAndEnvironments/types.ts new file mode 100644 index 000000000..c8d999573 --- /dev/null +++ b/src/Pages/GlobalConfigurations/ClustersAndEnvironments/types.ts @@ -0,0 +1,10 @@ +export interface NewClusterFormFooterProps { + apiCallInProgress: boolean + handleModalClose: () => void + closeButtonText?: string +} + +export interface NewClusterFormProps extends Pick { + FooterComponent: React.FunctionComponent & + Record<'CTA' | 'Start', React.FunctionComponent<{}>> +} diff --git a/src/Pages/GlobalConfigurations/index.ts b/src/Pages/GlobalConfigurations/index.ts index 9bc2dba52..d4b1f5746 100644 --- a/src/Pages/GlobalConfigurations/index.ts +++ b/src/Pages/GlobalConfigurations/index.ts @@ -16,5 +16,6 @@ export * from './Authorization' export * from './BuildInfra' +export * from './ClustersAndEnvironments' export * from './DeploymentCharts' export * from './ScopedVariables' diff --git a/src/Pages/ResourceBrowser/service.ts b/src/Pages/ResourceBrowser/service.ts index 886ac3f33..9c2318238 100644 --- a/src/Pages/ResourceBrowser/service.ts +++ b/src/Pages/ResourceBrowser/service.ts @@ -61,4 +61,5 @@ export const drainNodeCapacity = ( abortControllerRef?: APIOptions['abortControllerRef'], ): Promise => put(`${ROUTES.NODE_CAPACITY}/drain`, requestPayload, { abortControllerRef }) -export const getClusterListRaw = () => get(ROUTES.CLUSTER_LIST_RAW) +export const getClusterListRaw = (abortControllerRef?: APIOptions['abortControllerRef']) => + get(ROUTES.CLUSTER_LIST_RAW, { abortControllerRef }) diff --git a/src/Pages/ResourceBrowser/types.ts b/src/Pages/ResourceBrowser/types.ts index ed8dda683..23581d8b2 100644 --- a/src/Pages/ResourceBrowser/types.ts +++ b/src/Pages/ResourceBrowser/types.ts @@ -16,6 +16,8 @@ import { Dispatch, ReactElement, SetStateAction } from 'react' +import { InstallationClusterType } from '@Shared/types' + import { NodeActionRequest } from './ResourceBrowser.Types' export enum ClusterFiltersType { @@ -24,6 +26,16 @@ export enum ClusterFiltersType { UNHEALTHY = 'unhealthy', } +export enum InstallationClusterStatus { + Creating = 'Creating', + Updated = 'Updated', + Updating = 'Updating', + Installed = 'Installed', + Failed = 'Failed', + Deleting = 'Deleting', + Deleted = 'Deleted', +} + export enum ClusterStatusType { HEALTHY = 'healthy', UNHEALTHY = 'unhealthy', @@ -65,6 +77,7 @@ export interface ClusterCapacityType { nodeErrors: Record[] status?: ClusterStatusType isProd: boolean + installationId?: number } export interface ClusterDetail extends ClusterCapacityType { @@ -99,3 +112,35 @@ export interface AdditionalConfirmationModalOptionsProps { setOptionsData: Dispatch> children?: ReactElement } + +export interface InstallationClusterStepType { + lastTransitionTime: string + lastProbeTime: string + message: string + reason: string + status: 'False' | 'True' | 'Unknown' + type: string +} + +export interface InstallationClusterConfigDTO { + installationId: number + installationStatus: InstallationClusterStatus + name: string + values: string + valuesSchema: string + isProd: boolean + installationType: InstallationClusterType + conditions: InstallationClusterStepType[] + // NOTE: for installation cluster, that is creating this will be 0 + installedEntityId: number | 0 +} + +export interface InstallationClusterConfigType + extends Pick { + schema: object + values: object + installationId: number + name: string + status: InstallationClusterStatus + correspondingClusterId: number | 0 +} diff --git a/src/Shared/Components/EnterpriseTag/EnterpriseTag.component.tsx b/src/Shared/Components/EnterpriseTag/EnterpriseTag.component.tsx deleted file mode 100644 index 9cf49a2a9..000000000 --- a/src/Shared/Components/EnterpriseTag/EnterpriseTag.component.tsx +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2024. Devtron Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { ReactComponent as ICMedal } from '@Icons/ic-medal.svg' - -const EnterpriseTag = () => ( -
- - Enterprise -
-) - -export default EnterpriseTag diff --git a/src/Shared/Components/EnterpriseTag/index.ts b/src/Shared/Components/EnterpriseTag/index.ts deleted file mode 100644 index ea5e41615..000000000 --- a/src/Shared/Components/EnterpriseTag/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2024. Devtron Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export { default as EnterpriseTag } from './EnterpriseTag.component' diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index caf41168e..d4f40a33c 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -36,6 +36,7 @@ import { ReactComponent as ICClock } from '@IconsV2/ic-clock.svg' import { ReactComponent as ICCloseLarge } from '@IconsV2/ic-close-large.svg' import { ReactComponent as ICCloseSmall } from '@IconsV2/ic-close-small.svg' import { ReactComponent as ICCloudVms } from '@IconsV2/ic-cloud-vms.svg' +import { ReactComponent as ICCluster } from '@IconsV2/ic-cluster.svg' import { ReactComponent as ICCode } from '@IconsV2/ic-code.svg' import { ReactComponent as ICContainer } from '@IconsV2/ic-container.svg' import { ReactComponent as ICCookr } from '@IconsV2/ic-cookr.svg' @@ -44,6 +45,7 @@ import { ReactComponent as ICCpu } from '@IconsV2/ic-cpu.svg' import { ReactComponent as ICCrown } from '@IconsV2/ic-crown.svg' import { ReactComponent as ICCube } from '@IconsV2/ic-cube.svg' import { ReactComponent as ICDelete } from '@IconsV2/ic-delete.svg' +import { ReactComponent as ICDeleteDots } from '@IconsV2/ic-delete-dots.svg' import { ReactComponent as ICDeleteLightning } from '@IconsV2/ic-delete-lightning.svg' import { ReactComponent as ICDelhivery } from '@IconsV2/ic-delhivery.svg' import { ReactComponent as ICDevtron } from '@IconsV2/ic-devtron.svg' @@ -51,6 +53,8 @@ import { ReactComponent as ICDevtronHeaderLogo } from '@IconsV2/ic-devtron-heade import { ReactComponent as ICDisconnect } from '@IconsV2/ic-disconnect.svg' import { ReactComponent as ICDockerhub } from '@IconsV2/ic-dockerhub.svg' import { ReactComponent as ICEcr } from '@IconsV2/ic-ecr.svg' +import { ReactComponent as ICEnterpriseFeat } from '@IconsV2/ic-enterprise-feat.svg' +import { ReactComponent as ICEnterpriseTag } from '@IconsV2/ic-enterprise-tag.svg' import { ReactComponent as ICEnv } from '@IconsV2/ic-env.svg' import { ReactComponent as ICError } from '@IconsV2/ic-error.svg' import { ReactComponent as ICExpandRightSm } from '@IconsV2/ic-expand-right-sm.svg' @@ -91,7 +95,6 @@ import { ReactComponent as ICLdap } from '@IconsV2/ic-ldap.svg' import { ReactComponent as ICLightning } from '@IconsV2/ic-lightning.svg' import { ReactComponent as ICLightningFill } from '@IconsV2/ic-lightning-fill.svg' import { ReactComponent as ICLivspace } from '@IconsV2/ic-livspace.svg' -import { ReactComponent as ICLoginDevtronLogo } from '@IconsV2/ic-login-devtron-logo.svg' import { ReactComponent as ICLogout } from '@IconsV2/ic-logout.svg' import { ReactComponent as ICMediumDelete } from '@IconsV2/ic-medium-delete.svg' import { ReactComponent as ICMediumPaintbucket } from '@IconsV2/ic-medium-paintbucket.svg' @@ -182,6 +185,7 @@ export const iconMap = { 'ic-close-large': ICCloseLarge, 'ic-close-small': ICCloseSmall, 'ic-cloud-vms': ICCloudVms, + 'ic-cluster': ICCluster, 'ic-code': ICCode, 'ic-container': ICContainer, 'ic-cookr': ICCookr, @@ -189,6 +193,7 @@ export const iconMap = { 'ic-cpu': ICCpu, 'ic-crown': ICCrown, 'ic-cube': ICCube, + 'ic-delete-dots': ICDeleteDots, 'ic-delete-lightning': ICDeleteLightning, 'ic-delete': ICDelete, 'ic-delhivery': ICDelhivery, @@ -197,6 +202,8 @@ export const iconMap = { 'ic-disconnect': ICDisconnect, 'ic-dockerhub': ICDockerhub, 'ic-ecr': ICEcr, + 'ic-enterprise-feat': ICEnterpriseFeat, + 'ic-enterprise-tag': ICEnterpriseTag, 'ic-env': ICEnv, 'ic-error': ICError, 'ic-expand-right-sm': ICExpandRightSm, @@ -237,7 +244,6 @@ export const iconMap = { 'ic-lightning-fill': ICLightningFill, 'ic-lightning': ICLightning, 'ic-livspace': ICLivspace, - 'ic-login-devtron-logo': ICLoginDevtronLogo, 'ic-logout': ICLogout, 'ic-medium-delete': ICMediumDelete, 'ic-medium-paintbucket': ICMediumPaintbucket, diff --git a/src/Shared/Components/LoginBanner/Testimonials.components.tsx b/src/Shared/Components/LoginBanner/Testimonials.components.tsx new file mode 100644 index 000000000..d78b78c21 --- /dev/null +++ b/src/Shared/Components/LoginBanner/Testimonials.components.tsx @@ -0,0 +1,21 @@ +import { Icon } from '../Icon' +import { TestimonialCardConfig } from './types' + +const TestimonialContent = ({ quote, name, designation, iconName }: TestimonialCardConfig) => ( + <> +

{quote}"

+
+
+ {name} + {designation} +
+ {iconName && ( +
+ +
+ )} +
+ +) + +export default TestimonialContent diff --git a/src/Shared/Components/LoginBanner/index.tsx b/src/Shared/Components/LoginBanner/index.tsx index bead5bda4..726c6f74d 100644 --- a/src/Shared/Components/LoginBanner/index.tsx +++ b/src/Shared/Components/LoginBanner/index.tsx @@ -1 +1,3 @@ +export { TESTIMONIAL_CARD_DATA } from './constants' export { default as LoginBanner } from './LoginBanner' +export { default as TestimonialContent } from './Testimonials.components' diff --git a/src/Shared/Components/SelectPicker/common.tsx b/src/Shared/Components/SelectPicker/common.tsx index 6e960cb35..1f64d8905 100644 --- a/src/Shared/Components/SelectPicker/common.tsx +++ b/src/Shared/Components/SelectPicker/common.tsx @@ -225,7 +225,14 @@ export const SelectPickerOption = ({
{startIcon &&
{startIcon}
}
- +

@@ -431,3 +438,15 @@ export const SelectPickerGroupHeading = ({ export const renderLoadingMessage = () => (

Loading

) + +export const ValueContainerWithLoadingShimmer = (props: ValueContainerProps) => { + const { + selectProps: { isLoading }, + } = props + + if (!isLoading) { + return + } + + return
+} diff --git a/src/Shared/Components/SelectPicker/index.ts b/src/Shared/Components/SelectPicker/index.ts index 999db404c..35c4d8336 100644 --- a/src/Shared/Components/SelectPicker/index.ts +++ b/src/Shared/Components/SelectPicker/index.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +export { ValueContainerWithLoadingShimmer } from './common' export { default as FilterSelectPicker } from './FilterSelectPicker' export { default as SelectPicker } from './SelectPicker.component' export * from './SelectPickerTextArea.component' diff --git a/src/Shared/Components/StatusComponent/StatusComponent.tsx b/src/Shared/Components/StatusComponent/StatusComponent.tsx index 75c58ef03..cb83de839 100644 --- a/src/Shared/Components/StatusComponent/StatusComponent.tsx +++ b/src/Shared/Components/StatusComponent/StatusComponent.tsx @@ -64,7 +64,7 @@ export const StatusComponent = ({

{textContent}

diff --git a/src/Shared/Components/StatusComponent/types.ts b/src/Shared/Components/StatusComponent/types.ts index 5c8388b85..d03739c1b 100644 --- a/src/Shared/Components/StatusComponent/types.ts +++ b/src/Shared/Components/StatusComponent/types.ts @@ -34,6 +34,7 @@ export enum StatusType { INPROGRESS = 'INPROGRESS', HIBERNATING = 'HIBERNATING', TIMED_OUT = 'TIMED_OUT', + DELETING = 'DELETING', } export interface StatusComponentProps { diff --git a/src/Shared/Components/StatusComponent/utils.ts b/src/Shared/Components/StatusComponent/utils.ts index b6303d7c8..a9c110f0c 100644 --- a/src/Shared/Components/StatusComponent/utils.ts +++ b/src/Shared/Components/StatusComponent/utils.ts @@ -71,6 +71,10 @@ export const getIconName = (status: string, showAnimatedIcon: boolean): IconName case 'timedout': case 'timed_out': return 'ic-timeout-dash' + case 'deleting': + return 'ic-delete-dots' + case 'deleted': + return 'ic-delete' default: return null } @@ -93,6 +97,8 @@ export const getIconColor = (status: string): IconsProps['color'] => { return 'O500' case 'timedout': case 'timed_out': + case 'deleting': + case 'deleted': return 'R500' default: return null diff --git a/src/Shared/Components/index.ts b/src/Shared/Components/index.ts index 3747ac491..36d71ccb6 100644 --- a/src/Shared/Components/index.ts +++ b/src/Shared/Components/index.ts @@ -45,7 +45,6 @@ export * from './DiffViewer' export * from './DynamicDataTable' export * from './EditableTextArea' export * from './EditImageFormField' -export * from './EnterpriseTag' export * from './EnvironmentSelector' export * from './Error' export * from './ExcludedImageNode' diff --git a/src/Shared/types.ts b/src/Shared/types.ts index e266bdee0..97e0bcc6d 100644 --- a/src/Shared/types.ts +++ b/src/Shared/types.ts @@ -482,6 +482,7 @@ export enum ResourceKindType { releaseChannel = 'release-channel', tenant = 'tenant', installation = 'installation', + infrastructureInstallation = 'installations', environment = 'environment', cdPipeline = 'cd-pipeline', ciPipeline = 'ci-pipeline', @@ -1116,6 +1117,11 @@ export enum ResponseHeaders { LICENSE_STATUS = 'X-License-Status', } +export enum InstallationClusterType { + EKS_AUTO_CLUSTER = 'eksAutoCluster', + EKS_MANUAL_CLUSTER = 'eksManualCluster', +} + export type IconBaseSizeType = | 6 | 8