Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e83ae75
feat(Icon): add speedometer icon and update icon map
AbhishekA1509 Jun 5, 2025
5d34558
feat(ResourceBrowser): add ResourceRecommenderHeaderType and related …
AbhishekA1509 Jun 6, 2025
a2cbb09
fix(ResourceBrowser.Types): update K8sResourceDetailDataType to handl…
AbhishekA1509 Jun 6, 2025
17a32de
feat(Helpers): add getGroupVersionFromApiVersion function to parse AP…
AbhishekA1509 Jun 6, 2025
2f10c26
feat(Icon): add ic-minus icon and update icon map
AbhishekA1509 Jun 6, 2025
fb1d4a2
feat: add GVKOptionValueType
AbhishekA1509 Jun 7, 2025
fde0bd6
feat: add GetResourceRecommenderResourceListPropsType
AbhishekA1509 Jun 7, 2025
8a75222
feat(BulkSelectionActionWidget): add resource recommendation view and…
AbhishekA1509 Jun 7, 2025
2f99511
feat: add container registry icon and update related components
AbhishekA1509 Jun 8, 2025
425615b
fix: update K8sResourceDetailDataType to use string for value in curr…
AbhishekA1509 Jun 8, 2025
4c275b9
feat(GetResourceRecommenderResourceListPropsType): update props to in…
AbhishekA1509 Jun 9, 2025
7fcfd77
feat: add width mapping for resource recommender headers
AbhishekA1509 Jun 9, 2025
d2ea89d
Merge branch 'main' of https://github.com/devtron-labs/devtron-fe-com…
AbhishekA1509 Jun 10, 2025
b817cf1
fix: update K8sResourceDetailDataType to allow 'none' as a valid valu…
AbhishekA1509 Jun 10, 2025
206f0f3
feat: add gavel icon and update icon map
AbhishekA1509 Jun 10, 2025
42a5441
chore: update version to 1.15.1-beta-1 in package.json and package-lo…
AbhishekA1509 Jun 10, 2025
509f9b3
feat: add ic-two-cubes icon and update icon map
AbhishekA1509 Jun 12, 2025
1e4ef0e
fix: adjust opacity for readonly input fields in rjsfForm.scss
AbhishekA1509 Jun 12, 2025
d433cef
refactor: remove unused resource recommender header mappings from con…
AbhishekA1509 Jun 13, 2025
9ff305b
fix: add abort controller reference to createNewResource function
AbhishekA1509 Jun 13, 2025
a20748f
chore: update version to 1.15.1-beta-5 in package.json and package-lo…
AbhishekA1509 Jun 16, 2025
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": "1.15.1",
"version": "1.15.1-beta-5",
"description": "Supporting common component library",
"type": "module",
"main": "dist/index.js",
Expand Down
19 changes: 19 additions & 0 deletions src/Assets/IconV2/ic-container-registry.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 2 additions & 18 deletions src/Assets/IconV2/ic-container.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/Assets/IconV2/ic-gavel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/Assets/IconV2/ic-minus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/Assets/IconV2/ic-speedometer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/Assets/IconV2/ic-two-cubes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/Common/RJSF/rjsfForm.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@

input.form__input {
padding: 6px 8px;

&[readonly] {
opacity: 0.5;
}
}
}

Expand Down
74 changes: 72 additions & 2 deletions src/Pages/ResourceBrowser/ResourceBrowser.Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
* limitations under the License.
*/

import { RefObject } from 'react'
import { Dispatch, RefObject, SetStateAction } from 'react'
import { GroupBase } from 'react-select'

import { ServerErrors } from '@Common/ServerError'
import { SelectPickerOptionType } from '@Shared/Components'
import { Nodes, NodeType } from '@Shared/types'

export interface GVKType {
Expand Down Expand Up @@ -59,8 +62,54 @@ export interface K8sResourceListPayloadType {
k8sRequest: ResourceListPayloadK8sRequestType
}

export enum ResourceRecommenderHeaderType {
NAME = 'name',
NAMESPACE = 'namespace',
KIND = 'kind',
API_VERSION = 'apiVersion',
CONTAINER_NAME = 'containerName',
CPU_REQUEST = 'cpuRequest',
CPU_LIMIT = 'cpuLimit',
MEMORY_REQUEST = 'memoryRequest',
MEMORY_LIMIT = 'memoryLimit',
}

export type ResourceRecommenderHeaderWithStringValue = Extract<
ResourceRecommenderHeaderType,
| ResourceRecommenderHeaderType.NAME
| ResourceRecommenderHeaderType.NAMESPACE
| ResourceRecommenderHeaderType.KIND
| ResourceRecommenderHeaderType.API_VERSION
| ResourceRecommenderHeaderType.CONTAINER_NAME
>

export type ResourceRecommenderHeaderWithRecommendation = Extract<
ResourceRecommenderHeaderType,
| ResourceRecommenderHeaderType.CPU_REQUEST
| ResourceRecommenderHeaderType.CPU_LIMIT
| ResourceRecommenderHeaderType.MEMORY_REQUEST
| ResourceRecommenderHeaderType.MEMORY_LIMIT
>

export type K8sResourceDetailDataType = {
[key: string]: string | number | object | boolean
additionalMetadata?: Partial<
Record<
ResourceRecommenderHeaderWithRecommendation,
{
// In case there is not limit or request set, it will be null
current: {
value: string | 'none'
} | null
// In case cron is yet to run
recommended: {
value: string | 'none'
} | null
// In case any of current or recommended is null, delta will be null
delta: number | null
}
>
>
}

export interface K8sResourceDetailType {
Expand All @@ -69,19 +118,21 @@ export interface K8sResourceDetailType {
}

export interface BulkSelectionActionWidgetProps {
isResourceRecommendationView: boolean
count: number
handleOpenBulkDeleteModal: () => void
handleClearBulkSelection: () => void
handleOpenCordonNodeModal: () => void
handleOpenUncordonNodeModal: () => void
handleOpenDrainNodeModal: () => void
handleOpenRestartWorkloadModal: () => void
handleOpenApplyResourceRecommendationModal: () => void
parentRef: RefObject<HTMLDivElement>
showBulkRestartOption: boolean
showNodeListingOptions: boolean
}

export type RBBulkOperationType = 'restart' | 'delete' | 'cordon' | 'uncordon' | 'drain'
export type RBBulkOperationType = 'restart' | 'delete' | 'cordon' | 'uncordon' | 'drain' | 'applyResourceRecommendation'

export interface CreateResourceRequestBodyType {
appId: string
Expand All @@ -95,6 +146,7 @@ export interface CreateResourceRequestBodyType {
export interface ResourceManifestDTO {
manifestResponse: {
manifest: Record<string, unknown>
recommendedManifest?: Record<string, unknown>
}
secretViewAccess: boolean
}
Expand Down Expand Up @@ -146,3 +198,21 @@ export interface NodeActionRequest {
version: string
kind: string
}

export interface GVKOptionValueType {
kind: string
apiVersion: string
}

export interface GetResourceRecommenderResourceListPropsType {
resourceList: K8sResourceDetailType
reloadResourceListData: () => void
setShowAbsoluteValuesInResourceRecommender: Dispatch<SetStateAction<boolean>>
showAbsoluteValuesInResourceRecommender: boolean
gvkOptions: GroupBase<SelectPickerOptionType<GVKOptionValueType>>[]
areGVKOptionsLoading: boolean
reloadGVKOptions: () => void
gvkOptionsError: ServerErrors
isResourceListLoading: boolean
resourceListError: ServerErrors
}
3 changes: 3 additions & 0 deletions src/Pages/ResourceBrowser/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,6 @@ export const NODE_DRAIN_OPTIONS_CHECKBOX_CONFIG: {
label: DRAIN_NODE_MODAL_MESSAGING.IgnoreDaemonSets.heading,
},
] as const

export const GVK_FILTER_KIND_QUERY_PARAM_KEY = 'gvkFilterKind'
export const GVK_FILTER_API_VERSION_QUERY_PARAM_KEY = 'gvkFilterApiVersion'
4 changes: 3 additions & 1 deletion src/Pages/ResourceBrowser/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export const getK8sResourceList = (

export const createNewResource = (
resourceListPayload: CreateResourcePayload,
): Promise<ResponseType<CreateResourceDTO[]>> => post(ROUTES.K8S_RESOURCE_CREATE, resourceListPayload)
abortControllerRef?: APIOptions['abortControllerRef'],
): Promise<ResponseType<CreateResourceDTO[]>> =>
post(ROUTES.K8S_RESOURCE_CREATE, resourceListPayload, { abortControllerRef })

export const deleteResource = (
resourceListPayload: ResourceListPayloadType,
Expand Down
Loading
Loading