diff --git a/.eslintrc.cjs b/.eslintrc.cjs index a9e235250..c2e95c310 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -14,9 +14,11 @@ * limitations under the License. */ +const tsconfigPath = require('./tsconfig.json') + module.exports = { parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint', 'react', 'prettier', 'import'], + plugins: ['@typescript-eslint', 'react', 'prettier', 'import', 'simple-import-sort'], env: { browser: true, es2021: true, @@ -109,6 +111,26 @@ module.exports = { 'import/prefer-default-export': 'off', 'no-restricted-exports': 'off', 'import/named': 'off', + 'simple-import-sort/imports': [ + 'error', + { + groups: [ + // Packages `react` related packages and external packages. + ['^react', '^@?\\w'], + // Devtron packages + ['^@devtron-labs'], + // Internal packages. + [...Object.keys(tsconfigPath.compilerOptions.paths).map((alias) => alias.replace('/*', ''))], + // Side effect imports. + ['^\\u0000'], + // Put same-folder imports, `..` and `.` last. Other relative imports. + ['^\\.\\.(?!/?$)', '^\\.\\./?$', '^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$',], + // Style imports. + [ '^.+\\.?(css|scss)$'], + ], + }, + ], + 'simple-import-sort/exports': 'error', }, overrides: [ { diff --git a/package-lock.json b/package-lock.json index d759c8afc..6ec603ebe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.11.2", + "version": "1.12.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.11.2", + "version": "1.12.0", "hasInstallScript": true, "license": "ISC", "dependencies": { @@ -69,6 +69,7 @@ "eslint-plugin-prettier": "^5.1.2", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-simple-import-sort": "^12.1.1", "glob": "^10.3.3", "husky": "^7.0.4", "json-schema": "^0.4.0", @@ -82,7 +83,7 @@ "sharp": "^0.33.5", "svgo": "^3.3.2", "typescript": "5.5.4", - "vite": "5.4.14", + "vite": "5.4.17", "vite-plugin-dts": "4.0.3", "vite-plugin-image-optimizer": "^1.1.8", "vite-plugin-lib-inject-css": "2.1.1", @@ -6756,6 +6757,15 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-simple-import-sort": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.1.1.tgz", + "integrity": "sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==", + "dev": true, + "peerDependencies": { + "eslint": ">=5.0.0" + } + }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", @@ -12161,11 +12171,10 @@ } }, "node_modules/vite": { - "version": "5.4.14", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.14.tgz", - "integrity": "sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==", + "version": "5.4.17", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.17.tgz", + "integrity": "sha512-5+VqZryDj4wgCs55o9Lp+p8GE78TLVg0lasCH5xFZ4jacZjtqZa6JUw9/p0WeAojaOfncSM6v77InkFPGnvPvg==", "dev": true, - "license": "MIT", "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", diff --git a/package.json b/package.json index 3f8212f81..7a0801063 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.11.2", + "version": "1.12.0", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", @@ -60,6 +60,7 @@ "eslint-plugin-prettier": "^5.1.2", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-simple-import-sort": "^12.1.1", "glob": "^10.3.3", "husky": "^7.0.4", "json-schema": "^0.4.0", @@ -73,7 +74,7 @@ "sharp": "^0.33.5", "svgo": "^3.3.2", "typescript": "5.5.4", - "vite": "5.4.14", + "vite": "5.4.17", "vite-plugin-dts": "4.0.3", "vite-plugin-image-optimizer": "^1.1.8", "vite-plugin-lib-inject-css": "2.1.1", @@ -108,10 +109,10 @@ "@replit/codemirror-indentation-markers": "6.5.3", "@replit/codemirror-vscode-keymap": "6.0.2", "@types/react-dates": "^21.8.6", - "@xyflow/react": "12.4.2", "@uiw/codemirror-extensions-hyper-link": "4.23.10", "@uiw/codemirror-theme-github": "4.23.7", "@uiw/react-codemirror": "4.23.7", + "@xyflow/react": "12.4.2", "ansi_up": "^5.2.1", "codemirror-json-schema": "0.8.0", "dayjs": "^1.11.13", @@ -141,7 +142,7 @@ "monaco-editor": "0.44.0" }, "vite-plugin-svgr": { - "vite": "5.4.14" + "vite": "5.4.17" }, "react-virtualized-sticky-tree": { "react": "^17.0.2", diff --git a/src/Assets/IconV2/ic-arrow-clockwise.svg b/src/Assets/IconV2/ic-arrow-clockwise.svg new file mode 100644 index 000000000..0b54a39fd --- /dev/null +++ b/src/Assets/IconV2/ic-arrow-clockwise.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/Assets/IconV2/ic-bg-cluster.svg b/src/Assets/IconV2/ic-bg-cluster.svg new file mode 100644 index 000000000..1c8ba61ff --- /dev/null +++ b/src/Assets/IconV2/ic-bg-cluster.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/Assets/IconV2/ic-file-key.svg b/src/Assets/IconV2/ic-file-key.svg new file mode 100644 index 000000000..c626fb9b9 --- /dev/null +++ b/src/Assets/IconV2/ic-file-key.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/Assets/IconV2/ic-sliders-vertical.svg b/src/Assets/IconV2/ic-sliders-vertical.svg new file mode 100644 index 000000000..a4006ab36 --- /dev/null +++ b/src/Assets/IconV2/ic-sliders-vertical.svg @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/src/Assets/IconV2/ic-terminal-fill.svg b/src/Assets/IconV2/ic-terminal-fill.svg new file mode 100644 index 000000000..0ffae6cc0 --- /dev/null +++ b/src/Assets/IconV2/ic-terminal-fill.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/Common/API/CoreAPI.ts b/src/Common/API/CoreAPI.ts index 5f4d547bd..b4322d977 100644 --- a/src/Common/API/CoreAPI.ts +++ b/src/Common/API/CoreAPI.ts @@ -1,5 +1,10 @@ -import { INVALID_LICENSE_KEY, ResponseHeaders } from '@Shared/index' -import { API_STATUS_CODES, APIOptions, FALLBACK_REQUEST_TIMEOUT, Host, noop, ResponseType, ServerErrors } from '..' +import { API_STATUS_CODES, FALLBACK_REQUEST_TIMEOUT, Host } from '@Common/Constants' +import { noop } from '@Common/Helper' +import { ServerErrors } from '@Common/ServerError' +import { APIOptions, ResponseType } from '@Common/Types' +import { INVALID_LICENSE_KEY } from '@Shared/constants' +import { ResponseHeaders } from '@Shared/types' + import { CoreAPIConstructorParamsType, FetchAPIParamsType, FetchInTimeParamsType } from './types' import { handleServerError } from './utils' diff --git a/src/Common/API/index.ts b/src/Common/API/index.ts index 6ea6e93d5..a0c3caaa1 100644 --- a/src/Common/API/index.ts +++ b/src/Common/API/index.ts @@ -8,5 +8,5 @@ const dashboardAPI = new CoreAPI({ }) export const { post, put, patch, get, trash } = dashboardAPI -export { getIsRequestAborted, abortPreviousRequests, handleRedirectToLicenseActivation } from './utils' export { default as CoreAPI } from './CoreAPI' +export { abortPreviousRequests, getIsRequestAborted, handleRedirectToLicenseActivation } from './utils' diff --git a/src/Common/API/utils.ts b/src/Common/API/utils.ts index 4a1b6732d..512fd2cd3 100644 --- a/src/Common/API/utils.ts +++ b/src/Common/API/utils.ts @@ -1,6 +1,8 @@ -import { ServerErrors } from '@Common/ServerError' import { MutableRefObject } from 'react' + import { URLS } from '@Common/Constants' +import { ServerErrors } from '@Common/ServerError' + import { RESPONSE_MESSAGES } from './constants' export const handleServerError = async (contentType: string, response: Response) => { diff --git a/src/Common/AddCDButton/utils.tsx b/src/Common/AddCDButton/utils.tsx index 800029ab8..0a7683cb5 100644 --- a/src/Common/AddCDButton/utils.tsx +++ b/src/Common/AddCDButton/utils.tsx @@ -15,7 +15,7 @@ */ import { AddCDPositions, AddPipelineType, PipelineType, WorkflowNodeType } from '../Types' -import { HandleAddCD, GetPipelineType } from './types' +import { GetPipelineType, HandleAddCD } from './types' const getPipelineType = ({ startNode }: GetPipelineType) => { if (startNode.type === WorkflowNodeType.WEBHOOK) { diff --git a/src/Common/ClipboardButton/ClipboardButton.tsx b/src/Common/ClipboardButton/ClipboardButton.tsx index 5909b0193..d0b76f895 100644 --- a/src/Common/ClipboardButton/ClipboardButton.tsx +++ b/src/Common/ClipboardButton/ClipboardButton.tsx @@ -14,12 +14,14 @@ * limitations under the License. */ -import { useState, useEffect, useRef } from 'react' +import { useEffect, useRef, useState } from 'react' + import Tooltip from '@Common/Tooltip/Tooltip' + +import { ReactComponent as Check } from '../../Assets/Icon/ic-check.svg' +import { ReactComponent as ICCopy } from '../../Assets/Icon/ic-copy.svg' import { copyToClipboard, noop, stopPropagation } from '../Helper' import ClipboardProps from './types' -import { ReactComponent as ICCopy } from '../../Assets/Icon/ic-copy.svg' -import { ReactComponent as Check } from '../../Assets/Icon/ic-check.svg' /** * @param content - Content to be copied diff --git a/src/Common/CodeEditor/CodeEditor.reducer.ts b/src/Common/CodeEditor/CodeEditor.reducer.ts index 2b4b06552..1def619f1 100644 --- a/src/Common/CodeEditor/CodeEditor.reducer.ts +++ b/src/Common/CodeEditor/CodeEditor.reducer.ts @@ -15,7 +15,9 @@ */ import YAML from 'yaml' + import { noop, YAMLStringify } from '@Common/Helper' + import { MODES } from '../Constants' import { Action, CodeEditorInitialValueType, CodeEditorState } from './types' import { getCodeEditorThemeFromAppTheme } from './utils' diff --git a/src/Common/CodeEditor/types.ts b/src/Common/CodeEditor/types.ts index 2a7347487..85f9a7813 100644 --- a/src/Common/CodeEditor/types.ts +++ b/src/Common/CodeEditor/types.ts @@ -15,6 +15,7 @@ */ import { AppThemeType } from '@Shared/Providers' + import { MODES } from '../Constants' export interface InformationBarProps { diff --git a/src/Common/CodeEditor/utils.ts b/src/Common/CodeEditor/utils.ts index 63012f9ab..675519195 100644 --- a/src/Common/CodeEditor/utils.ts +++ b/src/Common/CodeEditor/utils.ts @@ -15,6 +15,7 @@ */ import { AppThemeType } from '@Shared/Providers' + import { CodeEditorInterface, CodeEditorThemesKeys } from './types' export const getCodeEditorThemeFromAppTheme = ( diff --git a/src/Common/CodeMirror/CodeEditor.components.tsx b/src/Common/CodeMirror/CodeEditor.components.tsx index 450a24dc1..fa2fcb653 100644 --- a/src/Common/CodeMirror/CodeEditor.components.tsx +++ b/src/Common/CodeMirror/CodeEditor.components.tsx @@ -16,10 +16,10 @@ import { ReactNode } from 'react' -import { ReactComponent as ICWarningY5 } from '@Icons/ic-warning-y5.svg' -import { ReactComponent as Info } from '@Icons/ic-info-filled.svg' -import { ReactComponent as ErrorIcon } from '@Icons/ic-error-exclamation.svg' import { ReactComponent as ICCompare } from '@Icons/ic-compare.svg' +import { ReactComponent as ErrorIcon } from '@Icons/ic-error-exclamation.svg' +import { ReactComponent as Info } from '@Icons/ic-info-filled.svg' +import { ReactComponent as ICWarningY5 } from '@Icons/ic-warning-y5.svg' import { ClipboardButton } from '@Common/ClipboardButton' import { getComponentSpecificThemeClass } from '@Shared/Providers' diff --git a/src/Common/CodeMirror/CodeEditor.theme.ts b/src/Common/CodeMirror/CodeEditor.theme.ts index 115bef1fd..e0b609010 100644 --- a/src/Common/CodeMirror/CodeEditor.theme.ts +++ b/src/Common/CodeMirror/CodeEditor.theme.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import { EditorView } from '@uiw/react-codemirror' -import { githubDarkInit, githubLightInit } from '@uiw/codemirror-theme-github' import { tags } from '@lezer/highlight' +import { githubDarkInit, githubLightInit } from '@uiw/codemirror-theme-github' +import { EditorView } from '@uiw/react-codemirror' import { CODE_EDITOR_FONT_SIZE } from './CodeEditor.constants' diff --git a/src/Common/CodeMirror/CodeEditor.tsx b/src/Common/CodeMirror/CodeEditor.tsx index b13a6beb1..22838f114 100644 --- a/src/Common/CodeMirror/CodeEditor.tsx +++ b/src/Common/CodeMirror/CodeEditor.tsx @@ -15,29 +15,32 @@ */ import { useEffect, useMemo, useRef, useState } from 'react' +import { foldGutter } from '@codemirror/language' +import { lintGutter } from '@codemirror/lint' +import { search } from '@codemirror/search' +import { indentationMarkers } from '@replit/codemirror-indentation-markers' +import { vscodeKeymap } from '@replit/codemirror-vscode-keymap' +import { hyperLink } from '@uiw/codemirror-extensions-hyper-link' import { - Extension, - ReactCodeMirrorProps, basicSetup, BasicSetupOptions, Compartment, - keymap, - EditorView, EditorState, + EditorView, + Extension, + keymap, + ReactCodeMirrorProps, } from '@uiw/react-codemirror' -import { foldGutter } from '@codemirror/language' -import { search } from '@codemirror/search' -import { lintGutter } from '@codemirror/lint' -import { vscodeKeymap } from '@replit/codemirror-vscode-keymap' -import { indentationMarkers } from '@replit/codemirror-indentation-markers' -import { hyperLink } from '@uiw/codemirror-extensions-hyper-link' -import { AppThemeType, useTheme } from '@Shared/Providers' -import { getUniqueId } from '@Shared/Helpers' -import { cleanKubeManifest } from '@Common/Helper' import { DEFAULT_JSON_SCHEMA_URI, MODES } from '@Common/Constants' +import { cleanKubeManifest } from '@Common/Helper' +import { getUniqueId } from '@Shared/Helpers' +import { AppThemeType, useTheme } from '@Shared/Providers' -import { codeEditorFindReplace, readOnlyTooltip, yamlHighlight } from './Extensions' +import { Clipboard, Container, ErrorBar, Header, Information, Warning } from './CodeEditor.components' +import { CodeEditorContext } from './CodeEditor.context' +import { getCodeEditorTheme } from './CodeEditor.theme' +import { CodeEditorRenderer } from './CodeEditorRenderer' import { blurOnEscape, openSearchPanel, @@ -45,12 +48,9 @@ import { replaceAll, showReplaceFieldState, } from './Commands' +import { codeEditorFindReplace, readOnlyTooltip, yamlHighlight } from './Extensions' import { CodeEditorContextProps, CodeEditorProps } from './types' import { getFoldGutterElement, getLanguageExtension, getValidationSchema, parseValueToCode } from './utils' -import { CodeEditorContext } from './CodeEditor.context' -import { Clipboard, Container, ErrorBar, Header, Information, Warning } from './CodeEditor.components' -import { getCodeEditorTheme } from './CodeEditor.theme' -import { CodeEditorRenderer } from './CodeEditorRenderer' import './codeEditor.scss' diff --git a/src/Common/CodeMirror/CodeEditorRenderer.tsx b/src/Common/CodeMirror/CodeEditorRenderer.tsx index adcd887bd..7ec4f6408 100644 --- a/src/Common/CodeMirror/CodeEditorRenderer.tsx +++ b/src/Common/CodeMirror/CodeEditorRenderer.tsx @@ -15,16 +15,16 @@ */ import { useEffect, useRef, useState } from 'react' -import CodeMirror, { EditorView, ReactCodeMirrorRef, ViewUpdate } from '@uiw/react-codemirror' import { MergeView } from '@codemirror/merge' +import CodeMirror, { EditorView, ReactCodeMirrorRef, ViewUpdate } from '@uiw/react-codemirror' -import { getComponentSpecificThemeClass } from '@Shared/Providers' import { Progressing } from '@Common/Progressing' +import { getComponentSpecificThemeClass } from '@Shared/Providers' import { useCodeEditorContext } from './CodeEditor.context' +import { DiffMinimap } from './Extensions' import { CodeEditorRendererProps } from './types' import { getCodeEditorHeight, getRevertControlButton, getScanLimit, updateDiffMinimapValues } from './utils' -import { DiffMinimap } from './Extensions' export const CodeEditorRenderer = ({ codemirrorMergeKey, diff --git a/src/Common/CodeMirror/Extensions/DiffMinimap.tsx b/src/Common/CodeMirror/Extensions/DiffMinimap.tsx index 41fc611c5..6e83f7414 100644 --- a/src/Common/CodeMirror/Extensions/DiffMinimap.tsx +++ b/src/Common/CodeMirror/Extensions/DiffMinimap.tsx @@ -18,8 +18,8 @@ import { useEffect, useRef, useState } from 'react' import { getComponentSpecificThemeClass } from '@Shared/Providers' -import { DiffMinimapProps } from '../types' import { CODE_EDITOR_FONT_SIZE, CODE_EDITOR_MIN_OVERLAY_HEIGHT } from '../CodeEditor.constants' +import { DiffMinimapProps } from '../types' export const DiffMinimap = ({ view, theme, diffMinimapParentRef, scalingFactor }: DiffMinimapProps) => { // STATES diff --git a/src/Common/CodeMirror/Extensions/findAndReplace.tsx b/src/Common/CodeMirror/Extensions/findAndReplace.tsx index 8b9ef3847..63da7f747 100644 --- a/src/Common/CodeMirror/Extensions/findAndReplace.tsx +++ b/src/Common/CodeMirror/Extensions/findAndReplace.tsx @@ -14,35 +14,34 @@ * limitations under the License. */ -import { ChangeEvent, MouseEvent, KeyboardEvent as ReactKeyboardEvent, useEffect, useState } from 'react' +import { ChangeEvent, KeyboardEvent as ReactKeyboardEvent, MouseEvent, useEffect, useState } from 'react' import { render } from 'react-dom' -import { EditorView, Panel, runScopeHandlers, ViewUpdate } from '@uiw/react-codemirror' import { + closeSearchPanel, findNext, findPrevious, - SearchQuery, - setSearchQuery, getSearchQuery, - replaceNext, replaceAll, - closeSearchPanel, + replaceNext, + SearchQuery, selectMatches, + setSearchQuery, } from '@codemirror/search' +import { EditorView, Panel, runScopeHandlers, ViewUpdate } from '@uiw/react-codemirror' -import { ReactComponent as ICClose } from '@Icons/ic-close.svg' -import { ReactComponent as ICCaretDown } from '@Icons/ic-caret-down.svg' import { ReactComponent as ICArrowDown } from '@Icons/ic-arrow-down.svg' -import { ReactComponent as ICWorld } from '@Icons/ic-world.svg' -import { ReactComponent as ICReplaceText } from '@Icons/ic-replace-text.svg' -import { ReactComponent as ICReplaceAllText } from '@Icons/ic-replace-all-text.svg' +import { ReactComponent as ICCaretDown } from '@Icons/ic-caret-down.svg' +import { ReactComponent as ICClose } from '@Icons/ic-close.svg' import { ReactComponent as ICMatchCase } from '@Icons/ic-match-case.svg' import { ReactComponent as ICMatchWord } from '@Icons/ic-match-word.svg' import { ReactComponent as ICRegex } from '@Icons/ic-regex.svg' +import { ReactComponent as ICReplaceAllText } from '@Icons/ic-replace-all-text.svg' +import { ReactComponent as ICReplaceText } from '@Icons/ic-replace-text.svg' +import { ReactComponent as ICWorld } from '@Icons/ic-world.svg' +import { Tooltip } from '@Common/Tooltip' import { Button, ButtonStyleType, ButtonVariantType, Collapse } from '@Shared/Components' import { ComponentSizeType } from '@Shared/constants' -import { Tooltip } from '@Common/Tooltip' -import { FindReplaceProps, FindReplaceQuery, FindReplaceToggleButtonProps } from '../types' import { CLOSE_SEARCH_SHORTCUT_KEYS, NEXT_MATCH_SHORTCUT_KEYS, @@ -50,8 +49,9 @@ import { REPLACE_ALL_SHORTCUT_KEYS, REPLACE_SHORTCUT_KEYS, } from '../CodeEditor.constants' -import { getFindReplaceToggleButtonIconClass, getUpdatedSearchMatchesCount } from '../utils' import { getShowReplaceField, setShowReplaceField } from '../Commands' +import { FindReplaceProps, FindReplaceQuery, FindReplaceToggleButtonProps } from '../types' +import { getFindReplaceToggleButtonIconClass, getUpdatedSearchMatchesCount } from '../utils' const FindReplaceToggleButton = ({ isChecked, diff --git a/src/Common/CodeMirror/Extensions/index.ts b/src/Common/CodeMirror/Extensions/index.ts index 936496d79..d181cb942 100644 --- a/src/Common/CodeMirror/Extensions/index.ts +++ b/src/Common/CodeMirror/Extensions/index.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -export * from './yamlParseLinter' -export * from './readOnlyTooltip' +export * from './DiffMinimap' export * from './findAndReplace' +export * from './readOnlyTooltip' export * from './yamlHighlight' -export * from './DiffMinimap' +export * from './yamlParseLinter' diff --git a/src/Common/CodeMirror/Extensions/readOnlyTooltip.ts b/src/Common/CodeMirror/Extensions/readOnlyTooltip.ts index 1557b708e..85889773a 100644 --- a/src/Common/CodeMirror/Extensions/readOnlyTooltip.ts +++ b/src/Common/CodeMirror/Extensions/readOnlyTooltip.ts @@ -16,8 +16,8 @@ import { EditorView, Extension, showTooltip, StateEffect, StateField, Tooltip, ViewPlugin } from '@uiw/react-codemirror' -import { getReadOnlyElement } from '../utils' import { READ_ONLY_TOOLTIP_TIMEOUT } from '../CodeEditor.constants' +import { getReadOnlyElement } from '../utils' /** Array of keys to be ignored on keypress */ const ignoreKeys = ['ArrowUp', 'ArrowRight', 'ArrowDown', 'ArrowLeft', 'Enter', 'Escape'] diff --git a/src/Common/CodeMirror/Extensions/yamlHighlight.ts b/src/Common/CodeMirror/Extensions/yamlHighlight.ts index dbf5760e5..7f43ee280 100644 --- a/src/Common/CodeMirror/Extensions/yamlHighlight.ts +++ b/src/Common/CodeMirror/Extensions/yamlHighlight.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { Decoration, DecorationSet, EditorState, EditorView, Extension, Range, StateField } from '@uiw/react-codemirror' import { ensureSyntaxTree } from '@codemirror/language' +import { Decoration, DecorationSet, EditorState, EditorView, Extension, Range, StateField } from '@uiw/react-codemirror' const isBool = (value: string) => /^(true|false)$/i.test(value) diff --git a/src/Common/CodeMirror/Extensions/yamlParseLinter.ts b/src/Common/CodeMirror/Extensions/yamlParseLinter.ts index 8ed628c7f..52b5569ad 100644 --- a/src/Common/CodeMirror/Extensions/yamlParseLinter.ts +++ b/src/Common/CodeMirror/Extensions/yamlParseLinter.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import YAML, { YAMLParseError } from 'yaml' -import { EditorView } from '@uiw/react-codemirror' import { Diagnostic } from '@codemirror/lint' +import { EditorView } from '@uiw/react-codemirror' +import YAML, { YAMLParseError } from 'yaml' export const yamlParseLinter = () => diff --git a/src/Common/CodeMirror/index.ts b/src/Common/CodeMirror/index.ts index 35e362121..f3443cfcc 100644 --- a/src/Common/CodeMirror/index.ts +++ b/src/Common/CodeMirror/index.ts @@ -15,4 +15,4 @@ */ export { default as CodeEditor } from './CodeEditor' -export type { CodeEditorProps, CodeEditorHeaderProps, CodeEditorStatusBarProps } from './types' +export type { CodeEditorHeaderProps, CodeEditorProps, CodeEditorStatusBarProps } from './types' diff --git a/src/Common/CodeMirror/types.ts b/src/Common/CodeMirror/types.ts index 7c514ab2b..1ffb86fd1 100644 --- a/src/Common/CodeMirror/types.ts +++ b/src/Common/CodeMirror/types.ts @@ -15,14 +15,14 @@ */ import { Dispatch, FunctionComponent, Key, MutableRefObject, ReactNode, SetStateAction, SVGProps } from 'react' -import { JSONSchema7 } from 'json-schema' -import { EditorView, Extension, ReactCodeMirrorProps } from '@uiw/react-codemirror' import { MergeView } from '@codemirror/merge' import { SearchQuery } from '@codemirror/search' +import { EditorView, Extension, ReactCodeMirrorProps } from '@uiw/react-codemirror' +import { JSONSchema7 } from 'json-schema' import { MODES } from '@Common/Constants' -import { Never } from '@Shared/types' import { AppThemeType } from '@Shared/Providers' +import { Never } from '@Shared/types' // COMPONENT PROPS export interface CodeEditorStatusBarProps { diff --git a/src/Common/CodeMirror/utils.tsx b/src/Common/CodeMirror/utils.tsx index 05a1c06ab..48b222408 100644 --- a/src/Common/CodeMirror/utils.tsx +++ b/src/Common/CodeMirror/utils.tsx @@ -16,21 +16,15 @@ import { render } from 'react-dom' import { renderToString } from 'react-dom/server' -import DOMPurify from 'dompurify' -import * as YAML from 'yaml' -import { Annotation, EditorView, Extension, hoverTooltip, Transaction } from '@uiw/react-codemirror' -import { linter } from '@codemirror/lint' -import { StreamLanguage } from '@codemirror/language' import { json, jsonLanguage, jsonParseLinter } from '@codemirror/lang-json' import { yaml, yamlLanguage } from '@codemirror/lang-yaml' -import { shell } from '@codemirror/legacy-modes/mode/shell' +import { StreamLanguage } from '@codemirror/language' import { dockerFile } from '@codemirror/legacy-modes/mode/dockerfile' +import { shell } from '@codemirror/legacy-modes/mode/shell' +import { linter } from '@codemirror/lint' import { MergeView } from '@codemirror/merge' - -import { ReactComponent as ICCaretDown } from '@Icons/ic-caret-down.svg' - import { SearchQuery } from '@codemirror/search' -import { MODES } from '@Common/Constants' +import { Annotation, EditorView, Extension, hoverTooltip, Transaction } from '@uiw/react-codemirror' import { handleRefresh, jsonCompletion, @@ -38,11 +32,15 @@ import { jsonSchemaLinter, stateExtensions, } from 'codemirror-json-schema' -import { yamlCompletion, yamlSchemaHover, yamlSchemaLinter } from 'codemirror-json-schema/yaml' +import DOMPurify from 'dompurify' +import * as YAML from 'yaml' -import { Icon } from '@Shared/Components' -import { Tooltip } from '@Common/Tooltip' +import { ReactComponent as ICCaretDown } from '@Icons/ic-caret-down.svg' +import { MODES } from '@Common/Constants' import { debounce, noop, YAMLStringify } from '@Common/Helper' +import { Tooltip } from '@Common/Tooltip' +import { Icon } from '@Shared/Components' +import { yamlCompletion, yamlSchemaHover, yamlSchemaLinter } from 'codemirror-json-schema/yaml' import { yamlParseLinter } from './Extensions' import { CodeEditorProps, FindReplaceToggleButtonProps, GetCodeEditorHeightReturnType, HoverTexts } from './types' diff --git a/src/Common/Constants.ts b/src/Common/Constants.ts index ab0248279..db6438898 100644 --- a/src/Common/Constants.ts +++ b/src/Common/Constants.ts @@ -29,6 +29,7 @@ export const DOCUMENTATION = { BLOB_STORAGE: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/getting-started/install/installation-configuration#configuration-of-blob-storage`, GLOBAL_CONFIG_BUILD_INFRA: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/global-configurations/build-infra`, ENTERPRISE_LICENSE: `${DOCUMENTATION_HOME_PAGE}/enterprise-license`, + KUBE_CONFIG: `${DOCUMENTATION_HOME_PAGE}${DOCUMENTATION_VERSION}/usage/resource-browser#running-kubectl-commands-locally`, } export const PATTERNS = { @@ -385,7 +386,6 @@ export const API_STATUS_CODES = { EXPECTATION_FAILED: 417, UNPROCESSABLE_ENTITY: 422, LOCKED: 423, - UNPROCESSABLE_CONTENT: 422, } export enum SERVER_MODE { diff --git a/src/Common/CustomTagSelector/Types.ts b/src/Common/CustomTagSelector/Types.ts index 537bc6d37..70c902a83 100644 --- a/src/Common/CustomTagSelector/Types.ts +++ b/src/Common/CustomTagSelector/Types.ts @@ -15,6 +15,7 @@ */ import { DetailedHTMLProps, MutableRefObject, TextareaHTMLAttributes } from 'react' + import { KEY_VALUE } from '../Constants' import { OptionType } from '../Types' diff --git a/src/Common/CustomTagSelector/index.ts b/src/Common/CustomTagSelector/index.ts index fb4b19f87..d22285ff5 100644 --- a/src/Common/CustomTagSelector/index.ts +++ b/src/Common/CustomTagSelector/index.ts @@ -15,8 +15,8 @@ */ export { default as PropagateTagInfo } from './PropagateTagInfo' +export * from './ResizableTagTextArea' export * from './TagDetails' export * from './TagLabelValueSelector' -export * from './ResizableTagTextArea' -export * from './Types' export { validateTagKeyValue, validateTagValue } from './tags.utils' +export * from './Types' diff --git a/src/Common/DeleteCINodeButton/DeleteCINodeButton.tsx b/src/Common/DeleteCINodeButton/DeleteCINodeButton.tsx index 32f08e63c..e909c83d4 100644 --- a/src/Common/DeleteCINodeButton/DeleteCINodeButton.tsx +++ b/src/Common/DeleteCINodeButton/DeleteCINodeButton.tsx @@ -15,13 +15,15 @@ */ import { useState } from 'react' + import { ERROR_STATUS_CODE } from '@Common/Constants' import { Button, ButtonStyleType, ButtonVariantType, DeleteConfirmationModal, Icon } from '@Shared/Components' import { ComponentSizeType, DeleteComponentsName } from '@Shared/constants' -import { ToastManager, ToastVariantType } from '@Shared/index' -import { deleteWorkflow, savePipeline } from './utils' -import { DeleteCINodeButtonProps } from './types' +import { ToastManager, ToastVariantType } from '@Shared/Services' + import { preventDefault, showError, stopPropagation } from '..' +import { DeleteCINodeButtonProps } from './types' +import { deleteWorkflow, savePipeline } from './utils' export const DeleteCINodeButton = ({ testId, diff --git a/src/Common/DeleteCINodeButton/index.tsx b/src/Common/DeleteCINodeButton/index.tsx index cbad6ab84..47a37f57b 100644 --- a/src/Common/DeleteCINodeButton/index.tsx +++ b/src/Common/DeleteCINodeButton/index.tsx @@ -15,5 +15,5 @@ */ export * from './DeleteCINodeButton' -export * from './utils' export * from './types' +export * from './utils' diff --git a/src/Common/DeleteCINodeButton/utils.tsx b/src/Common/DeleteCINodeButton/utils.tsx index 4b59757bb..678161ddb 100644 --- a/src/Common/DeleteCINodeButton/utils.tsx +++ b/src/Common/DeleteCINodeButton/utils.tsx @@ -15,8 +15,9 @@ */ import { Routes } from '@Shared/constants' -import { AppConfigProps, GetTemplateAPIRouteType } from '@Pages/index' import { getTemplateAPIRoute } from '@Shared/index' +import { AppConfigProps, GetTemplateAPIRouteType } from '@Pages/index' + import { post, trash } from '..' export function savePipeline( diff --git a/src/Common/DraggableWrapper/index.ts b/src/Common/DraggableWrapper/index.ts index 35e938426..4acb391c0 100644 --- a/src/Common/DraggableWrapper/index.ts +++ b/src/Common/DraggableWrapper/index.ts @@ -14,6 +14,6 @@ * limitations under the License. */ -export { default as DraggableWrapper } from './DraggableWrapper' export { default as DraggableButton } from './DraggableButton' +export { default as DraggableWrapper } from './DraggableWrapper' export * from './types' diff --git a/src/Common/EmptyState/GenericFilterEmptyState.tsx b/src/Common/EmptyState/GenericFilterEmptyState.tsx index 6855e53a4..435f27c86 100644 --- a/src/Common/EmptyState/GenericFilterEmptyState.tsx +++ b/src/Common/EmptyState/GenericFilterEmptyState.tsx @@ -17,6 +17,7 @@ import noResult from '@Images/empty-noresult@2x.png' import { Button, ButtonVariantType } from '@Shared/Components' import { ComponentSizeType } from '@Shared/constants' + import GenericEmptyState from './GenericEmptyState' import { GenericFilterEmptyStateProps } from './types' diff --git a/src/Common/ErrorPage.tsx b/src/Common/ErrorPage.tsx index 677ca156c..23cb6d01c 100644 --- a/src/Common/ErrorPage.tsx +++ b/src/Common/ErrorPage.tsx @@ -15,10 +15,11 @@ */ import { useHistory } from 'react-router-dom' -import { ERROR_STATUS_CODE, ERROR_EMPTY_SCREEN, ROUTES } from './Constants' + import GenericEmptyState from './EmptyState/GenericEmptyState' -import { ErrorPageType } from './Types' +import { ERROR_EMPTY_SCREEN, ERROR_STATUS_CODE, ROUTES } from './Constants' import { noop, refresh, reportIssue } from './Helper' +import { ErrorPageType } from './Types' const ErrorPage = ({ code, image, title, subTitle, imageType, redirectURL, reload }: ErrorPageType) => { const { push } = useHistory() diff --git a/src/Common/ErrorScreenManager.tsx b/src/Common/ErrorScreenManager.tsx index 18357d8c4..e434eeecd 100644 --- a/src/Common/ErrorScreenManager.tsx +++ b/src/Common/ErrorScreenManager.tsx @@ -14,12 +14,12 @@ * limitations under the License. */ +import unauthorized from '../Assets/Img/ic-not-authorized.svg' import notFound from '../Assets/Img/ic-not-found.svg' import badRequest from '../Assets/Img/ic-page-not-found.svg' -import unauthorized from '../Assets/Img/ic-not-authorized.svg' -import { ERROR_STATUS_CODE, ERROR_EMPTY_SCREEN } from './Constants' -import Reload from './Reload' +import { ERROR_EMPTY_SCREEN, ERROR_STATUS_CODE } from './Constants' import ErrorPage from './ErrorPage' +import Reload from './Reload' import { ErrorScreenManagerProps, ImageType } from './Types' const ErrorScreenManager = ({ diff --git a/src/Common/ErrorScreenNotAuthorized.tsx b/src/Common/ErrorScreenNotAuthorized.tsx index 3fe356fb4..181502f9d 100644 --- a/src/Common/ErrorScreenNotAuthorized.tsx +++ b/src/Common/ErrorScreenNotAuthorized.tsx @@ -15,8 +15,8 @@ */ import unauthorized from '../Assets/Img/ic-not-authorized.svg' -import { ERROR_EMPTY_SCREEN } from './Constants' import GenericEmptyState from './EmptyState/GenericEmptyState' +import { ERROR_EMPTY_SCREEN } from './Constants' import { ErrorScreenNotAuthorizedProps } from './Types' const ErrorScreenNotAuthorized = ({ subtitle, title }: ErrorScreenNotAuthorizedProps) => ( diff --git a/src/Common/GenericDescription/GenericDescription.tsx b/src/Common/GenericDescription/GenericDescription.tsx index da6b5c62b..422f170ad 100644 --- a/src/Common/GenericDescription/GenericDescription.tsx +++ b/src/Common/GenericDescription/GenericDescription.tsx @@ -14,36 +14,38 @@ * limitations under the License. */ -import { useState, useRef, useEffect } from 'react' -import Tippy from '@tippyjs/react' +import { useEffect, useRef, useState } from 'react' import ReactMde from 'react-mde' -import 'react-mde/lib/styles/css/react-mde-all.css' -import Markdown from '../Markdown/MarkDown' -import { deepEqual, showError } from '..' -import './genericDescription.scss' -import { ReactComponent as Edit } from '../../Assets/Icon/ic-pencil.svg' -import { GenericDescriptionProps, MDEditorSelectedTabType } from './types' -import { - DEFAULT_MARKDOWN_EDITOR_PREVIEW_MESSAGE, - MARKDOWN_EDITOR_COMMANDS, - MARKDOWN_EDITOR_COMMAND_TITLE, - MARKDOWN_EDITOR_COMMAND_ICON_TIPPY_CONTENT, -} from '../Markdown/constant' -import { ButtonWithLoader, ToastManager, ToastVariantType } from '../../Shared' -import { ReactComponent as HeaderIcon } from '../../Assets/Icon/ic-header.svg' +import Tippy from '@tippyjs/react' + import { ReactComponent as BoldIcon } from '../../Assets/Icon/ic-bold.svg' -import { ReactComponent as ItalicIcon } from '../../Assets/Icon/ic-italic.svg' -import { ReactComponent as LinkIcon } from '../../Assets/Icon/ic-link.svg' -import { ReactComponent as StrikethroughIcon } from '../../Assets/Icon/ic-strikethrough.svg' +import { ReactComponent as CheckedListIcon } from '../../Assets/Icon/ic-checked-list.svg' import { ReactComponent as CodeIcon } from '../../Assets/Icon/ic-code.svg' -import { ReactComponent as QuoteIcon } from '../../Assets/Icon/ic-quote.svg' +import { ReactComponent as HeaderIcon } from '../../Assets/Icon/ic-header.svg' import { ReactComponent as ImageIcon } from '../../Assets/Icon/ic-image.svg' +import { ReactComponent as ItalicIcon } from '../../Assets/Icon/ic-italic.svg' +import { ReactComponent as LinkIcon } from '../../Assets/Icon/ic-link.svg' import { ReactComponent as OrderedListIcon } from '../../Assets/Icon/ic-ordered-list.svg' +import { ReactComponent as Edit } from '../../Assets/Icon/ic-pencil.svg' +import { ReactComponent as QuoteIcon } from '../../Assets/Icon/ic-quote.svg' +import { ReactComponent as StrikethroughIcon } from '../../Assets/Icon/ic-strikethrough.svg' import { ReactComponent as UnorderedListIcon } from '../../Assets/Icon/ic-unordered-list.svg' -import { ReactComponent as CheckedListIcon } from '../../Assets/Icon/ic-checked-list.svg' +import { ButtonWithLoader, ToastManager, ToastVariantType } from '../../Shared' +import { + DEFAULT_MARKDOWN_EDITOR_PREVIEW_MESSAGE, + MARKDOWN_EDITOR_COMMAND_ICON_TIPPY_CONTENT, + MARKDOWN_EDITOR_COMMAND_TITLE, + MARKDOWN_EDITOR_COMMANDS, +} from '../Markdown/constant' +import Markdown from '../Markdown/MarkDown' +import { deepEqual, showError } from '..' import { DESCRIPTION_EMPTY_ERROR_MSG, DESCRIPTION_UNSAVED_CHANGES_MSG } from './constant' +import { GenericDescriptionProps, MDEditorSelectedTabType } from './types' import { getParsedUpdatedOnDate } from './utils' +import 'react-mde/lib/styles/css/react-mde-all.css' +import './genericDescription.scss' + const GenericDescription = ({ text, updatedBy, diff --git a/src/Common/GenericDescription/utils.ts b/src/Common/GenericDescription/utils.ts index 2bc77187c..0f0ccd4ee 100644 --- a/src/Common/GenericDescription/utils.ts +++ b/src/Common/GenericDescription/utils.ts @@ -15,6 +15,7 @@ */ import moment from 'moment' + import { DATE_TIME_FORMATS, ZERO_TIME_STRING } from '@Common/Constants' export const getParsedUpdatedOnDate = (updatedOn: string) => { diff --git a/src/Common/Helper.tsx b/src/Common/Helper.tsx index cbd30dcfc..76cd26c9d 100644 --- a/src/Common/Helper.tsx +++ b/src/Common/Helper.tsx @@ -247,10 +247,6 @@ export function useSearchString(): UseSearchString { return queryParams }, [location]) - // const searchParams={} - // for (let [key, value] of queryParams.entries()){ - // searchParams[key]=value - // } const searchParams = Array.from(queryParams.entries()).reduce((agg, curr, idx) => { agg[curr[0]] = curr[1] return agg diff --git a/src/Common/Hooks/UseGetUserRoles/UseGetUserRoles.tsx b/src/Common/Hooks/UseGetUserRoles/UseGetUserRoles.tsx index 098f23b79..fbae9aece 100644 --- a/src/Common/Hooks/UseGetUserRoles/UseGetUserRoles.tsx +++ b/src/Common/Hooks/UseGetUserRoles/UseGetUserRoles.tsx @@ -15,9 +15,10 @@ */ import { useEffect, useState } from 'react' + import { getUserRole } from '../../Common.service' -import { UseGetUserRolesType } from './types' import { showError } from '../../Helper' +import { UseGetUserRolesType } from './types' /** * @description It will return isSuperAdmin and would be set to false by default, might need few optimizations like dep, etc diff --git a/src/Common/Hooks/UseRegisterShortcut/UseRegisterShortcut.tsx b/src/Common/Hooks/UseRegisterShortcut/UseRegisterShortcut.tsx index 6f628ce8f..7bfb8cbcf 100644 --- a/src/Common/Hooks/UseRegisterShortcut/UseRegisterShortcut.tsx +++ b/src/Common/Hooks/UseRegisterShortcut/UseRegisterShortcut.tsx @@ -15,6 +15,7 @@ */ import { useContext } from 'react' + import { UseRegisterShortcutContext } from './UseRegisterShortcutContext' const useRegisterShortcut = () => useContext(UseRegisterShortcutContext) diff --git a/src/Common/Hooks/UseRegisterShortcut/UseRegisterShortcutContext.tsx b/src/Common/Hooks/UseRegisterShortcut/UseRegisterShortcutContext.tsx index 73114a703..70d36f55d 100644 --- a/src/Common/Hooks/UseRegisterShortcut/UseRegisterShortcutContext.tsx +++ b/src/Common/Hooks/UseRegisterShortcut/UseRegisterShortcutContext.tsx @@ -15,6 +15,7 @@ */ import { createContext } from 'react' + import { UseRegisterShortcutContextType } from './types' export const UseRegisterShortcutContext = createContext(null) diff --git a/src/Common/Hooks/UseRegisterShortcut/UseRegisterShortcutProvider.tsx b/src/Common/Hooks/UseRegisterShortcut/UseRegisterShortcutProvider.tsx index d86adc0d2..ff53f1ce7 100644 --- a/src/Common/Hooks/UseRegisterShortcut/UseRegisterShortcutProvider.tsx +++ b/src/Common/Hooks/UseRegisterShortcut/UseRegisterShortcutProvider.tsx @@ -16,8 +16,9 @@ import { useCallback, useEffect, useMemo, useRef } from 'react' import { deepEquals } from '@rjsf/utils' + +import { ShortcutType, UseRegisterShortcutContextType, UseRegisterShortcutProviderType } from './types' import { UseRegisterShortcutContext } from './UseRegisterShortcutContext' -import { UseRegisterShortcutProviderType, ShortcutType, UseRegisterShortcutContextType } from './types' import { preprocessKeys, verifyCallbackStack } from './utils' const IGNORE_TAGS_FALLBACK = ['input', 'textarea', 'select'] diff --git a/src/Common/Hooks/index.ts b/src/Common/Hooks/index.ts index b1bc37adc..fc57ae76b 100644 --- a/src/Common/Hooks/index.ts +++ b/src/Common/Hooks/index.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -export { useGetUserRoles } from './UseGetUserRoles' export { useClickOutside } from './UseClickOutside/UseClickOutside' -export { useWindowSize } from './UseWindowSize/UseWindowSize' -export * from './useUrlFilters' +export { useGetUserRoles } from './UseGetUserRoles' export * from './UseRegisterShortcut' export * from './useStateFilters' +export * from './useUrlFilters' +export { useWindowSize } from './UseWindowSize/UseWindowSize' diff --git a/src/Common/Hooks/useStateFilters/index.ts b/src/Common/Hooks/useStateFilters/index.ts index 105f50b38..22ccb810d 100644 --- a/src/Common/Hooks/useStateFilters/index.ts +++ b/src/Common/Hooks/useStateFilters/index.ts @@ -14,5 +14,5 @@ * limitations under the License. */ -export { default as useStateFilters } from './useStateFilters' export type { UseStateFiltersProps, UseStateFiltersReturnType } from './types' +export { default as useStateFilters } from './useStateFilters' diff --git a/src/Common/Hooks/useStateFilters/useStateFilters.tsx b/src/Common/Hooks/useStateFilters/useStateFilters.tsx index 6950e076b..864e1b3af 100644 --- a/src/Common/Hooks/useStateFilters/useStateFilters.tsx +++ b/src/Common/Hooks/useStateFilters/useStateFilters.tsx @@ -15,9 +15,10 @@ */ import { useState } from 'react' + import { DEFAULT_BASE_PAGE_SIZE, SortingOrder } from '../../Constants' -import { PaginationType, UseStateFiltersProps, UseStateFiltersReturnType } from './types' import { DEFAULT_PAGE_NUMBER } from '../useUrlFilters/constants' +import { PaginationType, UseStateFiltersProps, UseStateFiltersReturnType } from './types' /** * Generic hook for implementing state based pagination, search, sorting. diff --git a/src/Common/Hooks/useUrlFilters/index.ts b/src/Common/Hooks/useUrlFilters/index.ts index a3d3152ba..8e77c1d17 100644 --- a/src/Common/Hooks/useUrlFilters/index.ts +++ b/src/Common/Hooks/useUrlFilters/index.ts @@ -14,5 +14,5 @@ * limitations under the License. */ -export { default as useUrlFilters } from './useUrlFilters' export type { UseUrlFiltersProps, UseUrlFiltersReturnType } from './types' +export { default as useUrlFilters } from './useUrlFilters' diff --git a/src/Common/Hooks/useUrlFilters/useUrlFilters.ts b/src/Common/Hooks/useUrlFilters/useUrlFilters.ts index f2e49f619..85e9acb75 100644 --- a/src/Common/Hooks/useUrlFilters/useUrlFilters.ts +++ b/src/Common/Hooks/useUrlFilters/useUrlFilters.ts @@ -16,7 +16,9 @@ import { useMemo, useRef } from 'react' import { useHistory, useLocation } from 'react-router-dom' + import { getUrlWithSearchParams } from '@Common/Helper' + import { DEFAULT_BASE_PAGE_SIZE, EXCLUDED_FALSY_VALUES, SortingOrder } from '../../Constants' import { DEFAULT_PAGE_NUMBER, URL_FILTER_KEYS } from './constants' import { UpdateSearchParamsOptionsType, UseUrlFiltersProps, UseUrlFiltersReturnType } from './types' diff --git a/src/Common/Markdown/MarkDown.tsx b/src/Common/Markdown/MarkDown.tsx index 11e1983e6..8194b262a 100644 --- a/src/Common/Markdown/MarkDown.tsx +++ b/src/Common/Markdown/MarkDown.tsx @@ -14,10 +14,12 @@ * limitations under the License. */ -import { marked, Tokens } from 'marked' -import DOMPurify from 'dompurify' import { useEffect, useRef } from 'react' +import DOMPurify from 'dompurify' +import { marked, Tokens } from 'marked' + import { MarkDownProps } from './Types' + import './markdown.scss' const renderer = new marked.Renderer() diff --git a/src/Common/Pagination/PageSizeSelector.tsx b/src/Common/Pagination/PageSizeSelector.tsx index 56f267348..4b9108e54 100644 --- a/src/Common/Pagination/PageSizeSelector.tsx +++ b/src/Common/Pagination/PageSizeSelector.tsx @@ -15,8 +15,9 @@ */ import { useRef, useState } from 'react' -import { PageSizeItemsProps, PageSizeOption, PageSizeSelectorProps } from './types' + import { useClickOutside } from '../Hooks' +import { PageSizeItemsProps, PageSizeOption, PageSizeSelectorProps } from './types' import { getDefaultPageValueOptions } from './utils' const PageSizeItems = ({ diff --git a/src/Common/Pagination/Pagination.tsx b/src/Common/Pagination/Pagination.tsx index 7ead022e1..2cf59a30e 100644 --- a/src/Common/Pagination/Pagination.tsx +++ b/src/Common/Pagination/Pagination.tsx @@ -15,9 +15,11 @@ */ import { useEffect, useState } from 'react' + import PageSizeSelector from './PageSizeSelector' import { Page, PageValueItemProps, PaginationProps } from './types' import { createPageArr } from './utils' + import './pagination.scss' const PageValueItem = ({ value, isSelected, selectPage }: PageValueItemProps) => { diff --git a/src/Common/Pagination/utils.tsx b/src/Common/Pagination/utils.tsx index 7ce2d8bbf..08cfe076d 100644 --- a/src/Common/Pagination/utils.tsx +++ b/src/Common/Pagination/utils.tsx @@ -14,8 +14,8 @@ * limitations under the License. */ -import { CreatePageArrType, Page, PageSizeOption } from './types' import { FALLBACK_PAGE_SIZE_OPTIONS, VISIBLE_PAGES_LIMIT } from './constants' +import { CreatePageArrType, Page, PageSizeOption } from './types' /** * Returns an array of pages numbers and whether they are selected, visible or not diff --git a/src/Common/Policy.Types.ts b/src/Common/Policy.Types.ts index c3200e20c..3cb91fa61 100644 --- a/src/Common/Policy.Types.ts +++ b/src/Common/Policy.Types.ts @@ -15,6 +15,7 @@ */ import { PipelineFormType } from '@Pages/Applications' + import { PluginDataStoreType, PluginDetailPayloadType, ResourceKindType } from '../Shared' import { VariableType } from './CIPipeline.Types' import { ServerErrors } from './ServerError' diff --git a/src/Common/RJSF/Form.tsx b/src/Common/RJSF/Form.tsx index 993829c63..c8b650439 100644 --- a/src/Common/RJSF/Form.tsx +++ b/src/Common/RJSF/Form.tsx @@ -18,6 +18,7 @@ import { forwardRef, useMemo } from 'react' import RJSF from '@rjsf/core' import { SCHEMA_07_VALIDATOR } from '@Shared/validations' + import { templates, widgets } from './config' import { FormProps } from './types' import { @@ -26,6 +27,7 @@ import { translateString, updateFormDataFromFormState, } from './utils' + import './rjsfForm.scss' // Need to use this way because the default import was not working as expected diff --git a/src/Common/RJSF/common/FieldRow.tsx b/src/Common/RJSF/common/FieldRow.tsx index f3c366d38..5286413c0 100644 --- a/src/Common/RJSF/common/FieldRow.tsx +++ b/src/Common/RJSF/common/FieldRow.tsx @@ -15,8 +15,9 @@ */ import { Tooltip } from '@Common/Tooltip' -import { FieldRowProps } from './types' + import { DEFAULT_FIELD_TITLE } from '../constants' +import { FieldRowProps } from './types' export const FieldRowWithLabel = ({ showLabel, diff --git a/src/Common/RJSF/index.ts b/src/Common/RJSF/index.ts index 85de6c6c5..9795b97a7 100644 --- a/src/Common/RJSF/index.ts +++ b/src/Common/RJSF/index.ts @@ -14,12 +14,12 @@ * limitations under the License. */ +export { HIDE_SUBMIT_BUTTON_UI_SCHEMA } from './constants' export { RJSFForm } from './Form' export type * from './types' export { + conformPathToPointers, getInferredTypeFromValueType, getRedirectionProps, getSchemaPathToUpdatePathMap, - conformPathToPointers, } from './utils' -export { HIDE_SUBMIT_BUTTON_UI_SCHEMA } from './constants' diff --git a/src/Common/RJSF/templates/ObjectFieldTemplate.tsx b/src/Common/RJSF/templates/ObjectFieldTemplate.tsx index 53aa4aab9..825b18293 100644 --- a/src/Common/RJSF/templates/ObjectFieldTemplate.tsx +++ b/src/Common/RJSF/templates/ObjectFieldTemplate.tsx @@ -14,14 +14,16 @@ * limitations under the License. */ -import { ObjectFieldTemplateProps, canExpand, titleId, deepEquals } from '@rjsf/utils' +import { canExpand, deepEquals, ObjectFieldTemplateProps, titleId } from '@rjsf/utils' import { JSONPath } from 'jsonpath-plus' + import { convertJSONPointerToJSONPath } from '@Common/Helper' + import { FieldRowWithLabel } from '../common/FieldRow' -import { TitleField } from './TitleField' -import { AddButton } from './ButtonTemplates' import { RJSFFormSchema } from '../types' import { parseSchemaHiddenType } from '../utils' +import { AddButton } from './ButtonTemplates' +import { TitleField } from './TitleField' const Field = ({ disabled, diff --git a/src/Common/RJSF/templates/TitleField.tsx b/src/Common/RJSF/templates/TitleField.tsx index b0952f19d..6c6d34c8c 100644 --- a/src/Common/RJSF/templates/TitleField.tsx +++ b/src/Common/RJSF/templates/TitleField.tsx @@ -15,6 +15,7 @@ */ import { TitleFieldProps } from '@rjsf/utils' + import { Tooltip } from '@Common/Tooltip' export const TitleField = ({ diff --git a/src/Common/RJSF/templates/index.ts b/src/Common/RJSF/templates/index.ts index 0b6bba4e4..66d4b1e8f 100644 --- a/src/Common/RJSF/templates/index.ts +++ b/src/Common/RJSF/templates/index.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -export { ArrayFieldTemplate } from './ArrayFieldTemplate' export { ArrayFieldItemTemplate } from './ArrayFieldItemTemplate' +export { ArrayFieldTemplate } from './ArrayFieldTemplate' export { BaseInput as BaseInputTemplate } from './BaseInput' export * from './ButtonTemplates' export { Field as FieldTemplate } from './Field' diff --git a/src/Common/RJSF/utils.tsx b/src/Common/RJSF/utils.tsx index db2f96504..d26670475 100644 --- a/src/Common/RJSF/utils.tsx +++ b/src/Common/RJSF/utils.tsx @@ -14,10 +14,12 @@ * limitations under the License. */ -import { TranslatableString, englishStringTranslator } from '@rjsf/utils' -import { buildObjectFromPath, convertJSONPointerToJSONPath, joinObjects } from '@Common/Helper' -import { JSONPath } from 'jsonpath-plus' +import { englishStringTranslator, TranslatableString } from '@rjsf/utils' import { applyPatch, compare } from 'fast-json-patch' +import { JSONPath } from 'jsonpath-plus' + +import { buildObjectFromPath, convertJSONPointerToJSONPath, joinObjects } from '@Common/Helper' + import { GetFormStateFromFormDataProps, HiddenType, diff --git a/src/Common/RadioGroup.tsx b/src/Common/RadioGroup.tsx index 703ec6b4e..9ee80e4ac 100644 --- a/src/Common/RadioGroup.tsx +++ b/src/Common/RadioGroup.tsx @@ -15,6 +15,7 @@ */ import { createContext, useMemo } from 'react' + import { RadioGroupProps } from './Types' export const RadioGroupContext = createContext({ diff --git a/src/Common/RadioGroup/RadioGroup.tsx b/src/Common/RadioGroup/RadioGroup.tsx index 1f7fb4b55..4e4f01614 100644 --- a/src/Common/RadioGroup/RadioGroup.tsx +++ b/src/Common/RadioGroup/RadioGroup.tsx @@ -15,12 +15,15 @@ */ /* eslint-disable jsx-a11y/label-has-associated-control */ -import React, { useState, useEffect, useMemo } from 'react' +import React, { useEffect, useMemo, useState } from 'react' + import { Tooltip } from '@Common/Tooltip' + import { ConditionalWrap } from '../Helper' -import './radioGroup.scss' import { RadioGroupComposition, RadioGroupInterface, RadioInterface } from '../Types' +import './radioGroup.scss' + const RadioContext = React.createContext(null) function useRadioContext() { diff --git a/src/Common/RadioGroupItem.tsx b/src/Common/RadioGroupItem.tsx index e0f0ed1ad..71fe40183 100644 --- a/src/Common/RadioGroupItem.tsx +++ b/src/Common/RadioGroupItem.tsx @@ -14,8 +14,8 @@ * limitations under the License. */ -import { RadioGroupItemProps } from './Types' import { RadioGroupContext } from './RadioGroup' +import { RadioGroupItemProps } from './Types' const RadioGroupItem = ({ value, disabled, children, dataTestId }: RadioGroupItemProps) => ( diff --git a/src/Common/SearchBar/SearchBar.component.tsx b/src/Common/SearchBar/SearchBar.component.tsx index 6d54f5a27..7c48a03a7 100644 --- a/src/Common/SearchBar/SearchBar.component.tsx +++ b/src/Common/SearchBar/SearchBar.component.tsx @@ -14,16 +14,19 @@ * limitations under the License. */ -import { ChangeEvent, useCallback, useRef, useState, KeyboardEvent, useEffect } from 'react' -import { ComponentSizeType } from '@Shared/constants' -import { ReactComponent as Search } from '@Icons/ic-search.svg' +import { ChangeEvent, KeyboardEvent, useCallback, useEffect, useRef, useState } from 'react' + import { ReactComponent as ICCross } from '@Icons/ic-cross.svg' +import { ReactComponent as Search } from '@Icons/ic-search.svg' import { Button, ButtonStyleType, ButtonVariantType } from '@Shared/Components' -import { SearchBarProps } from './types' -import './searchBar.scss' +import { ComponentSizeType } from '@Shared/constants' + import { debounce } from '../Helper' +import { SearchBarProps } from './types' import { getSearchBarHeightFromSize } from './utils' +import './searchBar.scss' + /** * Generic search input component with support for enter based and debounced search * Note: The component is uncontrolled diff --git a/src/Common/SearchBar/utils.ts b/src/Common/SearchBar/utils.ts index b294c1256..895502e98 100644 --- a/src/Common/SearchBar/utils.ts +++ b/src/Common/SearchBar/utils.ts @@ -15,6 +15,7 @@ */ import { ComponentSizeType } from '@Shared/constants' + import { SearchBarProps } from './types' export const getSearchBarHeightFromSize = (size: SearchBarProps['size']): string => { diff --git a/src/Common/SegmentedBarChart/SegmentedBarChart.tsx b/src/Common/SegmentedBarChart/SegmentedBarChart.tsx index eb7401c23..33d64f26d 100644 --- a/src/Common/SegmentedBarChart/SegmentedBarChart.tsx +++ b/src/Common/SegmentedBarChart/SegmentedBarChart.tsx @@ -16,8 +16,10 @@ import React from 'react' import { motion } from 'framer-motion' -import { SegmentedBarChartProps, Entity } from './types' + import { FALLBACK_ENTITY } from './constants' +import { Entity, SegmentedBarChartProps } from './types' + import './styles.scss' const SegmentedBarChart: React.FC = ({ diff --git a/src/Common/SegmentedControl/Segment.tsx b/src/Common/SegmentedControl/Segment.tsx index 89de26cfe..19f28853b 100644 --- a/src/Common/SegmentedControl/Segment.tsx +++ b/src/Common/SegmentedControl/Segment.tsx @@ -1,10 +1,12 @@ import { ReactElement } from 'react' + +import { Tooltip } from '@Common/Tooltip' import { Icon } from '@Shared/Components' import { ComponentSizeType } from '@Shared/constants' -import { Tooltip } from '@Common/Tooltip' -import { SegmentProps, SegmentType } from './types' -import { COMPONENT_SIZE_TO_ICON_CLASS_MAP, COMPONENT_SIZE_TO_SEGMENT_CLASS_MAP } from './constants' + import { ConditionalWrap } from '../Helper' +import { COMPONENT_SIZE_TO_ICON_CLASS_MAP, COMPONENT_SIZE_TO_SEGMENT_CLASS_MAP } from './constants' +import { SegmentProps, SegmentType } from './types' const wrapWithTooltip = (tooltipProps: SegmentType['tooltipProps']) => (children: ReactElement) => ( diff --git a/src/Common/SegmentedControl/SegmentedControl.component.tsx b/src/Common/SegmentedControl/SegmentedControl.component.tsx index 145d8d2e3..92af6cf7f 100644 --- a/src/Common/SegmentedControl/SegmentedControl.component.tsx +++ b/src/Common/SegmentedControl/SegmentedControl.component.tsx @@ -1,8 +1,11 @@ import { useEffect, useRef, useState } from 'react' + import { ComponentSizeType } from '@Shared/constants' + +import Segment from './Segment' import { SegmentedControlProps, SegmentType } from './types' + import './segmentedControl.scss' -import Segment from './Segment' const SegmentedControl = ({ segments, diff --git a/src/Common/SegmentedControl/constants.ts b/src/Common/SegmentedControl/constants.ts index c7606dafd..47c104eaf 100644 --- a/src/Common/SegmentedControl/constants.ts +++ b/src/Common/SegmentedControl/constants.ts @@ -1,4 +1,5 @@ import { ComponentSizeType } from '@Shared/constants' + import { SegmentedControlProps } from './types' export const COMPONENT_SIZE_TO_SEGMENT_CLASS_MAP: Record = { diff --git a/src/Common/SegmentedControl/types.ts b/src/Common/SegmentedControl/types.ts index 0fda54886..32ce5c8b4 100644 --- a/src/Common/SegmentedControl/types.ts +++ b/src/Common/SegmentedControl/types.ts @@ -1,7 +1,8 @@ +import { RefObject } from 'react' + import { TooltipProps } from '@Common/Tooltip' import { IconsProps, SelectPickerOptionType } from '@Shared/Components' import { ComponentSizeType } from '@Shared/constants' -import { RefObject } from 'react' type SegmentTooltipProps = Omit< TooltipProps, diff --git a/src/Common/SortableTableHeaderCell/SortableTableHeaderCell.tsx b/src/Common/SortableTableHeaderCell/SortableTableHeaderCell.tsx index e5c85ef36..621aca797 100644 --- a/src/Common/SortableTableHeaderCell/SortableTableHeaderCell.tsx +++ b/src/Common/SortableTableHeaderCell/SortableTableHeaderCell.tsx @@ -14,13 +14,16 @@ * limitations under the License. */ -import { Tooltip } from '@Common/Tooltip' import Draggable, { DraggableProps } from 'react-draggable' + import { ReactComponent as SortIcon } from '@Icons/ic-arrow-up-down.svg' import { ReactComponent as SortArrowDown } from '@Icons/ic-sort-arrow-down.svg' +import { Tooltip } from '@Common/Tooltip' + import { SortingOrder } from '../Constants' import { noop } from '../Helper' import { SortableTableHeaderCellProps } from './types' + import './sortableTableHeaderCell.scss' /** diff --git a/src/Common/SortableTableHeaderCell/index.ts b/src/Common/SortableTableHeaderCell/index.ts index 807ff93b2..5631ef7ef 100644 --- a/src/Common/SortableTableHeaderCell/index.ts +++ b/src/Common/SortableTableHeaderCell/index.ts @@ -15,5 +15,5 @@ */ export { default as SortableTableHeaderCell } from './SortableTableHeaderCell' -export { default as useResizableTableConfig } from './useResizableTableConfig' export type { SortableTableHeaderCellProps } from './types' +export { default as useResizableTableConfig } from './useResizableTableConfig' diff --git a/src/Common/SortableTableHeaderCell/useResizableTableConfig.tsx b/src/Common/SortableTableHeaderCell/useResizableTableConfig.tsx index 2576407fb..2e3e2e0c4 100644 --- a/src/Common/SortableTableHeaderCell/useResizableTableConfig.tsx +++ b/src/Common/SortableTableHeaderCell/useResizableTableConfig.tsx @@ -15,8 +15,9 @@ */ import { useEffect, useState } from 'react' -import { UseResizableTableConfigProps } from './types' + import { DEFAULT_MAXIMUM_HEADER_WIDTH, DEFAULT_MINIMUM_HEADER_WIDTH } from './constants' +import { UseResizableTableConfigProps } from './types' const useResizableTableConfig = ({ headersConfig }: UseResizableTableConfigProps) => { const [headerDimensionsConfig, setHeaderDimensionsConfig] = useState< diff --git a/src/Common/Tooltip/ShortcutKeyComboTooltipContent.tsx b/src/Common/Tooltip/ShortcutKeyComboTooltipContent.tsx index 4aa24eaad..52cfa74d9 100644 --- a/src/Common/Tooltip/ShortcutKeyComboTooltipContent.tsx +++ b/src/Common/Tooltip/ShortcutKeyComboTooltipContent.tsx @@ -15,6 +15,7 @@ */ import { KEYBOARD_KEYS_MAP } from '@Common/Hooks/UseRegisterShortcut/types' + import { TooltipProps } from './types' const ShortcutKeyComboTooltipContent = ({ text, combo }: TooltipProps['shortcutKeyCombo']) => ( diff --git a/src/Common/Tooltip/Tooltip.tsx b/src/Common/Tooltip/Tooltip.tsx index 9b4e354a4..668342f04 100644 --- a/src/Common/Tooltip/Tooltip.tsx +++ b/src/Common/Tooltip/Tooltip.tsx @@ -14,12 +14,14 @@ * limitations under the License. */ -import { useState, cloneElement } from 'react' +import { cloneElement, useState } from 'react' import TippyJS from '@tippyjs/react' -import { TooltipProps } from './types' + +import { SUB_PIXEL_ERROR } from './constants' import ShortcutKeyComboTooltipContent from './ShortcutKeyComboTooltipContent' +import { TooltipProps } from './types' + import './styles.scss' -import { SUB_PIXEL_ERROR } from './constants' const Tooltip = ({ shortcutKeyCombo, diff --git a/src/Common/Tooltip/index.ts b/src/Common/Tooltip/index.ts index d0df41462..465f794fa 100644 --- a/src/Common/Tooltip/index.ts +++ b/src/Common/Tooltip/index.ts @@ -14,6 +14,6 @@ * limitations under the License. */ -export { default as Tooltip } from './Tooltip' export { TOOLTIP_CONTENTS } from './constants' +export { default as Tooltip } from './Tooltip' export type { TooltipProps } from './types' diff --git a/src/Common/Tooltip/types.ts b/src/Common/Tooltip/types.ts index ac71507f0..a71ec06ee 100644 --- a/src/Common/Tooltip/types.ts +++ b/src/Common/Tooltip/types.ts @@ -14,9 +14,10 @@ * limitations under the License. */ -import { SupportedKeyboardKeysType } from '@Common/Hooks/UseRegisterShortcut/types' import { TippyProps } from '@tippyjs/react' +import { SupportedKeyboardKeysType } from '@Common/Hooks/UseRegisterShortcut/types' + type BaseTooltipProps = | { /** diff --git a/src/Common/index.ts b/src/Common/index.ts index 3ab3f6353..a1aadbe5a 100644 --- a/src/Common/index.ts +++ b/src/Common/index.ts @@ -14,57 +14,57 @@ * limitations under the License. */ +export * from './AddCDButton' +export * from './API' +export { BreadCrumb, useBreadcrumb } from './BreadCrumb/BreadCrumb' +export { default as BreadcrumbStore, BreadcrumbText } from './BreadCrumb/BreadcrumbStore' +export { default as ChartVersionAndTypeSelector } from './ChartVersionAndTypeSelector' +export * from './Checkbox' +export * from './CIPipeline.Types' +export { ClipboardButton } from './ClipboardButton/ClipboardButton' +export * from './CodeEditor/types' +export * from './Common.service' export * from './Constants' -export * from './ServerError' -export * from './Types' -export { default as Reload } from './Reload' +export * from './CustomTagSelector' +export { default as DebouncedSearch } from './DebouncedSearch/DebouncedSearch' +export * from './DeleteCINodeButton' +export { default as DevtronCopyright } from './DevtronCopyright' +export * from './DevtronProgressing' +export * from './Dialogs' +export * from './DraggableWrapper' +export * from './Drawer/Drawer' +export { default as GenericEmptyState } from './EmptyState/GenericEmptyState' +export { default as GenericFilterEmptyState } from './EmptyState/GenericFilterEmptyState' export { default as ErrorScreenManager } from './ErrorScreenManager' export { default as ErrorScreenNotAuthorized } from './ErrorScreenNotAuthorized' +export * from './GenericDescription' +export { default as Grid } from './Grid/Grid' export * from './Helper' -export * from './Progressing' -export * from './Drawer/Drawer' +export * from './Hooks' +export * from './ImageTags' +export * from './ImageTags.Types' +export { default as InfoColourBar } from './InfoColorBar/InfoColourbar' +export * from './Markdown' export * from './Modals/Modal' export * from './Modals/VisibleModal' export * from './Modals/VisibleModal2' -export { BreadCrumb, useBreadcrumb } from './BreadCrumb/BreadCrumb' -export { default as BreadcrumbStore, BreadcrumbText } from './BreadCrumb/BreadcrumbStore' +export * from './MultiSelectCustomization' +export * from './Pagination' +export * from './Policy.Types' +export { default as PopupMenu } from './PopupMenu' +export * from './Progressing' export { default as RadioGroup } from './RadioGroup' +export { default as StyledRadioGroup } from './RadioGroup/RadioGroup' export { default as RadioGroupItem } from './RadioGroupItem' -export { default as PopupMenu } from './PopupMenu' -export * from './TippyCustomized' -export * from './CustomTagSelector' -export * from './Dialogs' -export * from './MultiSelectCustomization' -export { default as InfoColourBar } from './InfoColorBar/InfoColourbar' -export * from './Common.service' -export * from './Checkbox' -export { default as GenericEmptyState } from './EmptyState/GenericEmptyState' -export { default as GenericFilterEmptyState } from './EmptyState/GenericFilterEmptyState' +export { default as Reload } from './Reload' +export * from './RJSF' export * from './SearchBar' +export * from './SegmentedBarChart' +export * from './SegmentedControl' +export { default as Select } from './Select/Select' +export * from './ServerError' export * from './SortableTableHeaderCell' +export * from './TippyCustomized' export { default as Toggle } from './Toggle/Toggle' -export { default as StyledRadioGroup } from './RadioGroup/RadioGroup' -export * from './CIPipeline.Types' -export * from './Policy.Types' -export * from './ImageTags' -export * from './ImageTags.Types' -export { default as DebouncedSearch } from './DebouncedSearch/DebouncedSearch' -export { default as Grid } from './Grid/Grid' -export { default as Select } from './Select/Select' -export { ClipboardButton } from './ClipboardButton/ClipboardButton' -export * from './Hooks' -export * from './RJSF' -export * from './DevtronProgressing' -export { default as ChartVersionAndTypeSelector } from './ChartVersionAndTypeSelector' -export * from './AddCDButton' -export * from './DraggableWrapper' -export * from './Pagination' -export * from './Markdown' -export * from './GenericDescription' -export * from './SegmentedBarChart' -export * from './CodeEditor/types' export * from './Tooltip' -export * from './SegmentedControl' -export * from './API' -export * from './DeleteCINodeButton' -export { default as DevtronCopyright } from './DevtronCopyright' +export * from './Types' diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/ConfigMapSecret/utils.ts b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/ConfigMapSecret/utils.ts index 396386b03..565f176d0 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/ConfigMapSecret/utils.ts +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/ConfigMapSecret/utils.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { CMSecretExternalType } from '@Shared/index' +import { CMSecretExternalType } from '@Shared/Services' export const hasHashiOrAWS = (externalType: CMSecretExternalType): boolean => externalType === CMSecretExternalType.AWSSecretsManager || diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/DTApplicationMetricsFormField.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/DTApplicationMetricsFormField.tsx index fd0229942..4ca82f852 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/DTApplicationMetricsFormField.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/DTApplicationMetricsFormField.tsx @@ -14,13 +14,14 @@ * limitations under the License. */ -import { Progressing } from '@Common/Progressing' +import { ReactComponent as ICInfoFilledOverride } from '@Icons/ic-info-filled-override.svg' import { Checkbox } from '@Common/Checkbox' -import { CHECKBOX_VALUE } from '@Common/Types' -import { Tooltip } from '@Common/Tooltip' import { DOCUMENTATION } from '@Common/Constants' -import { ReactComponent as ICInfoFilledOverride } from '@Icons/ic-info-filled-override.svg' +import { Progressing } from '@Common/Progressing' +import { Tooltip } from '@Common/Tooltip' +import { CHECKBOX_VALUE } from '@Common/Types' import { InfoIconTippy, InvalidYAMLTippyWrapper } from '@Shared/Components' + import { DTApplicationMetricsFormFieldProps } from './types' const DTApplicationMetricsFormField = ({ diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/GUIView/index.ts b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/GUIView/index.ts index 0f3fedfe5..0d809ef21 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/GUIView/index.ts +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/GUIView/index.ts @@ -14,5 +14,5 @@ * limitations under the License. */ -export { ViewError as GUIViewError } from './utils' export type { ViewErrorType as GUIViewErrorType } from './types' +export { ViewError as GUIViewError } from './utils' diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/index.ts b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/index.ts index 395c5690a..d9be6cee2 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/index.ts +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/index.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -export * from './types' -export * from './service' -export { default as DTApplicationMetricsFormField } from './DTApplicationMetricsFormField' export { GET_RESOLVED_DEPLOYMENT_TEMPLATE_EMPTY_RESPONSE } from './constants' +export { default as DTApplicationMetricsFormField } from './DTApplicationMetricsFormField' export * from './GUIView' +export * from './service' +export * from './types' diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/service.ts b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/service.ts index 25e09f3e3..9648d4239 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/service.ts +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/service.ts @@ -15,10 +15,13 @@ */ import YAML from 'yaml' -import { showError, YAMLStringify } from '@Common/Helper' + +import { getIsRequestAborted, post } from '@Common/API' import { ROUTES } from '@Common/Constants' +import { showError, YAMLStringify } from '@Common/Helper' import { ResponseType } from '@Common/Types' -import { getIsRequestAborted, post } from '@Common/API' + +import { GET_RESOLVED_DEPLOYMENT_TEMPLATE_EMPTY_RESPONSE } from './constants' import { GetDeploymentManifestPayloadType, GetDeploymentManifestProps, @@ -28,7 +31,6 @@ import { ResolvedDeploymentTemplateDTO, ValuesAndManifestFlagDTO, } from './types' -import { GET_RESOLVED_DEPLOYMENT_TEMPLATE_EMPTY_RESPONSE } from './constants' export const getDeploymentManifest = async ( params: GetDeploymentManifestProps, diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/types.ts b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/types.ts index 29db314f8..e1798c8b1 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/types.ts +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/types.ts @@ -14,8 +14,9 @@ * limitations under the License. */ -import { DraftMetadataDTO, TemplateListType } from '@Shared/Services' import { ServerErrors } from '@Common/ServerError' +import { DraftMetadataDTO, TemplateListType } from '@Shared/Services' + import { OverrideMergeStrategyType } from '../types' export type DeploymentChartOptionkind = 'base' | 'env' | 'chartVersion' | 'deployment' diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/index.ts b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/index.ts index a91ab2bb1..6c26a0d1e 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/index.ts +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/index.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -export * from './DeploymentTemplate' -export * from './types' +export * from './ConfigMapSecret' export * from './constants' +export * from './DeploymentTemplate' export { default as OverrideStrategyTippyContent } from './OverrideStrategyTippyContent' +export * from './types' export { getDeploymentStageTitle } from './utils' -export * from './ConfigMapSecret' diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/types.ts b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/types.ts index 1026a7d19..d2c3b5c2f 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/types.ts +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/types.ts @@ -14,9 +14,10 @@ * limitations under the License. */ -import { ResourceKindType } from '@Shared/types' import { ReactNode, SyntheticEvent } from 'react' +import { ResourceKindType } from '@Shared/types' + export enum ConfigHeaderTabType { VALUES = 'values', INHERITED = 'inherited', diff --git a/src/Pages/Applications/DevtronApps/Details/CDPipeline/index.ts b/src/Pages/Applications/DevtronApps/Details/CDPipeline/index.ts index b2e7ac316..7395e78b2 100644 --- a/src/Pages/Applications/DevtronApps/Details/CDPipeline/index.ts +++ b/src/Pages/Applications/DevtronApps/Details/CDPipeline/index.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -export * from './types' +export { STAGE_MAP } from './constants' export * from './services' +export * from './types' export { getAPIOptionsWithTriggerTimeout } from './utils' -export { STAGE_MAP } from './constants' export { isImageActiveOnEnvironment } from './utils' diff --git a/src/Pages/Applications/DevtronApps/Details/CDPipeline/services.ts b/src/Pages/Applications/DevtronApps/Details/CDPipeline/services.ts index 0892fd1c0..3dcbaa952 100644 --- a/src/Pages/Applications/DevtronApps/Details/CDPipeline/services.ts +++ b/src/Pages/Applications/DevtronApps/Details/CDPipeline/services.ts @@ -15,15 +15,17 @@ */ import { MutableRefObject } from 'react' + import { getIsRequestAborted, post } from '@Common/API' import { ROUTES } from '@Common/Constants' import { getUrlWithSearchParams, showError } from '@Common/Helper' -import { UploadFileDTO, UploadFileProps } from '@Shared/types' import { DeploymentNodeType } from '@Common/Types' import { DeploymentWithConfigType } from '@Shared/constants' +import { UploadFileDTO, UploadFileProps } from '@Shared/types' + +import { STAGE_MAP } from './constants' import { TriggerCDNodeServiceProps, TriggerCDPipelinePayloadType } from './types' import { getAPIOptionsWithTriggerTimeout } from './utils' -import { STAGE_MAP } from './constants' export const uploadCDPipelineFile = async ({ file, @@ -69,6 +71,7 @@ export const triggerCDNode = ({ wfrId, runtimeParamsPayload, abortControllerRef, + skipIfHibernated, isRollbackTrigger = false, }: TriggerCDNodeServiceProps) => { const areRuntimeParamsConfigured = @@ -81,6 +84,7 @@ export const triggerCDNode = ({ cdWorkflowType: STAGE_MAP[stageType], isRollbackDeployment: isRollbackTrigger, ...(areRuntimeParamsConfigured && runtimeParamsPayload), + ...(skipIfHibernated ? { skipIfHibernated: true } : {}), } if (deploymentWithConfig) { diff --git a/src/Pages/Applications/DevtronApps/Details/CDPipeline/types.tsx b/src/Pages/Applications/DevtronApps/Details/CDPipeline/types.tsx index 03b7a625d..cf167f860 100644 --- a/src/Pages/Applications/DevtronApps/Details/CDPipeline/types.tsx +++ b/src/Pages/Applications/DevtronApps/Details/CDPipeline/types.tsx @@ -16,9 +16,9 @@ import { BuildStageType, FormType } from '@Common/CIPipeline.Types' import { APIOptions, DeploymentAppTypes, DeploymentNodeType } from '@Common/Types' -import { STAGE_MAP } from '@Pages/index' import { DeploymentStrategy } from '@Shared/Components' import { EnvListMinDTO, RuntimeParamsTriggerPayloadType } from '@Shared/types' +import { STAGE_MAP } from '@Pages/index' interface ConfigSecretType { label: string @@ -128,6 +128,7 @@ export interface TriggerCDNodeServiceProps extends Pick { + TriggerCDNodeServiceProps, + 'pipelineId' | 'appId' | 'ciArtifactId' | 'runtimeParamsPayload' | 'deploymentWithConfig' + >, + Partial> { cdWorkflowType: (typeof STAGE_MAP)[keyof typeof STAGE_MAP] isRollbackDeployment: boolean wfrIdForDeploymentWithSpecificTrigger?: number diff --git a/src/Pages/Applications/DevtronApps/Details/CIPipeline/components/index.ts b/src/Pages/Applications/DevtronApps/Details/CIPipeline/components/index.ts index 67f1a3a0e..b4bc9a140 100644 --- a/src/Pages/Applications/DevtronApps/Details/CIPipeline/components/index.ts +++ b/src/Pages/Applications/DevtronApps/Details/CIPipeline/components/index.ts @@ -14,5 +14,5 @@ * limitations under the License. */ -export * from './SystemVariableIcon' export * from './FileConfigTippy' +export * from './SystemVariableIcon' diff --git a/src/Pages/Applications/DevtronApps/Details/CIPipeline/index.ts b/src/Pages/Applications/DevtronApps/Details/CIPipeline/index.ts index f66a60d54..b18430363 100644 --- a/src/Pages/Applications/DevtronApps/Details/CIPipeline/index.ts +++ b/src/Pages/Applications/DevtronApps/Details/CIPipeline/index.ts @@ -14,6 +14,6 @@ * limitations under the License. */ -export * from './services' -export * from './constants' export * from './components' +export * from './constants' +export * from './services' diff --git a/src/Pages/Applications/DevtronApps/Details/CIPipeline/services.ts b/src/Pages/Applications/DevtronApps/Details/CIPipeline/services.ts index 6ff0d9e0c..35f21017d 100644 --- a/src/Pages/Applications/DevtronApps/Details/CIPipeline/services.ts +++ b/src/Pages/Applications/DevtronApps/Details/CIPipeline/services.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import { ROUTES } from '@Common/Constants' import { getIsRequestAborted, post } from '@Common/API' +import { ROUTES } from '@Common/Constants' import { getUrlWithSearchParams, showError } from '@Common/Helper' -import { UploadFileDTO, UploadFileProps } from '@Shared/types' import { APIOptions } from '@Common/Types' +import { UploadFileDTO, UploadFileProps } from '@Shared/types' export const uploadCIPipelineFile = async ({ file, diff --git a/src/Pages/GlobalConfigurations/Authorization/index.ts b/src/Pages/GlobalConfigurations/Authorization/index.ts index 292bae079..acd06e859 100644 --- a/src/Pages/GlobalConfigurations/Authorization/index.ts +++ b/src/Pages/GlobalConfigurations/Authorization/index.ts @@ -15,8 +15,8 @@ */ export * from './constants' -export type { UserListFilterParams, UserRoleGroup, UserGroupDTO, UserGroupType } from './types' -export { UserTypeToFetchType } from './types' -export * from './shared' export * from './service' +export * from './shared' +export type { UserGroupDTO, UserGroupType, UserListFilterParams, UserRoleGroup } from './types' +export { UserTypeToFetchType } from './types' export { getUserAndApiTokenOption } from './utils' diff --git a/src/Pages/GlobalConfigurations/Authorization/service.ts b/src/Pages/GlobalConfigurations/Authorization/service.ts index 4a447f6aa..748bcdc93 100644 --- a/src/Pages/GlobalConfigurations/Authorization/service.ts +++ b/src/Pages/GlobalConfigurations/Authorization/service.ts @@ -14,12 +14,14 @@ * limitations under the License. */ +import { GroupBase } from 'react-select' + import { get, ResponseType, ROUTES } from '@Common/index' import { SelectPickerOptionType } from '@Shared/Components' import { API_TOKEN_PREFIX } from '@Shared/constants' import { stringComparatorBySortOrder } from '@Shared/Helpers' import { DefaultUserKey } from '@Shared/types' -import { GroupBase } from 'react-select' + import { UserMinType } from './types' import { getUserAndApiTokenOption } from './utils' diff --git a/src/Pages/GlobalConfigurations/Authorization/shared/components/UserRoleGroupsTable/UserRoleGroupTableRow.tsx b/src/Pages/GlobalConfigurations/Authorization/shared/components/UserRoleGroupsTable/UserRoleGroupTableRow.tsx index 854c428d9..e5cc40e71 100644 --- a/src/Pages/GlobalConfigurations/Authorization/shared/components/UserRoleGroupsTable/UserRoleGroupTableRow.tsx +++ b/src/Pages/GlobalConfigurations/Authorization/shared/components/UserRoleGroupsTable/UserRoleGroupTableRow.tsx @@ -18,11 +18,12 @@ import { Link } from 'react-router-dom' import { URLS } from '@Common/Constants' import { getRandomColor } from '@Common/Helper' -import { ComponentSizeType } from '@Shared/constants' import { Button, ButtonStyleType, ButtonVariantType } from '@Shared/Components' -import { UserRoleGroupsTableProps } from './types' +import { ComponentSizeType } from '@Shared/constants' + import { ReactComponent as TrashIcon } from '../../../../../../Assets/Icon/ic-delete-interactive.svg' import { UserRoleGroup } from '../../../types' +import { UserRoleGroupsTableProps } from './types' const UserRoleGroupTableRow = ({ id, diff --git a/src/Pages/GlobalConfigurations/Authorization/shared/components/UserRoleGroupsTable/UserRoleGroupsTable.component.tsx b/src/Pages/GlobalConfigurations/Authorization/shared/components/UserRoleGroupsTable/UserRoleGroupsTable.component.tsx index d2b66b3a3..551751ce5 100644 --- a/src/Pages/GlobalConfigurations/Authorization/shared/components/UserRoleGroupsTable/UserRoleGroupsTable.component.tsx +++ b/src/Pages/GlobalConfigurations/Authorization/shared/components/UserRoleGroupsTable/UserRoleGroupsTable.component.tsx @@ -16,6 +16,7 @@ import { UserRoleGroupsTableProps } from './types' import UserRoleGroupTableRow from './UserRoleGroupTableRow' + import './userRoleGroupsTable.scss' const getModifierClassName = (showStatus, showDelete) => { diff --git a/src/Pages/GlobalConfigurations/Authorization/shared/components/UserRoleGroupsTable/types.ts b/src/Pages/GlobalConfigurations/Authorization/shared/components/UserRoleGroupsTable/types.ts index d83f23a3a..8ed85d363 100644 --- a/src/Pages/GlobalConfigurations/Authorization/shared/components/UserRoleGroupsTable/types.ts +++ b/src/Pages/GlobalConfigurations/Authorization/shared/components/UserRoleGroupsTable/types.ts @@ -15,6 +15,7 @@ */ import { FC } from 'react' + import { UserRoleGroup } from '../../../types' export type UserRoleGroupsTableProps = { diff --git a/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraConfigForm.tsx b/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraConfigForm.tsx index f9f081cb6..7a360f5f2 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraConfigForm.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraConfigForm.tsx @@ -15,10 +15,11 @@ */ import { FunctionComponent } from 'react' + import { Progressing } from '../../../Common' +import BuildInfraProfileDescriptionField from './BuildInfraDescriptionField' import BuildInfraFormAction from './BuildInfraFormAction' import BuildInfraFormItem from './BuildInfraFormItem' -import BuildInfraProfileDescriptionField from './BuildInfraDescriptionField' import BuildInfraProfileNameField from './BuildInfraProfileNameField' import { BUILD_INFRA_DEFAULT_PLATFORM_NAME, BUILD_INFRA_FORM_FIELDS, BUILD_INFRA_TEXT } from './constants' import { diff --git a/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.tsx b/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.tsx index fc908c3b3..fbad17971 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.tsx @@ -15,9 +15,11 @@ */ import { FormEvent, FunctionComponent } from 'react' + import { Textarea } from '@Shared/Components' -import { BuildInfraMetaConfigTypes, BuildInfraProfileMetaFieldProps } from './types' + import { BUILD_INFRA_TEXT } from './constants' +import { BuildInfraMetaConfigTypes, BuildInfraProfileMetaFieldProps } from './types' const BuildInfraProfileDescriptionField: FunctionComponent = ({ handleProfileInputChange, diff --git a/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormAction.tsx b/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormAction.tsx index ee29e96ca..8f6e89e7d 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormAction.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormAction.tsx @@ -15,13 +15,16 @@ */ import { FormEvent, FunctionComponent, useMemo } from 'react' + +import { ReactComponent as ErrorIcon } from '@Icons/ic-warning.svg' import { SelectPicker } from '@Shared/Components/SelectPicker' import { ComponentSizeType } from '@Shared/constants' import { isNullOrUndefined } from '@Shared/Helpers' -import { ReactComponent as ErrorIcon } from '@Icons/ic-warning.svg' -import { BuildInfraFormActionProps } from './types' + import { OptionType } from '../../../Common' import { BUILD_INFRA_DEFAULT_PLATFORM_NAME, BUILD_INFRA_INPUT_CONSTRAINTS } from './constants' +import { BuildInfraFormActionProps } from './types' + import './BuildInfraUnitSelect.scss' /** diff --git a/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormItem.tsx b/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormItem.tsx index 864df8804..550ad0084 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormItem.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraFormItem.tsx @@ -15,6 +15,7 @@ */ import { FunctionComponent } from 'react' + import { BuildInfraFormItemProps } from './types' const BuildInfraFormItem: FunctionComponent = ({ diff --git a/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.tsx b/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.tsx index 0ed36c3e1..2d94fbb5b 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.tsx @@ -15,9 +15,11 @@ */ import { FormEvent, FunctionComponent } from 'react' + import { CustomInput } from '@Shared/Components' -import { BuildInfraMetaConfigTypes, BuildInfraProfileMetaFieldProps } from './types' + import { BUILD_INFRA_TEXT } from './constants' +import { BuildInfraMetaConfigTypes, BuildInfraProfileMetaFieldProps } from './types' const BuildInfraProfileNameField: FunctionComponent = ({ onChange, diff --git a/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraUtilityContext.tsx b/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraUtilityContext.tsx index dc89f9517..d10303359 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraUtilityContext.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/BuildInfraUtilityContext.tsx @@ -15,6 +15,7 @@ */ import { createContext, useContext } from 'react' + import { BuildInfraUtilityContextType } from '@Pages/index' export const BuildInfraUtilityContext = createContext(null) diff --git a/src/Pages/GlobalConfigurations/BuildInfra/Descriptor.tsx b/src/Pages/GlobalConfigurations/BuildInfra/Descriptor.tsx index f405a10ae..344e94761 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/Descriptor.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/Descriptor.tsx @@ -15,9 +15,10 @@ */ import { InfoIconTippy } from '@Shared/Components/InfoIconTippy' -import { BuildInfraDescriptorProps } from './types' + import { BreadCrumb, DOCUMENTATION } from '../../../Common' import { BUILD_INFRA_TEXT } from './constants' +import { BuildInfraDescriptorProps } from './types' const Descriptor = ({ additionalContainerClasses, diff --git a/src/Pages/GlobalConfigurations/BuildInfra/Footer.tsx b/src/Pages/GlobalConfigurations/BuildInfra/Footer.tsx index 2231b5600..a4638daf2 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/Footer.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/Footer.tsx @@ -16,9 +16,10 @@ import { FunctionComponent, ReactElement } from 'react' import Tippy from '@tippyjs/react' + +import { ConditionalWrap, Progressing } from '../../../Common' import { BUILD_INFRA_TEST_IDS, BUILD_INFRA_TEXT } from './constants' import { FooterProps } from './types' -import { ConditionalWrap, Progressing } from '../../../Common' const Footer: FunctionComponent = ({ disabled, handleCancel, editProfile, loading }) => { const disableMessage = disabled diff --git a/src/Pages/GlobalConfigurations/BuildInfra/UseBuildInfraForm.tsx b/src/Pages/GlobalConfigurations/BuildInfra/UseBuildInfraForm.tsx index 6d56d060e..0d768d063 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/UseBuildInfraForm.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/UseBuildInfraForm.tsx @@ -15,7 +15,17 @@ */ import { FormEvent, useEffect, useState } from 'react' + import { logExceptionToSentry, showError, useAsync } from '@Common/Helper' +import { getConfigMapSecretFormInitialValues } from '@Shared/Components' +import { getUniqueId } from '@Shared/Helpers' +import { CM_SECRET_STATE, ToastManager, ToastVariantType } from '@Shared/Services' +import { + validateDescription, + validateLabelKey, + validateName, + validateRequiredPositiveInteger, +} from '@Shared/validations' import { ACTION_TO_PERSISTED_VALUE_MAP, BUILD_INFRA_DEFAULT_PLATFORM_NAME, @@ -49,19 +59,7 @@ import { UseBuildInfraFormProps, UseBuildInfraFormResponseType, } from '@Pages/index' -import { - validateDescription, - validateLabelKey, - validateName, - validateRequiredPositiveInteger, -} from '@Shared/validations' -import { - CM_SECRET_STATE, - getConfigMapSecretFormInitialValues, - getUniqueId, - ToastManager, - ToastVariantType, -} from '@Shared/index' + import { validateLabelValue, validateNodeSelector, diff --git a/src/Pages/GlobalConfigurations/BuildInfra/constants.tsx b/src/Pages/GlobalConfigurations/BuildInfra/constants.tsx index 449508172..f2c82d192 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/constants.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/constants.tsx @@ -16,27 +16,28 @@ import { ReactComponent as ICCpu } from '@Icons/ic-cpu.svg' import { ReactComponent as ICMemory } from '@Icons/ic-memory.svg' -import { ReactComponent as ICTimer } from '@Icons/ic-timer.svg' import { ReactComponent as ICSprayCan } from '@Icons/ic-spray-can.svg' import { ReactComponent as ICTag } from '@Icons/ic-tag.svg' +import { ReactComponent as ICTimer } from '@Icons/ic-timer.svg' import { UseBreadcrumbProps } from '@Common/BreadCrumb/Types' -import { CMSecretComponentType } from '@Shared/index' +import { CMSecretComponentType } from '@Shared/Services' + import { + BuildInfraAPIVersionType, BuildInfraConfigTypes, BuildInfraFormFieldType, + BuildInfraInheritActionsOnSubValues, BuildInfraLocators, BuildInfraMetaConfigTypes, - ProfileInputErrorType, - HandleProfileInputChangeType, BuildInfraProfileAdditionalErrorKeysType, - BuildInfraAPIVersionType, - TargetPlatformErrorFields, - ValidateRequestLimitType, - RequestLimitConfigType, BuildInfraToleranceEffectType, BuildInfraToleranceOperatorType, - BuildInfraInheritActionsOnSubValues, + HandleProfileInputChangeType, InfraConfigWithSubValues, + ProfileInputErrorType, + RequestLimitConfigType, + TargetPlatformErrorFields, + ValidateRequestLimitType, } from './types' export const BUILD_INFRA_INPUT_CONSTRAINTS = { diff --git a/src/Pages/GlobalConfigurations/BuildInfra/index.ts b/src/Pages/GlobalConfigurations/BuildInfra/index.ts index 863464df3..31cfa768a 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/index.ts +++ b/src/Pages/GlobalConfigurations/BuildInfra/index.ts @@ -14,15 +14,15 @@ * limitations under the License. */ -export { default as BuildInfraDescriptor } from './Descriptor' -export { default as BuildInfraFooter } from './Footer' export { default as BuildInfraConfigForm } from './BuildInfraConfigForm' -export { default as BuildInfraProfileNameField } from './BuildInfraProfileNameField' export { default as BuildInfraProfileDescriptionField } from './BuildInfraDescriptionField' export { default as BuildInfraFormAction } from './BuildInfraFormAction' -export { default as useBuildInfraForm } from './UseBuildInfraForm' +export { default as BuildInfraProfileNameField } from './BuildInfraProfileNameField' export * from './BuildInfraUtilityContext' +export * from './constants' +export { default as BuildInfraDescriptor } from './Descriptor' +export { default as BuildInfraFooter } from './Footer' export * from './services' -export * from './utils' export * from './types' -export * from './constants' +export { default as useBuildInfraForm } from './UseBuildInfraForm' +export * from './utils' diff --git a/src/Pages/GlobalConfigurations/BuildInfra/services.tsx b/src/Pages/GlobalConfigurations/BuildInfra/services.tsx index 2d529899a..49c661a43 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/services.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/services.tsx @@ -20,6 +20,7 @@ import { getBuildInfraProfilePayload, getTransformedBuildInfraProfileResponse, } from '@Pages/index' + import { get, getUrlWithSearchParams, post, put, showError } from '../../../Common' import { BuildInfraProfileDTO, diff --git a/src/Pages/GlobalConfigurations/BuildInfra/types.tsx b/src/Pages/GlobalConfigurations/BuildInfra/types.tsx index 3922eaae6..f0abdba0a 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/types.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/types.tsx @@ -15,7 +15,10 @@ */ import { FormEvent, FunctionComponent, ReactNode, SyntheticEvent } from 'react' + import { BUILD_INFRA_INHERIT_ACTIONS, useBuildInfraForm } from '@Pages/index' + +import { ServerErrors } from '../../../Common' import { Breadcrumb } from '../../../Common/BreadCrumb/Types' import { CMSecretComponentType, @@ -26,7 +29,6 @@ import { useForm, ValidationResponseType, } from '../../../Shared' -import { ServerErrors } from '../../../Common' /** * Unique actions that will be dispatched and, diff --git a/src/Pages/GlobalConfigurations/BuildInfra/utils.tsx b/src/Pages/GlobalConfigurations/BuildInfra/utils.tsx index 2e1972275..7b9bdfb72 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/utils.tsx +++ b/src/Pages/GlobalConfigurations/BuildInfra/utils.tsx @@ -26,7 +26,21 @@ import { INFRA_CONFIG_TO_CM_SECRET_COMPONENT_TYPE_MAP, InfraConfigWithSubValues, } from '@Pages/index' + import { ROUTES } from '../../../Common' +import { + CMSecretConfigData, + CMSecretPayloadType, + getConfigMapSecretFormInitialValues, + getConfigMapSecretPayload, + getUniqueId, +} from '../../../Shared' +import { + BUILD_INFRA_DEFAULT_PLATFORM_NAME, + BUILD_INFRA_LATEST_API_VERSION, + INFRA_CONFIG_NOT_SUPPORTED_BY_BUILD_X, + USE_BUILD_X_DRIVER_FALLBACK, +} from './constants' import { BuildInfraConfigInfoType, BuildInfraConfigTypes, @@ -50,19 +64,6 @@ import { GetBaseProfileObjectParamsType, GetPlatformConfigurationsWithDefaultValuesParamsType, } from './types' -import { - BUILD_INFRA_DEFAULT_PLATFORM_NAME, - BUILD_INFRA_LATEST_API_VERSION, - INFRA_CONFIG_NOT_SUPPORTED_BY_BUILD_X, - USE_BUILD_X_DRIVER_FALLBACK, -} from './constants' -import { - CMSecretConfigData, - CMSecretPayloadType, - getConfigMapSecretFormInitialValues, - getConfigMapSecretPayload, - getUniqueId, -} from '../../../Shared' export const parsePlatformConfigIntoValue = ( configuration: BuildInfraConfigValuesType, diff --git a/src/Pages/GlobalConfigurations/BuildInfra/validations.ts b/src/Pages/GlobalConfigurations/BuildInfra/validations.ts index 59982e15b..4e786ce56 100644 --- a/src/Pages/GlobalConfigurations/BuildInfra/validations.ts +++ b/src/Pages/GlobalConfigurations/BuildInfra/validations.ts @@ -15,6 +15,13 @@ */ import { PATTERNS } from '@Common/Constants' +import { + requiredField, + validateLabelKey, + validateRequiredPositiveNumber, + validateStringLength, + ValidationResponseType, +} from '@Shared/validations' import { BUILD_INFRA_INPUT_CONSTRAINTS, BUILD_INFRA_TEXT, @@ -24,13 +31,6 @@ import { ValidateRequestLimitResponseType, ValidateRequestLimitType, } from '@Pages/index' -import { - requiredField, - validateLabelKey, - validateRequiredPositiveNumber, - validateStringLength, - ValidationResponseType, -} from '@Shared/validations' /** * @description A valid platform name should not be empty and be less than 128 characters. Plus profile can not have duplicate platform names diff --git a/src/Pages/GlobalConfigurations/DeploymentCharts/utils.ts b/src/Pages/GlobalConfigurations/DeploymentCharts/utils.ts index 5cb88a759..5ad08e08f 100644 --- a/src/Pages/GlobalConfigurations/DeploymentCharts/utils.ts +++ b/src/Pages/GlobalConfigurations/DeploymentCharts/utils.ts @@ -15,13 +15,14 @@ */ import { versionComparatorBySortOrder } from '@Shared/Helpers' + +import fallbackGuiSchema from './basicViewSchema.json' import { DeploymentChartListDTO, DeploymentChartType, DeploymentChartVersionsType, DEVTRON_DEPLOYMENT_CHART_NAMES, } from './types' -import fallbackGuiSchema from './basicViewSchema.json' export const convertDeploymentChartListToChartType = (data: DeploymentChartListDTO): DeploymentChartType[] => { if (!data) { diff --git a/src/Pages/GlobalConfigurations/index.ts b/src/Pages/GlobalConfigurations/index.ts index 69c70dff6..9bc2dba52 100644 --- a/src/Pages/GlobalConfigurations/index.ts +++ b/src/Pages/GlobalConfigurations/index.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -export * from './BuildInfra' export * from './Authorization' -export * from './ScopedVariables' +export * from './BuildInfra' export * from './DeploymentCharts' +export * from './ScopedVariables' diff --git a/src/Pages/ResourceBrowser/ForceDeleteOption.tsx b/src/Pages/ResourceBrowser/ForceDeleteOption.tsx index fe5cfca7d..af3c84d7c 100644 --- a/src/Pages/ResourceBrowser/ForceDeleteOption.tsx +++ b/src/Pages/ResourceBrowser/ForceDeleteOption.tsx @@ -16,6 +16,7 @@ import { Checkbox } from '@Common/Checkbox' import { CHECKBOX_VALUE } from '@Common/Types' + import { AdditionalConfirmationModalOptionsProps } from './types' const ForceDeleteOption = ({ diff --git a/src/Pages/ResourceBrowser/Helper.tsx b/src/Pages/ResourceBrowser/Helper.tsx index 62d53d8de..8e5b79876 100644 --- a/src/Pages/ResourceBrowser/Helper.tsx +++ b/src/Pages/ResourceBrowser/Helper.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { AggregationKeys, NodeType, Nodes } from '../../Shared' +import { AggregationKeys, Nodes, NodeType } from '../../Shared' import { ALL_NAMESPACE_OPTION } from './constants' import { ApiResourceGroupType, diff --git a/src/Pages/ResourceBrowser/NodeDrainOptions.tsx b/src/Pages/ResourceBrowser/NodeDrainOptions.tsx index 7067e86a8..5cf954526 100644 --- a/src/Pages/ResourceBrowser/NodeDrainOptions.tsx +++ b/src/Pages/ResourceBrowser/NodeDrainOptions.tsx @@ -14,11 +14,13 @@ * limitations under the License. */ +import { ChangeEvent, FocusEvent } from 'react' + +import { ReactComponent as ICTimer } from '@Icons/ic-timer.svg' import { Checkbox } from '@Common/Checkbox' import { Tooltip } from '@Common/Tooltip' import { CHECKBOX_VALUE } from '@Common/Types' -import { ReactComponent as ICTimer } from '@Icons/ic-timer.svg' -import { ChangeEvent, FocusEvent } from 'react' + import { DRAIN_NODE_MODAL_MESSAGING, NODE_DRAIN_OPTIONS_CHECKBOX_CONFIG } from './constants' import { AdditionalConfirmationModalOptionsProps, NodeDrainRequest } from './types' diff --git a/src/Pages/ResourceBrowser/ResourceBrowser.Types.ts b/src/Pages/ResourceBrowser/ResourceBrowser.Types.ts index 5d401e3b0..237bb62a8 100644 --- a/src/Pages/ResourceBrowser/ResourceBrowser.Types.ts +++ b/src/Pages/ResourceBrowser/ResourceBrowser.Types.ts @@ -14,9 +14,10 @@ * limitations under the License. */ -import { NodeType, Nodes } from '@Shared/types' import { RefObject } from 'react' +import { Nodes, NodeType } from '@Shared/types' + export interface GVKType { Group: string Version: string diff --git a/src/Pages/ResourceBrowser/constants.tsx b/src/Pages/ResourceBrowser/constants.tsx index a5b3007c1..263605a5d 100644 --- a/src/Pages/ResourceBrowser/constants.tsx +++ b/src/Pages/ResourceBrowser/constants.tsx @@ -14,10 +14,11 @@ * limitations under the License. */ -import { SelectPickerOptionType } from '@Shared/Components' -import { ReactComponent as ICMediumPlay } from '@Icons/ic-medium-play.svg' -import { ReactComponent as ICMediumPause } from '@Icons/ic-medium-pause.svg' import { ReactComponent as ICCleanBrush } from '@Icons/ic-medium-clean-brush.svg' +import { ReactComponent as ICMediumPause } from '@Icons/ic-medium-pause.svg' +import { ReactComponent as ICMediumPlay } from '@Icons/ic-medium-play.svg' +import { SelectPickerOptionType } from '@Shared/Components' + import { NodeDrainRequest } from './types' export const ALL_NAMESPACE_OPTION: Readonly, 'value' | 'label'>> = { diff --git a/src/Pages/ResourceBrowser/index.ts b/src/Pages/ResourceBrowser/index.ts index 3ad3f2938..186fbf9e8 100644 --- a/src/Pages/ResourceBrowser/index.ts +++ b/src/Pages/ResourceBrowser/index.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -export * from './ResourceBrowser.Types' -export * from './Helper' export * from './constants' -export * from './types' -export * from './service' -export { default as NodeDrainOptions } from './NodeDrainOptions' export { default as ForceDeleteOption } from './ForceDeleteOption' +export * from './Helper' +export { default as NodeDrainOptions } from './NodeDrainOptions' +export * from './ResourceBrowser.Types' +export * from './service' +export * from './types' diff --git a/src/Pages/ResourceBrowser/service.ts b/src/Pages/ResourceBrowser/service.ts index 148f7462b..886ac3f33 100644 --- a/src/Pages/ResourceBrowser/service.ts +++ b/src/Pages/ResourceBrowser/service.ts @@ -17,6 +17,7 @@ import { get, post, put, trash } from '@Common/API' import { ROUTES } from '@Common/Constants' import { APIOptions, ResponseType } from '@Common/Types' + import { CreateResourceDTO, CreateResourcePayload, diff --git a/src/Pages/ResourceBrowser/types.ts b/src/Pages/ResourceBrowser/types.ts index 935665f2f..ed8dda683 100644 --- a/src/Pages/ResourceBrowser/types.ts +++ b/src/Pages/ResourceBrowser/types.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { Dispatch, SetStateAction, ReactElement } from 'react' +import { Dispatch, ReactElement, SetStateAction } from 'react' + import { NodeActionRequest } from './ResourceBrowser.Types' export enum ClusterFiltersType { diff --git a/src/Pages/index.ts b/src/Pages/index.ts index cc9412b58..62727b0bd 100644 --- a/src/Pages/index.ts +++ b/src/Pages/index.ts @@ -14,6 +14,6 @@ * limitations under the License. */ +export * from './Applications' export * from './GlobalConfigurations' export * from './ResourceBrowser' -export * from './Applications' diff --git a/src/Shared/API/APIQueuing.ts b/src/Shared/API/APIQueuing.ts index 7ad8b458c..3830e694a 100644 --- a/src/Shared/API/APIQueuing.ts +++ b/src/Shared/API/APIQueuing.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { PromiseAllStatusType, ApiQueuingWithBatchResponseItem, BatchConfigType } from '../types' +import { ApiQueuingWithBatchResponseItem, BatchConfigType, PromiseAllStatusType } from '../types' const eachCall = (batchConfig, functionCalls, resolve, reject, shouldRejectOnError) => { const callIndex = batchConfig.lastIndex diff --git a/src/Shared/Analytics/analytics.ts b/src/Shared/Analytics/analytics.ts index b01a121f6..468fd8c86 100644 --- a/src/Shared/Analytics/analytics.ts +++ b/src/Shared/Analytics/analytics.ts @@ -1,5 +1,6 @@ import { get } from '@Common/API' import { ROUTES } from '@Common/Constants' + import { ServerAnalyticsEventType } from './types' export const handleSendAnalyticsEventToServer = async ( diff --git a/src/Shared/Components/APIResponseHandler/types.tsx b/src/Shared/Components/APIResponseHandler/types.tsx index 48062a754..aa9a188ba 100644 --- a/src/Shared/Components/APIResponseHandler/types.tsx +++ b/src/Shared/Components/APIResponseHandler/types.tsx @@ -15,6 +15,7 @@ */ import { ReactNode } from 'react' + import { ErrorScreenManagerProps, GenericEmptyStateType, diff --git a/src/Shared/Components/ActionMenu/ActionMenu.component.tsx b/src/Shared/Components/ActionMenu/ActionMenu.component.tsx index 2155004ae..79e4f97b8 100644 --- a/src/Shared/Components/ActionMenu/ActionMenu.component.tsx +++ b/src/Shared/Components/ActionMenu/ActionMenu.component.tsx @@ -1,6 +1,8 @@ import PopupMenu from '@Common/PopupMenu' -import { ActionMenuProps } from './types' + import ActionMenuOption from './ActionMenuOption' +import { ActionMenuProps } from './types' + import './actionMenu.scss' const ActionMenu = ({ options, disableDescriptionEllipsis, children, onClick }: ActionMenuProps) => ( diff --git a/src/Shared/Components/ActionMenu/ActionMenuOption.tsx b/src/Shared/Components/ActionMenu/ActionMenuOption.tsx index 6ec8019e7..3d313888a 100644 --- a/src/Shared/Components/ActionMenu/ActionMenuOption.tsx +++ b/src/Shared/Components/ActionMenu/ActionMenuOption.tsx @@ -1,6 +1,7 @@ import { Tooltip } from '@Common/Tooltip' -import { ActionMenuOptionProps } from './types' + import { getTooltipProps } from '../SelectPicker/common' +import { ActionMenuOptionProps } from './types' const ActionMenuOption = ({ option, onClick, disableDescriptionEllipsis }: ActionMenuOptionProps) => { const iconBaseClass = 'dc__no-shrink icon-dim-16 flex dc__fill-available-space' diff --git a/src/Shared/Components/ActionMenu/types.ts b/src/Shared/Components/ActionMenu/types.ts index 877fda463..45f74e5b4 100644 --- a/src/Shared/Components/ActionMenu/types.ts +++ b/src/Shared/Components/ActionMenu/types.ts @@ -1,5 +1,6 @@ import { ReactElement } from 'react' import { GroupBase, OptionsOrGroups } from 'react-select' + import { SelectPickerOptionType, SelectPickerProps } from '../SelectPicker' type ActionMenuOptionType = SelectPickerOptionType & { diff --git a/src/Shared/Components/AnimatedDeployButton/AnimatedDeployButton.tsx b/src/Shared/Components/AnimatedDeployButton/AnimatedDeployButton.tsx index 28ede4e1b..f8dea6c50 100644 --- a/src/Shared/Components/AnimatedDeployButton/AnimatedDeployButton.tsx +++ b/src/Shared/Components/AnimatedDeployButton/AnimatedDeployButton.tsx @@ -14,15 +14,18 @@ * limitations under the License. */ +import { SyntheticEvent, useEffect, useRef, useState } from 'react' import { motion } from 'framer-motion' + import { ReactComponent as ICDeploy } from '@Icons/ic-nav-rocket.svg' -import { ComponentSizeType } from '@Shared/constants' -import { SyntheticEvent, useEffect, useRef, useState } from 'react' import DeployAudio from '@Sounds/DeployAudio.mp3' +import { ComponentSizeType } from '@Shared/constants' + import { Button } from '../Button' -import './animatedDeployButton.scss' import { AnimatedDeployButtonProps } from './types' +import './animatedDeployButton.scss' + const AnimatedDeployButton = ({ isVirtualEnvironment, onButtonClick }: AnimatedDeployButtonProps) => { const audioRef = useRef(null) const timeoutRef = useRef>(null) diff --git a/src/Shared/Components/AnimatedTimer/AnimatedTimer.component.tsx b/src/Shared/Components/AnimatedTimer/AnimatedTimer.component.tsx new file mode 100644 index 000000000..cb1f83fd8 --- /dev/null +++ b/src/Shared/Components/AnimatedTimer/AnimatedTimer.component.tsx @@ -0,0 +1,68 @@ +import { useEffect } from 'react' +import { animate, motion, useMotionValue, useTransform } from 'framer-motion' + +import { Tooltip } from '@Common/Tooltip' + +import { CX, CY, END_ANGLE, RADIUS, START_ANGLE } from './constants' +import { AnimatedTimerProps } from './types' + +const polarToCartesian = (cx: number, cy: number, r: number, angleInDegrees: number) => { + const angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180.0 + return { + x: cx + r * Math.cos(angleInRadians), + y: cy + r * Math.sin(angleInRadians), + } +} + +const describeArcPath = (cx: number, cy: number, r: number, endAngle: number) => { + const startAngle = 0 + const largeArcFlag = endAngle - startAngle <= 180 ? '0' : '1' + const start = polarToCartesian(cx, cy, r, endAngle) + const end = polarToCartesian(cx, cy, r, startAngle) + + return ` + M ${cx} ${cy} + L ${start.x} ${start.y} + A ${r} ${r} 0 ${largeArcFlag} 0 ${end.x} ${end.y} + Z + ` +} + +const AnimatedTimer = ({ duration, onComplete, size = 24, tooltipContent }: AnimatedTimerProps) => { + const angle = useMotionValue(START_ANGLE) + const d = useTransform(angle, (currentAngle) => describeArcPath(CX, CY, RADIUS, currentAngle)) + useEffect(() => { + const controls = animate(angle, END_ANGLE, { + duration, + ease: 'easeInOut', + onComplete, + }) + return controls.stop + }, [duration]) + + return ( + +
+ + + + + +
+
+ ) +} + +export default AnimatedTimer diff --git a/src/Shared/Components/AnimatedTimer/constants.ts b/src/Shared/Components/AnimatedTimer/constants.ts new file mode 100644 index 000000000..72f5801b2 --- /dev/null +++ b/src/Shared/Components/AnimatedTimer/constants.ts @@ -0,0 +1,5 @@ +export const CX = 12 +export const CY = 12 +export const RADIUS = 6 +export const START_ANGLE = 0 +export const END_ANGLE = 360 diff --git a/src/Shared/Components/AnimatedTimer/index.ts b/src/Shared/Components/AnimatedTimer/index.ts new file mode 100644 index 000000000..c3e571198 --- /dev/null +++ b/src/Shared/Components/AnimatedTimer/index.ts @@ -0,0 +1 @@ +export { default as AnimatedTimer } from './AnimatedTimer.component' diff --git a/src/Shared/Components/AnimatedTimer/types.ts b/src/Shared/Components/AnimatedTimer/types.ts new file mode 100644 index 000000000..00dbbf69f --- /dev/null +++ b/src/Shared/Components/AnimatedTimer/types.ts @@ -0,0 +1,17 @@ +import { animate } from 'framer-motion' + +import { TooltipProps } from '@Common/Tooltip' +import { IconBaseSizeType } from '@Shared/index' + +export interface AnimatedTimerProps extends Pick[2], 'onComplete'> { + /** + * The time in seconds for the timer to animate. + */ + duration: number + onComplete?: () => void + /** + * @default 24 + */ + size?: IconBaseSizeType + tooltipContent?: TooltipProps['content'] +} diff --git a/src/Shared/Components/AnnouncementBanner/AnnouncementBanner.tsx b/src/Shared/Components/AnnouncementBanner/AnnouncementBanner.tsx index 286bb2bc3..131c4670e 100644 --- a/src/Shared/Components/AnnouncementBanner/AnnouncementBanner.tsx +++ b/src/Shared/Components/AnnouncementBanner/AnnouncementBanner.tsx @@ -16,10 +16,11 @@ import { useState } from 'react' import DOMPurify from 'dompurify' -import { InfoColourBar } from '../../../Common' -import { ReactComponent as MegaphoneIcon } from '../../../Assets/Icon/ic-megaphone.svg' + import { ReactComponent as Close } from '../../../Assets/Icon/ic-close.svg' -import { setActionWithExpiry, getDateInMilliseconds } from '../Header/utils' +import { ReactComponent as MegaphoneIcon } from '../../../Assets/Icon/ic-megaphone.svg' +import { InfoColourBar } from '../../../Common' +import { getDateInMilliseconds, setActionWithExpiry } from '../Header/utils' interface AnnouncementBannerType { parentClassName?: string diff --git a/src/Shared/Components/ArtifactInfoModal/ArtifactInfoModal.component.tsx b/src/Shared/Components/ArtifactInfoModal/ArtifactInfoModal.component.tsx index 005ed89f5..cbdda4a98 100644 --- a/src/Shared/Components/ArtifactInfoModal/ArtifactInfoModal.component.tsx +++ b/src/Shared/Components/ArtifactInfoModal/ArtifactInfoModal.component.tsx @@ -14,11 +14,11 @@ * limitations under the License. */ +import { ReactComponent as ICArrowDown } from '../../../Assets/Icon/ic-arrow-down.svg' +import { ReactComponent as ICClose } from '../../../Assets/Icon/ic-close.svg' import { Drawer, GenericEmptyState, useAsync } from '../../../Common' import { getArtifactInfo, getCITriggerInfo } from '../../Services/app.service' import { APIResponseHandler } from '../APIResponseHandler' -import { ReactComponent as ICClose } from '../../../Assets/Icon/ic-close.svg' -import { ReactComponent as ICArrowDown } from '../../../Assets/Icon/ic-arrow-down.svg' import { Artifacts } from '../CICDHistory' import MaterialHistory from '../MaterialHistory/MaterialHistory.component' import { ArtifactInfoModalProps } from './types' diff --git a/src/Shared/Components/Backdrop/Backdrop.tsx b/src/Shared/Components/Backdrop/Backdrop.tsx index 0e19e4846..d8c460276 100644 --- a/src/Shared/Components/Backdrop/Backdrop.tsx +++ b/src/Shared/Components/Backdrop/Backdrop.tsx @@ -17,9 +17,11 @@ import { useEffect } from 'react' import { createPortal } from 'react-dom' import { motion } from 'framer-motion' + import { useRegisterShortcut } from '@Common/Hooks' -import { preventBodyScroll, preventOutsideFocus } from '@Shared/Helpers' import { DEVTRON_BASE_MAIN_ID } from '@Shared/constants' +import { preventBodyScroll, preventOutsideFocus } from '@Shared/Helpers' + import { BackdropProps } from './types' const Backdrop = ({ children, onEscape }: BackdropProps) => { diff --git a/src/Shared/Components/BulkOperations/BulkOperations.component.tsx b/src/Shared/Components/BulkOperations/BulkOperations.component.tsx index bfc650e50..9c6c1e02c 100644 --- a/src/Shared/Components/BulkOperations/BulkOperations.component.tsx +++ b/src/Shared/Components/BulkOperations/BulkOperations.component.tsx @@ -14,18 +14,22 @@ * limitations under the License. */ -import { Prompt } from 'react-router-dom' import { useEffect, useRef, useState } from 'react' +import { Prompt } from 'react-router-dom' +import { noop } from 'rxjs' + import { getIsRequestAborted } from '@Common/API' import { showError } from '@Common/Helper' import { ServerErrors } from '@Common/ServerError' import { ApiQueuingWithBatch } from '@Shared/API' import { usePrompt } from '@Shared/Hooks' -import { ConfirmationModal, ToastManager, ToastVariantType } from '@Shared/index' -import { noop } from 'rxjs' -import { OperationResultStore } from './OperationResultStore' +import { ToastManager, ToastVariantType } from '@Shared/Services' + +import { ConfirmationModal } from '../ConfirmationModal' import BulkOperationsResultModal from './BulkOperationsResultModal' -import { OperationResultStoreType, BulkOperationModalProps } from './types' +import { OperationResultStore } from './OperationResultStore' +import { BulkOperationModalProps, OperationResultStoreType } from './types' + import './styles.scss' const BulkOperations = ({ diff --git a/src/Shared/Components/BulkOperations/BulkOperationsResultModal.tsx b/src/Shared/Components/BulkOperations/BulkOperationsResultModal.tsx index 6f4f42bd5..04b7247a5 100644 --- a/src/Shared/Components/BulkOperations/BulkOperationsResultModal.tsx +++ b/src/Shared/Components/BulkOperations/BulkOperationsResultModal.tsx @@ -15,6 +15,11 @@ */ import { useCallback, useEffect } from 'react' + +import { ReactComponent as ICAborted } from '@Icons/ic-aborted.svg' +import { ReactComponent as ICRestart } from '@Icons/ic-arrows-clockwise.svg' +import { ReactComponent as ICClose } from '@Icons/ic-close.svg' +import { ReactComponent as ICInfo } from '@Icons/ic-info-outline.svg' import { SortingOrder } from '@Common/Constants' import { stopPropagation } from '@Common/Helper' import { useStateFilters } from '@Common/Hooks' @@ -24,14 +29,11 @@ import { SortableTableHeaderCell } from '@Common/SortableTableHeaderCell' import { Tooltip } from '@Common/Tooltip' import { ComponentSizeType } from '@Shared/constants' import { stringComparatorBySortOrder } from '@Shared/Helpers' -import { ReactComponent as ICInfo } from '@Icons/ic-info-outline.svg' -import { ReactComponent as ICClose } from '@Icons/ic-close.svg' -import { ReactComponent as ICAborted } from '@Icons/ic-aborted.svg' -import { ReactComponent as ICRestart } from '@Icons/ic-arrows-clockwise.svg' -import { RESULTS_MODAL_HEADERS, SORT_KEY_TO_NORMALIZER, SORT_ORDER_TO_KEY } from './constants' -import { BulkOperationResultType, BulkOperationsResultModalProps } from './types' + import { Button, ButtonComponentType, ButtonStyleType, ButtonVariantType } from '../Button' import { getProgressingStateForStatus } from '../Security' +import { RESULTS_MODAL_HEADERS, SORT_KEY_TO_NORMALIZER, SORT_ORDER_TO_KEY } from './constants' +import { BulkOperationResultType, BulkOperationsResultModalProps } from './types' const BulkOperationsResultModal = ({ apiCallInProgress, diff --git a/src/Shared/Components/BulkOperations/index.ts b/src/Shared/Components/BulkOperations/index.ts index 9e0f2360f..4897a8926 100644 --- a/src/Shared/Components/BulkOperations/index.ts +++ b/src/Shared/Components/BulkOperations/index.ts @@ -15,4 +15,4 @@ */ export { default as BulkOperations } from './BulkOperations.component' -export type { BulkOperationModalProps, BulkOperation } from './types' +export type { BulkOperation, BulkOperationModalProps } from './types' diff --git a/src/Shared/Components/BulkOperations/types.ts b/src/Shared/Components/BulkOperations/types.ts index e37f79911..b3a1d5bc7 100644 --- a/src/Shared/Components/BulkOperations/types.ts +++ b/src/Shared/Components/BulkOperations/types.ts @@ -14,11 +14,13 @@ * limitations under the License. */ -import { SegmentedBarChartProps } from '@Common/SegmentedBarChart' import { ReactNode } from 'react' + import { APIOptions, DrawerProps } from '@Common/index' -import { getProgressingStateForStatus } from '../Security' +import { SegmentedBarChartProps } from '@Common/SegmentedBarChart' + import { ConfirmationModalProps } from '../ConfirmationModal/types' +import { getProgressingStateForStatus } from '../Security' interface BulkOperationAdditionalKeysType { label: string diff --git a/src/Shared/Components/BulkSelection/BulkSelection.tsx b/src/Shared/Components/BulkSelection/BulkSelection.tsx index 288928fb3..866b89cb9 100644 --- a/src/Shared/Components/BulkSelection/BulkSelection.tsx +++ b/src/Shared/Components/BulkSelection/BulkSelection.tsx @@ -14,15 +14,15 @@ * limitations under the License. */ +import { ReactComponent as ICCheckAll } from '../../../Assets/Icon/ic-check-all.svg' +import { ReactComponent as ICCheckSquare } from '../../../Assets/Icon/ic-check-square.svg' +import { ReactComponent as ICChevronDown } from '../../../Assets/Icon/ic-chevron-down.svg' +import { ReactComponent as ICClose } from '../../../Assets/Icon/ic-close.svg' +import { Checkbox, CHECKBOX_VALUE, noop, PopupMenu } from '../../../Common' import BulkSelectionDropdownItems from './BulkSelectionDropdownItems' -import { CHECKBOX_VALUE, Checkbox, PopupMenu, noop } from '../../../Common' import { useBulkSelection } from './BulkSelectionProvider' -import { BulkSelectionDropdownItemsType, BulkSelectionEvents, BulkSelectionProps } from './types' import { BULK_DROPDOWN_TEST_ID, BulkSelectionOptionsLabels } from './constants' -import { ReactComponent as ICChevronDown } from '../../../Assets/Icon/ic-chevron-down.svg' -import { ReactComponent as ICCheckSquare } from '../../../Assets/Icon/ic-check-square.svg' -import { ReactComponent as ICCheckAll } from '../../../Assets/Icon/ic-check-all.svg' -import { ReactComponent as ICClose } from '../../../Assets/Icon/ic-close.svg' +import { BulkSelectionDropdownItemsType, BulkSelectionEvents, BulkSelectionProps } from './types' const BulkSelection = ({ showPagination, disabled = false, showChevronDownIcon = true }: BulkSelectionProps) => { const { handleBulkSelection, isChecked, checkboxValue, getSelectedIdentifiersCount } = useBulkSelection() diff --git a/src/Shared/Components/BulkSelection/BulkSelectionProvider.tsx b/src/Shared/Components/BulkSelection/BulkSelectionProvider.tsx index 7eb676797..b6bf5054e 100644 --- a/src/Shared/Components/BulkSelection/BulkSelectionProvider.tsx +++ b/src/Shared/Components/BulkSelection/BulkSelectionProvider.tsx @@ -15,12 +15,15 @@ */ import { createContext, useContext, useMemo, useState } from 'react' + import { ToastManager, ToastVariantType } from '@Shared/Services' + +import { CHECKBOX_VALUE, noop, useEffectAfterMount } from '../../../Common' import { BULK_SELECTION_CONTEXT_ERROR, CLEAR_SELECTIONS_WARNING, - SELECT_ALL_ACROSS_PAGES_LOCATOR, getInvalidActionMessage, + SELECT_ALL_ACROSS_PAGES_LOCATOR, } from './constants' import { BulkSelectionEvents, @@ -30,7 +33,6 @@ import { UseBulkSelectionProps, UseBulkSelectionReturnType, } from './types' -import { CHECKBOX_VALUE, noop, useEffectAfterMount } from '../../../Common' // giving type any here since not exporting this context, rather using it through useBulkSelection hook which is typed const BulkSelectionContext = createContext>({ diff --git a/src/Shared/Components/BulkSelection/index.ts b/src/Shared/Components/BulkSelection/index.ts index 1c9267953..39ae6a1b3 100644 --- a/src/Shared/Components/BulkSelection/index.ts +++ b/src/Shared/Components/BulkSelection/index.ts @@ -16,5 +16,5 @@ export { default as BulkSelection } from './BulkSelection' export * from './BulkSelectionProvider' -export * from './types' export * from './constants' +export * from './types' diff --git a/src/Shared/Components/Button/Button.component.tsx b/src/Shared/Components/Button/Button.component.tsx index 947d5af3d..525f96440 100644 --- a/src/Shared/Components/Button/Button.component.tsx +++ b/src/Shared/Components/Button/Button.component.tsx @@ -16,12 +16,15 @@ import { MutableRefObject, PropsWithChildren, useEffect, useRef, useState } from 'react' import { Link } from 'react-router-dom' + import { Progressing } from '@Common/Progressing' import { Tooltip } from '@Common/Tooltip' import { TooltipProps } from '@Common/Tooltip/types' import { ComponentSizeType } from '@Shared/constants' + import { ButtonComponentType, ButtonProps, ButtonStyleType, ButtonVariantType } from './types' import { getButtonDerivedClass, getButtonIconClassName, getButtonLoaderSize } from './utils' + import './button.scss' const ButtonElement = ({ diff --git a/src/Shared/Components/Button/constants.ts b/src/Shared/Components/Button/constants.ts index 686323355..0cfaec60e 100644 --- a/src/Shared/Components/Button/constants.ts +++ b/src/Shared/Components/Button/constants.ts @@ -14,8 +14,9 @@ * limitations under the License. */ -import { COMPONENT_SIZE_TYPE_TO_FONT_AND_BLOCK_PADDING_MAP, ComponentSizeType } from '@Shared/constants' import { ProgressingProps } from '@Common/Types' +import { COMPONENT_SIZE_TYPE_TO_FONT_AND_BLOCK_PADDING_MAP, ComponentSizeType } from '@Shared/constants' + import { ButtonProps } from './types' export const BUTTON_SIZE_TO_CLASS_NAME_MAP: Record = { diff --git a/src/Shared/Components/Button/index.ts b/src/Shared/Components/Button/index.ts index 22c2362af..b66a6f095 100644 --- a/src/Shared/Components/Button/index.ts +++ b/src/Shared/Components/Button/index.ts @@ -15,5 +15,5 @@ */ export { default as Button } from './Button.component' -export { default as useTriggerAutoClickTimestamp } from './useTriggerAutoClickTimestamp' export * from './types' +export { default as useTriggerAutoClickTimestamp } from './useTriggerAutoClickTimestamp' diff --git a/src/Shared/Components/Button/types.ts b/src/Shared/Components/Button/types.ts index 35fa1300d..4c6128377 100644 --- a/src/Shared/Components/Button/types.ts +++ b/src/Shared/Components/Button/types.ts @@ -14,11 +14,12 @@ * limitations under the License. */ -import { TooltipProps } from '@Common/Tooltip/types' -import { ComponentSizeType } from '@Shared/constants' import { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactElement } from 'react' import { LinkProps } from 'react-router-dom' +import { TooltipProps } from '@Common/Tooltip/types' +import { ComponentSizeType } from '@Shared/constants' + // Using the same for BEM class elements export enum ButtonVariantType { primary = 'primary', diff --git a/src/Shared/Components/Button/useTriggerAutoClickTimestamp.tsx b/src/Shared/Components/Button/useTriggerAutoClickTimestamp.tsx index eda212e99..c892ae00f 100644 --- a/src/Shared/Components/Button/useTriggerAutoClickTimestamp.tsx +++ b/src/Shared/Components/Button/useTriggerAutoClickTimestamp.tsx @@ -1,4 +1,5 @@ import { useState } from 'react' + import { ButtonProps } from './types' const useTriggerAutoClickTimestamp = () => { diff --git a/src/Shared/Components/Button/utils.ts b/src/Shared/Components/Button/utils.ts index ad989b9f3..460582841 100644 --- a/src/Shared/Components/Button/utils.ts +++ b/src/Shared/Components/Button/utils.ts @@ -15,6 +15,7 @@ */ import { COMPONENT_SIZE_TYPE_TO_ICON_SIZE_MAP } from '@Shared/constants' + import { BUTTON_SIZE_TO_CLASS_NAME_MAP, ICON_BUTTON_SIZE_TO_CLASS_NAME_MAP, diff --git a/src/Shared/Components/ButtonWithLoader/ButtonWithLoader.tsx b/src/Shared/Components/ButtonWithLoader/ButtonWithLoader.tsx index 491079ea1..c71a151f9 100644 --- a/src/Shared/Components/ButtonWithLoader/ButtonWithLoader.tsx +++ b/src/Shared/Components/ButtonWithLoader/ButtonWithLoader.tsx @@ -17,6 +17,7 @@ /* eslint-disable react/prop-types */ /* eslint-disable react/destructuring-assignment */ import React, { Component } from 'react' + import { Progressing } from '../../../Common' export interface ButtonWithLoaderProps { diff --git a/src/Shared/Components/ButtonWithSelector/ButtonWithSelector.tsx b/src/Shared/Components/ButtonWithSelector/ButtonWithSelector.tsx index 42b2fdc25..ed29b5d19 100644 --- a/src/Shared/Components/ButtonWithSelector/ButtonWithSelector.tsx +++ b/src/Shared/Components/ButtonWithSelector/ButtonWithSelector.tsx @@ -15,11 +15,13 @@ */ import { useState } from 'react' + import { ReactComponent as ICDropdown } from '../../../Assets/Icon/ic-chevron-down.svg' import { PopupMenu } from '../../../Common' +import { ButtonWithLoader } from '../ButtonWithLoader' import { ButtonWithSelectorProps } from './types' + import './buttonWithSelector.scss' -import { ButtonWithLoader } from '../ButtonWithLoader' /** * Button With Selector diff --git a/src/Shared/Components/CICDHistory/AppStatusDetailsChart.tsx b/src/Shared/Components/CICDHistory/AppStatusDetailsChart.tsx index 7c0a775ac..7225c5a80 100644 --- a/src/Shared/Components/CICDHistory/AppStatusDetailsChart.tsx +++ b/src/Shared/Components/CICDHistory/AppStatusDetailsChart.tsx @@ -15,17 +15,19 @@ */ import { useEffect, useMemo, useState } from 'react' -import Tippy from '@tippyjs/react' import { useHistory } from 'react-router-dom' +import Tippy from '@tippyjs/react' + import { URLS } from '@Common/Constants' -import { ReactComponent as InfoIcon } from '../../../Assets/Icon/ic-info-filled.svg' + import { ReactComponent as Chat } from '../../../Assets/Icon/ic-chat-circle-dots.svg' -import { AppStatusDetailsChartType, AggregatedNodes, STATUS_SORTING_ORDER, NodeFilters } from './types' -import { StatusFilterButtonComponent } from './StatusFilterButtonComponent' -import { DEPLOYMENT_STATUS, APP_STATUS_HEADERS, ComponentSizeType, ALL_RESOURCE_KIND_FILTER } from '../../constants' -import { IndexStore } from '../../Store' +import { ReactComponent as InfoIcon } from '../../../Assets/Icon/ic-info-filled.svg' +import { ALL_RESOURCE_KIND_FILTER, APP_STATUS_HEADERS, ComponentSizeType, DEPLOYMENT_STATUS } from '../../constants' import { aggregateNodes } from '../../Helpers' +import { IndexStore } from '../../Store' import { Button, ButtonStyleType, ButtonVariantType } from '../Button' +import { StatusFilterButtonComponent } from './StatusFilterButtonComponent' +import { AggregatedNodes, AppStatusDetailsChartType, NodeFilters, STATUS_SORTING_ORDER } from './types' const AppStatusDetailsChart = ({ filterRemoveHealth = false, diff --git a/src/Shared/Components/CICDHistory/Artifacts.tsx b/src/Shared/Components/CICDHistory/Artifacts.tsx index 433550608..d582bba05 100644 --- a/src/Shared/Components/CICDHistory/Artifacts.tsx +++ b/src/Shared/Components/CICDHistory/Artifacts.tsx @@ -15,28 +15,30 @@ */ import { useParams } from 'react-router-dom' -import { useDownload } from '@Shared/Hooks' -import { ReactComponent as Download } from '@Icons/ic-download.svg' -import { ReactComponent as MechanicalOperation } from '@Icons/ic-mechanical-operation.svg' -import { ReactComponent as OpenInNew } from '@Icons/ic-arrow-out.svg' + import { ReactComponent as Down } from '@Icons/ic-arrow-forward.svg' -import { ReactComponent as ICHelpOutline } from '@Icons/ic-help.svg' -import folder from '@Icons/ic-folder.svg' +import { ReactComponent as OpenInNew } from '@Icons/ic-arrow-out.svg' import docker from '@Icons/ic-docker.svg' +import { ReactComponent as Download } from '@Icons/ic-download.svg' +import folder from '@Icons/ic-folder.svg' +import { ReactComponent as ICHelpOutline } from '@Icons/ic-help.svg' +import { ReactComponent as MechanicalOperation } from '@Icons/ic-mechanical-operation.svg' import noartifact from '@Images/no-artifact.webp' import { getIsApprovalPolicyConfigured } from '@Shared/Helpers' -import { TargetPlatformBadgeList } from '../TargetPlatforms' +import { useDownload } from '@Shared/Hooks' + import { - GenericEmptyState, - ImageTagsContainer, ClipboardButton, - extractImage, DOCUMENTATION, + extractImage, + GenericEmptyState, + ImageTagsContainer, useGetUserRoles, } from '../../../Common' -import { ArtifactType, CIListItemType } from './types' -import { TERMINAL_STATUS_MAP } from './constants' import { EMPTY_STATE_STATUS } from '../../constants' +import { TargetPlatformBadgeList } from '../TargetPlatforms' +import { TERMINAL_STATUS_MAP } from './constants' +import { ArtifactType, CIListItemType } from './types' const CIProgressView = (): JSX.Element => ( { - const timeDifference = getTimeDifference(startTime, endTime) + const timeDifference = getTimeDifference({ startTime, endTime }) if (timeDifference === '0s') { return '< 1s' } diff --git a/src/Shared/Components/CICDHistory/LogsRenderer.tsx b/src/Shared/Components/CICDHistory/LogsRenderer.tsx index 16bae67f4..3ef941bb6 100644 --- a/src/Shared/Components/CICDHistory/LogsRenderer.tsx +++ b/src/Shared/Components/CICDHistory/LogsRenderer.tsx @@ -14,28 +14,32 @@ * limitations under the License. */ -import { useParams } from 'react-router-dom' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' +import { useParams } from 'react-router-dom' import AnsiUp from 'ansi_up' import DOMPurify from 'dompurify' + +import { ReactComponent as ICArrow } from '@Icons/ic-caret-down.svg' +import { ReactComponent as ICCollapseAll } from '@Icons/ic-collapse-all.svg' +import { ReactComponent as ICExpandAll } from '@Icons/ic-expand-all.svg' import { ANSI_UP_REGEX, ComponentSizeType } from '@Shared/constants' import { escapeRegExp, sanitizeTargetPlatforms } from '@Shared/Helpers' -import { ReactComponent as ICExpandAll } from '@Icons/ic-expand-all.svg' -import { ReactComponent as ICCollapseAll } from '@Icons/ic-collapse-all.svg' -import { ReactComponent as ICArrow } from '@Icons/ic-caret-down.svg' import { AppThemeType, getComponentSpecificThemeClass } from '@Shared/Providers' + +import { ReactComponent as OpenInNew } from '../../../Assets/Icon/ic-arrow-out.svg' +import { ReactComponent as HelpIcon } from '../../../Assets/Icon/ic-help.svg' +import { ReactComponent as Info } from '../../../Assets/Icon/ic-info-filled.svg' import { - Progressing, - Host, - useInterval, DOCUMENTATION, + Host, + Progressing, ROUTES, SearchBar, - useUrlFilters, Tooltip, + useInterval, useRegisterShortcut, + useUrlFilters, } from '../../../Common' -import LogStageAccordion from './LogStageAccordion' import { EVENT_STREAM_EVENTS_MAP, LOGS_RETRY_COUNT, @@ -43,6 +47,7 @@ import { LOGS_STAGE_STREAM_SEPARATOR, POD_STATUS, } from './constants' +import LogStageAccordion from './LogStageAccordion' import { CreateMarkupPropsType, CreateMarkupReturnType, @@ -54,9 +59,7 @@ import { StageStatusType, } from './types' import { getLogSearchIndex } from './utils' -import { ReactComponent as Info } from '../../../Assets/Icon/ic-info-filled.svg' -import { ReactComponent as HelpIcon } from '../../../Assets/Icon/ic-help.svg' -import { ReactComponent as OpenInNew } from '../../../Assets/Icon/ic-arrow-out.svg' + import './LogsRenderer.scss' const renderLogsNotAvailable = (subtitle?: string): JSX.Element => ( diff --git a/src/Shared/Components/CICDHistory/Sidebar.tsx b/src/Shared/Components/CICDHistory/Sidebar.tsx index 73d48b27d..16e9e1cf7 100644 --- a/src/Shared/Components/CICDHistory/Sidebar.tsx +++ b/src/Shared/Components/CICDHistory/Sidebar.tsx @@ -15,32 +15,33 @@ */ import React, { memo, useEffect, useRef } from 'react' -import TippyHeadless from '@tippyjs/react/headless' import ReactGA from 'react-ga4' -import { useHistory, useParams, useRouteMatch, generatePath, useLocation, NavLink } from 'react-router-dom' +import { generatePath, NavLink, useHistory, useLocation, useParams, useRouteMatch } from 'react-router-dom' import ReactSelect, { components } from 'react-select' +import TippyHeadless from '@tippyjs/react/headless' import moment from 'moment' + import { ReactComponent as ICArrowBackward } from '@Icons/ic-arrow-backward.svg' import { ReactComponent as ICDocker } from '@Icons/ic-docker.svg' import { DeploymentStageType } from '@Shared/constants' + +import { ConditionalWrap, DATE_TIME_FORMATS, DropdownIndicator, Tooltip } from '../../../Common' +import { DetectBottom } from '../DetectBottom' +import { Icon } from '../Icon' +import { getCustomOptionSelectionStyle } from '../ReactSelect' +import { DeploymentStatus } from '../StatusComponent' +import BuildAndTaskSummaryTooltipCard from './BuildAndTaskSummaryTooltipCard' +import { FILTER_STYLE, HISTORY_LABEL, statusColor as colorMap } from './constants' +import GitTriggerList from './GitTriggerList' import { - SidebarType, CICDSidebarFilterOptionType, - HistoryComponentType, - HistorySummaryCardType, DeploymentSummaryTooltipCardType, FetchIdDataStatus, + HistoryComponentType, + HistorySummaryCardType, + SidebarType, } from './types' -import BuildAndTaskSummaryTooltipCard from './BuildAndTaskSummaryTooltipCard' -import { getCustomOptionSelectionStyle } from '../ReactSelect' -import { DetectBottom } from '../DetectBottom' -import { ConditionalWrap, DATE_TIME_FORMATS, DropdownIndicator, Tooltip } from '../../../Common' - -import { HISTORY_LABEL, FILTER_STYLE, statusColor as colorMap } from './constants' -import { DeploymentStatus } from '../StatusComponent' -import { Icon } from '../Icon' -import { getTriggerStatusIcon, getHistoryItemStatusIconFromWorkflowStages, getWorkflowNodeStatusTitle } from './utils' -import GitTriggerList from './GitTriggerList' +import { getHistoryItemStatusIconFromWorkflowStages, getTriggerStatusIcon, getWorkflowNodeStatusTitle } from './utils' /** * @description To be shown on deployment history or when we don't have workflowExecutionStages diff --git a/src/Shared/Components/CICDHistory/StatusFilterButtonComponent.tsx b/src/Shared/Components/CICDHistory/StatusFilterButtonComponent.tsx index d8c03e92f..918276109 100644 --- a/src/Shared/Components/CICDHistory/StatusFilterButtonComponent.tsx +++ b/src/Shared/Components/CICDHistory/StatusFilterButtonComponent.tsx @@ -17,11 +17,12 @@ import { ChangeEvent, useEffect, useMemo, useState } from 'react' import { ReactComponent as ICCaretDown } from '@Icons/ic-caret-down.svg' + import { PopupMenu, StyledRadioGroup as RadioGroup } from '../../../Common' import { StatusFilterButtonType } from './types' +import { getAppStatusIcon, getNodesCount, getStatusFilters } from './utils' import './StatusFilterButtonComponent.scss' -import { getAppStatusIcon, getNodesCount, getStatusFilters } from './utils' export const StatusFilterButtonComponent = ({ nodes, diff --git a/src/Shared/Components/CICDHistory/TriggerDetails.tsx b/src/Shared/Components/CICDHistory/TriggerDetails.tsx index 5afbcbb6a..ffd7738ca 100644 --- a/src/Shared/Components/CICDHistory/TriggerDetails.tsx +++ b/src/Shared/Components/CICDHistory/TriggerDetails.tsx @@ -15,50 +15,52 @@ */ import { Fragment, memo, useMemo, useState } from 'react' -import { useLocation, useParams, useRouteMatch, Link } from 'react-router-dom' -import { getHandleOpenURL } from '@Shared/Helpers' -import { ImageChipCell } from '@Shared/Components/ImageChipCell' -import { CommitChipCell } from '@Shared/Components/CommitChipCell' -import { ReactComponent as ICPulsateStatus } from '@Icons/ic-pulsate-status.svg' +import { Link, useLocation, useParams, useRouteMatch } from 'react-router-dom' + import { ReactComponent as ICAborted } from '@Icons/ic-aborted.svg' import { ReactComponent as ICArrowRight } from '@Icons/ic-arrow-right.svg' import { ReactComponent as ICEnvironment } from '@Icons/ic-environment.svg' +import { ReactComponent as ICPulsateStatus } from '@Icons/ic-pulsate-status.svg' +import { createGitCommitUrl } from '@Common/Common.service' +import { ZERO_TIME_STRING } from '@Common/Constants' +import { CommitChipCell } from '@Shared/Components/CommitChipCell' +import { ImageChipCell } from '@Shared/Components/ImageChipCell' +import { getHandleOpenURL } from '@Shared/Helpers' import { ToastManager, ToastVariantType } from '@Shared/Services' import { getDeploymentStageTitle } from '@Pages/Applications' -import { ZERO_TIME_STRING } from '@Common/Constants' -import { createGitCommitUrl } from '@Common/Common.service' + +import { ComponentSizeType, DeploymentStageType } from '../../constants' +import { GitTriggers } from '../../types' +import { Button, ButtonStyleType, ButtonVariantType } from '../Button' +import { ConfirmationModal, ConfirmationModalVariantType } from '../ConfirmationModal' +import { Icon } from '../Icon' import { - TriggerDetailsType, + DEFAULT_CLUSTER_ID, + DEFAULT_ENV, + EXECUTION_FINISHED_TEXT_MAP, + PROGRESSING_STATUS, + PULSATING_STATUS_MAP, + statusColor as colorMap, + TERMINAL_STATUS_COLOR_CLASS_MAP, +} from './constants' +import { cancelCiTrigger, cancelPrePostCdTrigger } from './service' +import { + CurrentStatusIconProps, CurrentStatusType, FinishedType, HistoryComponentType, ProgressingStatusType, StartDetailsType, + TriggerDetailsType, WorkflowStageStatusType, - CurrentStatusIconProps, } from './types' import { getFormattedTriggerTime, - sanitizeWorkflowExecutionStages, getIconFromWorkflowStageStatusType, getWorkflowNodeStatusTitle, + sanitizeWorkflowExecutionStages, } from './utils' -import { cancelCiTrigger, cancelPrePostCdTrigger } from './service' -import { - DEFAULT_CLUSTER_ID, - DEFAULT_ENV, - statusColor as colorMap, - PULSATING_STATUS_MAP, - TERMINAL_STATUS_COLOR_CLASS_MAP, - PROGRESSING_STATUS, - EXECUTION_FINISHED_TEXT_MAP, -} from './constants' -import { ComponentSizeType, DeploymentStageType } from '../../constants' -import { GitTriggers } from '../../types' -import { ConfirmationModal, ConfirmationModalVariantType } from '../ConfirmationModal' import WorkerStatus from './WorkerStatus' -import { Button, ButtonStyleType, ButtonVariantType } from '../Button' -import { Icon } from '../Icon' const Finished = memo(({ status, finishedOn, artifact, type, executionInfo }: FinishedType): JSX.Element => { const finishedOnTime = executionInfo?.finishedOn || finishedOn diff --git a/src/Shared/Components/CICDHistory/TriggerOutput.tsx b/src/Shared/Components/CICDHistory/TriggerOutput.tsx index 4371257a8..404129be8 100644 --- a/src/Shared/Components/CICDHistory/TriggerOutput.tsx +++ b/src/Shared/Components/CICDHistory/TriggerOutput.tsx @@ -14,37 +14,40 @@ * limitations under the License. */ -import { Redirect, Route, Switch, useParams, useRouteMatch, NavLink } from 'react-router-dom' import React, { useEffect, useMemo } from 'react' +import { NavLink, Redirect, Route, Switch, useParams, useRouteMatch } from 'react-router-dom' + import { sanitizeTargetPlatforms } from '@Shared/Helpers' + import { DeploymentAppTypes, GenericEmptyState, + mapByKey, Progressing, Reload, + ServerError, + URLS, useAsync, useInterval, - URLS, - ServerError, - mapByKey, } from '../../../Common' +import { EMPTY_STATE_STATUS } from '../../constants' +import Artifacts from './Artifacts' +import DeploymentDetailSteps from './DeploymentDetailSteps' +import { DeploymentHistoryConfigDiff } from './DeploymentHistoryConfigDiff' +import { GitChanges, Scroller } from './History.components' +import LogsRenderer from './LogsRenderer' +import { getTagDetails, getTriggerDetails } from './service' +import TriggerDetails from './TriggerDetails' import { FetchIdDataStatus, + History, HistoryComponentType, - TriggerOutputProps, + HistoryLogsProps, statusSet, terminalStatus, - History, - HistoryLogsProps, + TriggerOutputProps, } from './types' -import { getTagDetails, getTriggerDetails } from './service' -import LogsRenderer from './LogsRenderer' -import DeploymentDetailSteps from './DeploymentDetailSteps' -import { DeploymentHistoryConfigDiff } from './DeploymentHistoryConfigDiff' -import { GitChanges, Scroller } from './History.components' -import Artifacts from './Artifacts' -import TriggerDetails from './TriggerDetails' -import { EMPTY_STATE_STATUS } from '../../constants' + import './cicdHistory.scss' const HistoryLogs: React.FC = ({ diff --git a/src/Shared/Components/CICDHistory/WorkerStatus.tsx b/src/Shared/Components/CICDHistory/WorkerStatus.tsx index fefae87dd..ccf7c79fa 100644 --- a/src/Shared/Components/CICDHistory/WorkerStatus.tsx +++ b/src/Shared/Components/CICDHistory/WorkerStatus.tsx @@ -15,16 +15,18 @@ */ import { memo } from 'react' -import { DeploymentStageType } from '@Shared/constants' import { NavLink } from 'react-router-dom' import moment from 'moment' + import { ReactComponent as ICLines } from '@Icons/ic-lines.svg' +import { DeploymentStageType } from '@Shared/constants' import { isTimeStringAvailable } from '@Shared/Helpers' + +import { Icon } from '../Icon' import { ShowMoreText } from '../ShowMoreText' import { FAILED_WORKFLOW_STAGE_STATUS_MAP, TIMEOUT_VALUE, WORKFLOW_STAGE_STATUS_TO_TEXT_MAP } from './constants' -import { getWorkerPodBaseUrl } from './utils' import { WorkerStatusType } from './types' -import { Icon } from '../Icon' +import { getWorkerPodBaseUrl } from './utils' const WorkerStatus = memo( ({ diff --git a/src/Shared/Components/CICDHistory/constants.tsx b/src/Shared/Components/CICDHistory/constants.tsx index 1de66cd5e..6e427ba19 100644 --- a/src/Shared/Components/CICDHistory/constants.tsx +++ b/src/Shared/Components/CICDHistory/constants.tsx @@ -15,6 +15,7 @@ */ import { WorkflowStatusEnum } from '@Shared/types' + import { multiSelectStyles } from '../../../Common/MultiSelectCustomization' import { WorkflowStageStatusType } from './types' diff --git a/src/Shared/Components/CICDHistory/index.tsx b/src/Shared/Components/CICDHistory/index.tsx index 34bf096bb..6a3fd3394 100644 --- a/src/Shared/Components/CICDHistory/index.tsx +++ b/src/Shared/Components/CICDHistory/index.tsx @@ -14,20 +14,20 @@ * limitations under the License. */ -export { default as Sidebar } from './Sidebar' +export { default as AppStatusDetailsChart } from './AppStatusDetailsChart' export { default as Artifacts } from './Artifacts' -export { default as TriggerOutput } from './TriggerOutput' -export { default as TriggerDetails } from './TriggerDetails' export { default as CDEmptyState } from './CDEmptyState' -export { default as DeploymentStatusDetailBreakdown } from './DeploymentStatusBreakdown' -export { default as AppStatusDetailsChart } from './AppStatusDetailsChart' +export * from './CiPipelineSourceConfig' +export { statusColor } from './constants' export { default as DeploymentDetailSteps } from './DeploymentDetailSteps' -export * from './types' -export * from './service' +export * from './DeploymentHistoryConfigDiff' +export { default as DeploymentStatusDetailBreakdown } from './DeploymentStatusBreakdown' export * from './History.components' -export * from './utils' export { default as LogsRenderer } from './LogsRenderer' -export * from './DeploymentHistoryConfigDiff' -export * from './CiPipelineSourceConfig' +export * from './service' +export { default as Sidebar } from './Sidebar' export * from './StatusFilterButtonComponent' -export { statusColor } from './constants' +export { default as TriggerDetails } from './TriggerDetails' +export { default as TriggerOutput } from './TriggerOutput' +export * from './types' +export * from './utils' diff --git a/src/Shared/Components/CICDHistory/service.tsx b/src/Shared/Components/CICDHistory/service.tsx index 37c07d5c6..b28f2935c 100644 --- a/src/Shared/Components/CICDHistory/service.tsx +++ b/src/Shared/Components/CICDHistory/service.tsx @@ -15,9 +15,10 @@ */ /* eslint-disable dot-notation */ -import { ROUTES, ResponseType, get, getUrlWithSearchParams, sanitizeUserApprovalMetadata, trash } from '../../../Common' -import { ResourceKindType, ResourceVersionType } from '../../types' +import { get, getUrlWithSearchParams, ResponseType, ROUTES, sanitizeUserApprovalMetadata, trash } from '../../../Common' import { DEPLOYMENT_HISTORY_CONFIGURATION_LIST_MAP, EXTERNAL_TYPES } from '../../constants' +import { decode } from '../../Helpers' +import { ResourceKindType, ResourceVersionType } from '../../types' import { DeploymentConfigurationsRes, DeploymentHistoryDetail, @@ -32,7 +33,6 @@ import { TriggerHistoryParamsType, } from './types' import { getParsedTriggerHistory, getTriggerHistoryFilterCriteria } from './utils' -import { decode } from '../../Helpers' const getTriggerDetailsQuery = (fetchIdData) => { if (fetchIdData && fetchIdData === FetchIdDataStatus.FETCHING) { diff --git a/src/Shared/Components/CICDHistory/types.tsx b/src/Shared/Components/CICDHistory/types.tsx index c16375743..f34a00765 100644 --- a/src/Shared/Components/CICDHistory/types.tsx +++ b/src/Shared/Components/CICDHistory/types.tsx @@ -15,17 +15,19 @@ */ import { CSSProperties, ReactElement, ReactNode } from 'react' + import { SupportedKeyboardKeysType } from '@Common/Hooks/UseRegisterShortcut/types' + import { - OptionType, - UserApprovalMetadataType, - ReleaseTag, + DeploymentAppTypes, + FilterConditionsListType, ImageComment, + OptionType, + PaginationProps, PromotionApprovalMetadataType, - FilterConditionsListType, - DeploymentAppTypes, + ReleaseTag, ResponseType, - PaginationProps, + UserApprovalMetadataType, useScrollable, } from '../../../Common' import { DeploymentStageType } from '../../constants' diff --git a/src/Shared/Components/CICDHistory/utils.tsx b/src/Shared/Components/CICDHistory/utils.tsx index 21783287f..0dd44d247 100644 --- a/src/Shared/Components/CICDHistory/utils.tsx +++ b/src/Shared/Components/CICDHistory/utils.tsx @@ -15,42 +15,44 @@ */ import { ReactElement } from 'react' import moment from 'moment' -import { ALL_RESOURCE_KIND_FILTER } from '@Shared/constants' -import { ReactComponent as Close } from '@Icons/ic-close.svg' + +import { ReactComponent as ICCheck } from '@Icons/ic-check.svg' import { ReactComponent as Check } from '@Icons/ic-check-grey.svg' -import { ReactComponent as ICHelpOutline } from '@Icons/ic-help-outline.svg' -import { ReactComponent as Error } from '@Icons/ic-error-exclamation.svg' -import { ReactComponent as Timer } from '@Icons/ic-timer.svg' +import { ReactComponent as Close } from '@Icons/ic-close.svg' import { ReactComponent as Disconnect } from '@Icons/ic-disconnected.svg' -import { ReactComponent as TimeOut } from '@Icons/ic-timeout-red.svg' -import { ReactComponent as ICCheck } from '@Icons/ic-check.svg' +import { ReactComponent as Error } from '@Icons/ic-error-exclamation.svg' +import { ReactComponent as ICHelpOutline } from '@Icons/ic-help-outline.svg' import { ReactComponent as ICInProgress } from '@Icons/ic-in-progress.svg' -import { isTimeStringAvailable } from '@Shared/Helpers' +import { ReactComponent as TimeOut } from '@Icons/ic-timeout-red.svg' +import { ReactComponent as Timer } from '@Icons/ic-timer.svg' import { DATE_TIME_FORMATS } from '@Common/Constants' +import { ALL_RESOURCE_KIND_FILTER } from '@Shared/constants' +import { isTimeStringAvailable } from '@Shared/Helpers' + +import { Node, ResourceKindType, WorkflowStatusEnum } from '../../types' +import { Icon } from '../Icon' +import { AppStatus, DeploymentStatus, StatusType } from '../StatusComponent' import { DEFAULT_CLUSTER_ID, DEFAULT_NAMESPACE, FAILED_WORKFLOW_STAGE_STATUS_MAP, TERMINAL_STATUS_MAP, } from './constants' -import { Node, ResourceKindType, WorkflowStatusEnum } from '../../types' import { - TriggerHistoryFilterCriteriaProps, - DeploymentHistoryResultObject, DeploymentHistory, - TriggerHistoryFilterCriteriaType, + DeploymentHistoryResultObject, + ExecutionInfoType, + NodeFilters, + NodeStatus, + PodExecutionStageDTO, StageStatusType, + TriggerHistoryFilterCriteriaProps, + TriggerHistoryFilterCriteriaType, + WorkflowExecutionStageNameType, WorkflowExecutionStagesMapDTO, - ExecutionInfoType, WorkflowExecutionStageType, - PodExecutionStageDTO, WorkflowStageStatusType, - WorkflowExecutionStageNameType, - NodeStatus, - NodeFilters, } from './types' -import { Icon } from '../Icon' -import { AppStatus, DeploymentStatus, StatusType } from '../StatusComponent' export const getTriggerHistoryFilterCriteria = ({ appId, diff --git a/src/Shared/Components/CMCS/ConfigMapSecretReadyOnly.tsx b/src/Shared/Components/CMCS/ConfigMapSecretReadyOnly.tsx index f84486c17..2d37a3c96 100644 --- a/src/Shared/Components/CMCS/ConfigMapSecretReadyOnly.tsx +++ b/src/Shared/Components/CMCS/ConfigMapSecretReadyOnly.tsx @@ -14,14 +14,14 @@ * limitations under the License. */ +import { MODES } from '@Common/Constants' import { Progressing } from '@Common/Progressing' import { hasHashiOrAWS } from '@Pages/index' -import { MODES } from '@Common/Constants' -import { getConfigMapSecretReadOnlyValues } from './utils' -import { ConfigMapSecretReadyOnlyProps } from './types' -import { renderHashiOrAwsDeprecatedInfo } from './helpers' import { CodeEditor } from '../CodeEditorWrapper' +import { renderHashiOrAwsDeprecatedInfo } from './helpers' +import { ConfigMapSecretReadyOnlyProps } from './types' +import { getConfigMapSecretReadOnlyValues } from './utils' const ConfigMapSecretReadyOnly = ({ componentType, diff --git a/src/Shared/Components/CMCS/constants.ts b/src/Shared/Components/CMCS/constants.ts index 627374fdc..d24b0012f 100644 --- a/src/Shared/Components/CMCS/constants.ts +++ b/src/Shared/Components/CMCS/constants.ts @@ -15,6 +15,7 @@ */ import { CMSecretExternalType, CMSecretYamlData } from '@Shared/Services' + import { ConfigMapSecretDataTypeOptionType } from './types' export const CONFIG_MAP_SECRET_YAML_PARSE_ERROR = 'Please provide valid YAML' diff --git a/src/Shared/Components/CMCS/helpers.tsx b/src/Shared/Components/CMCS/helpers.tsx index 09fa25a21..5ae49ac39 100644 --- a/src/Shared/Components/CMCS/helpers.tsx +++ b/src/Shared/Components/CMCS/helpers.tsx @@ -14,8 +14,8 @@ * limitations under the License. */ -import { InfoColourBar } from '@Common/index' import { ReactComponent as ICWarningY5 } from '@Icons/ic-warning-y5.svg' +import { InfoColourBar } from '@Common/index' export const renderHashiOrAwsDeprecatedInfo = () => ( (children: React.ReactElement) => ( diff --git a/src/Shared/Components/CollapsibleList/CollapsibleList.types.ts b/src/Shared/Components/CollapsibleList/CollapsibleList.types.ts index bdc8ec35a..61a93faf5 100644 --- a/src/Shared/Components/CollapsibleList/CollapsibleList.types.ts +++ b/src/Shared/Components/CollapsibleList/CollapsibleList.types.ts @@ -15,8 +15,8 @@ */ import React from 'react' -import { TippyProps } from '@tippyjs/react' import { NavLinkProps } from 'react-router-dom' +import { TippyProps } from '@tippyjs/react' interface ButtonTab { /** diff --git a/src/Shared/Components/CommitChipCell/CommitChipCell.tsx b/src/Shared/Components/CommitChipCell/CommitChipCell.tsx index d318b4606..602c43947 100644 --- a/src/Shared/Components/CommitChipCell/CommitChipCell.tsx +++ b/src/Shared/Components/CommitChipCell/CommitChipCell.tsx @@ -15,6 +15,7 @@ */ import { noop } from '@Common/Helper' + import { ReactComponent as CommitIcon } from '../../../Assets/Icon/ic-code-commit.svg' import { CommitChipCellProps } from './types' diff --git a/src/Shared/Components/ConfirmationModal/CannotDeleteModal.tsx b/src/Shared/Components/ConfirmationModal/CannotDeleteModal.tsx index ecb38b11b..126544aaf 100644 --- a/src/Shared/Components/ConfirmationModal/CannotDeleteModal.tsx +++ b/src/Shared/Components/ConfirmationModal/CannotDeleteModal.tsx @@ -15,7 +15,7 @@ */ import ConfirmationModal from './ConfirmationModal' -import { ConfirmationModalVariantType, CannotDeleteModalProps } from './types' +import { CannotDeleteModalProps, ConfirmationModalVariantType } from './types' export const CannotDeleteModal = ({ title, component, subtitle, closeConfirmationModal }: CannotDeleteModalProps) => ( (null) diff --git a/src/Shared/Components/ConfirmationModal/DeleteConfirmationModal.tsx b/src/Shared/Components/ConfirmationModal/DeleteConfirmationModal.tsx index 72ad97693..a4d1bdbf3 100644 --- a/src/Shared/Components/ConfirmationModal/DeleteConfirmationModal.tsx +++ b/src/Shared/Components/ConfirmationModal/DeleteConfirmationModal.tsx @@ -15,13 +15,15 @@ */ import React, { useState } from 'react' -import { ToastManager, ToastVariantType } from '@Shared/Services/ToastManager' -import { ServerErrors } from '@Common/ServerError' + import { showError, stopPropagation } from '@Common/Helper' -import { ConfirmationModalVariantType, DeleteConfirmationModalProps } from './types' -import ConfirmationModal from './ConfirmationModal' +import { ServerErrors } from '@Common/ServerError' +import { ToastManager, ToastVariantType } from '@Shared/Services/ToastManager' + import { CannotDeleteModal } from './CannotDeleteModal' +import ConfirmationModal from './ConfirmationModal' import { ForceDeleteConfirmationModal } from './ForceDeleteConfirmationModal' +import { ConfirmationModalVariantType, DeleteConfirmationModalProps } from './types' export const DeleteConfirmationModal: React.FC = ({ title, diff --git a/src/Shared/Components/ConfirmationModal/ForceDeleteConfirmationModal.tsx b/src/Shared/Components/ConfirmationModal/ForceDeleteConfirmationModal.tsx index b0e28d625..439672137 100644 --- a/src/Shared/Components/ConfirmationModal/ForceDeleteConfirmationModal.tsx +++ b/src/Shared/Components/ConfirmationModal/ForceDeleteConfirmationModal.tsx @@ -15,6 +15,7 @@ */ import { ConfirmationModal, ConfirmationModalVariantType } from '@Shared/Components' + import { ForceDeleteConfirmationProps } from './types' export const ForceDeleteConfirmationModal = ({ diff --git a/src/Shared/Components/ConfirmationModal/index.tsx b/src/Shared/Components/ConfirmationModal/index.tsx index e66c0d6ff..534bf37e0 100644 --- a/src/Shared/Components/ConfirmationModal/index.tsx +++ b/src/Shared/Components/ConfirmationModal/index.tsx @@ -14,10 +14,10 @@ * limitations under the License. */ -export { default as ConfirmationModal, BaseConfirmationModal } from './ConfirmationModal' -export { DeleteConfirmationModal } from './DeleteConfirmationModal' -export { ForceDeleteConfirmationModal } from './ForceDeleteConfirmationModal' export { CannotDeleteModal } from './CannotDeleteModal' -export { ConfirmationModalVariantType, type ConfirmationModalProps, type DeleteConfirmationModalProps } from './types' +export { BaseConfirmationModal, default as ConfirmationModal } from './ConfirmationModal' export { ConfirmationModalProvider } from './ConfirmationModalContext' +export { DeleteConfirmationModal } from './DeleteConfirmationModal' +export { ForceDeleteConfirmationModal } from './ForceDeleteConfirmationModal' +export { type ConfirmationModalProps, ConfirmationModalVariantType, type DeleteConfirmationModalProps } from './types' export { getConfirmationLabel } from './utils' diff --git a/src/Shared/Components/ConfirmationModal/types.ts b/src/Shared/Components/ConfirmationModal/types.ts index ff5b13ad9..091543f3a 100644 --- a/src/Shared/Components/ConfirmationModal/types.ts +++ b/src/Shared/Components/ConfirmationModal/types.ts @@ -23,6 +23,7 @@ import { SetStateAction, SyntheticEvent, } from 'react' + import { ButtonProps } from '../Button' export enum ConfirmationModalVariantType { diff --git a/src/Shared/Components/ConfirmationModal/utils.tsx b/src/Shared/Components/ConfirmationModal/utils.tsx index d348406c4..05aa9e0ee 100644 --- a/src/Shared/Components/ConfirmationModal/utils.tsx +++ b/src/Shared/Components/ConfirmationModal/utils.tsx @@ -14,12 +14,14 @@ * limitations under the License. */ +import { ReactElement, ReactNode } from 'react' + import { ReactComponent as ICInfo } from '@Icons/ic-medium-info.svg' import { ReactComponent as ICWarning } from '@Icons/ic-warning-y5.svg' -import { ReactElement, ReactNode } from 'react' import { ReactComponent as ICDelete } from '@Images/delete-medium.svg' -import { ConfirmationModalVariantType } from './types' + import { ButtonStyleType } from '../Button' +import { ConfirmationModalVariantType } from './types' export const getIconFromVariant = (variant: ConfirmationModalVariantType): ReactElement => { switch (variant) { diff --git a/src/Shared/Components/CountrySelect/CountrySelect.component.tsx b/src/Shared/Components/CountrySelect/CountrySelect.component.tsx index f074a3a45..c2e8b0308 100644 --- a/src/Shared/Components/CountrySelect/CountrySelect.component.tsx +++ b/src/Shared/Components/CountrySelect/CountrySelect.component.tsx @@ -1,8 +1,9 @@ import { useMemo } from 'react' + +import { FlagImage } from '../FlagImage' import { SelectPicker, SelectPickerProps } from '../SelectPicker' import { CountrySelectProps } from './types' import { getCountryOptions } from './utils' -import { FlagImage } from '../FlagImage' const CountrySelect = ({ selectedCountry, diff --git a/src/Shared/Components/CountrySelect/types.ts b/src/Shared/Components/CountrySelect/types.ts index 075ca2342..e251ac35d 100644 --- a/src/Shared/Components/CountrySelect/types.ts +++ b/src/Shared/Components/CountrySelect/types.ts @@ -1,4 +1,5 @@ -import { CountryISO2Type } from '@Shared/index' +import { CountryISO2Type } from '@Shared/types' + import { SelectPickerProps } from '../SelectPicker' export interface CountrySelectProps diff --git a/src/Shared/Components/CountrySelect/utils.tsx b/src/Shared/Components/CountrySelect/utils.tsx index cd8c143b1..6e805cbe2 100644 --- a/src/Shared/Components/CountrySelect/utils.tsx +++ b/src/Shared/Components/CountrySelect/utils.tsx @@ -1,8 +1,10 @@ import { defaultCountries, parseCountry, ParsedCountry } from 'react-international-phone' + import { Tooltip } from '@Common/Tooltip' -import { CountrySelectProps } from './types' -import { SelectPickerOptionType } from '../SelectPicker' + import { FlagImage } from '../FlagImage' +import { SelectPickerOptionType } from '../SelectPicker' +import { CountrySelectProps } from './types' export const getCountryOptions = (variant: CountrySelectProps['variant']): SelectPickerOptionType[] => defaultCountries.map((countryData) => { diff --git a/src/Shared/Components/CustomInput/CustomInput.tsx b/src/Shared/Components/CustomInput/CustomInput.tsx index 0614cf1d8..16c83dccf 100644 --- a/src/Shared/Components/CustomInput/CustomInput.tsx +++ b/src/Shared/Components/CustomInput/CustomInput.tsx @@ -15,6 +15,7 @@ */ import { useEffect, useRef } from 'react' + import { FormFieldWrapper, getFormFieldAriaAttributes } from '@Shared/Components/FormFieldWrapper' import { COMPONENT_SIZE_TYPE_TO_FONT_AND_BLOCK_PADDING_MAP, @@ -22,9 +23,11 @@ import { ComponentSizeType, } from '@Shared/constants' import { deriveBorderRadiusAndBorderClassFromConfig } from '@Shared/Helpers' -import { CustomInputProps } from './types' + import { Button, ButtonProps, ButtonStyleType, ButtonVariantType } from '../Button' import { CUSTOM_INPUT_TO_ICON_BUTTON_SIZE_MAP } from './constants' +import { CustomInputProps } from './types' + import './customInput.scss' const CustomInput = ({ diff --git a/src/Shared/Components/CustomInput/PasswordField.tsx b/src/Shared/Components/CustomInput/PasswordField.tsx index 845be6877..cda1e9ed4 100644 --- a/src/Shared/Components/CustomInput/PasswordField.tsx +++ b/src/Shared/Components/CustomInput/PasswordField.tsx @@ -15,9 +15,11 @@ */ import { useMemo, useState } from 'react' -import { DEFAULT_SECRET_PLACEHOLDER } from '@Shared/constants' -import { ReactComponent as ICVisibilityOn } from '@Icons/ic-visibility-on.svg' + import { ReactComponent as ICVisibilityOff } from '@Icons/ic-visibility-off.svg' +import { ReactComponent as ICVisibilityOn } from '@Icons/ic-visibility-on.svg' +import { DEFAULT_SECRET_PLACEHOLDER } from '@Shared/constants' + import CustomInput from './CustomInput' import { CustomInputProps, PasswordFieldProps } from './types' diff --git a/src/Shared/Components/CustomInput/constants.ts b/src/Shared/Components/CustomInput/constants.ts index 3b0d693b8..0a964a515 100644 --- a/src/Shared/Components/CustomInput/constants.ts +++ b/src/Shared/Components/CustomInput/constants.ts @@ -15,6 +15,7 @@ */ import { ComponentSizeType } from '@Shared/constants' + import { ButtonProps } from '../Button' import { CustomInputProps } from './types' diff --git a/src/Shared/Components/CustomInput/types.ts b/src/Shared/Components/CustomInput/types.ts index fbf050628..d2e1164b8 100644 --- a/src/Shared/Components/CustomInput/types.ts +++ b/src/Shared/Components/CustomInput/types.ts @@ -15,9 +15,11 @@ */ import { InputHTMLAttributes, MutableRefObject } from 'react' + import { ComponentSizeType } from '@Shared/constants' -import { FormFieldWrapperProps } from '../FormFieldWrapper' + import { ButtonComponentType, ButtonProps } from '../Button' +import { FormFieldWrapperProps } from '../FormFieldWrapper' export interface CustomInputProps extends Omit, diff --git a/src/Shared/Components/DatePicker/DateTimePicker.tsx b/src/Shared/Components/DatePicker/DateTimePicker.tsx index 45a146b61..37e443434 100644 --- a/src/Shared/Components/DatePicker/DateTimePicker.tsx +++ b/src/Shared/Components/DatePicker/DateTimePicker.tsx @@ -14,23 +14,27 @@ * limitations under the License. */ +import { useState } from 'react' import { SingleDatePicker } from 'react-dates' +import CustomizableCalendarDay from 'react-dates/esm/components/CustomizableCalendarDay' import { SelectInstance } from 'react-select' import moment from 'moment' -import CustomizableCalendarDay from 'react-dates/esm/components/CustomizableCalendarDay' -import { useState } from 'react' -import { ReactComponent as ClockIcon } from '@Icons/ic-clock.svg' + import { ReactComponent as CalendarIcon } from '@Icons/ic-calendar.svg' +import { ReactComponent as ClockIcon } from '@Icons/ic-clock.svg' import { ReactComponent as ICWarning } from '@Icons/ic-warning.svg' import { ComponentSizeType } from '@Shared/constants' -import { DEFAULT_TIME_OPTIONS, getTimeValue, updateDate, updateTime } from './utils' + +import 'react-dates/initialize' + +import { DATE_TIME_FORMATS } from '../../../Common' +import { SelectPicker } from '../SelectPicker' +import { customDayStyles, DATE_PICKER_IDS, DATE_PICKER_PLACEHOLDER } from './constants' import { DateTimePickerProps } from './types' -import { DATE_PICKER_IDS, DATE_PICKER_PLACEHOLDER, customDayStyles } from './constants' +import { DEFAULT_TIME_OPTIONS, getTimeValue, updateDate, updateTime } from './utils' + import './datePicker.scss' -import { DATE_TIME_FORMATS } from '../../../Common' -import 'react-dates/initialize' import 'react-dates/lib/css/_datepicker.css' -import { SelectPicker } from '../SelectPicker' const DateTimePicker = ({ date: dateObject = new Date(), diff --git a/src/Shared/Components/DatePicker/MonthlySelect.tsx b/src/Shared/Components/DatePicker/MonthlySelect.tsx index e91dda3f2..925921149 100644 --- a/src/Shared/Components/DatePicker/MonthlySelect.tsx +++ b/src/Shared/Components/DatePicker/MonthlySelect.tsx @@ -14,10 +14,10 @@ * limitations under the License. */ -import { MONTHLY_DATE_OPTIONS } from './utils' -import { MonthlySelectProps } from './types' -import { DATE_PICKER_IDS } from './constants' import { SelectPicker } from '../SelectPicker' +import { DATE_PICKER_IDS } from './constants' +import { MonthlySelectProps } from './types' +import { MONTHLY_DATE_OPTIONS } from './utils' export const MonthlySelect = ({ selectedMonthlyDate, diff --git a/src/Shared/Components/DatePicker/SingleDatePickerComponent.tsx b/src/Shared/Components/DatePicker/SingleDatePickerComponent.tsx index 0f1180eaa..e5ea513e1 100644 --- a/src/Shared/Components/DatePicker/SingleDatePickerComponent.tsx +++ b/src/Shared/Components/DatePicker/SingleDatePickerComponent.tsx @@ -16,13 +16,16 @@ import { useState } from 'react' import { SingleDatePicker } from 'react-dates' -import moment, { Moment } from 'moment' import CustomizableCalendarDay from 'react-dates/lib/components/CustomizableCalendarDay' -import { SingleDatePickerProps } from './types' -import { customDayStyles } from './constants' +import moment, { Moment } from 'moment' + import 'react-dates/initialize' -import 'react-dates/lib/css/_datepicker.css' + import CalenderIcon from '../../../Assets/Icon/ic-calender-blank.svg' +import { customDayStyles } from './constants' +import { SingleDatePickerProps } from './types' + +import 'react-dates/lib/css/_datepicker.css' const blockToday = (day: Moment): boolean => day.isSame(moment(), 'day') diff --git a/src/Shared/Components/DatePicker/TimeSelect.tsx b/src/Shared/Components/DatePicker/TimeSelect.tsx index 01c8ba7d0..221fd199d 100644 --- a/src/Shared/Components/DatePicker/TimeSelect.tsx +++ b/src/Shared/Components/DatePicker/TimeSelect.tsx @@ -16,10 +16,11 @@ import { ReactComponent as ClockIcon } from '@Icons/ic-clock.svg' import { ComponentSizeType } from '@Shared/constants' -import { DEFAULT_TIME_OPTIONS } from './utils' -import { TimeSelectProps } from './types' -import { DATE_PICKER_IDS } from './constants' + import { SelectPicker } from '../SelectPicker' +import { DATE_PICKER_IDS } from './constants' +import { TimeSelectProps } from './types' +import { DEFAULT_TIME_OPTIONS } from './utils' export const TimePickerSelect = ({ disabled = false, diff --git a/src/Shared/Components/DatePicker/index.ts b/src/Shared/Components/DatePicker/index.ts index b91704d36..aced868c3 100644 --- a/src/Shared/Components/DatePicker/index.ts +++ b/src/Shared/Components/DatePicker/index.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -export { default as SingleDatePickerComponent } from './SingleDatePickerComponent' -export * from './types' +export * from './constants' +export { default as DateTimePicker } from './DateTimePicker' export * from './MonthlySelect' +export { default as SingleDatePickerComponent } from './SingleDatePickerComponent' export * from './TimeSelect' +export * from './types' export * from './utils' -export * from './constants' -export { default as DateTimePicker } from './DateTimePicker' diff --git a/src/Shared/Components/DatePicker/types.ts b/src/Shared/Components/DatePicker/types.ts index b2298b551..82cafc3cf 100644 --- a/src/Shared/Components/DatePicker/types.ts +++ b/src/Shared/Components/DatePicker/types.ts @@ -14,9 +14,10 @@ * limitations under the License. */ -import { Moment } from 'moment' -import { SelectInstance } from 'react-select' import { SingleDatePickerShape } from 'react-dates' +import { SelectInstance } from 'react-select' +import { Moment } from 'moment' + import { SelectPickerOptionType } from '../SelectPicker' export interface SingleDatePickerProps { diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.tsx b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.tsx index 824167e7d..34e305be8 100644 --- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.tsx +++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.tsx @@ -14,9 +14,10 @@ * limitations under the License. */ -import { DeploymentConfigDiffNavigation } from './DeploymentConfigDiffNavigation' -import { DeploymentConfigDiffMain } from './DeploymentConfigDiffMain' import { DeploymentConfigDiffProps } from './DeploymentConfigDiff.types' +import { DeploymentConfigDiffMain } from './DeploymentConfigDiffMain' +import { DeploymentConfigDiffNavigation } from './DeploymentConfigDiffNavigation' + import './DeploymentConfigDiff.scss' export const DeploymentConfigDiff = ({ diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.constants.ts b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.constants.ts index b82078d3f..02895a03f 100644 --- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.constants.ts +++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.constants.ts @@ -16,9 +16,9 @@ import { FunctionComponent, SVGProps } from 'react' -import { ReactComponent as ICDiffFileUpdated } from '@Icons/ic-diff-file-updated.svg' import { ReactComponent as ICDiffFileAdded } from '@Icons/ic-diff-file-added.svg' import { ReactComponent as ICDiffFileRemoved } from '@Icons/ic-diff-file-removed.svg' +import { ReactComponent as ICDiffFileUpdated } from '@Icons/ic-diff-file-updated.svg' import { DeploymentConfigDiffState } from './DeploymentConfigDiff.types' diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.types.ts b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.types.ts index de635db71..13a834b72 100644 --- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.types.ts +++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.types.ts @@ -15,7 +15,6 @@ */ import { SortingOrder } from '@Common/Constants' - import { AppEnvDeploymentConfigDTO, ConfigMapSecretDataConfigDatumDTO, @@ -23,12 +22,12 @@ import { EnvResourceType, TemplateListDTO, } from '@Shared/Services' - import { ManifestTemplateDTO } from '@Pages/Applications' + import { DeploymentHistoryDetail } from '../CICDHistory' +import { CollapseProps } from '../Collapse' import { CollapsibleListConfig, CollapsibleListItem } from '../CollapsibleList' import { SelectPickerProps } from '../SelectPicker' -import { CollapseProps } from '../Collapse' export enum DeploymentConfigDiffState { NO_DIFF = 'noDiff', diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.tsx b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.tsx index fe702cd1e..b57c4cbf4 100644 --- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.tsx +++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.tsx @@ -20,21 +20,21 @@ import { ReactComponent as ICCheck } from '@Icons/ic-check.svg' import { ReactComponent as ICCheckCircleDots } from '@Icons/ic-check-circle-dots.svg' import { ReactComponent as ICEditFile } from '@Icons/ic-edit-file.svg' import { ReactComponent as ICFileCode } from '@Icons/ic-file-code.svg' -import { stringComparatorBySortOrder, yamlComparatorBySortOrder } from '@Shared/Helpers' -import { DEPLOYMENT_HISTORY_CONFIGURATION_LIST_MAP } from '@Shared/constants' +import { deepEqual, noop, YAMLStringify } from '@Common/Helper' import { + AppEnvDeploymentConfigListParams, DeploymentConfigDiffProps, DeploymentConfigDiffState, DeploymentHistoryDetail, DeploymentHistorySingleValue, - AppEnvDeploymentConfigListParams, DiffHeadingDataType, - prepareHistoryData, GenericSectionErrorState, + prepareHistoryData, } from '@Shared/Components' -import { deepEqual, noop, YAMLStringify } from '@Common/Helper' - +import { DEPLOYMENT_HISTORY_CONFIGURATION_LIST_MAP } from '@Shared/constants' +import { stringComparatorBySortOrder, yamlComparatorBySortOrder } from '@Shared/Helpers' import { ManifestTemplateDTO } from '@Pages/Applications' + import { CMSecretExternalType, ConfigMapSecretDataConfigDatumDTO, diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffAccordion.tsx b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffAccordion.tsx index 787177d52..911b1dc5f 100644 --- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffAccordion.tsx +++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffAccordion.tsx @@ -17,8 +17,8 @@ import { ReactComponent as ICCaretDown } from '@Icons/ic-caret-down.svg' import { Collapse } from '../Collapse' -import { DeploymentConfigDiffAccordionProps, DeploymentConfigDiffState } from './DeploymentConfigDiff.types' import { diffStateTextColorMap, diffStateTextMap } from './DeploymentConfigDiff.constants' +import { DeploymentConfigDiffAccordionProps, DeploymentConfigDiffState } from './DeploymentConfigDiff.types' export const DeploymentConfigDiffAccordion = ({ diffState, diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.tsx b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.tsx index 44c12064f..595f437a5 100644 --- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.tsx +++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.tsx @@ -16,26 +16,26 @@ import { Fragment, useEffect, useState } from 'react' -import { ReactComponent as ICSortArrowDown } from '@Icons/ic-sort-arrow-down.svg' import { ReactComponent as ICSort } from '@Icons/ic-arrow-up-down.svg' -import { Progressing } from '@Common/Progressing' +import { ReactComponent as ICSortArrowDown } from '@Icons/ic-sort-arrow-down.svg' import { SortingOrder } from '@Common/Constants' import ErrorScreenManager from '@Common/ErrorScreenManager' -import { ComponentSizeType } from '@Shared/constants' +import { Progressing } from '@Common/Progressing' import { DiffViewer } from '@Shared/Components/DiffViewer' +import { ComponentSizeType } from '@Shared/constants' import { Button, ButtonStyleType, ButtonVariantType } from '../Button' -import { SelectPicker } from '../SelectPicker' import { DeploymentHistoryDiffView } from '../CICDHistory' -import { DeploymentConfigDiffAccordion } from './DeploymentConfigDiffAccordion' +import { SelectPicker } from '../SelectPicker' +import { ToggleResolveScopedVariables } from '../ToggleResolveScopedVariables' import { + DeploymentConfigDiffAccordionProps, DeploymentConfigDiffMainProps, DeploymentConfigDiffSelectPickerProps, DeploymentConfigDiffState, - DeploymentConfigDiffAccordionProps, } from './DeploymentConfigDiff.types' import { renderDiffViewNoDifferenceState } from './DeploymentConfigDiff.utils' -import { ToggleResolveScopedVariables } from '../ToggleResolveScopedVariables' +import { DeploymentConfigDiffAccordion } from './DeploymentConfigDiffAccordion' export const DeploymentConfigDiffMain = ({ isLoading, diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.tsx b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.tsx index 2c0a55d87..432b91b2e 100644 --- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.tsx +++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.tsx @@ -19,13 +19,13 @@ import { Link, NavLink } from 'react-router-dom' import Tippy from '@tippyjs/react' import { ReactComponent as ICClose } from '@Icons/ic-close.svg' -import { ReactComponent as ICInfoOutlined } from '@Icons/ic-info-outlined.svg' import { ReactComponent as ICError } from '@Icons/ic-error.svg' +import { ReactComponent as ICInfoOutlined } from '@Icons/ic-info-outlined.svg' import { StyledRadioGroup } from '@Common/index' import { CollapsibleList, CollapsibleListConfig } from '../CollapsibleList' -import { DeploymentConfigDiffNavigationProps, DeploymentConfigDiffState } from './DeploymentConfigDiff.types' import { diffStateIconMap, diffStateTooltipTextMap } from './DeploymentConfigDiff.constants' +import { DeploymentConfigDiffNavigationProps, DeploymentConfigDiffState } from './DeploymentConfigDiff.types' // LOADING SHIMMER const ShimmerText = ({ width }: { width: string }) => ( diff --git a/src/Shared/Components/DeploymentConfigDiff/index.ts b/src/Shared/Components/DeploymentConfigDiff/index.ts index 2c3bb61e5..fb054bb0e 100644 --- a/src/Shared/Components/DeploymentConfigDiff/index.ts +++ b/src/Shared/Components/DeploymentConfigDiff/index.ts @@ -15,6 +15,6 @@ */ export * from './DeploymentConfigDiff.component' +export * from './DeploymentConfigDiff.constants' export * from './DeploymentConfigDiff.types' export * from './DeploymentConfigDiff.utils' -export * from './DeploymentConfigDiff.constants' diff --git a/src/Shared/Components/DetectBottom/DetectBottom.component.tsx b/src/Shared/Components/DetectBottom/DetectBottom.component.tsx index 9da07365b..6310c08ce 100644 --- a/src/Shared/Components/DetectBottom/DetectBottom.component.tsx +++ b/src/Shared/Components/DetectBottom/DetectBottom.component.tsx @@ -15,6 +15,7 @@ */ import { useEffect, useRef } from 'react' + import { useIntersection } from '../../Helpers' import { GenericSectionErrorState } from '../GenericSectionErrorState' diff --git a/src/Shared/Components/DiffViewer/DiffViewer.component.tsx b/src/Shared/Components/DiffViewer/DiffViewer.component.tsx index c97e647ba..863d20cca 100644 --- a/src/Shared/Components/DiffViewer/DiffViewer.component.tsx +++ b/src/Shared/Components/DiffViewer/DiffViewer.component.tsx @@ -15,6 +15,7 @@ */ import ReactDiffViewer, { DiffMethod } from 'react-diff-viewer-continued' + import { diffViewerStyles } from './constants' import { DiffViewerProps, DiffViewTitleWrapperProps } from './types' diff --git a/src/Shared/Components/DynamicDataTable/DynamicDataTable.tsx b/src/Shared/Components/DynamicDataTable/DynamicDataTable.tsx index 5c296ddb4..b98cf41bd 100644 --- a/src/Shared/Components/DynamicDataTable/DynamicDataTable.tsx +++ b/src/Shared/Components/DynamicDataTable/DynamicDataTable.tsx @@ -19,6 +19,7 @@ import { useMemo } from 'react' import { DynamicDataTableHeader } from './DynamicDataTableHeader' import { DynamicDataTableRow } from './DynamicDataTableRow' import { DynamicDataTableProps } from './types' + import './styles.scss' export const DynamicDataTable = >({ diff --git a/src/Shared/Components/DynamicDataTable/DynamicDataTableHeader.tsx b/src/Shared/Components/DynamicDataTable/DynamicDataTableHeader.tsx index 01ac24d1a..a6d59cb91 100644 --- a/src/Shared/Components/DynamicDataTable/DynamicDataTableHeader.tsx +++ b/src/Shared/Components/DynamicDataTable/DynamicDataTableHeader.tsx @@ -14,14 +14,14 @@ * limitations under the License. */ -import { ReactComponent as ICArrowDown } from '@Icons/ic-sort-arrow-down.svg' import { ReactComponent as ICAdd } from '@Icons/ic-add.svg' -import { ComponentSizeType } from '@Shared/constants' +import { ReactComponent as ICArrowDown } from '@Icons/ic-sort-arrow-down.svg' import { SortingOrder } from '@Common/Constants' +import { ComponentSizeType } from '@Shared/constants' import { Button, ButtonVariantType } from '../Button' +import { DynamicDataTableHeaderProps, DynamicDataTableHeaderType } from './types' import { getActionButtonPosition, getHeaderGridTemplateColumn } from './utils' -import { DynamicDataTableHeaderType, DynamicDataTableHeaderProps } from './types' export const DynamicDataTableHeader = >({ headers, diff --git a/src/Shared/Components/DynamicDataTable/DynamicDataTableRow.tsx b/src/Shared/Components/DynamicDataTable/DynamicDataTableRow.tsx index 95bb3f2d9..3904c5147 100644 --- a/src/Shared/Components/DynamicDataTable/DynamicDataTableRow.tsx +++ b/src/Shared/Components/DynamicDataTable/DynamicDataTableRow.tsx @@ -29,22 +29,22 @@ import { import { followCursor } from 'tippy.js' import { ReactComponent as ICClose } from '@Icons/ic-close.svg' -import { Tooltip } from '@Common/Tooltip' -import { ConditionalWrap } from '@Common/Helper' import { ResizableTagTextArea } from '@Common/CustomTagSelector' +import { ConditionalWrap } from '@Common/Helper' +import { Tooltip } from '@Common/Tooltip' import { ComponentSizeType } from '@Shared/constants' import { Button, ButtonStyleType, ButtonVariantType } from '../Button' +import { FileUpload } from '../FileUpload' import { getSelectPickerOptionByValue, SelectPicker, - SelectPickerTextArea, SelectPickerOptionType, + SelectPickerTextArea, SelectPickerVariantType, } from '../SelectPicker' -import { FileUpload } from '../FileUpload' +import { DynamicDataTableRowDataType, DynamicDataTableRowProps, DynamicDataTableRowType } from './types' import { getActionButtonPosition, getRowGridTemplateColumn, rowTypeHasInputField } from './utils' -import { DynamicDataTableRowType, DynamicDataTableRowProps, DynamicDataTableRowDataType } from './types' const getWrapperForButtonCell = >( diff --git a/src/Shared/Components/DynamicDataTable/types.ts b/src/Shared/Components/DynamicDataTable/types.ts index 801e51833..8d3785d17 100644 --- a/src/Shared/Components/DynamicDataTable/types.ts +++ b/src/Shared/Components/DynamicDataTable/types.ts @@ -18,10 +18,10 @@ import { DetailedHTMLProps, ReactElement, ReactNode } from 'react' import { ResizableTagTextAreaProps } from '@Common/CustomTagSelector' import { UseStateFiltersReturnType } from '@Common/Hooks' - import { TooltipProps } from '@Common/Tooltip/types' -import { SelectPickerOptionType, SelectPickerProps, SelectPickerTextAreaProps } from '../SelectPicker' + import { FileUploadProps } from '../FileUpload' +import { SelectPickerOptionType, SelectPickerProps, SelectPickerTextAreaProps } from '../SelectPicker' /** * Interface representing header for a dynamic data table. diff --git a/src/Shared/Components/EditImageFormField/EditImageFormField.tsx b/src/Shared/Components/EditImageFormField/EditImageFormField.tsx index 3999c0fb9..269f9440e 100644 --- a/src/Shared/Components/EditImageFormField/EditImageFormField.tsx +++ b/src/Shared/Components/EditImageFormField/EditImageFormField.tsx @@ -15,19 +15,22 @@ */ import { KeyboardEvent, SyntheticEvent, useState } from 'react' + +import { ReactComponent as ICPencil } from '@Icons/ic-pencil.svg' import { showError } from '@Common/Helper' -import { CustomInput } from '@Shared/Components/CustomInput' import { ButtonWithLoader, ImageWithFallback } from '@Shared/Components' -import { validateIfImageExist, validateURL } from '@Shared/validations' +import { CustomInput } from '@Shared/Components/CustomInput' import { ToastManager, ToastVariantType } from '@Shared/Services' -import { ReactComponent as ICPencil } from '@Icons/ic-pencil.svg' -import { EditImageFormFieldProps, FallbackImageProps } from './types' +import { validateIfImageExist, validateURL } from '@Shared/validations' + import { BASE_IMAGE_CLASS, DEFAULT_IMAGE_DIMENSIONS, DEFAULT_MAX_IMAGE_SIZE, EMPTY_PREVIEW_URL_ERROR_MESSAGE, } from './constants' +import { EditImageFormFieldProps, FallbackImageProps } from './types' + import './EditImageFormField.scss' const FallbackImage = ({ showEditIcon, defaultIcon }: FallbackImageProps) => ( diff --git a/src/Shared/Components/EditableTextArea/EditableTextArea.tsx b/src/Shared/Components/EditableTextArea/EditableTextArea.tsx index 65659f80f..f0a33b50c 100644 --- a/src/Shared/Components/EditableTextArea/EditableTextArea.tsx +++ b/src/Shared/Components/EditableTextArea/EditableTextArea.tsx @@ -15,11 +15,13 @@ */ import { useState } from 'react' + import { ComponentSizeType } from '@Shared/constants' + import { ReactComponent as EditIcon } from '../../../Assets/Icon/ic-pencil.svg' -import type { EditableTextAreaProps, Error } from './types' -import { Textarea } from '../Textarea' import { Button, ButtonStyleType, ButtonVariantType } from '../Button' +import { Textarea } from '../Textarea' +import type { EditableTextAreaProps, Error } from './types' const TextArea = ( props: Omit & { diff --git a/src/Shared/Components/EnvironmentSelector/EnvironmentSelector.component.tsx b/src/Shared/Components/EnvironmentSelector/EnvironmentSelector.component.tsx index 6b30ec818..a60fc8d37 100644 --- a/src/Shared/Components/EnvironmentSelector/EnvironmentSelector.component.tsx +++ b/src/Shared/Components/EnvironmentSelector/EnvironmentSelector.component.tsx @@ -16,9 +16,10 @@ import { useMemo } from 'react' import ReactSelect from 'react-select' + +import { ClearIndicator, useAsync } from '../../../Common' import { GenericSectionErrorState } from '../GenericSectionErrorState' import { commonSelectStyles, GroupHeading, LoadingIndicator } from '../ReactSelect' -import { ClearIndicator, useAsync } from '../../../Common' import { ENVIRONMENT_SELECTOR_TEXT } from './constants' import { getEnvironmentsGroupedByCluster } from './service' import { EnvironmentSelectorProps } from './types' diff --git a/src/Shared/Components/Error/ErrorBar.tsx b/src/Shared/Components/Error/ErrorBar.tsx index f75c18d65..4fc517ff5 100644 --- a/src/Shared/Components/Error/ErrorBar.tsx +++ b/src/Shared/Components/Error/ErrorBar.tsx @@ -16,11 +16,12 @@ import { useEffect, useState } from 'react' import { NavLink } from 'react-router-dom' + import { ReactComponent as ErrorInfo } from '../../../Assets/Icon/ic-errorInfo.svg' -import { ErrorBarType, AppDetailsErrorType } from './types' +import { URLS } from '../../../Common' import { AppType } from '../../types' +import { AppDetailsErrorType, ErrorBarType } from './types' import { renderErrorHeaderMessage } from './utils' -import { URLS } from '../../../Common' const ErrorBar = ({ appDetails }: ErrorBarType) => { const [isImagePullBackOff, setIsImagePullBackOff] = useState(false) diff --git a/src/Shared/Components/ExcludedImageNode/ExcludedImageNode.tsx b/src/Shared/Components/ExcludedImageNode/ExcludedImageNode.tsx index 6fc38c232..acaa32a1e 100644 --- a/src/Shared/Components/ExcludedImageNode/ExcludedImageNode.tsx +++ b/src/Shared/Components/ExcludedImageNode/ExcludedImageNode.tsx @@ -15,9 +15,10 @@ */ import Tippy from '@tippyjs/react' + +import { ReactComponent as ICAbort } from '../../../Assets/Icon/ic-abort.svg' import { EXCLUDED_IMAGE_TOOLTIP } from '../../constants' import { ExcludedImageNodeProps } from './types' -import { ReactComponent as ICAbort } from '../../../Assets/Icon/ic-abort.svg' const ExcludedImageNode = ({ image }: ExcludedImageNodeProps) => ( diff --git a/src/Shared/Components/FeatureDescription/FeatureDescriptionModal.tsx b/src/Shared/Components/FeatureDescription/FeatureDescriptionModal.tsx index b8d448591..13ca28577 100644 --- a/src/Shared/Components/FeatureDescription/FeatureDescriptionModal.tsx +++ b/src/Shared/Components/FeatureDescription/FeatureDescriptionModal.tsx @@ -15,14 +15,17 @@ */ import { ChangeEvent, useState } from 'react' + import { ComponentSizeType } from '@Shared/constants' -import { StyledRadioGroup, VisibleModal, stopPropagation } from '../../../Common' + +import { ReactComponent as ArrowOutSquare } from '../../../Assets/Icon/ic-arrow-square-out.svg' +import { stopPropagation, StyledRadioGroup, VisibleModal } from '../../../Common' +import { Button } from '../Button' import { BUTTON_TEXT } from './constant' import { FeatureDescriptionModalProps } from './types' -import './featureDescription.scss' -import { ReactComponent as ArrowOutSquare } from '../../../Assets/Icon/ic-arrow-square-out.svg' import { getImageSize } from './utils' -import { Button } from '../Button' + +import './featureDescription.scss' const FeatureDescriptionModalContent = ({ renderDescriptionContent, diff --git a/src/Shared/Components/FeatureDescription/FeatureTitleWithInfo.tsx b/src/Shared/Components/FeatureDescription/FeatureTitleWithInfo.tsx index 1efacada3..88fa2f878 100644 --- a/src/Shared/Components/FeatureDescription/FeatureTitleWithInfo.tsx +++ b/src/Shared/Components/FeatureDescription/FeatureTitleWithInfo.tsx @@ -15,11 +15,12 @@ */ import { useState } from 'react' -import { DescriptorProps } from './types' + import { ReactComponent as ICHelpOutline } from '../../../Assets/Icon/ic-help-outline.svg' import { BreadCrumb } from '../../../Common' -import { FeatureDescriptionModal } from './FeatureDescriptionModal' import { InfoIconTippy } from '../InfoIconTippy' +import { FeatureDescriptionModal } from './FeatureDescriptionModal' +import { DescriptorProps } from './types' const FeatureTitleWithInfo = ({ additionalContainerClasses, diff --git a/src/Shared/Components/FeatureDescription/types.ts b/src/Shared/Components/FeatureDescription/types.ts index 6e2a69cad..7227dfda9 100644 --- a/src/Shared/Components/FeatureDescription/types.ts +++ b/src/Shared/Components/FeatureDescription/types.ts @@ -15,6 +15,7 @@ */ import React, { ReactNode } from 'react' + import { ImageType } from '../../../Common' import { Breadcrumb } from '../../../Common/BreadCrumb/Types' diff --git a/src/Shared/Components/FlagImage/FlagImage.component.tsx b/src/Shared/Components/FlagImage/FlagImage.component.tsx index 209ee304a..9aa7c21db 100644 --- a/src/Shared/Components/FlagImage/FlagImage.component.tsx +++ b/src/Shared/Components/FlagImage/FlagImage.component.tsx @@ -1,4 +1,5 @@ import { FlagImage as FlagImageHelper } from 'react-international-phone' + import { FlagImageProps } from './types' const FlagImage = ({ country, size }: FlagImageProps) => ( diff --git a/src/Shared/Components/FlagImage/types.ts b/src/Shared/Components/FlagImage/types.ts index fdf9b41dd..5ab63f135 100644 --- a/src/Shared/Components/FlagImage/types.ts +++ b/src/Shared/Components/FlagImage/types.ts @@ -1,4 +1,4 @@ -import { CountryISO2Type } from '@Shared/index' +import { CountryISO2Type } from '@Shared/types' export interface FlagImageProps { country: CountryISO2Type diff --git a/src/Shared/Components/FloatingVariablesSuggestions/FloatingVariablesSuggestions.tsx b/src/Shared/Components/FloatingVariablesSuggestions/FloatingVariablesSuggestions.tsx index ee319caae..dadaf8cc0 100644 --- a/src/Shared/Components/FloatingVariablesSuggestions/FloatingVariablesSuggestions.tsx +++ b/src/Shared/Components/FloatingVariablesSuggestions/FloatingVariablesSuggestions.tsx @@ -14,17 +14,19 @@ * limitations under the License. */ -import React, { useState, useRef, useMemo, useCallback, memo, useEffect } from 'react' +import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react' import Draggable from 'react-draggable' import Tippy from '@tippyjs/react' -import { useWindowSize } from '@Common/Hooks' -import { useAsync } from '@Common/Helper' + import { ReactComponent as ICDrag } from '@Icons/ic-drag.svg' import { ReactComponent as ICViewVariable } from '@Icons/ic-view-variable-toggle.svg' -import Suggestions from './Suggestions' +import { useAsync } from '@Common/Helper' +import { useWindowSize } from '@Common/Hooks' + +import { SUGGESTIONS_SIZE } from './constants' import { getScopedVariables } from './service' +import Suggestions from './Suggestions' import { FloatingVariablesSuggestionsProps } from './types' -import { SUGGESTIONS_SIZE } from './constants' /** * Component uses react-draggable and handles the re-sizing and positioning of the suggestions on the assumption that the suggestions are going to expand to the right and bottom of the collapsed state diff --git a/src/Shared/Components/FloatingVariablesSuggestions/SuggestionItem.tsx b/src/Shared/Components/FloatingVariablesSuggestions/SuggestionItem.tsx index 313ec2752..5f2e664a9 100644 --- a/src/Shared/Components/FloatingVariablesSuggestions/SuggestionItem.tsx +++ b/src/Shared/Components/FloatingVariablesSuggestions/SuggestionItem.tsx @@ -16,9 +16,11 @@ import { useState } from 'react' import DOMPurify from 'dompurify' + import { ClipboardButton, ConditionalWrap, copyToClipboard, Tooltip, YAMLStringify } from '@Common/index' -import { SuggestionsItemProps } from './types' + import { NO_DEFINED_DESCRIPTION } from './constants' +import { SuggestionsItemProps } from './types' const SuggestionItem = ({ variableName, diff --git a/src/Shared/Components/FloatingVariablesSuggestions/Suggestions.tsx b/src/Shared/Components/FloatingVariablesSuggestions/Suggestions.tsx index 4f8d64a06..0a74234c5 100644 --- a/src/Shared/Components/FloatingVariablesSuggestions/Suggestions.tsx +++ b/src/Shared/Components/FloatingVariablesSuggestions/Suggestions.tsx @@ -14,18 +14,20 @@ * limitations under the License. */ -import { useState, memo, useEffect } from 'react' -import { DebouncedSearch, GenericEmptyState, Progressing, Reload } from '@Common/index' -import NoVariables from '@Images/no-artifact.webp' +import { memo, useEffect, useState } from 'react' + import { ReactComponent as ICClose } from '@Icons/ic-cross.svg' import { ReactComponent as ICSearch } from '@Icons/ic-search.svg' import { ReactComponent as ICVariable } from '@Icons/ic-view-variable-toggle.svg' +import NoVariables from '@Images/no-artifact.webp' +import { DebouncedSearch, GenericEmptyState, Progressing, Reload } from '@Common/index' import { ComponentSizeType } from '@Shared/constants' + +import { Button, ButtonStyleType, ButtonVariantType } from '../Button' +import { NO_DEFINED_DESCRIPTION, NO_DEFINED_VALUE } from './constants' import SuggestionItem from './SuggestionItem' -import { SuggestionsProps, ScopedVariableType } from './types' import SuggestionsInfo from './SuggestionsInfo' -import { NO_DEFINED_DESCRIPTION, NO_DEFINED_VALUE } from './constants' -import { Button, ButtonStyleType, ButtonVariantType } from '../Button' +import { ScopedVariableType, SuggestionsProps } from './types' const Suggestions = ({ handleDeActivation, diff --git a/src/Shared/Components/FloatingVariablesSuggestions/SuggestionsInfo.tsx b/src/Shared/Components/FloatingVariablesSuggestions/SuggestionsInfo.tsx index 4caa8806f..95de29e94 100644 --- a/src/Shared/Components/FloatingVariablesSuggestions/SuggestionsInfo.tsx +++ b/src/Shared/Components/FloatingVariablesSuggestions/SuggestionsInfo.tsx @@ -16,9 +16,11 @@ import { memo, useState } from 'react' import { Link } from 'react-router-dom' -import { URLS } from '@Common/Constants' -import { ReactComponent as ICHelp } from '@Icons/ic-help.svg' + import { ReactComponent as ICDown } from '@Icons/ic-chevron-down.svg' +import { ReactComponent as ICHelp } from '@Icons/ic-help.svg' +import { URLS } from '@Common/Constants' + import { SUGGESTIONS_INFO_TITLE } from './constants' const SuggestionsInfo = () => { diff --git a/src/Shared/Components/FloatingVariablesSuggestions/service.ts b/src/Shared/Components/FloatingVariablesSuggestions/service.ts index 5fce4b09c..d43eb0752 100644 --- a/src/Shared/Components/FloatingVariablesSuggestions/service.ts +++ b/src/Shared/Components/FloatingVariablesSuggestions/service.ts @@ -16,6 +16,7 @@ import { get } from '@Common/API' import { ROUTES } from '@Common/Constants' + import { FloatingVariablesSuggestionsProps, ScopedVariableType } from './types' const generateScope = (key: string | number, value: string | number) => { diff --git a/src/Shared/Components/FloatingVariablesSuggestions/types.ts b/src/Shared/Components/FloatingVariablesSuggestions/types.ts index 58df50ccc..1c5230fd3 100644 --- a/src/Shared/Components/FloatingVariablesSuggestions/types.ts +++ b/src/Shared/Components/FloatingVariablesSuggestions/types.ts @@ -14,9 +14,10 @@ * limitations under the License. */ -import { AppConfigProps } from '@Pages/index' import { DraggableBounds } from 'react-draggable' +import { AppConfigProps } from '@Pages/index' + export interface ScopedVariableType { variableName: string shortDescription: string | null diff --git a/src/Shared/Components/FormFieldWrapper/FormFieldInfo.tsx b/src/Shared/Components/FormFieldWrapper/FormFieldInfo.tsx index 57df83d64..5af5f32be 100644 --- a/src/Shared/Components/FormFieldWrapper/FormFieldInfo.tsx +++ b/src/Shared/Components/FormFieldWrapper/FormFieldInfo.tsx @@ -14,9 +14,9 @@ * limitations under the License. */ +import { Icon } from '../Icon' import { FormFieldInfoProps, FormInfoItemProps } from './types' import { getFormErrorElementId } from './utils' -import { Icon } from '../Icon' const FormInfoItem = ({ id, text, icon, textClass }: FormInfoItemProps) => (
diff --git a/src/Shared/Components/FormFieldWrapper/FormFieldLabel.tsx b/src/Shared/Components/FormFieldWrapper/FormFieldLabel.tsx index c55655a93..4ee9d5a97 100644 --- a/src/Shared/Components/FormFieldWrapper/FormFieldLabel.tsx +++ b/src/Shared/Components/FormFieldWrapper/FormFieldLabel.tsx @@ -14,12 +14,14 @@ * limitations under the License. */ -import { ConditionalWrap } from '@Common/Helper' import { ReactElement } from 'react' + +import { ConditionalWrap } from '@Common/Helper' import { Tooltip, TooltipProps } from '@Common/Tooltip' -import { getFormLabelElementId } from './utils' -import { FormFieldLabelProps } from './types' + import { InfoIconTippy } from '..' +import { FormFieldLabelProps } from './types' +import { getFormLabelElementId } from './utils' const FormFieldLabel = ({ label, diff --git a/src/Shared/Components/FormFieldWrapper/FormFieldWrapper.tsx b/src/Shared/Components/FormFieldWrapper/FormFieldWrapper.tsx index 64278afe2..25e2ed9b5 100644 --- a/src/Shared/Components/FormFieldWrapper/FormFieldWrapper.tsx +++ b/src/Shared/Components/FormFieldWrapper/FormFieldWrapper.tsx @@ -14,9 +14,9 @@ * limitations under the License. */ -import { FormFieldWrapperProps } from './types' -import FormFieldLabel from './FormFieldLabel' import FormFieldInfo from './FormFieldInfo' +import FormFieldLabel from './FormFieldLabel' +import { FormFieldWrapperProps } from './types' const FormFieldWrapper = ({ layout, diff --git a/src/Shared/Components/FormFieldWrapper/index.ts b/src/Shared/Components/FormFieldWrapper/index.ts index c176a6255..fbed15afd 100644 --- a/src/Shared/Components/FormFieldWrapper/index.ts +++ b/src/Shared/Components/FormFieldWrapper/index.ts @@ -14,7 +14,7 @@ * limitations under the License. */ +export { default as FormFieldInfo } from './FormFieldInfo' export { default as FormFieldWrapper } from './FormFieldWrapper' export type { FormFieldWrapperProps } from './types' export { getFormFieldAriaAttributes } from './utils' -export { default as FormFieldInfo } from './FormFieldInfo' diff --git a/src/Shared/Components/FormFieldWrapper/types.ts b/src/Shared/Components/FormFieldWrapper/types.ts index b98e2ce5e..74a7f9f70 100644 --- a/src/Shared/Components/FormFieldWrapper/types.ts +++ b/src/Shared/Components/FormFieldWrapper/types.ts @@ -15,9 +15,11 @@ */ import { ReactElement, ReactNode } from 'react' + import { TooltipProps } from '@Common/Tooltip' import { InfoIconTippyProps } from '@Common/Types' import { BorderConfigType, ComponentLayoutType } from '@Shared/types' + import { IconsProps } from '../Icon' export type LabelOrAriaLabelType = diff --git a/src/Shared/Components/FramerComponents/MotionDiv.tsx b/src/Shared/Components/FramerComponents/MotionDiv.tsx index eaae3d3c6..ad3f7f245 100644 --- a/src/Shared/Components/FramerComponents/MotionDiv.tsx +++ b/src/Shared/Components/FramerComponents/MotionDiv.tsx @@ -1,3 +1,3 @@ -import { motion, HTMLMotionProps } from 'framer-motion' +import { HTMLMotionProps, motion } from 'framer-motion' export const MotionDiv = (props: HTMLMotionProps<'div'>) => diff --git a/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx b/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx index 468279c3c..ea373c5c1 100644 --- a/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx +++ b/src/Shared/Components/GenericInfoCard/GenericInfoCard.component.tsx @@ -16,10 +16,13 @@ import { cloneElement } from 'react' import { Link } from 'react-router-dom' + import { ReactComponent as ICCaretSmall } from '@Icons/ic-caret-left-small.svg' import { Tooltip } from '@Common/Tooltip' + import { GenericInfoCardProps } from './types' import { getClassNameForBorderVariant } from './utils' + import './styles.scss' const GenericInfoCard = ({ diff --git a/src/Shared/Components/GenericInfoCard/index.ts b/src/Shared/Components/GenericInfoCard/index.ts index c80c1adbe..763c46d7d 100644 --- a/src/Shared/Components/GenericInfoCard/index.ts +++ b/src/Shared/Components/GenericInfoCard/index.ts @@ -14,5 +14,5 @@ * limitations under the License. */ -export { type GenericInfoCardProps, GenericInfoCardBorderVariant } from './types' export { default as GenericInfoCard } from './GenericInfoCard.component' +export { GenericInfoCardBorderVariant, type GenericInfoCardProps } from './types' diff --git a/src/Shared/Components/GenericSectionErrorState/GenericSectionErrorState.component.tsx b/src/Shared/Components/GenericSectionErrorState/GenericSectionErrorState.component.tsx index f53bef52b..2875146ec 100644 --- a/src/Shared/Components/GenericSectionErrorState/GenericSectionErrorState.component.tsx +++ b/src/Shared/Components/GenericSectionErrorState/GenericSectionErrorState.component.tsx @@ -15,11 +15,13 @@ */ import { ReactNode } from 'react' -import { ComponentSizeType } from '@Shared/constants' + import { ReactComponent as ErrorIcon } from '@Icons/ic-error-exclamation.svg' import { ReactComponent as ICInfoOutline } from '@Icons/ic-info-outline.svg' -import { Icon } from '../Icon' +import { ComponentSizeType } from '@Shared/constants' + import { Button, ButtonVariantType } from '../Button' +import { Icon } from '../Icon' import { GenericSectionErrorStateProps } from './types' const GenericSectionErrorState = ({ diff --git a/src/Shared/Components/GenericSectionErrorState/types.ts b/src/Shared/Components/GenericSectionErrorState/types.ts index d2eefe1ab..df99b7e97 100644 --- a/src/Shared/Components/GenericSectionErrorState/types.ts +++ b/src/Shared/Components/GenericSectionErrorState/types.ts @@ -15,6 +15,7 @@ */ import { ReactNode } from 'react' + import { IconsProps } from '../Icon' export type GenericSectionErrorStateProps = { diff --git a/src/Shared/Components/GettingStartedCard/GettingStarted.tsx b/src/Shared/Components/GettingStartedCard/GettingStarted.tsx index 9819bad70..18604ca28 100644 --- a/src/Shared/Components/GettingStartedCard/GettingStarted.tsx +++ b/src/Shared/Components/GettingStartedCard/GettingStarted.tsx @@ -15,13 +15,15 @@ */ import { ComponentSizeType } from '@Shared/constants' + import GettingToast from '../../../Assets/Img/lifebuoy.png' -import updateLoginCount from './service' import { LOGIN_COUNT, MAX_LOGIN_COUNT, POSTHOG_EVENT_ONBOARDING } from '../../../Common' +import { Button, ButtonStyleType, ButtonVariantType } from '../Button' import { handlePostHogEventUpdate, setActionWithExpiry } from '../Header/utils' +import updateLoginCount from './service' import { GettingStartedType } from './types' + import './gettingStarted.scss' -import { Button, ButtonStyleType, ButtonVariantType } from '../Button' const GettingStartedCard = ({ className, hideGettingStartedCard }: GettingStartedType) => { const onClickedOkay = async () => { diff --git a/src/Shared/Components/GitCommitInfoGeneric/GitCommitInfoGeneric.tsx b/src/Shared/Components/GitCommitInfoGeneric/GitCommitInfoGeneric.tsx index fe0ff6b29..0c861e1f3 100644 --- a/src/Shared/Components/GitCommitInfoGeneric/GitCommitInfoGeneric.tsx +++ b/src/Shared/Components/GitCommitInfoGeneric/GitCommitInfoGeneric.tsx @@ -15,26 +15,28 @@ */ /* eslint-disable eqeqeq */ -import moment from 'moment' import Tippy from '@tippyjs/react' -import { ClipboardButton } from '@Common/ClipboardButton/ClipboardButton' +import moment from 'moment' + +import { ReactComponent as Abort } from '@Icons/ic-abort.svg' +import { ReactComponent as CalendarIcon } from '@Icons/ic-calendar.svg' +import { ReactComponent as Check } from '@Icons/ic-check-circle.svg' import { ReactComponent as Circle } from '@Icons/ic-circle.svg' import { ReactComponent as Commit } from '@Icons/ic-commit.svg' -import { ReactComponent as PersonIcon } from '@Icons/ic-person.svg' -import { ReactComponent as CalendarIcon } from '@Icons/ic-calendar.svg' +import { ReactComponent as Hash } from '@Icons/ic-hash.svg' import { ReactComponent as MessageIcon } from '@Icons/ic-message.svg' +import { ReactComponent as PersonIcon } from '@Icons/ic-person.svg' import { ReactComponent as PullRequestIcon } from '@Icons/ic-pull-request.svg' -import { ReactComponent as Check } from '@Icons/ic-check-circle.svg' -import { ReactComponent as Abort } from '@Icons/ic-abort.svg' -import { SourceTypeMap, createGitCommitUrl, getGitBranchUrl } from '@Common/Common.service' -import { stopPropagation } from '@Common/Helper' -import { DATE_TIME_FORMATS, GitProviderType } from '@Common/Constants' import { ReactComponent as Tag } from '@Icons/ic-tag.svg' +import { ClipboardButton } from '@Common/ClipboardButton/ClipboardButton' +import { createGitCommitUrl, getGitBranchUrl, SourceTypeMap } from '@Common/Common.service' +import { DATE_TIME_FORMATS, GitProviderType } from '@Common/Constants' +import { stopPropagation } from '@Common/Helper' import { getLowerCaseObject, getWebhookDate } from '@Shared/Helpers' -import { ReactComponent as Hash } from '@Icons/ic-hash.svg' -import GitMaterialInfoHeader from './GitMaterialInfoHeader' + import { MATERIAL_EXCLUDE_TIPPY_TEXT } from '../../constants' import { WEBHOOK_EVENT_ACTION_TYPE } from './constants' +import GitMaterialInfoHeader from './GitMaterialInfoHeader' import { GitCommitInfoGenericProps } from './types' const GitCommitInfoGeneric = ({ @@ -215,7 +217,7 @@ const GitCommitInfoGeneric = ({ return (
- {showMaterialInfoHeader && (_isWebhook || lowerCaseCommitInfo.commit) && ( + {showMaterialInfoHeader && (_isWebhook || lowerCaseCommitInfo.commit) && !!materialUrl && ( { diff --git a/src/Shared/Components/GraphVisualizer/GraphVisualizer.tsx b/src/Shared/Components/GraphVisualizer/GraphVisualizer.tsx index 93b481b97..3b329eef5 100644 --- a/src/Shared/Components/GraphVisualizer/GraphVisualizer.tsx +++ b/src/Shared/Components/GraphVisualizer/GraphVisualizer.tsx @@ -28,12 +28,12 @@ import { ReactFlowProvider, Viewport, } from '@xyflow/react' -import '@xyflow/react/dist/style.css' import { DEFAULT_VIEWPORT, NODE_TYPES, PADDING_X, PADDING_Y } from './constants' import { GraphVisualizerExtendedNode, GraphVisualizerProps } from './types' import { processEdges, processNodes } from './utils' +import '@xyflow/react/dist/style.css' import './styles.scss' const options: ReactFlowProps['proOptions'] = { diff --git a/src/Shared/Components/GraphVisualizer/components/DropdownNode.tsx b/src/Shared/Components/GraphVisualizer/components/DropdownNode.tsx index 00bc023e7..934e5be5c 100644 --- a/src/Shared/Components/GraphVisualizer/components/DropdownNode.tsx +++ b/src/Shared/Components/GraphVisualizer/components/DropdownNode.tsx @@ -19,8 +19,8 @@ import { NodeProps } from '@xyflow/react' import { ComponentSizeType } from '@Shared/constants' import { SelectPicker, SelectPickerVariantType } from '../../SelectPicker' -import { DropdownNodeProps } from './types' import { BaseNode } from './BaseNode' +import { DropdownNodeProps } from './types' export const DropdownNode = ({ id, data, isConnectable }: NodeProps) => { const { isError, ...restData } = data diff --git a/src/Shared/Components/GraphVisualizer/components/IconNode.tsx b/src/Shared/Components/GraphVisualizer/components/IconNode.tsx index 675f29cf4..8adc6d2db 100644 --- a/src/Shared/Components/GraphVisualizer/components/IconNode.tsx +++ b/src/Shared/Components/GraphVisualizer/components/IconNode.tsx @@ -16,8 +16,8 @@ import { NodeProps } from '@xyflow/react' -import { IconNodeProps } from './types' import { BaseNode } from './BaseNode' +import { IconNodeProps } from './types' export const IconNode = ({ data, id, isConnectable }: NodeProps) => { const { icon } = data diff --git a/src/Shared/Components/GraphVisualizer/components/TextNode.tsx b/src/Shared/Components/GraphVisualizer/components/TextNode.tsx index cef2619ed..52a1b888b 100644 --- a/src/Shared/Components/GraphVisualizer/components/TextNode.tsx +++ b/src/Shared/Components/GraphVisualizer/components/TextNode.tsx @@ -18,8 +18,8 @@ import { NodeProps } from '@xyflow/react' import { Tooltip } from '@Common/Tooltip' -import { TextNodeProps } from './types' import { BaseNode } from './BaseNode' +import { TextNodeProps } from './types' export const TextNode = ({ id, data, isConnectable }: NodeProps) => { const { icon, text } = data diff --git a/src/Shared/Components/GraphVisualizer/components/index.ts b/src/Shared/Components/GraphVisualizer/components/index.ts index 841bf31b6..569fe88b6 100644 --- a/src/Shared/Components/GraphVisualizer/components/index.ts +++ b/src/Shared/Components/GraphVisualizer/components/index.ts @@ -14,8 +14,7 @@ * limitations under the License. */ +export * from './DropdownNode' export * from './IconNode' export * from './TextNode' -export * from './DropdownNode' - export * from './types' diff --git a/src/Shared/Components/GraphVisualizer/index.ts b/src/Shared/Components/GraphVisualizer/index.ts index 78bc6343d..f8cf291bc 100644 --- a/src/Shared/Components/GraphVisualizer/index.ts +++ b/src/Shared/Components/GraphVisualizer/index.ts @@ -15,4 +15,4 @@ */ export * from './GraphVisualizer' -export type { GraphVisualizerProps, GraphVisualizerNode, GraphVisualizerEdge } from './types' +export type { GraphVisualizerEdge, GraphVisualizerNode, GraphVisualizerProps } from './types' diff --git a/src/Shared/Components/Header/HeaderWithCreateButton/HeaderWithCreateButon.tsx b/src/Shared/Components/Header/HeaderWithCreateButton/HeaderWithCreateButon.tsx index e7577716d..811226972 100644 --- a/src/Shared/Components/Header/HeaderWithCreateButton/HeaderWithCreateButon.tsx +++ b/src/Shared/Components/Header/HeaderWithCreateButton/HeaderWithCreateButon.tsx @@ -16,18 +16,21 @@ import { useState } from 'react' import { useHistory, useLocation, useParams } from 'react-router-dom' -import Button from '@Shared/Components/Button/Button.component' + +import { ReactComponent as AddIcon } from '@Icons/ic-add.svg' import { ReactComponent as DropDown } from '@Icons/ic-caret-down-small.svg' import { ReactComponent as ChartIcon } from '@Icons/ic-charts.svg' -import { ReactComponent as AddIcon } from '@Icons/ic-add.svg' import { ReactComponent as JobIcon } from '@Icons/ic-k8s-job.svg' -import PageHeader from '../PageHeader' +import Button from '@Shared/Components/Button/Button.component' + import { Modal, SERVER_MODE, URLS } from '../../../../Common' import { AppListConstants, ComponentSizeType } from '../../../constants' -import './HeaderWithCreateButton.scss' import { useMainContext } from '../../../Providers' +import PageHeader from '../PageHeader' import { getIsShowingLicenseData } from '../utils' +import './HeaderWithCreateButton.scss' + export interface HeaderWithCreateButtonProps { headerName: string } diff --git a/src/Shared/Components/Header/HelpNav.tsx b/src/Shared/Components/Header/HelpNav.tsx index 31b1e8123..1c6cc2251 100644 --- a/src/Shared/Components/Header/HelpNav.tsx +++ b/src/Shared/Components/Header/HelpNav.tsx @@ -18,12 +18,13 @@ import { Fragment } from 'react' import ReactGA from 'react-ga4' import { NavLink } from 'react-router-dom' import { SliderButton } from '@typeform/embed-react' -import { stopPropagation, URLS } from '../../../Common' -import { InstallationType, HelpNavType, HelpOptionType } from './types' -import { ReactComponent as GettingStartedIcon } from '../../../Assets/Icon/ic-onboarding.svg' + import { ReactComponent as Feedback } from '../../../Assets/Icon/ic-feedback.svg' +import { ReactComponent as GettingStartedIcon } from '../../../Assets/Icon/ic-onboarding.svg' +import { stopPropagation, URLS } from '../../../Common' import { useMainContext } from '../../Providers' import { Icon } from '../Icon' +import { HelpNavType, HelpOptionType, InstallationType } from './types' import { getHelpOptions } from './utils' const HelpNav = ({ diff --git a/src/Shared/Components/Header/IframePromoButton.tsx b/src/Shared/Components/Header/IframePromoButton.tsx index 1585b2e58..85545d044 100644 --- a/src/Shared/Components/Header/IframePromoButton.tsx +++ b/src/Shared/Components/Header/IframePromoButton.tsx @@ -14,11 +14,13 @@ * limitations under the License. */ -import { useState, useCallback } from 'react' -import { GenericEmptyState, stopPropagation, VisibleModal } from '@Common/index' -import { ComponentSizeType } from '@Shared/constants' +import { useCallback, useState } from 'react' import ReactGA from 'react-ga4' + import { ReactComponent as Close } from '@Icons/ic-close.svg' +import { GenericEmptyState, stopPropagation, VisibleModal } from '@Common/index' +import { ComponentSizeType } from '@Shared/constants' + import { Button, ButtonStyleType, ButtonVariantType } from '../Button' export const IframePromoButton = () => { diff --git a/src/Shared/Components/Header/PageHeader.tsx b/src/Shared/Components/Header/PageHeader.tsx index 94dfbe8ab..b31e9034f 100644 --- a/src/Shared/Components/Header/PageHeader.tsx +++ b/src/Shared/Components/Header/PageHeader.tsx @@ -15,24 +15,27 @@ */ import { useEffect, useState } from 'react' -import Tippy from '@tippyjs/react' import ReactGA from 'react-ga4' -import { ReactComponent as ICMediumPaintBucket } from '@IconsV2/ic-medium-paintbucket.svg' +import Tippy from '@tippyjs/react' + import { ReactComponent as ICCaretDownSmall } from '@Icons/ic-caret-down-small.svg' import { ReactComponent as Close } from '@Icons/ic-close.svg' import { ReactComponent as Question } from '@Icons/ic-help-outline.svg' +import { ReactComponent as ICMediumPaintBucket } from '@IconsV2/ic-medium-paintbucket.svg' + import { getAlphabetIcon, TippyCustomized, TippyTheme } from '../../../Common' -import LogoutCard from '../LogoutCard' -import { setActionWithExpiry, handlePostHogEventUpdate, getIsShowingLicenseData } from './utils' -import { InstallationType, ServerInfo, PageHeaderType } from './types' -import { getServerInfo } from './service' -import GettingStartedCard from '../GettingStartedCard/GettingStarted' -import { POSTHOG_EVENT_ONBOARDING, MAX_LOGIN_COUNT } from '../../../Common/Constants' -import HelpNav from './HelpNav' -import AnnouncementBanner from '../AnnouncementBanner/AnnouncementBanner' +import { MAX_LOGIN_COUNT, POSTHOG_EVENT_ONBOARDING } from '../../../Common/Constants' import { useMainContext, useTheme, useUserEmail } from '../../Providers' +import AnnouncementBanner from '../AnnouncementBanner/AnnouncementBanner' +import GettingStartedCard from '../GettingStartedCard/GettingStarted' import { InfoIconTippy } from '../InfoIconTippy' +import LogoutCard from '../LogoutCard' +import HelpNav from './HelpNav' import { IframePromoButton } from './IframePromoButton' +import { getServerInfo } from './service' +import { InstallationType, PageHeaderType, ServerInfo } from './types' +import { getIsShowingLicenseData, handlePostHogEventUpdate, setActionWithExpiry } from './utils' + import './pageHeader.scss' const PageHeader = ({ diff --git a/src/Shared/Components/Header/constants.ts b/src/Shared/Components/Header/constants.ts index 01691578b..e4b2ac646 100644 --- a/src/Shared/Components/Header/constants.ts +++ b/src/Shared/Components/Header/constants.ts @@ -15,11 +15,12 @@ */ import { CONTACT_SUPPORT_LINK, OPEN_NEW_TICKET, RAISE_ISSUE, VIEW_ALL_TICKETS } from '@Shared/constants' -import { HelpOptionType } from './types' + import { ReactComponent as Chat } from '../../../Assets/Icon/ic-chat-circle-dots.svg' import { ReactComponent as EditFile } from '../../../Assets/Icon/ic-edit-file.svg' import { ReactComponent as Files } from '../../../Assets/Icon/ic-files.svg' import { DISCORD_LINK } from '../../../Common' +import { HelpOptionType } from './types' export const EnterpriseHelpOptions: HelpOptionType[] = [ { diff --git a/src/Shared/Components/Header/index.ts b/src/Shared/Components/Header/index.ts index 9ff09f2e4..b8092a768 100644 --- a/src/Shared/Components/Header/index.ts +++ b/src/Shared/Components/Header/index.ts @@ -14,6 +14,6 @@ * limitations under the License. */ -export { default as PageHeader } from './PageHeader' export * from './HeaderWithCreateButton' +export { default as PageHeader } from './PageHeader' export * from './utils' diff --git a/src/Shared/Components/Header/service.ts b/src/Shared/Components/Header/service.ts index 559a9b9f2..a0e3af365 100644 --- a/src/Shared/Components/Header/service.ts +++ b/src/Shared/Components/Header/service.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { ResponseType, post, ROUTES, get } from '../../../Common' +import { get, post, ResponseType, ROUTES } from '../../../Common' import { ServerInfoResponse } from './types' export const updatePostHogEvent = (payload): Promise => post(ROUTES.TELEMETRY_EVENT, payload) diff --git a/src/Shared/Components/Header/types.ts b/src/Shared/Components/Header/types.ts index 275610440..dc352b95a 100644 --- a/src/Shared/Components/Header/types.ts +++ b/src/Shared/Components/Header/types.ts @@ -15,6 +15,7 @@ */ import { ModuleStatus } from '@Shared/types' + import { ResponseType, TippyCustomizedProps } from '../../../Common' export enum InstallationType { diff --git a/src/Shared/Components/Header/utils.ts b/src/Shared/Components/Header/utils.ts index 0957b1d96..feebdc56a 100644 --- a/src/Shared/Components/Header/utils.ts +++ b/src/Shared/Components/Header/utils.ts @@ -14,12 +14,13 @@ * limitations under the License. */ -import { ReactComponent as File } from '@Icons/ic-file-text.svg' import { ReactComponent as Discord } from '@Icons/ic-discord-fill.svg' -import { updatePostHogEvent } from './service' +import { ReactComponent as File } from '@Icons/ic-file-text.svg' + import { DISCORD_LINK, DOCUMENTATION_HOME_PAGE, LOGIN_COUNT } from '../../../Common' import { DevtronLicenseInfo, LicenseStatus } from '../License' import { EnterpriseHelpOptions, OSSHelpOptions, TrialHelpOptions } from './constants' +import { updatePostHogEvent } from './service' const millisecondsInDay = 86400000 export const getDateInMilliseconds = (days) => 1 + new Date().valueOf() + (days ?? 0) * millisecondsInDay diff --git a/src/Shared/Components/Icon/Icon.tsx b/src/Shared/Components/Icon/Icon.tsx index a859c144e..1b68f10d4 100644 --- a/src/Shared/Components/Icon/Icon.tsx +++ b/src/Shared/Components/Icon/Icon.tsx @@ -5,10 +5,12 @@ import { ReactComponent as ICAborted } from '@IconsV2/ic-aborted.svg' import { ReactComponent as ICAdd } from '@IconsV2/ic-add.svg' import { ReactComponent as ICApica } from '@IconsV2/ic-apica.svg' import { ReactComponent as ICAppGroup } from '@IconsV2/ic-app-group.svg' +import { ReactComponent as ICArrowClockwise } from '@IconsV2/ic-arrow-clockwise.svg' import { ReactComponent as ICArrowRight } from '@IconsV2/ic-arrow-right.svg' import { ReactComponent as ICArrowsLeftRight } from '@IconsV2/ic-arrows-left-right.svg' import { ReactComponent as ICAther } from '@IconsV2/ic-ather.svg' import { ReactComponent as ICAzure } from '@IconsV2/ic-azure.svg' +import { ReactComponent as ICBgCluster } from '@IconsV2/ic-bg-cluster.svg' import { ReactComponent as ICBharatpe } from '@IconsV2/ic-bharatpe.svg' import { ReactComponent as ICBitbucket } from '@IconsV2/ic-bitbucket.svg' import { ReactComponent as ICBookOpen } from '@IconsV2/ic-book-open.svg' @@ -33,28 +35,29 @@ import { ReactComponent as ICCookr } from '@IconsV2/ic-cookr.svg' import { ReactComponent as ICCopy } from '@IconsV2/ic-copy.svg' import { ReactComponent as ICCrown } from '@IconsV2/ic-crown.svg' import { ReactComponent as ICCube } from '@IconsV2/ic-cube.svg' -import { ReactComponent as ICDeleteLightning } from '@IconsV2/ic-delete-lightning.svg' import { ReactComponent as ICDelete } from '@IconsV2/ic-delete.svg' +import { ReactComponent as ICDeleteLightning } from '@IconsV2/ic-delete-lightning.svg' import { ReactComponent as ICDelhivery } from '@IconsV2/ic-delhivery.svg' -import { ReactComponent as ICDevtronHeaderLogo } from '@IconsV2/ic-devtron-header-logo.svg' import { ReactComponent as ICDevtron } from '@IconsV2/ic-devtron.svg' +import { ReactComponent as ICDevtronHeaderLogo } from '@IconsV2/ic-devtron-header-logo.svg' import { ReactComponent as ICDockerhub } from '@IconsV2/ic-dockerhub.svg' import { ReactComponent as ICEcr } from '@IconsV2/ic-ecr.svg' import { ReactComponent as ICEnv } from '@IconsV2/ic-env.svg' import { ReactComponent as ICError } from '@IconsV2/ic-error.svg' import { ReactComponent as ICFailure } from '@IconsV2/ic-failure.svg' +import { ReactComponent as ICFileKey } from '@IconsV2/ic-file-key.svg' import { ReactComponent as ICFolderUser } from '@IconsV2/ic-folder-user.svg' import { ReactComponent as ICGear } from '@IconsV2/ic-gear.svg' import { ReactComponent as ICGit } from '@IconsV2/ic-git.svg' import { ReactComponent as ICGithub } from '@IconsV2/ic-github.svg' import { ReactComponent as ICGitlab } from '@IconsV2/ic-gitlab.svg' +import { ReactComponent as ICGoogle } from '@IconsV2/ic-google.svg' import { ReactComponent as ICGoogleArtifactRegistry } from '@IconsV2/ic-google-artifact-registry.svg' import { ReactComponent as ICGoogleContainerRegistry } from '@IconsV2/ic-google-container-registry.svg' -import { ReactComponent as ICGoogle } from '@IconsV2/ic-google.svg' import { ReactComponent as ICGridView } from '@IconsV2/ic-grid-view.svg' import { ReactComponent as ICHeartGreen } from '@IconsV2/ic-heart-green.svg' -import { ReactComponent as ICHeartRedAnimated } from '@IconsV2/ic-heart-red-animated.svg' import { ReactComponent as ICHeartRed } from '@IconsV2/ic-heart-red.svg' +import { ReactComponent as ICHeartRedAnimated } from '@IconsV2/ic-heart-red-animated.svg' import { ReactComponent as ICHelm } from '@IconsV2/ic-helm.svg' import { ReactComponent as ICHelpOutline } from '@IconsV2/ic-help-outline.svg' import { ReactComponent as ICHibernate } from '@IconsV2/ic-hibernate.svg' @@ -64,8 +67,8 @@ import { ReactComponent as ICInfoOutline } from '@IconsV2/ic-info-outline.svg' import { ReactComponent as ICJobColor } from '@IconsV2/ic-job-color.svg' import { ReactComponent as ICK8sJob } from '@IconsV2/ic-k8s-job.svg' import { ReactComponent as ICLdap } from '@IconsV2/ic-ldap.svg' -import { ReactComponent as ICLightningFill } from '@IconsV2/ic-lightning-fill.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' @@ -86,6 +89,7 @@ import { ReactComponent as ICPencil } from '@IconsV2/ic-pencil.svg' import { ReactComponent as ICQuay } from '@IconsV2/ic-quay.svg' import { ReactComponent as ICQuote } from '@IconsV2/ic-quote.svg' import { ReactComponent as ICShieldCheck } from '@IconsV2/ic-shield-check.svg' +import { ReactComponent as ICSlidersVertical } from '@IconsV2/ic-sliders-vertical.svg' import { ReactComponent as ICSortAscending } from '@IconsV2/ic-sort-ascending.svg' import { ReactComponent as ICSortDescending } from '@IconsV2/ic-sort-descending.svg' import { ReactComponent as ICSortable } from '@IconsV2/ic-sortable.svg' @@ -95,6 +99,7 @@ import { ReactComponent as ICStamp } from '@IconsV2/ic-stamp.svg' import { ReactComponent as ICSuccess } from '@IconsV2/ic-success.svg' import { ReactComponent as ICSuspended } from '@IconsV2/ic-suspended.svg' import { ReactComponent as ICTata1mg } from '@IconsV2/ic-tata1mg.svg' +import { ReactComponent as ICTerminalFill } from '@IconsV2/ic-terminal-fill.svg' import { ReactComponent as ICTimeoutTwoDash } from '@IconsV2/ic-timeout-two-dash.svg' import { ReactComponent as ICTimer } from '@IconsV2/ic-timer.svg' import { ReactComponent as ICTravclan } from '@IconsV2/ic-travclan.svg' @@ -113,10 +118,12 @@ export const iconMap = { 'ic-add': ICAdd, 'ic-apica': ICApica, 'ic-app-group': ICAppGroup, + 'ic-arrow-clockwise': ICArrowClockwise, 'ic-arrow-right': ICArrowRight, 'ic-arrows-left-right': ICArrowsLeftRight, 'ic-ather': ICAther, 'ic-azure': ICAzure, + 'ic-bg-cluster': ICBgCluster, 'ic-bharatpe': ICBharatpe, 'ic-bitbucket': ICBitbucket, 'ic-book-open': ICBookOpen, @@ -151,6 +158,7 @@ export const iconMap = { 'ic-env': ICEnv, 'ic-error': ICError, 'ic-failure': ICFailure, + 'ic-file-key': ICFileKey, 'ic-folder-user': ICFolderUser, 'ic-gear': ICGear, 'ic-git': ICGit, @@ -194,6 +202,7 @@ export const iconMap = { 'ic-quay': ICQuay, 'ic-quote': ICQuote, 'ic-shield-check': ICShieldCheck, + 'ic-sliders-vertical': ICSlidersVertical, 'ic-sort-ascending': ICSortAscending, 'ic-sort-descending': ICSortDescending, 'ic-sortable': ICSortable, @@ -203,6 +212,7 @@ export const iconMap = { 'ic-success': ICSuccess, 'ic-suspended': ICSuspended, 'ic-tata1mg': ICTata1mg, + 'ic-terminal-fill': ICTerminalFill, 'ic-timeout-two-dash': ICTimeoutTwoDash, 'ic-timer': ICTimer, 'ic-travclan': ICTravclan, diff --git a/src/Shared/Components/Icon/IconBase.tsx b/src/Shared/Components/Icon/IconBase.tsx index a74db85df..cb837f9fc 100644 --- a/src/Shared/Components/Icon/IconBase.tsx +++ b/src/Shared/Components/Icon/IconBase.tsx @@ -17,8 +17,8 @@ import { ConditionalWrap } from '@Common/Helper' import { Tooltip } from '@Common/Tooltip' -import { IconBaseProps } from './types' import { ICON_STROKE_WIDTH_MAP } from './constants' +import { IconBaseProps } from './types' import './styles.scss' diff --git a/src/Shared/Components/Icon/types.ts b/src/Shared/Components/Icon/types.ts index 53d8f6fc3..d5ddd47b1 100644 --- a/src/Shared/Components/Icon/types.ts +++ b/src/Shared/Components/Icon/types.ts @@ -17,6 +17,7 @@ import { FC, SVGProps } from 'react' import { TooltipProps } from '@Common/Tooltip/types' +import { IconBaseColorType, IconBaseSizeType } from '@Shared/index' type IconMap = Record>> @@ -29,7 +30,7 @@ export interface IconBaseProps { * The size of the icon in pixels. * @default 16 */ - size?: 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 28 | 30 | 32 | 34 | 36 | 40 | 42 | 44 | 48 | 72 | 80 + size?: IconBaseSizeType /** Props to configure the tooltip when hovering over the icon. */ tooltipProps?: TooltipProps /** @@ -37,9 +38,5 @@ export interface IconBaseProps { * If `null`, the default color present in icon is used. * @example `'B500'`, `'N200'`, `'G50'`, `'R700'` */ - color: - | `${'B' | 'N' | 'G' | 'Y' | 'R' | 'V' | 'O'}${`${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00` | '50' | '0'}` - | 'white' - | 'black' - | null + color: IconBaseColorType } diff --git a/src/Shared/Components/IframeContainer/IframeElement.tsx b/src/Shared/Components/IframeContainer/IframeElement.tsx index 41d82521b..c229317db 100644 --- a/src/Shared/Components/IframeContainer/IframeElement.tsx +++ b/src/Shared/Components/IframeContainer/IframeElement.tsx @@ -16,12 +16,14 @@ import { useState } from 'react' import Tippy from '@tippyjs/react' -import { IframeElementProps } from './types' -import { stopPropagation, VisibleModal } from '../../../Common' -import { ReactComponent as ICFullScreen } from '../../../Assets/Icon/ic-fullscreen-2.svg' + import { ReactComponent as ICClose } from '../../../Assets/Icon/ic-close.svg' -import './IframeElement.scss' +import { ReactComponent as ICFullScreen } from '../../../Assets/Icon/ic-fullscreen-2.svg' +import { stopPropagation, VisibleModal } from '../../../Common' import { GenericSectionErrorState } from '../GenericSectionErrorState' +import { IframeElementProps } from './types' + +import './IframeElement.scss' const IframeElement = ({ URL, width, height, title, maxHeight, maxWidth }: IframeElementProps) => { const [showFullScreen, setShowFullScreen] = useState(false) diff --git a/src/Shared/Components/ImageCard/ArtifactInfo/ArtifactInfo.tsx b/src/Shared/Components/ImageCard/ArtifactInfo/ArtifactInfo.tsx index afa7e6571..35129d8c2 100644 --- a/src/Shared/Components/ImageCard/ArtifactInfo/ArtifactInfo.tsx +++ b/src/Shared/Components/ImageCard/ArtifactInfo/ArtifactInfo.tsx @@ -15,14 +15,16 @@ */ import Tippy from '@tippyjs/react' + import { Tooltip } from '@Common/Tooltip' import { RegistryIcon } from '@Shared/Components/RegistryIcon' + +import { ReactComponent as ICBot } from '../../../../Assets/Icon/ic-bot.svg' +import { ReactComponent as DeployIcon } from '../../../../Assets/Icon/ic-nav-rocket.svg' +import { ConditionalWrap, getRandomColor } from '../../../../Common/Helper' import { DefaultUserKey } from '../../../types' -import { ImagePathTippyContentProps } from './types' import { ArtifactInfoProps } from '../types' -import { ConditionalWrap, getRandomColor } from '../../../../Common/Helper' -import { ReactComponent as DeployIcon } from '../../../../Assets/Icon/ic-nav-rocket.svg' -import { ReactComponent as ICBot } from '../../../../Assets/Icon/ic-bot.svg' +import { ImagePathTippyContentProps } from './types' const ImagePathTippyContent = ({ imagePath, registryName }: ImagePathTippyContentProps) => (
diff --git a/src/Shared/Components/ImageCard/SequentialCDCardTitle/DeploymentEnvState/utils.tsx b/src/Shared/Components/ImageCard/SequentialCDCardTitle/DeploymentEnvState/utils.tsx index 154a4c88f..2b89a418e 100644 --- a/src/Shared/Components/ImageCard/SequentialCDCardTitle/DeploymentEnvState/utils.tsx +++ b/src/Shared/Components/ImageCard/SequentialCDCardTitle/DeploymentEnvState/utils.tsx @@ -15,10 +15,11 @@ */ import { Icon } from '@Shared/Components/Icon' + +import { ReactComponent as ICRocketFail } from '../../../../../Assets/Icon/ic-rocket-fail.svg' +import { ReactComponent as ICWorld } from '../../../../../Assets/Icon/ic-world.svg' import { DEPLOYMENT_ENV_TEXT } from './constants' import { GetDeploymentEnvConfigType } from './types' -import { ReactComponent as ICWorld } from '../../../../../Assets/Icon/ic-world.svg' -import { ReactComponent as ICRocketFail } from '../../../../../Assets/Icon/ic-rocket-fail.svg' export const getDeploymentEnvConfig = (envStateText: string): GetDeploymentEnvConfigType => { switch (envStateText) { diff --git a/src/Shared/Components/ImageCard/SequentialCDCardTitle/SequentialCDCardTitle.tsx b/src/Shared/Components/ImageCard/SequentialCDCardTitle/SequentialCDCardTitle.tsx index 019bf74ea..ae75ef196 100644 --- a/src/Shared/Components/ImageCard/SequentialCDCardTitle/SequentialCDCardTitle.tsx +++ b/src/Shared/Components/ImageCard/SequentialCDCardTitle/SequentialCDCardTitle.tsx @@ -16,11 +16,12 @@ import { ReactComponent as ICStack } from '@Icons/ic-stack.svg' import { TargetPlatformListTooltip } from '@Shared/Components/TargetPlatforms' + +import { ImageTagButton } from '../../../../Common' import { ARTIFACT_STATUS, STAGE_TYPE } from '../../../constants' -import { DeploymentEnvState } from './DeploymentEnvState' -import { DEPLOYMENT_ENV_TEXT } from './DeploymentEnvState/constants' import { SequentialCDCardTitleProps } from '../types' -import { ImageTagButton } from '../../../../Common' +import { DEPLOYMENT_ENV_TEXT } from './DeploymentEnvState/constants' +import { DeploymentEnvState } from './DeploymentEnvState' const SequentialCDCardTitle = ({ isLatest, diff --git a/src/Shared/Components/ImageCard/index.ts b/src/Shared/Components/ImageCard/index.ts index aa1ef446f..ef6b39195 100644 --- a/src/Shared/Components/ImageCard/index.ts +++ b/src/Shared/Components/ImageCard/index.ts @@ -14,6 +14,6 @@ * limitations under the License. */ +export * from './ArtifactInfo' export { default as ImageCard } from './ImageCard' export * from './types' -export * from './ArtifactInfo' diff --git a/src/Shared/Components/ImageCard/types.ts b/src/Shared/Components/ImageCard/types.ts index 9c6d3ffbe..d4f8425ed 100644 --- a/src/Shared/Components/ImageCard/types.ts +++ b/src/Shared/Components/ImageCard/types.ts @@ -15,6 +15,7 @@ */ import { ReactNode } from 'react' + import { CDMaterialType, ImageTaggingContainerType } from '../../../Common' import { RegistryType } from '../..' diff --git a/src/Shared/Components/ImageCardAccordion/ImageCardAccordion.tsx b/src/Shared/Components/ImageCardAccordion/ImageCardAccordion.tsx index 0ce73a8a5..431016ce8 100644 --- a/src/Shared/Components/ImageCardAccordion/ImageCardAccordion.tsx +++ b/src/Shared/Components/ImageCardAccordion/ImageCardAccordion.tsx @@ -15,10 +15,11 @@ */ import { useState } from 'react' + +import { ReactComponent as ICChevronDown } from '../../../Assets/Icon/ic-chevron-down.svg' import { CDModalTab, CDModalTabType } from '../../../Common' import { Vulnerabilities } from '../Security/Vulnerabilities' import { AccordionItemProps, ImageCardAccordionProps } from './types' -import { ReactComponent as ICChevronDown } from '../../../Assets/Icon/ic-chevron-down.svg' const AccordionItem = ({ currentTab, activeTab, setActiveTab, buttonText }: AccordionItemProps) => { const handleTabSwitch = () => { diff --git a/src/Shared/Components/ImageCardAccordion/types.ts b/src/Shared/Components/ImageCardAccordion/types.ts index 7958c1574..e73faf7ed 100644 --- a/src/Shared/Components/ImageCardAccordion/types.ts +++ b/src/Shared/Components/ImageCardAccordion/types.ts @@ -15,6 +15,7 @@ */ import React, { ReactNode } from 'react' + import { CDModalTabType, VulnerabilityType } from '../../../Common' import { MaterialSecurityInfoType } from '../../types' import { SidebarPropsType } from '../Security' diff --git a/src/Shared/Components/ImageChipCell/ImageChipCell.component.tsx b/src/Shared/Components/ImageChipCell/ImageChipCell.component.tsx index b8958e126..c2e99bda1 100644 --- a/src/Shared/Components/ImageChipCell/ImageChipCell.component.tsx +++ b/src/Shared/Components/ImageChipCell/ImageChipCell.component.tsx @@ -16,10 +16,13 @@ import { useState } from 'react' import Tippy from '@tippyjs/react' -import { RegistryType } from '@Shared/index' + +import { RegistryType } from '@Shared/types' + +import { RegistryIcon } from '../RegistryIcon' import { ImageChipCellProps } from './types' + import './imageChipCell.scss' -import { RegistryIcon } from '../RegistryIcon' const ImageChipCell = ({ imagePath, diff --git a/src/Shared/Components/ImageChipCell/types.ts b/src/Shared/Components/ImageChipCell/types.ts index 8eab8395e..5fda48a4a 100644 --- a/src/Shared/Components/ImageChipCell/types.ts +++ b/src/Shared/Components/ImageChipCell/types.ts @@ -13,8 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Tippy from '@tippyjs/react' import { ComponentProps, SyntheticEvent } from 'react' +import Tippy from '@tippyjs/react' + import { RegistryType } from '../../types' type ImageChipCellButtonActionProps = diff --git a/src/Shared/Components/ImageWithFallback/ImageWithFallback.component.tsx b/src/Shared/Components/ImageWithFallback/ImageWithFallback.component.tsx index c3ed120d9..a867dbcf7 100644 --- a/src/Shared/Components/ImageWithFallback/ImageWithFallback.component.tsx +++ b/src/Shared/Components/ImageWithFallback/ImageWithFallback.component.tsx @@ -15,6 +15,7 @@ */ import { SyntheticEvent, useEffect, useState } from 'react' + import { ImageWithFallbackProps } from './types' const ImageWithFallback = ({ imageProps, fallbackImage }: ImageWithFallbackProps) => { diff --git a/src/Shared/Components/InfoBlock/InfoBlock.component.tsx b/src/Shared/Components/InfoBlock/InfoBlock.component.tsx index 4bde6d9a4..e87831c04 100644 --- a/src/Shared/Components/InfoBlock/InfoBlock.component.tsx +++ b/src/Shared/Components/InfoBlock/InfoBlock.component.tsx @@ -16,7 +16,8 @@ import { ComponentSizeType } from '@Shared/constants' import { deriveBorderRadiusAndBorderClassFromConfig } from '@Shared/Helpers' -import { InfoBlockProps } from './types' + +import { Button } from '../Button' import { CONTAINER_SIZE_TO_BUTTON_SIZE, CONTAINER_SIZE_TO_CLASS_MAP, @@ -24,7 +25,7 @@ import { VARIANT_TO_BG_MAP, VARIANT_TO_ICON_MAP, } from './constants' -import { Button } from '../Button' +import { InfoBlockProps } from './types' const InfoBlock = ({ layout = 'row', diff --git a/src/Shared/Components/InfoBlock/constants.tsx b/src/Shared/Components/InfoBlock/constants.tsx index d7979ed5f..e372ad68b 100644 --- a/src/Shared/Components/InfoBlock/constants.tsx +++ b/src/Shared/Components/InfoBlock/constants.tsx @@ -15,10 +15,11 @@ */ import { ReactComponent as ICError } from '@Icons/ic-error.svg' +import { ReactComponent as ICHelp } from '@Icons/ic-help.svg' import { ReactComponent as ICSuccess } from '@Icons/ic-success.svg' import { ReactComponent as ICWarningY5 } from '@Icons/ic-warning-y5.svg' -import { ReactComponent as ICHelp } from '@Icons/ic-help.svg' import { ComponentSizeType } from '@Shared/constants' + import { ButtonProps } from '../Button' import { Icon } from '../Icon' import { InfoBlockProps } from './types' diff --git a/src/Shared/Components/InfoBlock/types.ts b/src/Shared/Components/InfoBlock/types.ts index eeb4def4c..776488e81 100644 --- a/src/Shared/Components/InfoBlock/types.ts +++ b/src/Shared/Components/InfoBlock/types.ts @@ -14,9 +14,11 @@ * limitations under the License. */ +import { ReactElement, ReactNode } from 'react' + import { ComponentSizeType } from '@Shared/constants' import { BorderConfigType, ComponentLayoutType } from '@Shared/types' -import { ReactElement, ReactNode } from 'react' + import { ButtonComponentType, ButtonProps } from '../Button' export type InfoBlockProps = { diff --git a/src/Shared/Components/InfoIconTippy/InfoIconTippy.tsx b/src/Shared/Components/InfoIconTippy/InfoIconTippy.tsx index 453891d15..437b05def 100644 --- a/src/Shared/Components/InfoIconTippy/InfoIconTippy.tsx +++ b/src/Shared/Components/InfoIconTippy/InfoIconTippy.tsx @@ -14,10 +14,10 @@ * limitations under the License. */ -import { TippyCustomized } from '../../../Common/TippyCustomized' -import { TippyTheme, InfoIconTippyProps } from '../../../Common/Types' -import { ReactComponent as ICHelpOutline } from '../../../Assets/Icon/ic-help-outline.svg' import { ReactComponent as HelpIcon } from '../../../Assets/Icon/ic-help.svg' +import { ReactComponent as ICHelpOutline } from '../../../Assets/Icon/ic-help-outline.svg' +import { TippyCustomized } from '../../../Common/TippyCustomized' +import { InfoIconTippyProps, TippyTheme } from '../../../Common/Types' const InfoIconTippy = ({ heading, diff --git a/src/Shared/Components/InvalidYAMLTippy/InvalidYAMLTippyWrapper.tsx b/src/Shared/Components/InvalidYAMLTippy/InvalidYAMLTippyWrapper.tsx index 7544a81de..cf25633cf 100644 --- a/src/Shared/Components/InvalidYAMLTippy/InvalidYAMLTippyWrapper.tsx +++ b/src/Shared/Components/InvalidYAMLTippy/InvalidYAMLTippyWrapper.tsx @@ -15,6 +15,7 @@ */ import { Tooltip } from '@Common/Tooltip' + import { InvalidYAMLTippyWrapperProps } from './types' import { getInvalidTippyContent } from './utils' diff --git a/src/Shared/Components/InvalidYAMLTippy/index.ts b/src/Shared/Components/InvalidYAMLTippy/index.ts index 574f315c8..46d759cb4 100644 --- a/src/Shared/Components/InvalidYAMLTippy/index.ts +++ b/src/Shared/Components/InvalidYAMLTippy/index.ts @@ -15,5 +15,5 @@ */ export { default as InvalidYAMLTippyWrapper } from './InvalidYAMLTippyWrapper' -export { getInvalidTippyContent } from './utils' export { InvalidTippyTypeEnum } from './types' +export { getInvalidTippyContent } from './utils' diff --git a/src/Shared/Components/InvalidYAMLTippy/utils.tsx b/src/Shared/Components/InvalidYAMLTippy/utils.tsx index d2c9e5c18..1f8e8398b 100644 --- a/src/Shared/Components/InvalidYAMLTippy/utils.tsx +++ b/src/Shared/Components/InvalidYAMLTippy/utils.tsx @@ -15,6 +15,7 @@ */ import { ReactComponent as ICArrowCounterClockwise } from '@Icons/ic-arrow-counter-clockwise.svg' + import { DEFAULT_INVALID_YAML_ERROR } from './constants' import { InvalidTippyProps, InvalidTippyTypeEnum } from './types' diff --git a/src/Shared/Components/KeyValueTable/KeyValueTable.component.tsx b/src/Shared/Components/KeyValueTable/KeyValueTable.component.tsx index 43855b3d7..a292140df 100644 --- a/src/Shared/Components/KeyValueTable/KeyValueTable.component.tsx +++ b/src/Shared/Components/KeyValueTable/KeyValueTable.component.tsx @@ -14,21 +14,22 @@ * limitations under the License. */ -import { createRef, useEffect, useRef, useState, ReactElement, Fragment, useMemo } from 'react' +import { createRef, Fragment, ReactElement, useEffect, useMemo, useRef, useState } from 'react' import Tippy from '@tippyjs/react' // eslint-disable-next-line import/no-extraneous-dependencies import { followCursor } from 'tippy.js' -import { ReactComponent as ICArrowDown } from '@Icons/ic-sort-arrow-down.svg' +import { ReactComponent as ICAdd } from '@Icons/ic-add.svg' import { ReactComponent as ICClose } from '@Icons/ic-close.svg' import { ReactComponent as ICCross } from '@Icons/ic-cross.svg' -import { ReactComponent as ICAdd } from '@Icons/ic-add.svg' +import { ReactComponent as ICArrowDown } from '@Icons/ic-sort-arrow-down.svg' import { ConditionalWrap, ResizableTagTextArea, SortingOrder, useStateFilters } from '@Common/index' -import { stringComparatorBySortOrder } from '@Shared/Helpers' import { DEFAULT_SECRET_PLACEHOLDER } from '@Shared/constants' +import { stringComparatorBySortOrder } from '@Shared/Helpers' -import { KeyValueRow, KeyValueTableProps } from './KeyValueTable.types' import { DUPLICATE_KEYS_VALIDATION_MESSAGE, EMPTY_KEY_VALIDATION_MESSAGE } from './constants' +import { KeyValueRow, KeyValueTableProps } from './KeyValueTable.types' + import './KeyValueTable.scss' const renderWithReadOnlyTippy = (children: ReactElement) => ( diff --git a/src/Shared/Components/KeyValueTable/KeyValueTable.types.ts b/src/Shared/Components/KeyValueTable/KeyValueTable.types.ts index 51f69fe09..d437b514a 100644 --- a/src/Shared/Components/KeyValueTable/KeyValueTable.types.ts +++ b/src/Shared/Components/KeyValueTable/KeyValueTable.types.ts @@ -15,6 +15,7 @@ */ import { ReactNode } from 'react' + import { ResizableTagTextAreaProps } from '../../../Common' /** diff --git a/src/Shared/Components/License/ActivateLicenseDialog.tsx b/src/Shared/Components/License/ActivateLicenseDialog.tsx index b5a3b5efd..5dc2c7262 100644 --- a/src/Shared/Components/License/ActivateLicenseDialog.tsx +++ b/src/Shared/Components/License/ActivateLicenseDialog.tsx @@ -1,5 +1,8 @@ import { ChangeEvent, SyntheticEvent, useState } from 'react' + import { ReactComponent as ICCross } from '@Icons/ic-cross.svg' +import { API_STATUS_CODES } from '@Common/Constants' +import { showError } from '@Common/index' import { ActivateLicenseDialogProps, Button, @@ -14,11 +17,10 @@ import { ToastManager, ToastVariantType, } from '@Shared/index' -import { API_STATUS_CODES } from '@Common/Constants' -import { showError } from '@Common/index' -import { getGateKeeperUrl } from './utils' -import { activateLicense } from './services' + import { GatekeeperQRDialog, ICDevtronWithBorder } from './License.components' +import { activateLicense } from './services' +import { getGateKeeperUrl } from './utils' const ActivateLicenseDialog = ({ fingerprint, diff --git a/src/Shared/Components/License/DevtronLicenseCard.tsx b/src/Shared/Components/License/DevtronLicenseCard.tsx index f90a75538..25395dcc6 100644 --- a/src/Shared/Components/License/DevtronLicenseCard.tsx +++ b/src/Shared/Components/License/DevtronLicenseCard.tsx @@ -1,20 +1,19 @@ import { useEffect, useRef } from 'react' import { animate, motion, useMotionTemplate, useMotionValue, useTransform } from 'framer-motion' -import { ClipboardButton, getTTLInHumanReadableFormat } from '@Common/index' + import { ReactComponent as ICChatSupport } from '@IconsV2/ic-chat-circle-dots.svg' -import { getThemeOppositeThemeClass } from '@Shared/Providers/ThemeProvider/utils' -import { - AppThemeType, - CONTACT_SUPPORT_LINK, - DevtronLicenseCardProps, - ENTERPRISE_SUPPORT_LINK, - getHandleOpenURL, - LicenseStatus, -} from '@Shared/index' import { ReactComponent as TexturedBG } from '@Images/licenseCardBG.svg' +import { ClipboardButton, getTTLInHumanReadableFormat } from '@Common/index' +import { CONTACT_SUPPORT_LINK, ENTERPRISE_SUPPORT_LINK } from '@Shared/constants' +import { getHandleOpenURL } from '@Shared/Helpers' +import { AppThemeType } from '@Shared/Providers' +import { getThemeOppositeThemeClass } from '@Shared/Providers/ThemeProvider/utils' + import { Button, ButtonVariantType } from '../Button' import { Icon } from '../Icon' +import { DevtronLicenseCardProps, LicenseStatus } from './types' import { getLicenseColorsAccordingToStatus } from './utils' + import './licenseCard.scss' const DAMPEN_FACTOR = 50 diff --git a/src/Shared/Components/License/License.components.tsx b/src/Shared/Components/License/License.components.tsx index d5b4a20f2..df879988a 100644 --- a/src/Shared/Components/License/License.components.tsx +++ b/src/Shared/Components/License/License.components.tsx @@ -1,9 +1,10 @@ -import { ClipboardButton, copyToClipboard, showError } from '@Common/index' - -import { DOCUMENTATION } from '@Common/Constants' import { useEffect, useRef, useState } from 'react' -import { ReactComponent as ICClipboard } from '@Icons/ic-copy.svg' + import { ReactComponent as ICCheck } from '@Icons/ic-check.svg' +import { ReactComponent as ICClipboard } from '@Icons/ic-copy.svg' +import { DOCUMENTATION } from '@Common/Constants' +import { ClipboardButton, copyToClipboard, showError } from '@Common/index' + import { Backdrop, Button, ButtonStyleType, ButtonVariantType, Icon, InfoIconTippy, QRCode } from '..' import { CopyButtonProps, GatekeeperQRDialogProps, InstallFingerprintInfoProps } from './types' import { getGateKeeperUrl } from './utils' diff --git a/src/Shared/Components/License/index.tsx b/src/Shared/Components/License/index.tsx index 68f9c27d5..671b23814 100644 --- a/src/Shared/Components/License/index.tsx +++ b/src/Shared/Components/License/index.tsx @@ -1,6 +1,5 @@ -export { default as DevtronLicenseCard } from './DevtronLicenseCard' -export { parseDevtronLicenseData } from './utils' -export { default as InstallationFingerprintInfo, ICDevtronWithBorder } from './License.components' export { default as ActivateLicenseDialog } from './ActivateLicenseDialog' - +export { default as DevtronLicenseCard } from './DevtronLicenseCard' +export { ICDevtronWithBorder, default as InstallationFingerprintInfo } from './License.components' export * from './types' +export { parseDevtronLicenseData } from './utils' diff --git a/src/Shared/Components/License/types.ts b/src/Shared/Components/License/types.ts index 047348c36..614aa9f97 100644 --- a/src/Shared/Components/License/types.ts +++ b/src/Shared/Components/License/types.ts @@ -1,4 +1,5 @@ -import { AppThemeType, DevtronLicenseBaseDTO, DevtronLicenseDTO } from '@Shared/index' +import { AppThemeType } from '@Shared/Providers' +import { DevtronLicenseBaseDTO, DevtronLicenseDTO } from '@Shared/types' export enum LicenseStatus { ACTIVE = 'ACTIVE', diff --git a/src/Shared/Components/License/utils.tsx b/src/Shared/Components/License/utils.tsx index 8ca3b6d0f..0f011841f 100644 --- a/src/Shared/Components/License/utils.tsx +++ b/src/Shared/Components/License/utils.tsx @@ -1,7 +1,10 @@ import moment from 'moment' + import { DATE_TIME_FORMATS } from '@Common/Constants' -import { DevtronLicenseCardProps, DevtronLicenseDTO, DevtronLicenseInfo, LicenseStatus } from '@Shared/index' import { getUrlWithSearchParams } from '@Common/index' +import { DevtronLicenseDTO } from '@Shared/types' + +import { DevtronLicenseCardProps, DevtronLicenseInfo, LicenseStatus } from './types' export const getLicenseColorsAccordingToStatus = ( licenseStatus: LicenseStatus, diff --git a/src/Shared/Components/LoginBanner/LoginBanner.tsx b/src/Shared/Components/LoginBanner/LoginBanner.tsx index 5fcc6e183..c2981b6af 100644 --- a/src/Shared/Components/LoginBanner/LoginBanner.tsx +++ b/src/Shared/Components/LoginBanner/LoginBanner.tsx @@ -1,6 +1,8 @@ -import { motion } from 'framer-motion' import { useEffect, useState } from 'react' +import { motion } from 'framer-motion' + import LoginBannerImg from '@Images/login-screen-ui.webp' + import { Icon } from '../Icon' import { TESTIMONIAL_CARD_DATA, TESTIMONIAL_CARD_INTERVAL, TRANSITION_EASE_CURVE } from './constants' diff --git a/src/Shared/Components/LogoutCard.tsx b/src/Shared/Components/LogoutCard.tsx index b80ad6aa7..6f2e4cece 100644 --- a/src/Shared/Components/LogoutCard.tsx +++ b/src/Shared/Components/LogoutCard.tsx @@ -16,11 +16,13 @@ import React from 'react' import { useHistory } from 'react-router-dom' -import { useMainContext } from '@Shared/Providers' + import { clearCookieOnLogout } from '@Shared/Helpers' +import { useMainContext } from '@Shared/Providers' + import { getRandomColor, stopPropagation } from '../../Common' -import { ThemeSwitcher } from './ThemeSwitcher' import { Icon } from './Icon' +import { ThemeSwitcher } from './ThemeSwitcher' interface LogoutCardType { className: string diff --git a/src/Shared/Components/MaterialHistory/MaterialHistory.component.tsx b/src/Shared/Components/MaterialHistory/MaterialHistory.component.tsx index d994d645b..9764a8292 100644 --- a/src/Shared/Components/MaterialHistory/MaterialHistory.component.tsx +++ b/src/Shared/Components/MaterialHistory/MaterialHistory.component.tsx @@ -14,9 +14,11 @@ * limitations under the License. */ +import { useMemo } from 'react' + import { getWebhookDate } from '@Shared/Helpers' import { MaterialHistoryType } from '@Shared/Services' -import { useMemo } from 'react' + import { SourceTypeMap } from '../../../Common' import { GitCommitInfoGeneric } from '../GitCommitInfoGeneric' import { MaterialHistoryProps } from './types' diff --git a/src/Shared/Components/NumbersCount/NumbersCount.component.tsx b/src/Shared/Components/NumbersCount/NumbersCount.component.tsx index e28d0a9cc..95714af75 100644 --- a/src/Shared/Components/NumbersCount/NumbersCount.component.tsx +++ b/src/Shared/Components/NumbersCount/NumbersCount.component.tsx @@ -15,6 +15,7 @@ */ import { ReactComponent as ICTilde } from '@Icons/ic-tilde.svg' + import { NumbersCountProps } from './types' const NumbersCount = ({ count, isApprox, isSelected }: NumbersCountProps) => ( diff --git a/src/Shared/Components/PhoneInput/PhoneInput.component.tsx b/src/Shared/Components/PhoneInput/PhoneInput.component.tsx index f34d130d2..34e452a62 100644 --- a/src/Shared/Components/PhoneInput/PhoneInput.component.tsx +++ b/src/Shared/Components/PhoneInput/PhoneInput.component.tsx @@ -1,10 +1,12 @@ -import { usePhoneInput } from 'react-international-phone' -import { CountryISO2Type } from '@Shared/index' import { useRef, useState } from 'react' -import { PhoneInputProps } from './types' +import { usePhoneInput } from 'react-international-phone' + +import { CountryISO2Type } from '@Shared/types' + import { CountrySelect } from '../CountrySelect' import { CustomInput } from '../CustomInput' import { FormFieldInfo } from '../FormFieldWrapper' +import { PhoneInputProps } from './types' const PhoneInput = ({ error, diff --git a/src/Shared/Components/PhoneInput/types.ts b/src/Shared/Components/PhoneInput/types.ts index da2c4a3d5..ea8461404 100644 --- a/src/Shared/Components/PhoneInput/types.ts +++ b/src/Shared/Components/PhoneInput/types.ts @@ -1,4 +1,5 @@ import { ComponentProps } from 'react' + import { CountrySelect } from '../CountrySelect' export interface PhoneInputProps { diff --git a/src/Shared/Components/Plugin/PluginCard.tsx b/src/Shared/Components/Plugin/PluginCard.tsx index 62c022c0c..7fa8c4149 100644 --- a/src/Shared/Components/Plugin/PluginCard.tsx +++ b/src/Shared/Components/Plugin/PluginCard.tsx @@ -14,11 +14,11 @@ * limitations under the License. */ +import { ReactComponent as ICBookOpen } from '../../../Assets/Icon/ic-book-open.svg' import { Checkbox, CHECKBOX_VALUE, stopPropagation } from '../../../Common' import PluginImageContainer from './PluginImageContainer' import PluginTagsContainer from './PluginTagsContainer' import { PluginCardProps } from './types' -import { ReactComponent as ICBookOpen } from '../../../Assets/Icon/ic-book-open.svg' const PluginCard = ({ isSelectable, diff --git a/src/Shared/Components/Plugin/PluginImageContainer.tsx b/src/Shared/Components/Plugin/PluginImageContainer.tsx index 141d9c1b4..ab8bb88ac 100644 --- a/src/Shared/Components/Plugin/PluginImageContainer.tsx +++ b/src/Shared/Components/Plugin/PluginImageContainer.tsx @@ -14,9 +14,9 @@ * limitations under the License. */ -import { PluginImageContainerProps } from './types' import { ReactComponent as ICLegoBlock } from '../../../Assets/Icon/ic-lego-block.svg' import { ImageWithFallback } from '../ImageWithFallback' +import { PluginImageContainerProps } from './types' const PluginImageContainer = ({ imageProps, fallbackImageClassName }: PluginImageContainerProps) => ( ({ container: (base, state) => ({ diff --git a/src/Shared/Components/RegistryIcon/constants.tsx b/src/Shared/Components/RegistryIcon/constants.tsx index e534ce16c..d464236c9 100644 --- a/src/Shared/Components/RegistryIcon/constants.tsx +++ b/src/Shared/Components/RegistryIcon/constants.tsx @@ -16,6 +16,7 @@ import { RegistryTypeDetailType } from '@Common/Types' import { RegistryType } from '@Shared/types' + import { RegistryIcon } from './RegistryIcon' export const REGISTRY_TYPE_MAP: Record = { diff --git a/src/Shared/Components/RegistryIcon/index.ts b/src/Shared/Components/RegistryIcon/index.ts index 48f834351..f47fdefd5 100644 --- a/src/Shared/Components/RegistryIcon/index.ts +++ b/src/Shared/Components/RegistryIcon/index.ts @@ -14,5 +14,5 @@ * limitations under the License. */ -export * from './RegistryIcon' export * from './constants' +export * from './RegistryIcon' diff --git a/src/Shared/Components/RegistryIcon/types.ts b/src/Shared/Components/RegistryIcon/types.ts index b78024c65..bd974aa22 100644 --- a/src/Shared/Components/RegistryIcon/types.ts +++ b/src/Shared/Components/RegistryIcon/types.ts @@ -15,6 +15,7 @@ */ import { RegistryType } from '@Shared/types' + import { IconsProps } from '../Icon' export interface RegistryIconProps { diff --git a/src/Shared/Components/SSOProviderIcon/SSOProviderIcon.tsx b/src/Shared/Components/SSOProviderIcon/SSOProviderIcon.tsx index 7a3fe9e43..76ec0bdb7 100644 --- a/src/Shared/Components/SSOProviderIcon/SSOProviderIcon.tsx +++ b/src/Shared/Components/SSOProviderIcon/SSOProviderIcon.tsx @@ -15,9 +15,9 @@ */ import { SSOProvider } from '@Common/Constants' -import { SSOProviderIconProps } from './types' import { Icon, IconName } from '../Icon' +import { SSOProviderIconProps } from './types' const ssoProviderIconMap: Record = { [SSOProvider.google]: 'ic-google', diff --git a/src/Shared/Components/ScannedByToolModal/ScannedByToolModal.tsx b/src/Shared/Components/ScannedByToolModal/ScannedByToolModal.tsx index 51097ab86..9772b5832 100644 --- a/src/Shared/Components/ScannedByToolModal/ScannedByToolModal.tsx +++ b/src/Shared/Components/ScannedByToolModal/ScannedByToolModal.tsx @@ -15,9 +15,11 @@ */ import React from 'react' + import { ReactComponent as ICScanFallback } from '@Icons/ic-scan-fallback.svg' -import { ScannedByToolModalProps } from './types' + import { ImageWithFallback } from '../ImageWithFallback' +import { ScannedByToolModalProps } from './types' const ScannedByToolModal: React.FC = ({ scanToolName, diff --git a/src/Shared/Components/Security/SecurityDetailsCards/SecurityCard.tsx b/src/Shared/Components/Security/SecurityDetailsCards/SecurityCard.tsx index b5296a7d4..c728c555f 100644 --- a/src/Shared/Components/Security/SecurityDetailsCards/SecurityCard.tsx +++ b/src/Shared/Components/Security/SecurityDetailsCards/SecurityCard.tsx @@ -14,17 +14,19 @@ * limitations under the License. */ -import { SegmentedBarChart } from '@Common/SegmentedBarChart' -import { ReactComponent as ICShieldWarning } from '@Icons/ic-shield-warning-outline.svg' -import { ReactComponent as ICShieldSecure } from '@Icons/ic-shield-check.svg' -import { ReactComponent as ICError } from '@Icons/ic-error-exclamation.svg' import { ReactComponent as ICArrowRight } from '@Icons/ic-caret-down-small.svg' -import { SecurityCardProps } from './types' -import { SUB_CATEGORIES } from '../SecurityModal/types' +import { ReactComponent as ICError } from '@Icons/ic-error-exclamation.svg' +import { ReactComponent as ICShieldSecure } from '@Icons/ic-shield-check.svg' +import { ReactComponent as ICShieldWarning } from '@Icons/ic-shield-warning-outline.svg' +import { SegmentedBarChart } from '@Common/SegmentedBarChart' + +import { SECURITY_CONFIG } from '../constants' import { SEVERITIES } from '../SecurityModal/constants' -import './securityCard.scss' +import { SUB_CATEGORIES } from '../SecurityModal/types' import { getTotalSeverities } from '../utils' -import { SECURITY_CONFIG } from '../constants' +import { SecurityCardProps } from './types' + +import './securityCard.scss' const SecurityCard = ({ category, diff --git a/src/Shared/Components/Security/SecurityDetailsCards/SecurityDetailsCards.tsx b/src/Shared/Components/Security/SecurityDetailsCards/SecurityDetailsCards.tsx index 132d5ee26..27d5301b1 100644 --- a/src/Shared/Components/Security/SecurityDetailsCards/SecurityDetailsCards.tsx +++ b/src/Shared/Components/Security/SecurityDetailsCards/SecurityDetailsCards.tsx @@ -14,19 +14,22 @@ * limitations under the License. */ -import { ScannedByToolModal } from '@Shared/Components/ScannedByToolModal' -import { EMPTY_STATE_STATUS } from '@Shared/constants' import { useState } from 'react' -import { GenericEmptyState } from '@Common/index' + import { ReactComponent as NoVulnerability } from '@Icons/ic-vulnerability-not-found.svg' +import { GenericEmptyState } from '@Common/index' import { GenericSectionErrorState } from '@Shared/Components/GenericSectionErrorState' -import SecurityCard from './SecurityCard' -import { CATEGORIES, SecurityModalStateType, SUB_CATEGORIES } from '../SecurityModal/types' -import { SecurityCardProps, SecurityDetailsCardsProps } from './types' +import { ScannedByToolModal } from '@Shared/Components/ScannedByToolModal' +import { EMPTY_STATE_STATUS } from '@Shared/constants' + import { SecurityModal } from '../SecurityModal' import { DEFAULT_SECURITY_MODAL_IMAGE_STATE } from '../SecurityModal/constants' +import { CATEGORIES, SecurityModalStateType, SUB_CATEGORIES } from '../SecurityModal/types' import { ScanCategories, ScanSubCategories } from '../types' -import { getSecurityConfig, getCompiledSecurityThreats, getTotalSeverities, getStatusForScanList } from '../utils' +import { getCompiledSecurityThreats, getSecurityConfig, getStatusForScanList, getTotalSeverities } from '../utils' +import SecurityCard from './SecurityCard' +import { SecurityCardProps, SecurityDetailsCardsProps } from './types' + import './securityCard.scss' const SecurityDetailsCards = ({ scanResult, Sidebar }: SecurityDetailsCardsProps) => { diff --git a/src/Shared/Components/Security/SecurityModal/SecurityModal.tsx b/src/Shared/Components/Security/SecurityModal/SecurityModal.tsx index fb4a0c75b..4e0c55de6 100644 --- a/src/Shared/Components/Security/SecurityModal/SecurityModal.tsx +++ b/src/Shared/Components/Security/SecurityModal/SecurityModal.tsx @@ -15,24 +15,27 @@ */ import React, { useState } from 'react' + +import { ReactComponent as ICBack } from '@Icons/ic-caret-left-small.svg' +import { ReactComponent as ICClose } from '@Icons/ic-close.svg' import { - ErrorScreenManager, ClipboardButton, + ErrorScreenManager, GenericEmptyState, ImageType, Progressing, stopPropagation, VisibleModal2, } from '@Common/index' -import { ReactComponent as ICClose } from '@Icons/ic-close.svg' -import { ReactComponent as ICBack } from '@Icons/ic-caret-left-small.svg' import { Button, ButtonStyleType, ButtonVariantType } from '@Shared/Components/Button' import { ComponentSizeType } from '@Shared/constants' -import { Table, InfoCard } from './components' -import { getDefaultSecurityModalState } from './constants' -import { getTableData, getInfoCardData } from './config' -import { SecurityModalPropsType, SecurityModalStateType, DetailViewDataType } from './types' + import { getEmptyStateValues } from './config/EmptyState' +import { InfoCard, Table } from './components' +import { getInfoCardData, getTableData } from './config' +import { getDefaultSecurityModalState } from './constants' +import { DetailViewDataType, SecurityModalPropsType, SecurityModalStateType } from './types' + import './styles.scss' /** diff --git a/src/Shared/Components/Security/SecurityModal/components/IndexedTextDisplay.tsx b/src/Shared/Components/Security/SecurityModal/components/IndexedTextDisplay.tsx index 08e20a535..b72479055 100644 --- a/src/Shared/Components/Security/SecurityModal/components/IndexedTextDisplay.tsx +++ b/src/Shared/Components/Security/SecurityModal/components/IndexedTextDisplay.tsx @@ -15,8 +15,10 @@ */ import React from 'react' -import { ClipboardButton } from '@Common/index' + import { ReactComponent as ICInfoOutline } from '@Icons/ic-info-outlined.svg' +import { ClipboardButton } from '@Common/index' + import { IndexedTextDisplayPropsType } from '../types' const EmptyState: React.FC<{ href: string }> = ({ href }) => ( diff --git a/src/Shared/Components/Security/SecurityModal/components/InfoCard.tsx b/src/Shared/Components/Security/SecurityModal/components/InfoCard.tsx index f8f097c2e..086f5268b 100644 --- a/src/Shared/Components/Security/SecurityModal/components/InfoCard.tsx +++ b/src/Shared/Components/Security/SecurityModal/components/InfoCard.tsx @@ -16,10 +16,12 @@ import React from 'react' import dayjs from 'dayjs' -import { ScannedByToolModal } from '@Shared/Components/ScannedByToolModal' -import { SegmentedBarChart } from '@Common/SegmentedBarChart' + import { ReactComponent as ICClock } from '@Icons/ic-clock.svg' -import { ZERO_TIME_STRING, DATE_TIME_FORMATS } from '../../../../../Common/Constants' +import { SegmentedBarChart } from '@Common/SegmentedBarChart' +import { ScannedByToolModal } from '@Shared/Components/ScannedByToolModal' + +import { DATE_TIME_FORMATS, ZERO_TIME_STRING } from '../../../../../Common/Constants' import { InfoCardPropsType } from '../types' const InfoCard: React.FC = ({ entities, lastScanTimeString, scanToolName, scanToolUrl }) => ( diff --git a/src/Shared/Components/Security/SecurityModal/components/OpenDetailViewButton.tsx b/src/Shared/Components/Security/SecurityModal/components/OpenDetailViewButton.tsx index fa26ed470..67c3744d5 100644 --- a/src/Shared/Components/Security/SecurityModal/components/OpenDetailViewButton.tsx +++ b/src/Shared/Components/Security/SecurityModal/components/OpenDetailViewButton.tsx @@ -15,6 +15,7 @@ */ import { PropsWithChildren } from 'react' + import { OpenDetailViewButtonProps } from '../types' const OpenDetailViewButton = ({ diff --git a/src/Shared/Components/Security/SecurityModal/components/Table.tsx b/src/Shared/Components/Security/SecurityModal/components/Table.tsx index 3eff5bf88..c857e11b4 100644 --- a/src/Shared/Components/Security/SecurityModal/components/Table.tsx +++ b/src/Shared/Components/Security/SecurityModal/components/Table.tsx @@ -14,10 +14,12 @@ * limitations under the License. */ -import React, { useState, useMemo } from 'react' -import { SortableTableHeaderCell } from '@Common/SortableTableHeaderCell' -import { SortingOrder } from '@Common/Constants' +import React, { useMemo, useState } from 'react' + import { ReactComponent as ICExpand } from '@Icons/ic-expand.svg' +import { SortingOrder } from '@Common/Constants' +import { SortableTableHeaderCell } from '@Common/SortableTableHeaderCell' + import { SortOrderEnum, TablePropsType, TableSortStateType } from '../types' import { compareStringAndObject } from '../utils' diff --git a/src/Shared/Components/Security/SecurityModal/components/index.ts b/src/Shared/Components/Security/SecurityModal/components/index.ts index b8027ff7e..645d3df2a 100644 --- a/src/Shared/Components/Security/SecurityModal/components/index.ts +++ b/src/Shared/Components/Security/SecurityModal/components/index.ts @@ -14,6 +14,6 @@ * limitations under the License. */ -export { default as Table } from './Table' export { default as InfoCard } from './InfoCard' export { default as OpenDetailViewButton } from './OpenDetailViewButton' +export { default as Table } from './Table' diff --git a/src/Shared/Components/Security/SecurityModal/config/CodeScan.tsx b/src/Shared/Components/Security/SecurityModal/config/CodeScan.tsx index 068904b4c..8d89bdd68 100644 --- a/src/Shared/Components/Security/SecurityModal/config/CodeScan.tsx +++ b/src/Shared/Components/Security/SecurityModal/config/CodeScan.tsx @@ -14,17 +14,11 @@ * limitations under the License. */ +import { getCVEUrlFromCVEName } from '../../utils' +import { OpenDetailViewButton } from '../components' import IndexedTextDisplay from '../components/IndexedTextDisplay' -import { - compareSeverities, - compareSeverity, - getScanCompletedEmptyState, - mapSeveritiesToSegmentedBarChartEntities, - stringifySeverities, -} from '../utils' import { SCAN_FAILED_EMPTY_STATE, SCAN_IN_PROGRESS_EMPTY_STATE, SEVERITY_DEFAULT_SORT_ORDER } from '../constants' import { - ScanResultDTO, CATEGORIES, CodeScan, CodeScanExposedSecretsListType, @@ -33,13 +27,19 @@ import { EmptyStateType, InfoCardPropsType, OpenDetailViewButtonProps, - SUB_CATEGORIES, + ScanResultDTO, SecurityModalStateType, StatusType, + SUB_CATEGORIES, TablePropsType, } from '../types' -import { OpenDetailViewButton } from '../components' -import { getCVEUrlFromCVEName } from '../../utils' +import { + compareSeverities, + compareSeverity, + getScanCompletedEmptyState, + mapSeveritiesToSegmentedBarChartEntities, + stringifySeverities, +} from '../utils' export const getCodeScanVulnerabilities = (data: CodeScan['vulnerability'], hidePolicy: boolean) => ({ headers: [ diff --git a/src/Shared/Components/Security/SecurityModal/config/EmptyState.tsx b/src/Shared/Components/Security/SecurityModal/config/EmptyState.tsx index d6a4d52dd..ae28e3fd0 100644 --- a/src/Shared/Components/Security/SecurityModal/config/EmptyState.tsx +++ b/src/Shared/Components/Security/SecurityModal/config/EmptyState.tsx @@ -14,10 +14,10 @@ * limitations under the License. */ +import { CATEGORIES, DetailViewDataType, ScanResultDTO, SecurityModalStateType } from '../types' import { getCodeScanEmptyState } from './CodeScan' import { getImageScanEmptyState } from './ImageScan' import { getKubernetesManifestEmptyState } from './KubernetesManifest' -import { ScanResultDTO, CATEGORIES, DetailViewDataType, SecurityModalStateType } from '../types' export const getEmptyStateValues = ( data: ScanResultDTO, diff --git a/src/Shared/Components/Security/SecurityModal/config/ImageScan.tsx b/src/Shared/Components/Security/SecurityModal/config/ImageScan.tsx index cf151e51d..393682510 100644 --- a/src/Shared/Components/Security/SecurityModal/config/ImageScan.tsx +++ b/src/Shared/Components/Security/SecurityModal/config/ImageScan.tsx @@ -15,24 +15,28 @@ */ import dayjs from 'dayjs' -import { Progressing } from '@Common/Progressing' + import { ReactComponent as ICError } from '@Icons/ic-error-cross.svg' import { ReactComponent as ICSuccess } from '@Icons/ic-success.svg' -import { ZERO_TIME_STRING, DATE_TIME_FORMATS } from '../../../../../Common/Constants' +import { Progressing } from '@Common/Progressing' + +import { DATE_TIME_FORMATS, ZERO_TIME_STRING } from '../../../../../Common/Constants' +import { OpenDetailViewButton } from '../components' +import { SCAN_FAILED_EMPTY_STATE, SCAN_IN_PROGRESS_EMPTY_STATE, SEVERITY_DEFAULT_SORT_ORDER } from '../constants' import { + CATEGORIES, DetailViewDataType, - ImageScanVulnerabilityListType, + EmptyStateType, ImageScan, - SUB_CATEGORIES, - SecurityModalStateType, - TablePropsType, - StatusType, - InfoCardPropsType, ImageScanLicenseListType, - EmptyStateType, - ScanResultDTO, - CATEGORIES, + ImageScanVulnerabilityListType, + InfoCardPropsType, OpenDetailViewButtonProps, + ScanResultDTO, + SecurityModalStateType, + StatusType, + SUB_CATEGORIES, + TablePropsType, } from '../types' import { compareSeverities, @@ -42,9 +46,7 @@ import { mapSeveritiesToSegmentedBarChartEntities, stringifySeverities, } from '../utils' -import { SCAN_FAILED_EMPTY_STATE, SCAN_IN_PROGRESS_EMPTY_STATE, SEVERITY_DEFAULT_SORT_ORDER } from '../constants' import { getCodeScanVulnerabilities } from './CodeScan' -import { OpenDetailViewButton } from '../components' const getVulnerabilitiesDetailBaseData = (element: ImageScanVulnerabilityListType) => ({ titlePrefix: 'Image', diff --git a/src/Shared/Components/Security/SecurityModal/config/InfoCard.tsx b/src/Shared/Components/Security/SecurityModal/config/InfoCard.tsx index 731df4b42..c55d8daa6 100644 --- a/src/Shared/Components/Security/SecurityModal/config/InfoCard.tsx +++ b/src/Shared/Components/Security/SecurityModal/config/InfoCard.tsx @@ -14,9 +14,9 @@ * limitations under the License. */ -import { InfoCardPropsType, ScanResultDTO, CATEGORIES, SecurityModalStateType } from '../types' -import { getImageScanInfoCardData } from './ImageScan' +import { CATEGORIES, InfoCardPropsType, ScanResultDTO, SecurityModalStateType } from '../types' import { getCodeScanInfoCardData } from './CodeScan' +import { getImageScanInfoCardData } from './ImageScan' import { getKubernetesManifestInfoCardData } from './KubernetesManifest' export const getInfoCardData = ( diff --git a/src/Shared/Components/Security/SecurityModal/config/KubernetesManifest.tsx b/src/Shared/Components/Security/SecurityModal/config/KubernetesManifest.tsx index af80891ee..78e7a9336 100644 --- a/src/Shared/Components/Security/SecurityModal/config/KubernetesManifest.tsx +++ b/src/Shared/Components/Security/SecurityModal/config/KubernetesManifest.tsx @@ -14,20 +14,20 @@ * limitations under the License. */ -import { getScanCompletedEmptyState, mapSeveritiesToSegmentedBarChartEntities } from '../utils' +import { SCAN_FAILED_EMPTY_STATE, SCAN_IN_PROGRESS_EMPTY_STATE } from '../constants' import { - ScanResultDTO, CATEGORIES, DetailViewDataType, EmptyStateType, InfoCardPropsType, KubernetesManifest, OpenDetailViewButtonProps, - SUB_CATEGORIES, + ScanResultDTO, SecurityModalStateType, + SUB_CATEGORIES, TablePropsType, } from '../types' -import { SCAN_FAILED_EMPTY_STATE, SCAN_IN_PROGRESS_EMPTY_STATE } from '../constants' +import { getScanCompletedEmptyState, mapSeveritiesToSegmentedBarChartEntities } from '../utils' import { getCodeScanExposedSecrets, getCodeScanMisconfigurations } from './CodeScan' export const getKubernetesManifestTableData = ( diff --git a/src/Shared/Components/Security/SecurityModal/config/Sidebar.ts b/src/Shared/Components/Security/SecurityModal/config/Sidebar.ts index 5666470cd..569f55e3d 100644 --- a/src/Shared/Components/Security/SecurityModal/config/Sidebar.ts +++ b/src/Shared/Components/Security/SecurityModal/config/Sidebar.ts @@ -16,7 +16,7 @@ import { ScanCategoriesWithLicense } from '../../types' import { CATEGORY_LABELS, SUB_CATEGORY_LABELS } from '../constants' -import { CATEGORIES, SUB_CATEGORIES, SidebarDataType } from '../types' +import { CATEGORIES, SidebarDataType, SUB_CATEGORIES } from '../types' export const getSidebarData = (categoriesConfig: Record): SidebarDataType[] => { const { imageScan, codeScan, kubernetesManifest, imageScanLicenseRisks } = categoriesConfig diff --git a/src/Shared/Components/Security/SecurityModal/config/Table.tsx b/src/Shared/Components/Security/SecurityModal/config/Table.tsx index cb36d5e3f..e9adc0faf 100644 --- a/src/Shared/Components/Security/SecurityModal/config/Table.tsx +++ b/src/Shared/Components/Security/SecurityModal/config/Table.tsx @@ -14,9 +14,9 @@ * limitations under the License. */ -import { ScanResultDTO, CATEGORIES, OpenDetailViewButtonProps, SecurityModalStateType, TablePropsType } from '../types' -import { getImageScanTableData } from './ImageScan' +import { CATEGORIES, OpenDetailViewButtonProps, ScanResultDTO, SecurityModalStateType, TablePropsType } from '../types' import { getCodeScanTableData } from './CodeScan' +import { getImageScanTableData } from './ImageScan' import { getKubernetesManifestTableData } from './KubernetesManifest' export const getTableData = ( diff --git a/src/Shared/Components/Security/SecurityModal/config/index.ts b/src/Shared/Components/Security/SecurityModal/config/index.ts index 55215fc09..974736e69 100644 --- a/src/Shared/Components/Security/SecurityModal/config/index.ts +++ b/src/Shared/Components/Security/SecurityModal/config/index.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -export { getTableData } from './Table' +export { getProgressingStateForStatus } from './ImageScan' export { getInfoCardData } from './InfoCard' export { getSidebarData } from './Sidebar' -export { getProgressingStateForStatus } from './ImageScan' +export { getTableData } from './Table' diff --git a/src/Shared/Components/Security/SecurityModal/constants.tsx b/src/Shared/Components/Security/SecurityModal/constants.tsx index 41c5e7847..f838c24ed 100644 --- a/src/Shared/Components/Security/SecurityModal/constants.tsx +++ b/src/Shared/Components/Security/SecurityModal/constants.tsx @@ -14,17 +14,18 @@ * limitations under the License. */ -import PageNotFound from '@Images/ic-page-not-found.svg' import { ReactComponent as MechanicalOperation } from '@Icons/ic-mechanical-operation.svg' +import PageNotFound from '@Images/ic-page-not-found.svg' + +import { ScanCategoriesWithLicense } from '../types' import { CATEGORIES, - SUB_CATEGORIES, - SeveritiesDTO, - SortOrderEnum, EmptyStateType, SecurityModalStateType, + SeveritiesDTO, + SortOrderEnum, + SUB_CATEGORIES, } from './types' -import { ScanCategoriesWithLicense } from '../types' export const DEFAULT_SECURITY_MODAL_IMAGE_STATE = { category: CATEGORIES.IMAGE_SCAN, diff --git a/src/Shared/Components/Security/SecurityModal/index.ts b/src/Shared/Components/Security/SecurityModal/index.ts index fb4207073..466b11348 100644 --- a/src/Shared/Components/Security/SecurityModal/index.ts +++ b/src/Shared/Components/Security/SecurityModal/index.ts @@ -14,21 +14,21 @@ * limitations under the License. */ +export { getProgressingStateForStatus, getSidebarData } from './config' +export { CATEGORY_LABELS } from './constants' export { default as SecurityModal } from './SecurityModal' -export { - getSecurityScanSeveritiesCount, - getTotalVulnerabilityCount, - parseGetResourceScanDetailsResponse, -} from './utils' +export { getSecurityScan } from './service' export type { + GetResourceScanDetailsPayloadType, + GetResourceScanDetailsResponseType, ScanResultDTO, - SidebarPropsType, SidebarDataChildType, SidebarDataType, - GetResourceScanDetailsPayloadType, - GetResourceScanDetailsResponseType, + SidebarPropsType, } from './types' export { SeveritiesDTO } from './types' -export { getSidebarData, getProgressingStateForStatus } from './config' -export { CATEGORY_LABELS } from './constants' -export { getSecurityScan } from './service' +export { + getSecurityScanSeveritiesCount, + getTotalVulnerabilityCount, + parseGetResourceScanDetailsResponse, +} from './utils' diff --git a/src/Shared/Components/Security/SecurityModal/service.ts b/src/Shared/Components/Security/SecurityModal/service.ts index acebdbaca..6ae40c5c0 100644 --- a/src/Shared/Components/Security/SecurityModal/service.ts +++ b/src/Shared/Components/Security/SecurityModal/service.ts @@ -14,10 +14,11 @@ * limitations under the License. */ +import { get } from '@Common/API' import { ROUTES } from '@Common/Constants' import { getUrlWithSearchParams } from '@Common/Helper' -import { get } from '@Common/API' import { ResponseType } from '@Common/Types' + import { ScanResultDTO, ScanResultParamsType } from './types' export const getSecurityScan = async ({ diff --git a/src/Shared/Components/Security/SecurityModal/types.ts b/src/Shared/Components/Security/SecurityModal/types.ts index 17849dfa9..b1588666a 100644 --- a/src/Shared/Components/Security/SecurityModal/types.ts +++ b/src/Shared/Components/Security/SecurityModal/types.ts @@ -15,10 +15,12 @@ */ import React from 'react' -import { GenericEmptyStateType } from '@Common/Types' -import { LastExecutionResultType, NodeType, Nodes } from '@Shared/types' + import { SegmentedBarChartProps } from '@Common/SegmentedBarChart' import { ServerErrors } from '@Common/ServerError' +import { GenericEmptyStateType } from '@Common/Types' +import { LastExecutionResultType, Nodes, NodeType } from '@Shared/types' + import { ScanCategories, ScanSubCategories } from '../types' export interface GetResourceScanDetailsPayloadType { diff --git a/src/Shared/Components/Security/SecurityModal/utils.tsx b/src/Shared/Components/Security/SecurityModal/utils.tsx index b19a6ceac..08ac7b5e6 100644 --- a/src/Shared/Components/Security/SecurityModal/utils.tsx +++ b/src/Shared/Components/Security/SecurityModal/utils.tsx @@ -14,23 +14,24 @@ * limitations under the License. */ -import { ScannedByToolModal } from '@Shared/Components/ScannedByToolModal' +import { ReactComponent as NoVulnerability } from '@Icons/ic-vulnerability-not-found.svg' import { SegmentedBarChartProps } from '@Common/SegmentedBarChart' -import { Severity } from '@Shared/types' import { VulnerabilityType } from '@Common/Types' -import { ReactComponent as NoVulnerability } from '@Icons/ic-vulnerability-not-found.svg' +import { ScannedByToolModal } from '@Shared/Components/ScannedByToolModal' +import { Severity } from '@Shared/types' + +import { ORDERED_SEVERITY_KEYS, SEVERITIES, TRIVY_ICON_URL } from './constants' import { - ScanResultDTO, - SeveritiesDTO, CATEGORIES, GetResourceScanDetailsResponseType, ImageScanVulnerabilityType, ImageVulnerabilityType, + ScanResultDTO, + SeveritiesDTO, SUB_CATEGORIES, VulnerabilityCountType, VulnerabilityState, } from './types' -import { SEVERITIES, ORDERED_SEVERITY_KEYS, TRIVY_ICON_URL } from './constants' export const mapSeveritiesToSegmentedBarChartEntities = ( severities: Partial>, diff --git a/src/Shared/Components/Security/Vulnerabilities/Vulnerabilities.tsx b/src/Shared/Components/Security/Vulnerabilities/Vulnerabilities.tsx index dd7d6c0cb..e9bb025e4 100644 --- a/src/Shared/Components/Security/Vulnerabilities/Vulnerabilities.tsx +++ b/src/Shared/Components/Security/Vulnerabilities/Vulnerabilities.tsx @@ -15,13 +15,14 @@ */ import { useEffect, useState } from 'react' + import { Progressing, useAsync } from '../../../../Common' -import { VulnerabilitiesProps } from './types' -import { getSecurityScan } from '../SecurityModal/service' import { SecurityCard } from '../SecurityDetailsCards' -import { CATEGORIES, SUB_CATEGORIES } from '../SecurityModal/types' import { SecurityModal } from '../SecurityModal' +import { getSecurityScan } from '../SecurityModal/service' +import { CATEGORIES, SUB_CATEGORIES } from '../SecurityModal/types' import { getStatusForScanList } from '../utils' +import { VulnerabilitiesProps } from './types' const Vulnerabilities = ({ isScanned, diff --git a/src/Shared/Components/Security/Vulnerabilities/index.ts b/src/Shared/Components/Security/Vulnerabilities/index.ts index a9fe39be8..7b29147bb 100644 --- a/src/Shared/Components/Security/Vulnerabilities/index.ts +++ b/src/Shared/Components/Security/Vulnerabilities/index.ts @@ -14,5 +14,5 @@ * limitations under the License. */ -export { default as Vulnerabilities } from './Vulnerabilities' export * from './utils' +export { default as Vulnerabilities } from './Vulnerabilities' diff --git a/src/Shared/Components/Security/Vulnerabilities/types.ts b/src/Shared/Components/Security/Vulnerabilities/types.ts index 5c8839548..12828c331 100644 --- a/src/Shared/Components/Security/Vulnerabilities/types.ts +++ b/src/Shared/Components/Security/Vulnerabilities/types.ts @@ -15,6 +15,7 @@ */ import { ImageCardAccordionProps } from '@Shared/Components/ImageCardAccordion/types' + import { MaterialSecurityInfoType } from '../../../types' export interface VulnerabilitiesProps diff --git a/src/Shared/Components/Security/Vulnerabilities/utils.ts b/src/Shared/Components/Security/Vulnerabilities/utils.ts index 8ac7a9fcd..b331d177e 100644 --- a/src/Shared/Components/Security/Vulnerabilities/utils.ts +++ b/src/Shared/Components/Security/Vulnerabilities/utils.ts @@ -15,6 +15,7 @@ */ import { numberComparatorBySortOrder } from '@Shared/Helpers' + import { SortingOrder, VULNERABILITIES_SORT_PRIORITY } from '../../../../Common' export const getSortedVulnerabilities = (vulnerabilities) => diff --git a/src/Shared/Components/Security/constants.tsx b/src/Shared/Components/Security/constants.tsx index cbef00738..65fc41c55 100644 --- a/src/Shared/Components/Security/constants.tsx +++ b/src/Shared/Components/Security/constants.tsx @@ -14,8 +14,8 @@ * limitations under the License. */ -import { CATEGORY_LABELS } from './SecurityModal' import { CATEGORIES, SUB_CATEGORIES } from './SecurityModal/types' +import { CATEGORY_LABELS } from './SecurityModal' import { SecurityConfigType } from './types' export const SECURITY_CONFIG: SecurityConfigType = { diff --git a/src/Shared/Components/Security/index.tsx b/src/Shared/Components/Security/index.tsx index b26140343..d6b7f36b4 100644 --- a/src/Shared/Components/Security/index.tsx +++ b/src/Shared/Components/Security/index.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -export * from './Vulnerabilities' +export * from './SecurityDetailsCards' export * from './SecurityModal' export * from './utils' -export * from './SecurityDetailsCards' +export * from './Vulnerabilities' diff --git a/src/Shared/Components/Security/utils.tsx b/src/Shared/Components/Security/utils.tsx index 00464179a..b8b0a9761 100644 --- a/src/Shared/Components/Security/utils.tsx +++ b/src/Shared/Components/Security/utils.tsx @@ -14,8 +14,6 @@ * limitations under the License. */ -import { SECURITY_CONFIG } from './constants' -import { ScanResultDTO, SeveritiesDTO } from './SecurityModal' import { CATEGORIES, ImageScanLicenseListType, @@ -23,7 +21,9 @@ import { StatusType, SUB_CATEGORIES, } from './SecurityModal/types' -import { CategoriesConfig, SecurityConfigType, ScanCategories, ScanSubCategories } from './types' +import { SECURITY_CONFIG } from './constants' +import { ScanResultDTO, SeveritiesDTO } from './SecurityModal' +import { CategoriesConfig, ScanCategories, ScanSubCategories, SecurityConfigType } from './types' export const getCVEUrlFromCVEName = (cveName: string): string => `https://cve.mitre.org/cgi-bin/cvename.cgi?name=${cveName}` diff --git a/src/Shared/Components/SelectPicker/FilterSelectPicker.tsx b/src/Shared/Components/SelectPicker/FilterSelectPicker.tsx index b8dbed9a8..db5ce8d1f 100644 --- a/src/Shared/Components/SelectPicker/FilterSelectPicker.tsx +++ b/src/Shared/Components/SelectPicker/FilterSelectPicker.tsx @@ -15,14 +15,16 @@ */ import { useEffect, useMemo, useRef, useState } from 'react' + import { ReactComponent as ICFilter } from '@Icons/ic-filter.svg' import { ReactComponent as ICFilterApplied } from '@Icons/ic-filter-applied.svg' -import { useRegisterShortcut, UseRegisterShortcutProvider } from '@Common/Hooks' import { IS_PLATFORM_MAC_OS } from '@Common/Constants' +import { useRegisterShortcut, UseRegisterShortcutProvider } from '@Common/Hooks' import { SupportedKeyboardKeysType } from '@Common/Hooks/UseRegisterShortcut/types' + +import { ButtonProps, ButtonVariantType, useTriggerAutoClickTimestamp } from '../Button' import SelectPicker from './SelectPicker.component' import { FilterSelectPickerProps, SelectPickerOptionType, SelectPickerProps } from './type' -import { ButtonProps, ButtonVariantType, useTriggerAutoClickTimestamp } from '../Button' const APPLY_FILTER_SHORTCUT_KEYS: SupportedKeyboardKeysType[] = [IS_PLATFORM_MAC_OS ? 'Meta' : 'Control', 'Enter'] diff --git a/src/Shared/Components/SelectPicker/SelectPicker.component.tsx b/src/Shared/Components/SelectPicker/SelectPicker.component.tsx index cf7aa92b0..930559493 100644 --- a/src/Shared/Components/SelectPicker/SelectPicker.component.tsx +++ b/src/Shared/Components/SelectPicker/SelectPicker.component.tsx @@ -14,6 +14,7 @@ * limitations under the License. */ +import { ReactElement, useCallback, useMemo, useRef, useState } from 'react' import { GroupHeadingProps, MultiValueProps, @@ -22,16 +23,15 @@ import { ValueContainerProps, } from 'react-select' import CreatableSelect from 'react-select/creatable' -import { ReactElement, useCallback, useMemo, useRef, useState } from 'react' -import { ComponentSizeType } from '@Shared/constants' -import { ConditionalWrap } from '@Common/Helper' import Tippy from '@tippyjs/react' + +import { ConditionalWrap } from '@Common/Helper' +import { ComponentSizeType } from '@Shared/constants' import { deriveBorderRadiusAndBorderClassFromConfig, isNullOrUndefined } from '@Shared/Helpers' -import { getCommonSelectStyle, getSelectPickerOptionByValue } from './utils' -import { SelectPickerOptionType, SelectPickerProps, SelectPickerVariantType } from './type' -import FormFieldWrapper from '../FormFieldWrapper/FormFieldWrapper' import { getFormFieldAriaAttributes } from '../FormFieldWrapper' +import FormFieldWrapper from '../FormFieldWrapper/FormFieldWrapper' +import { GenericSectionErrorState } from '../GenericSectionErrorState' import { renderLoadingMessage, SelectPickerClearIndicator, @@ -45,7 +45,8 @@ import { SelectPickerOption, SelectPickerValueContainer, } from './common' -import { GenericSectionErrorState } from '../GenericSectionErrorState' +import { SelectPickerOptionType, SelectPickerProps, SelectPickerVariantType } from './type' +import { getCommonSelectStyle, getSelectPickerOptionByValue } from './utils' /** * Generic component for select picker diff --git a/src/Shared/Components/SelectPicker/SelectPickerTextArea.component.tsx b/src/Shared/Components/SelectPicker/SelectPickerTextArea.component.tsx index ff1cf2203..20b16c232 100644 --- a/src/Shared/Components/SelectPicker/SelectPickerTextArea.component.tsx +++ b/src/Shared/Components/SelectPicker/SelectPickerTextArea.component.tsx @@ -20,8 +20,8 @@ import { InputActionMeta, SelectInstance, SingleValue } from 'react-select' import { ReactSelectInputAction } from '@Common/Constants' import { useThrottledEffect } from '@Common/Helper' -import { SelectPickerOptionType, SelectPickerTextAreaProps } from './type' import SelectPicker from './SelectPicker.component' +import { SelectPickerOptionType, SelectPickerTextAreaProps } from './type' export const SelectPickerTextArea = ({ value, diff --git a/src/Shared/Components/SelectPicker/common.tsx b/src/Shared/Components/SelectPicker/common.tsx index 1ad1f8c37..6e960cb35 100644 --- a/src/Shared/Components/SelectPicker/common.tsx +++ b/src/Shared/Components/SelectPicker/common.tsx @@ -14,36 +14,38 @@ * limitations under the License. */ +import { ChangeEvent, Children } from 'react' import { + ClearIndicatorProps, components, - DropdownIndicatorProps, ControlProps, - OptionProps, - ClearIndicatorProps, - ValueContainerProps, + DropdownIndicatorProps, + InputProps, MenuListProps, - MultiValueRemoveProps, - MultiValueProps, MultiValue, - InputProps, + MultiValueProps, + MultiValueRemoveProps, + OptionProps, + ValueContainerProps, } from 'react-select' -import { Progressing } from '@Common/Progressing' + import { ReactComponent as ICCaretDown } from '@Icons/ic-caret-down.svg' import { ReactComponent as ICClose } from '@Icons/ic-close.svg' import { ReactComponent as ICErrorExclamation } from '@Icons/ic-error-exclamation.svg' -import { ChangeEvent, Children } from 'react' -import { noop } from '@Common/Helper' -import { CHECKBOX_VALUE } from '@Common/Types' import { Checkbox } from '@Common/Checkbox' import { ReactSelectInputAction } from '@Common/Constants' -import { isNullOrUndefined } from '@Shared/Helpers' +import { noop } from '@Common/Helper' +import { Progressing } from '@Common/Progressing' import { Tooltip } from '@Common/Tooltip' import { TooltipProps } from '@Common/Tooltip/types' +import { CHECKBOX_VALUE } from '@Common/Types' import { ComponentSizeType } from '@Shared/constants' +import { isNullOrUndefined } from '@Shared/Helpers' + +import { Button, ButtonProps, ButtonVariantType } from '../Button' +import { Icon } from '../Icon' import { SelectPickerGroupHeadingProps, SelectPickerOptionType, SelectPickerProps } from './type' import { getGroupCheckboxValue } from './utils' -import { Icon } from '../Icon' -import { Button, ButtonProps, ButtonVariantType } from '../Button' export const getTooltipProps = (tooltipProps: SelectPickerOptionType['tooltipProps'] = {}): TooltipProps => { if (tooltipProps) { diff --git a/src/Shared/Components/SelectPicker/constants.ts b/src/Shared/Components/SelectPicker/constants.ts index dd998f422..6419e79cc 100644 --- a/src/Shared/Components/SelectPicker/constants.ts +++ b/src/Shared/Components/SelectPicker/constants.ts @@ -15,7 +15,9 @@ */ import { CSSProperties } from 'react' + import { ComponentSizeType } from '@Shared/constants' + import { SelectPickerProps } from './type' export const SELECT_PICKER_FONT_SIZE_MAP: Record = { diff --git a/src/Shared/Components/SelectPicker/index.ts b/src/Shared/Components/SelectPicker/index.ts index 1eb12e2bc..999db404c 100644 --- a/src/Shared/Components/SelectPicker/index.ts +++ b/src/Shared/Components/SelectPicker/index.ts @@ -14,8 +14,8 @@ * limitations under the License. */ +export { default as FilterSelectPicker } from './FilterSelectPicker' export { default as SelectPicker } from './SelectPicker.component' export * from './SelectPickerTextArea.component' -export { default as FilterSelectPicker } from './FilterSelectPicker' export * from './type' export { getSelectPickerOptionByValue } from './utils' diff --git a/src/Shared/Components/SelectPicker/type.ts b/src/Shared/Components/SelectPicker/type.ts index 71cf4aab1..3ef481f64 100644 --- a/src/Shared/Components/SelectPicker/type.ts +++ b/src/Shared/Components/SelectPicker/type.ts @@ -14,18 +14,20 @@ * limitations under the License. */ -import { ServerErrors } from '@Common/ServerError' -import { OptionType } from '@Common/Types' -import { ComponentSizeType } from '@Shared/constants' import { MutableRefObject, ReactElement, ReactNode } from 'react' import { GroupBase, GroupHeadingProps, Props as ReactSelectProps, SelectInstance } from 'react-select' -import { CreatableProps } from 'react-select/creatable' // This import allows to extend the base interface in react-select module via module augmentation import type {} from 'react-select/base' -import { TooltipProps } from '@Common/Tooltip/types' +import { CreatableProps } from 'react-select/creatable' + import { ResizableTagTextAreaProps } from '@Common/CustomTagSelector' -import { FormFieldWrapperProps } from '../FormFieldWrapper/types' +import { ServerErrors } from '@Common/ServerError' +import { TooltipProps } from '@Common/Tooltip/types' +import { OptionType } from '@Common/Types' +import { ComponentSizeType } from '@Shared/constants' + import { ButtonComponentType, ButtonProps, ButtonVariantType } from '../Button' +import { FormFieldWrapperProps } from '../FormFieldWrapper/types' export interface SelectPickerOptionType extends OptionType { /** diff --git a/src/Shared/Components/SelectPicker/utils.ts b/src/Shared/Components/SelectPicker/utils.ts index cf151c73b..207a09331 100644 --- a/src/Shared/Components/SelectPicker/utils.ts +++ b/src/Shared/Components/SelectPicker/utils.ts @@ -14,12 +14,14 @@ * limitations under the License. */ -import { CHECKBOX_VALUE } from '@Common/Types' -import { ComponentSizeType } from '@Shared/constants' import { GroupBase, MultiValue, OptionsOrGroups, StylesConfig } from 'react-select' + import { noop } from '@Common/Helper' -import { SelectPickerOptionType, SelectPickerProps, SelectPickerVariantType } from './type' +import { CHECKBOX_VALUE } from '@Common/Types' +import { ComponentSizeType } from '@Shared/constants' + import { SELECT_PICKER_CONTROL_SIZE_MAP, SELECT_PICKER_FONT_SIZE_MAP, SELECT_PICKER_ICON_SIZE_MAP } from './constants' +import { SelectPickerOptionType, SelectPickerProps, SelectPickerVariantType } from './type' const getMenuWidthFromSize = ( menuSize: SelectPickerProps['menuSize'], diff --git a/src/Shared/Components/ShowMoreText/ShowMoreText.tsx b/src/Shared/Components/ShowMoreText/ShowMoreText.tsx index d1eb65d1d..e038b26a3 100644 --- a/src/Shared/Components/ShowMoreText/ShowMoreText.tsx +++ b/src/Shared/Components/ShowMoreText/ShowMoreText.tsx @@ -15,6 +15,7 @@ */ import { useEffect, useRef, useState } from 'react' + import { ReactComponent as ICCaretDown } from '@Icons/ic-caret-down.svg' interface ShowMoreTextProps { diff --git a/src/Shared/Components/StatusComponent/AppStatus.tsx b/src/Shared/Components/StatusComponent/AppStatus.tsx index 339a207d3..774c60cf3 100644 --- a/src/Shared/Components/StatusComponent/AppStatus.tsx +++ b/src/Shared/Components/StatusComponent/AppStatus.tsx @@ -15,9 +15,9 @@ */ import { Icon } from '../Icon' -import { AppStatusProps } from './types' -import { StatusComponent } from './StatusComponent' import { APP_STATUS } from './constants' +import { StatusComponent } from './StatusComponent' +import { AppStatusProps } from './types' import { getJobStatusFromStatus } from './utils' export const AppStatus = ({ status, isJobView = false, isVirtualEnv = false, ...restProps }: AppStatusProps) => { diff --git a/src/Shared/Components/StatusComponent/StatusComponent.tsx b/src/Shared/Components/StatusComponent/StatusComponent.tsx index 1e57f18d7..75c58ef03 100644 --- a/src/Shared/Components/StatusComponent/StatusComponent.tsx +++ b/src/Shared/Components/StatusComponent/StatusComponent.tsx @@ -14,8 +14,8 @@ * limitations under the License. */ -import { Tooltip } from '@Common/Tooltip' import { ConditionalWrap } from '@Common/Helper' +import { Tooltip } from '@Common/Tooltip' import { Icon } from '../Icon' import { StatusComponentProps } from './types' diff --git a/src/Shared/Components/StatusComponent/index.ts b/src/Shared/Components/StatusComponent/index.ts index 119ad1502..a9c8cc1a3 100644 --- a/src/Shared/Components/StatusComponent/index.ts +++ b/src/Shared/Components/StatusComponent/index.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -export * from './StatusComponent' export * from './AppStatus' export * from './DeploymentStatus' +export * from './StatusComponent' export * from './types' export { getDeploymentStatusFromStatus } from './utils' diff --git a/src/Shared/Components/TabGroup/TabGroup.component.tsx b/src/Shared/Components/TabGroup/TabGroup.component.tsx index 71c56067e..801a4d806 100644 --- a/src/Shared/Components/TabGroup/TabGroup.component.tsx +++ b/src/Shared/Components/TabGroup/TabGroup.component.tsx @@ -16,12 +16,12 @@ import { Link, NavLink } from 'react-router-dom' -import { ComponentSizeType } from '@Shared/constants' import { Tooltip } from '@Common/Tooltip' +import { ComponentSizeType } from '@Shared/constants' +import { getTabBadge, getTabDescription, getTabIcon, getTabIndicator } from './TabGroup.helpers' import { TabGroupProps, TabProps } from './TabGroup.types' import { getClassNameBySizeMap, tabGroupClassMap } from './TabGroup.utils' -import { getTabBadge, getTabDescription, getTabIcon, getTabIndicator } from './TabGroup.helpers' import './TabGroup.scss' diff --git a/src/Shared/Components/TabGroup/TabGroup.scss b/src/Shared/Components/TabGroup/TabGroup.scss index a4f18a8a5..c5a352898 100644 --- a/src/Shared/Components/TabGroup/TabGroup.scss +++ b/src/Shared/Components/TabGroup/TabGroup.scss @@ -90,6 +90,10 @@ color: var(--B500); font-weight: 600; @include svg-styles(var(--B500)); + + svg.icon-component-color { + --overrideIconColor: var(--B500); + } } &:not(.active) { diff --git a/src/Shared/Components/TabGroup/TabGroup.types.ts b/src/Shared/Components/TabGroup/TabGroup.types.ts index acc87cfb9..0ddb160f9 100644 --- a/src/Shared/Components/TabGroup/TabGroup.types.ts +++ b/src/Shared/Components/TabGroup/TabGroup.types.ts @@ -16,9 +16,9 @@ import { LinkProps, NavLinkProps } from 'react-router-dom' +import { TooltipProps } from '@Common/Tooltip/types' import { ComponentSizeType } from '@Shared/constants' import { DataAttributes } from '@Shared/types' -import { TooltipProps } from '@Common/Tooltip/types' import { IconName } from '../Icon' diff --git a/src/Shared/Components/Table/BulkSelectionActionWidget.tsx b/src/Shared/Components/Table/BulkSelectionActionWidget.tsx index 0df4492d5..0e09b1f03 100644 --- a/src/Shared/Components/Table/BulkSelectionActionWidget.tsx +++ b/src/Shared/Components/Table/BulkSelectionActionWidget.tsx @@ -2,14 +2,16 @@ * Copyright (c) 2024. Devtron Inc. */ +import { useEffect } from 'react' + import { ReactComponent as ICClose } from '@Icons/ic-close.svg' import { DraggableButton, DraggablePositionVariant, DraggableWrapper } from '@Common/DraggableWrapper' -import { ComponentSizeType } from '@Shared/constants' import { useRegisterShortcut } from '@Common/Hooks' -import { useEffect } from 'react' -import { BulkSelectionActionWidgetProps } from './types' +import { ComponentSizeType } from '@Shared/constants' + import { Button, ButtonComponentType, ButtonStyleType, ButtonVariantType } from '../Button' import { DRAG_SELECTOR_IDENTIFIER } from './constants' +import { BulkSelectionActionWidgetProps } from './types' const BulkSelectionActionWidget = ({ count, diff --git a/src/Shared/Components/Table/InternalTable.tsx b/src/Shared/Components/Table/InternalTable.tsx index 06aaffc91..999fad96d 100644 --- a/src/Shared/Components/Table/InternalTable.tsx +++ b/src/Shared/Components/Table/InternalTable.tsx @@ -1,12 +1,13 @@ -import { useRef, useEffect, useMemo, Fragment } from 'react' +import { Fragment, useEffect, useMemo, useRef } from 'react' + import { Checkbox } from '@Common/Checkbox' import { DEFAULT_BASE_PAGE_SIZE } from '@Common/Constants' import ErrorScreenManager from '@Common/ErrorScreenManager' import { - useAsync, CHECKBOX_VALUE, - GenericFilterEmptyState, GenericEmptyState, + GenericFilterEmptyState, + useAsync, useEffectAfterMount, } from '@Common/index' import { Pagination } from '@Common/Pagination' @@ -15,7 +16,7 @@ import { SortableTableHeaderCell } from '@Common/SortableTableHeaderCell' import { BulkSelection } from '../BulkSelection' import BulkSelectionActionWidget from './BulkSelectionActionWidget' import { BULK_ACTION_GUTTER_LABEL, EVENT_TARGET, SHIMMER_DUMMY_ARRAY } from './constants' -import { PaginationEnum, SignalsType, FiltersTypeEnum, InternalTableProps } from './types' +import { FiltersTypeEnum, InternalTableProps, PaginationEnum, SignalsType } from './types' import useTableWithKeyboardShortcuts from './useTableWithKeyboardShortcuts' import { getFilteringPromise, searchAndSortRows } from './utils' diff --git a/src/Shared/Components/Table/Table.component.tsx b/src/Shared/Components/Table/Table.component.tsx index c00fca0b6..8da192b5f 100644 --- a/src/Shared/Components/Table/Table.component.tsx +++ b/src/Shared/Components/Table/Table.component.tsx @@ -1,4 +1,5 @@ import { useCallback, useEffect, useMemo, useState } from 'react' + import { noop, UseRegisterShortcutProvider, @@ -7,6 +8,9 @@ import { useUrlFilters, } from '@Common/index' +import { BulkSelectionEvents, BulkSelectionProvider, useBulkSelection } from '../BulkSelection' +import { BULK_ACTION_GUTTER_LABEL } from './constants' +import InternalTable from './InternalTable' import { FiltersTypeEnum, FilterWrapperProps, @@ -18,9 +22,6 @@ import { VisibleColumnsWrapperProps, } from './types' import { getVisibleColumns, setVisibleColumnsToLocalStorage } from './utils' -import { BULK_ACTION_GUTTER_LABEL } from './constants' -import { BulkSelectionEvents, BulkSelectionProvider, useBulkSelection } from '../BulkSelection' -import InternalTable from './InternalTable' import './styles.scss' diff --git a/src/Shared/Components/Table/index.ts b/src/Shared/Components/Table/index.ts index a6c7d4765..c19e84928 100644 --- a/src/Shared/Components/Table/index.ts +++ b/src/Shared/Components/Table/index.ts @@ -1,8 +1,8 @@ export { default as Table } from './Table.component' -export { FiltersTypeEnum, PaginationEnum, SignalEnum as TableSignalEnum } from './types' export type { - ViewWrapperProps as TableViewWrapperProps, + CellComponentProps as TableCellComponentProps, Column as TableColumnType, TableProps, - CellComponentProps as TableCellComponentProps, + ViewWrapperProps as TableViewWrapperProps, } from './types' +export { FiltersTypeEnum, PaginationEnum, SignalEnum as TableSignalEnum } from './types' diff --git a/src/Shared/Components/Table/types.ts b/src/Shared/Components/Table/types.ts index 7fabf5e12..d32d09362 100644 --- a/src/Shared/Components/Table/types.ts +++ b/src/Shared/Components/Table/types.ts @@ -1,8 +1,10 @@ import { Dispatch, FunctionComponent, PropsWithChildren, SetStateAction } from 'react' -import { SortableTableHeaderCellProps, useResizableTableConfig } from '@Common/SortableTableHeaderCell' + +import { GenericFilterEmptyStateProps } from '@Common/EmptyState/types' import { UseStateFiltersProps, UseStateFiltersReturnType, UseUrlFiltersProps } from '@Common/Hooks' import { GenericEmptyStateType } from '@Common/index' -import { GenericFilterEmptyStateProps } from '@Common/EmptyState/types' +import { SortableTableHeaderCellProps, useResizableTableConfig } from '@Common/SortableTableHeaderCell' + import { useBulkSelection, UseBulkSelectionProps } from '../BulkSelection' export interface UseFiltersReturnType extends UseStateFiltersReturnType {} diff --git a/src/Shared/Components/Table/useTableWithKeyboardShortcuts.ts b/src/Shared/Components/Table/useTableWithKeyboardShortcuts.ts index d95d136d6..8d5127f65 100644 --- a/src/Shared/Components/Table/useTableWithKeyboardShortcuts.ts +++ b/src/Shared/Components/Table/useTableWithKeyboardShortcuts.ts @@ -1,9 +1,11 @@ -import { useRegisterShortcut } from '@Common/Hooks' -import { useState, useRef, useCallback, useEffect } from 'react' +import { useCallback, useEffect, useRef, useState } from 'react' + import { noop } from '@Common/Helper' +import { useRegisterShortcut } from '@Common/Hooks' + import { BulkSelectionEvents } from '../BulkSelection' -import { InternalTableProps, RowsType, SignalEnum } from './types' import { EVENT_TARGET } from './constants' +import { InternalTableProps, RowsType, SignalEnum } from './types' const useTableWithKeyboardShortcuts = ( { diff --git a/src/Shared/Components/Table/utils.ts b/src/Shared/Components/Table/utils.ts index 50093efaf..b99a1dd02 100644 --- a/src/Shared/Components/Table/utils.ts +++ b/src/Shared/Components/Table/utils.ts @@ -1,6 +1,12 @@ -import { showError } from '@Common/Helper' import { SortingOrder } from '@Common/Constants' +import { showError } from '@Common/Helper' import { isNullOrUndefined } from '@Shared/Helpers' + +import { + LOCAL_STORAGE_EXISTS, + LOCAL_STORAGE_KEY_FOR_VISIBLE_COLUMNS, + SEARCH_SORT_CHANGE_DEBOUNCE_TIME, +} from './constants' import { Column, ConfigurableColumnsConfigType, @@ -10,11 +16,6 @@ import { TableProps, UseFiltersReturnType, } from './types' -import { - LOCAL_STORAGE_EXISTS, - LOCAL_STORAGE_KEY_FOR_VISIBLE_COLUMNS, - SEARCH_SORT_CHANGE_DEBOUNCE_TIME, -} from './constants' export const searchAndSortRows = ( rows: TableProps['rows'], diff --git a/src/Shared/Components/TagsKeyValueTable/TagsContainer.tsx b/src/Shared/Components/TagsKeyValueTable/TagsContainer.tsx index fa849fbfd..661e30331 100644 --- a/src/Shared/Components/TagsKeyValueTable/TagsContainer.tsx +++ b/src/Shared/Components/TagsKeyValueTable/TagsContainer.tsx @@ -15,13 +15,15 @@ */ import ReactGA from 'react-ga4' + import { ReactComponent as ICPropagate } from '@Icons/inject-tag.svg' import { PropagateTagInfo, validateTagKeyValue } from '@Common/CustomTagSelector' -import { Tooltip } from '@Common/Tooltip' import { validateTagValue } from '@Common/CustomTagSelector/tags.utils' -import { TagsContainerProps, TagsTableColumnsType } from './types' -import { DEVTRON_AI_URL, TAGS_TABLE_HEADERS } from './constants' +import { Tooltip } from '@Common/Tooltip' + import { DynamicDataTable, DynamicDataTableRowType } from '../DynamicDataTable' +import { DEVTRON_AI_URL, TAGS_TABLE_HEADERS } from './constants' +import { TagsContainerProps, TagsTableColumnsType } from './types' import { getEmptyTagTableRow } from './utils' const TagsKeyValueTable = ({ diff --git a/src/Shared/Components/TagsKeyValueTable/index.tsx b/src/Shared/Components/TagsKeyValueTable/index.tsx index 00c95e2b8..bb3b39bd3 100644 --- a/src/Shared/Components/TagsKeyValueTable/index.tsx +++ b/src/Shared/Components/TagsKeyValueTable/index.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ +export { DEVTRON_AI_URL } from './constants' export { default as TagsContainer } from './TagsContainer' -export { getEmptyTagTableRow } from './utils' export type { TagsTableColumnsType } from './types' -export { DEVTRON_AI_URL } from './constants' +export { getEmptyTagTableRow } from './utils' diff --git a/src/Shared/Components/TargetPlatforms/TargetPlatformBadgeList.tsx b/src/Shared/Components/TargetPlatforms/TargetPlatformBadgeList.tsx index c8f276090..a94653b1f 100644 --- a/src/Shared/Components/TargetPlatforms/TargetPlatformBadgeList.tsx +++ b/src/Shared/Components/TargetPlatforms/TargetPlatformBadgeList.tsx @@ -16,6 +16,7 @@ import { ReactComponent as ICStack } from '@Icons/ic-stack.svg' import { Tooltip } from '@Common/Tooltip' + import { TargetPlatformBadgeListProps } from './types' const TargetPlatformBadge = ({ name }: TargetPlatformBadgeListProps['targetPlatforms'][number]) => ( diff --git a/src/Shared/Components/TargetPlatforms/TargetPlatformListTooltip.tsx b/src/Shared/Components/TargetPlatforms/TargetPlatformListTooltip.tsx index 188a8e058..31fad83e2 100644 --- a/src/Shared/Components/TargetPlatforms/TargetPlatformListTooltip.tsx +++ b/src/Shared/Components/TargetPlatforms/TargetPlatformListTooltip.tsx @@ -14,8 +14,9 @@ * limitations under the License. */ -import { Tooltip } from '@Common/Tooltip' import { stopPropagation } from '@Common/Helper' +import { Tooltip } from '@Common/Tooltip' + import { TargetPlatformListTooltipProps } from './types' const TooltipContent = ({ targetPlatforms }: Pick) => ( diff --git a/src/Shared/Components/Textarea/Textarea.component.tsx b/src/Shared/Components/Textarea/Textarea.component.tsx index ff6aac77d..fb9f3271e 100644 --- a/src/Shared/Components/Textarea/Textarea.component.tsx +++ b/src/Shared/Components/Textarea/Textarea.component.tsx @@ -15,16 +15,19 @@ */ import { TextareaHTMLAttributes, useEffect, useRef, useState } from 'react' + +import { useThrottledEffect } from '@Common/Helper' import { COMPONENT_SIZE_TYPE_TO_FONT_AND_BLOCK_PADDING_MAP, COMPONENT_SIZE_TYPE_TO_INLINE_PADDING_MAP, ComponentSizeType, } from '@Shared/constants' import { deriveBorderRadiusAndBorderClassFromConfig } from '@Shared/Helpers' -import { useThrottledEffect } from '@Common/Helper' + import { FormFieldWrapper, getFormFieldAriaAttributes } from '../FormFieldWrapper' -import { TextareaProps } from './types' import { TEXTAREA_CONSTRAINTS } from './constants' +import { TextareaProps } from './types' + import './textarea.scss' const { MIN_HEIGHT, AUTO_EXPANSION_MAX_HEIGHT } = TEXTAREA_CONSTRAINTS diff --git a/src/Shared/Components/Textarea/types.ts b/src/Shared/Components/Textarea/types.ts index f94463f15..4584dfdd6 100644 --- a/src/Shared/Components/Textarea/types.ts +++ b/src/Shared/Components/Textarea/types.ts @@ -15,7 +15,9 @@ */ import { TextareaHTMLAttributes } from 'react' + import { ComponentSizeType } from '@Shared/constants' + import { FormFieldWrapperProps } from '../FormFieldWrapper' export interface TextareaProps diff --git a/src/Shared/Components/ThemeSwitcher/ThemeSwitcher.component.tsx b/src/Shared/Components/ThemeSwitcher/ThemeSwitcher.component.tsx index cc0f1f59e..93f23dcf1 100644 --- a/src/Shared/Components/ThemeSwitcher/ThemeSwitcher.component.tsx +++ b/src/Shared/Components/ThemeSwitcher/ThemeSwitcher.component.tsx @@ -14,10 +14,11 @@ * limitations under the License. */ -import { getThemePreferenceText, useTheme } from '@Shared/Providers' import { ReactComponent as ICCaretLeftSmall } from '@Icons/ic-caret-left-small.svg' -import { ThemeSwitcherProps } from './types' +import { getThemePreferenceText, useTheme } from '@Shared/Providers' + import { LOGOUT_CARD_BASE_BUTTON_CLASS } from '../LogoutCard' +import { ThemeSwitcherProps } from './types' const ThemeSwitcher = ({ onChange }: ThemeSwitcherProps) => { const { handleThemeSwitcherDialogVisibilityChange, themePreference } = useTheme() diff --git a/src/Shared/Components/ToggleResolveScopedVariables/ToggleResolveScopedVariables.component.tsx b/src/Shared/Components/ToggleResolveScopedVariables/ToggleResolveScopedVariables.component.tsx index 017470dda..2d628c768 100644 --- a/src/Shared/Components/ToggleResolveScopedVariables/ToggleResolveScopedVariables.component.tsx +++ b/src/Shared/Components/ToggleResolveScopedVariables/ToggleResolveScopedVariables.component.tsx @@ -14,8 +14,9 @@ * limitations under the License. */ -import { Toggle, Tooltip } from '@Common/index' import { ReactComponent as ICViewVariableToggle } from '@Icons/ic-view-variable-toggle.svg' +import { Toggle, Tooltip } from '@Common/index' + import { ToggleResolveScopedVariablesProps } from './types' const ToggleResolveScopedVariables = ({ diff --git a/src/Shared/Components/WorkflowOptionsModal/SourceTypeCard.tsx b/src/Shared/Components/WorkflowOptionsModal/SourceTypeCard.tsx index ca467fcb7..1d01c4370 100644 --- a/src/Shared/Components/WorkflowOptionsModal/SourceTypeCard.tsx +++ b/src/Shared/Components/WorkflowOptionsModal/SourceTypeCard.tsx @@ -15,7 +15,9 @@ */ import Tippy from '@tippyjs/react' + import { ConditionalWrap } from '@Common/Helper' + import { SourceTypeCardProps } from './types' const SourceTypeCard = ({ diff --git a/src/Shared/Components/WorkflowOptionsModal/WorkflowOptionsModal.tsx b/src/Shared/Components/WorkflowOptionsModal/WorkflowOptionsModal.tsx index bc4fb07ac..1f7feaad2 100644 --- a/src/Shared/Components/WorkflowOptionsModal/WorkflowOptionsModal.tsx +++ b/src/Shared/Components/WorkflowOptionsModal/WorkflowOptionsModal.tsx @@ -15,14 +15,15 @@ */ import React, { useEffect, useState } from 'react' -import { CIPipelineNodeType, saveCDPipeline, ToastManager, ToastVariantType } from '@Shared/index' -import { PipelineType, WorkflowNodeType } from '@Common/Types' -import { showError, stopPropagation } from '@Common/Helper' -import { VisibleModal } from '@Common/index' + import changeCI from '@Images/change-source.png' import selectWorkflowSource from '@Images/select-image-source.png' -import SourceTypeCard from './SourceTypeCard' -import { WorkflowOptionsModalProps } from './types' +import { showError, stopPropagation } from '@Common/Helper' +import { VisibleModal } from '@Common/index' +import { PipelineType, WorkflowNodeType } from '@Common/Types' +import { saveCDPipeline, ToastManager, ToastVariantType } from '@Shared/Services' +import { CIPipelineNodeType } from '@Shared/types' + import { CHANGE_SAME_CI, NO_ENV_FOUND, @@ -32,6 +33,8 @@ import { WORKFLOW_OPTIONS_MODAL, WORKFLOW_OPTIONS_MODAL_TYPES, } from './constants' +import SourceTypeCard from './SourceTypeCard' +import { WorkflowOptionsModalProps } from './types' import { getSwitchToWebhookPayload } from './utils' const WorkflowOptionsModal = ({ diff --git a/src/Shared/Components/WorkflowOptionsModal/constants.tsx b/src/Shared/Components/WorkflowOptionsModal/constants.tsx index c4c7fb11a..05d1be554 100644 --- a/src/Shared/Components/WorkflowOptionsModal/constants.tsx +++ b/src/Shared/Components/WorkflowOptionsModal/constants.tsx @@ -14,12 +14,12 @@ * limitations under the License. */ -import linkedPipeline from '@Icons/ic-source-linked-build.svg' import ci from '@Icons/ic-source-build.svg' -import webhook from '@Icons/ic-source-webhook.svg' import ciJobIcon from '@Icons/ic-source-job.svg' -import { CIPipelineNodeType } from '@Shared/types' +import linkedPipeline from '@Icons/ic-source-linked-build.svg' +import webhook from '@Icons/ic-source-webhook.svg' import { PipelineType } from '@Common/Types' +import { CIPipelineNodeType } from '@Shared/types' export const WORKFLOW_OPTIONS_MODAL = { ACTION_TEXT: 'Select an image source for new workflow', diff --git a/src/Shared/Components/WorkflowOptionsModal/types.tsx b/src/Shared/Components/WorkflowOptionsModal/types.tsx index 5209914fb..eb5ec2bff 100644 --- a/src/Shared/Components/WorkflowOptionsModal/types.tsx +++ b/src/Shared/Components/WorkflowOptionsModal/types.tsx @@ -14,8 +14,8 @@ * limitations under the License. */ -import { AppConfigProps } from '@Pages/index' import { ChangeCIPayloadType, CIPipelineNodeType, WorkflowType } from '@Shared/types' +import { AppConfigProps } from '@Pages/index' interface LinkedCDSourceVariant { title: string diff --git a/src/Shared/Components/index.ts b/src/Shared/Components/index.ts index 2d23f7534..14503779c 100644 --- a/src/Shared/Components/index.ts +++ b/src/Shared/Components/index.ts @@ -14,85 +14,86 @@ * limitations under the License. */ -export * from './APIResponseHandler' -export * from './ReactSelect' -export * from './BulkSelection' -export * from './ImageCard' -export * from './ImageCardAccordion' -export * from './ExcludedImageNode' -export * from './ScannedByToolModal' -export * from './FilterChips' +export * from './ActionMenu' export * from './ActivityIndicator' -export * from './GenericSectionErrorState' -export * from './InfoIconTippy' -export * from './EditableTextArea' -export * from './Header' +export * from './AnimatedDeployButton' +export * from './AnimatedTimer' export * from './AnnouncementBanner' +export * from './APIResponseHandler' +export * from './ArtifactInfoModal' +export * from './Backdrop' +export * from './BulkOperations' +export * from './BulkSelection' +export * from './Button' export * from './ButtonWithLoader' export * from './ButtonWithSelector' -export * from './EnvironmentSelector' -export * from './ModalSidebarPanel' -export * from './ImageWithFallback' -export * from './FeatureDescription' export * from './CICDHistory' -export * from './GitCommitInfoGeneric' -export * from './Error' -export * from './DatePicker' -export * from './CommitChipCell' -export * from './ImageChipCell' -export * from './ArtifactInfoModal' -export * from './MaterialHistory' -export * from './IframeContainer' -export * from './Plugin' -export * from './KeyValueTable' -export * from './SelectPicker' -export * from './ShowMoreText' +export * from './CMCS' +export * from './CodeEditorWrapper' +export * from './Collapse' export * from './CollapsibleList' +export * from './CommitChipCell' +export * from './Confetti' +export * from './ConfirmationModal' +export * from './CountrySelect' +export * from './CustomInput' +export * from './DatePicker' export * from './DeploymentConfigDiff' export * from './DetectBottom' -export * from './TabGroup' -export * from './EditImageFormField' -export * from './Collapse' -export * from './Security' -export * from './Button' -export * from './InvalidYAMLTippy' -export * from './NumbersCount' -export * from './EnterpriseTag' -export * from './ConfirmationModal' export * from './DiffViewer' export * from './DynamicDataTable' -export * from './TagsKeyValueTable' +export * from './EditableTextArea' +export * from './EditImageFormField' +export * from './EnterpriseTag' +export * from './EnvironmentSelector' +export * from './Error' +export * from './ExcludedImageNode' +export * from './FeatureDescription' export * from './FileUpload' -export * from './AnimatedDeployButton' -export * from './CMCS' +export * from './FilterChips' +export * from './FlagImage' export * from './FloatingVariablesSuggestions' -export * from './ToggleResolveScopedVariables' -export * from './BulkOperations' -export * from './WorkflowOptionsModal' -export * from './VirtualizedList' -export * from './Textarea' -export * from './ThemeSwitcher' -export * from './TargetPlatforms' -export * from './UnsavedChanges' -export * from './UnsavedChangesDialog' -export * from './GraphVisualizer' +export * from './FramerComponents' export * from './GenericInfoCard' -export * from './Icon' -export * from './StatusComponent' -export * from './RegistryIcon' +export * from './GenericSectionErrorState' +export * from './GitCommitInfoGeneric' export * from './GitProviderIcon' -export * from './CustomInput' +export * from './GraphVisualizer' +export * from './Header' +export * from './Icon' +export * from './IframeContainer' +export * from './ImageCard' +export * from './ImageCardAccordion' +export * from './ImageChipCell' +export * from './ImageWithFallback' export * from './InfoBlock' -export * from './CodeEditorWrapper' -export * from './SSOProviderIcon' -export * from './Table' -export * from './Backdrop' -export * from './CountrySelect' -export * from './PhoneInput' -export * from './FlagImage' +export * from './InfoIconTippy' +export * from './InvalidYAMLTippy' +export * from './KeyValueTable' export * from './License' export * from './LoginBanner' -export * from './Confetti' -export * from './FramerComponents' -export * from './ActionMenu' +export * from './MaterialHistory' +export * from './ModalSidebarPanel' +export * from './NumbersCount' +export * from './PhoneInput' +export * from './Plugin' export { default as QRCode } from './QRCode' +export * from './ReactSelect' +export * from './RegistryIcon' +export * from './ScannedByToolModal' +export * from './Security' +export * from './SelectPicker' +export * from './ShowMoreText' +export * from './SSOProviderIcon' +export * from './StatusComponent' +export * from './TabGroup' +export * from './Table' +export * from './TagsKeyValueTable' +export * from './TargetPlatforms' +export * from './Textarea' +export * from './ThemeSwitcher' +export * from './ToggleResolveScopedVariables' +export * from './UnsavedChanges' +export * from './UnsavedChangesDialog' +export * from './VirtualizedList' +export * from './WorkflowOptionsModal' diff --git a/src/Shared/Helpers.tsx b/src/Shared/Helpers.tsx index c39d02a1d..eda31ea24 100644 --- a/src/Shared/Helpers.tsx +++ b/src/Shared/Helpers.tsx @@ -15,42 +15,53 @@ */ /* eslint-disable no-param-reassign */ -import { useEffect, useRef, useState, ReactElement } from 'react' +import { ReactElement, useEffect, useRef, useState } from 'react' import { PromptProps } from 'react-router-dom' +import { StrictRJSFSchema } from '@rjsf/utils' import Tippy from '@tippyjs/react' -import { Pair } from 'yaml' import moment from 'moment' import { nanoid } from 'nanoid' -import { StrictRJSFSchema } from '@rjsf/utils' -import { MaterialHistoryType } from '@Shared/Services/app.types' +import { Pair } from 'yaml' + +import { ReactComponent as ICAWSCodeCommit } from '@Icons/ic-aws-codecommit.svg' +import { ReactComponent as ICBitbucket } from '@Icons/ic-bitbucket.svg' +import { ReactComponent as ICGit } from '@Icons/ic-git.svg' +import { ReactComponent as ICGithub } from '@Icons/ic-github.svg' +import { ReactComponent as ICGitlab } from '@Icons/ic-gitlab.svg' import { ReactComponent as ICPullRequest } from '@Icons/ic-pull-request.svg' import { ReactComponent as ICTag } from '@Icons/ic-tag.svg' import { ReactComponent as ICWebhook } from '@Icons/ic-webhook.svg' -import { ReactComponent as ICGithub } from '@Icons/ic-github.svg' -import { ReactComponent as ICGitlab } from '@Icons/ic-gitlab.svg' -import { ReactComponent as ICGit } from '@Icons/ic-git.svg' -import { ReactComponent as ICBitbucket } from '@Icons/ic-bitbucket.svg' -import { ReactComponent as ICAWSCodeCommit } from '@Icons/ic-aws-codecommit.svg' +import { MaterialHistoryType } from '@Shared/Services/app.types' + import { + ApprovalConfigDataType, + DATE_TIME_FORMATS, handleUTCTime, ManualApprovalType, mapByKey, MaterialInfo, + noop, + PATTERNS, shallowEqual, SortingOrder, - UserApprovalConfigType, - PATTERNS, - ZERO_TIME_STRING, - noop, SourceTypeMap, - DATE_TIME_FORMATS, - ApprovalConfigDataType, - UserApprovalInfo, TOKEN_COOKIE_NAME, + UserApprovalConfigType, + UserApprovalInfo, + ZERO_TIME_STRING, } from '../Common' +import { getAggregator } from '../Pages' +import { + AggregatedNodes, + DeploymentStatusDetailsBreakdownDataType, + DeploymentStatusDetailsType, + PodMetadatum, +} from './Components' +import { DEPLOYMENT_STATUS, TIMELINE_STATUS, UNSAVED_CHANGES_PROMPT_MESSAGE } from './constants' import { AggregationKeys, BorderConfigType, + GetTimeDifferenceParamsType, GitTriggers, IntersectionChangeHandler, IntersectionOptions, @@ -60,14 +71,6 @@ import { TargetPlatformsDTO, WebhookEventNameType, } from './types' -import { DEPLOYMENT_STATUS, TIMELINE_STATUS, UNSAVED_CHANGES_PROMPT_MESSAGE } from './constants' -import { - AggregatedNodes, - DeploymentStatusDetailsBreakdownDataType, - DeploymentStatusDetailsType, - PodMetadatum, -} from './Components' -import { getAggregator } from '../Pages' interface HighlightSearchTextProps { /** @@ -778,9 +781,13 @@ export const decode = (data, isEncoded: boolean = false) => export const isTimeStringAvailable = (time: string): boolean => !!time && time !== ZERO_TIME_STRING -export const getTimeDifference = (startTime: string, endTime: string): string => { +export const getTimeDifference = ({ + startTime, + endTime, + fallbackString = '-', +}: GetTimeDifferenceParamsType): string => { if (!isTimeStringAvailable(startTime) || !isTimeStringAvailable(endTime)) { - return '-' + return fallbackString } const seconds = moment(endTime).diff(moment(startTime), 'seconds') diff --git a/src/Shared/Hooks/UseDownload/UseDownload.tsx b/src/Shared/Hooks/UseDownload/UseDownload.tsx index 4a7129fd5..6e18ad782 100644 --- a/src/Shared/Hooks/UseDownload/UseDownload.tsx +++ b/src/Shared/Hooks/UseDownload/UseDownload.tsx @@ -14,12 +14,14 @@ * limitations under the License. */ -import { showError } from '@Common/Helper' import { useState } from 'react' + import { API_STATUS_CODES, Host } from '@Common/Constants' +import { showError } from '@Common/Helper' import { ServerErrors } from '@Common/ServerError' import { getFileNameFromHeaders } from '@Shared/Helpers' import { ToastManager, ToastVariantType } from '@Shared/Services' + import { getDownloadResponse } from './service' import { UseDownloadProps, UseDownloadReturnType } from './types' diff --git a/src/Shared/Hooks/UseDownload/index.tsx b/src/Shared/Hooks/UseDownload/index.tsx index 299e1fa0b..4e109b008 100644 --- a/src/Shared/Hooks/UseDownload/index.tsx +++ b/src/Shared/Hooks/UseDownload/index.tsx @@ -14,5 +14,5 @@ * limitations under the License. */ -export { default as useDownload } from './UseDownload' export * from './types' +export { default as useDownload } from './UseDownload' diff --git a/src/Shared/Hooks/UsePrompt/UsePrompt.tsx b/src/Shared/Hooks/UsePrompt/UsePrompt.tsx index 9a846b38c..737554235 100644 --- a/src/Shared/Hooks/UsePrompt/UsePrompt.tsx +++ b/src/Shared/Hooks/UsePrompt/UsePrompt.tsx @@ -15,6 +15,7 @@ */ import { useCallback, useEffect } from 'react' + import { UsePromptProps } from './types' /** diff --git a/src/Shared/Hooks/index.ts b/src/Shared/Hooks/index.ts index 0aee8859c..4a7279c6c 100644 --- a/src/Shared/Hooks/index.ts +++ b/src/Shared/Hooks/index.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -export * from './UsePrompt' -export * from './useGetResourceKindsOptions' export * from './UseDownload' export * from './useForm' -export * from './useStickyEvent' +export * from './useGetResourceKindsOptions' export * from './useOneTimePrompt' +export * from './UsePrompt' +export * from './useStickyEvent' export * from './useUserPreferences' diff --git a/src/Shared/Hooks/useForm/useForm.ts b/src/Shared/Hooks/useForm/useForm.ts index d77b5574a..975587ca8 100644 --- a/src/Shared/Hooks/useForm/useForm.ts +++ b/src/Shared/Hooks/useForm/useForm.ts @@ -18,16 +18,16 @@ import { BaseSyntheticEvent, ChangeEvent, useEffect, useRef, useState } from 're import { deepEqual, noop } from '@Common/Helper' -import { checkValidation } from './useForm.utils' import { DirtyFields, - UseFormErrors, TouchedFields, + UseFormErrorHandler, + UseFormErrors, UseFormSubmitHandler, UseFormValidation, UseFormValidations, - UseFormErrorHandler, } from './useForm.types' +import { checkValidation } from './useForm.utils' /** * A custom hook to manage form state, validation, and submission handling. diff --git a/src/Shared/Hooks/useGetResourceKindsOptions/index.ts b/src/Shared/Hooks/useGetResourceKindsOptions/index.ts index 467b79e90..86a41c642 100644 --- a/src/Shared/Hooks/useGetResourceKindsOptions/index.ts +++ b/src/Shared/Hooks/useGetResourceKindsOptions/index.ts @@ -14,5 +14,5 @@ * limitations under the License. */ +export type { UseGetResourceKindOptionsReturnType, UseGetResourceKindsOptionsProps } from './types' export { default as useGetResourceKindsOptions } from './useGetResourceKindsOptions' -export type { UseGetResourceKindsOptionsProps, UseGetResourceKindOptionsReturnType } from './types' diff --git a/src/Shared/Hooks/useGetResourceKindsOptions/service.ts b/src/Shared/Hooks/useGetResourceKindsOptions/service.ts index 17cbf4e66..3d247ef9f 100644 --- a/src/Shared/Hooks/useGetResourceKindsOptions/service.ts +++ b/src/Shared/Hooks/useGetResourceKindsOptions/service.ts @@ -14,14 +14,15 @@ * limitations under the License. */ -import { ResponseType, Teams } from '@Common/Types' +import { get } from '@Common/API' import { getTeamListMin } from '@Common/Common.service' -import { ClusterType } from '@Shared/Services' -import { EnvListMinDTO } from '@Shared/types' -import { EnvironmentTypeEnum } from '@Shared/constants' import { ROUTES } from '@Common/Constants' +import { ResponseType, Teams } from '@Common/Types' +import { EnvironmentTypeEnum } from '@Shared/constants' import { stringComparatorBySortOrder } from '@Shared/Helpers' -import { get } from '@Common/API' +import { ClusterType } from '@Shared/Services' +import { EnvListMinDTO } from '@Shared/types' + import { AppsGroupedByProjectsType, ClusterDTO, EnvironmentsGroupedByClustersType } from './types' export const getAppOptionsGroupedByProjects = async (): Promise => { diff --git a/src/Shared/Hooks/useGetResourceKindsOptions/types.ts b/src/Shared/Hooks/useGetResourceKindsOptions/types.ts index c3af72b1d..b36bd7430 100644 --- a/src/Shared/Hooks/useGetResourceKindsOptions/types.ts +++ b/src/Shared/Hooks/useGetResourceKindsOptions/types.ts @@ -16,8 +16,9 @@ // ====== Service Types: Start ====== // -import { EnvironmentType, ResourceKindType } from '@Shared/types' import { ServerErrors } from '@Common/ServerError' +import { EnvironmentType, ResourceKindType } from '@Shared/types' + import { getAppOptionsGroupedByProjects, getClusterOptions, getProjectOptions } from './service' export interface AppType { diff --git a/src/Shared/Hooks/useGetResourceKindsOptions/useGetResourceKindsOptions.tsx b/src/Shared/Hooks/useGetResourceKindsOptions/useGetResourceKindsOptions.tsx index bb7978bd0..0717f8865 100644 --- a/src/Shared/Hooks/useGetResourceKindsOptions/useGetResourceKindsOptions.tsx +++ b/src/Shared/Hooks/useGetResourceKindsOptions/useGetResourceKindsOptions.tsx @@ -15,8 +15,10 @@ */ import { useMemo } from 'react' -import { ResourceKindType } from '@Shared/types' + import { useAsync } from '@Common/Helper' +import { ResourceKindType } from '@Shared/types' + import { getAppOptionsGroupedByProjects, getClusterOptions, diff --git a/src/Shared/Hooks/useGetResourceKindsOptions/utils.ts b/src/Shared/Hooks/useGetResourceKindsOptions/utils.ts index 9e27c2f49..2ea375881 100644 --- a/src/Shared/Hooks/useGetResourceKindsOptions/utils.ts +++ b/src/Shared/Hooks/useGetResourceKindsOptions/utils.ts @@ -15,6 +15,7 @@ */ import { ResourceKindType } from '@Shared/types' + import { UseGetResourceKindsOptionsProps } from './types' export const getResourcesToFetchMap = (resourcesToFetch: UseGetResourceKindsOptionsProps['resourcesToFetch']) => diff --git a/src/Shared/Hooks/useOneTimePrompt/useOneTimePrompt.ts b/src/Shared/Hooks/useOneTimePrompt/useOneTimePrompt.ts index b5379cdbf..0590e52a5 100644 --- a/src/Shared/Hooks/useOneTimePrompt/useOneTimePrompt.ts +++ b/src/Shared/Hooks/useOneTimePrompt/useOneTimePrompt.ts @@ -1,7 +1,7 @@ import { useEffect, useRef, useState } from 'react' -import { UseOneTimePromptProps } from './types' import { ONE_TIME_PROMPT_LOCAL_STORAGE_KEY } from './constants' +import { UseOneTimePromptProps } from './types' const getOneTimePromptLocalStorageValue = () => { try { diff --git a/src/Shared/Hooks/useStickyEvent/useStickyEvent.ts b/src/Shared/Hooks/useStickyEvent/useStickyEvent.ts index 185bd52d0..fd07ac1b8 100644 --- a/src/Shared/Hooks/useStickyEvent/useStickyEvent.ts +++ b/src/Shared/Hooks/useStickyEvent/useStickyEvent.ts @@ -15,10 +15,12 @@ */ import { useEffect, useRef, useState } from 'react' -import { isNullOrUndefined } from '@Shared/Helpers' + import { noop } from '@Common/Helper' -import { UseStickyEventProps, UseStickyEventReturnType } from './types' +import { isNullOrUndefined } from '@Shared/Helpers' + import { OBSERVER_ROOT_MARGIN, OBSERVER_THRESHOLD } from './constants' +import { UseStickyEventProps, UseStickyEventReturnType } from './types' import { getHeightForStickyElementTopOffset } from './utils' import './styles.scss' diff --git a/src/Shared/Hooks/useUserPreferences/index.ts b/src/Shared/Hooks/useUserPreferences/index.ts index 82f66036b..ccf3ce08b 100644 --- a/src/Shared/Hooks/useUserPreferences/index.ts +++ b/src/Shared/Hooks/useUserPreferences/index.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -export { useUserPreferences } from './useUserPrefrences' export * from './constants' +export { getUserPreferences, updateUserPreferences } from './service' export * from './types' -export { updateUserPreferences, getUserPreferences } from './service' +export { useUserPreferences } from './useUserPrefrences' diff --git a/src/Shared/Hooks/useUserPreferences/service.ts b/src/Shared/Hooks/useUserPreferences/service.ts index 5d23ca5e9..88d38eab6 100644 --- a/src/Shared/Hooks/useUserPreferences/service.ts +++ b/src/Shared/Hooks/useUserPreferences/service.ts @@ -16,19 +16,21 @@ import { ROUTES } from '@Common/Constants' import { get, getUrlWithSearchParams, patch, showError } from '@Common/index' -import { ResourceKindType, BaseAppMetaData } from '@Shared/index' import { THEME_PREFERENCE_MAP } from '@Shared/Providers/ThemeProvider/types' +import { BaseAppMetaData } from '@Shared/Services' +import { ResourceKindType } from '@Shared/types' + import { USER_PREFERENCES_ATTRIBUTE_KEY } from './constants' import { - UserPreferencesType, - GetUserPreferencesQueryParamsType, GetUserPreferencesParsedDTO, - ViewIsPipelineRBACConfiguredRadioTabs, - UserPreferenceResourceActions, - UserPreferencesPayloadValueType, + GetUserPreferencesQueryParamsType, UpdateUserPreferencesPayloadType, UserPathValueMapType, + UserPreferenceResourceActions, UserPreferenceResourceProps, + UserPreferencesPayloadValueType, + UserPreferencesType, + ViewIsPipelineRBACConfiguredRadioTabs, } from './types' import { getUserPreferenceResourcesMetadata } from './utils' diff --git a/src/Shared/Hooks/useUserPreferences/types.ts b/src/Shared/Hooks/useUserPreferences/types.ts index 013e9fe30..18d70f79e 100644 --- a/src/Shared/Hooks/useUserPreferences/types.ts +++ b/src/Shared/Hooks/useUserPreferences/types.ts @@ -14,9 +14,10 @@ * limitations under the License. */ -import { AppThemeType, BaseAppMetaData, ResourceKindType } from '@Shared/index' -import { ThemeConfigType, ThemePreferenceType } from '@Shared/Providers/ThemeProvider/types' import { USER_PREFERENCES_ATTRIBUTE_KEY } from '@Shared/Hooks/useUserPreferences/constants' +import { AppThemeType, ThemeConfigType, ThemePreferenceType } from '@Shared/Providers/ThemeProvider/types' +import { BaseAppMetaData } from '@Shared/Services' +import { ResourceKindType } from '@Shared/types' export interface GetUserPreferencesQueryParamsType { key: typeof USER_PREFERENCES_ATTRIBUTE_KEY diff --git a/src/Shared/Hooks/useUserPreferences/useUserPrefrences.tsx b/src/Shared/Hooks/useUserPreferences/useUserPrefrences.tsx index 9f8929690..9b108a0cd 100644 --- a/src/Shared/Hooks/useUserPreferences/useUserPrefrences.tsx +++ b/src/Shared/Hooks/useUserPreferences/useUserPrefrences.tsx @@ -14,9 +14,13 @@ * limitations under the License. */ -import { ResourceKindType, useTheme } from '@Shared/index' import { useState } from 'react' + import { ServerErrors } from '@Common/ServerError' +import { useTheme } from '@Shared/Providers' +import { ResourceKindType } from '@Shared/types' + +import { getUserPreferences, updateUserPreferences } from './service' import { UserPreferenceRecentlyVisitedAppsTypes, UserPreferenceResourceActions, @@ -24,7 +28,6 @@ import { UseUserPreferencesProps, ViewIsPipelineRBACConfiguredRadioTabs, } from './types' -import { getUserPreferences, updateUserPreferences } from './service' import { getFilteredUniqueAppList } from './utils' export const useUserPreferences = ({ migrateUserPreferences }: UseUserPreferencesProps) => { diff --git a/src/Shared/Hooks/useUserPreferences/utils.tsx b/src/Shared/Hooks/useUserPreferences/utils.tsx index 0f96f6494..1e077272b 100644 --- a/src/Shared/Hooks/useUserPreferences/utils.tsx +++ b/src/Shared/Hooks/useUserPreferences/utils.tsx @@ -1,4 +1,6 @@ -import { BaseAppMetaData, ResourceKindType } from '@Shared/index' +import { BaseAppMetaData } from '@Shared/Services' +import { ResourceKindType } from '@Shared/types' + import { UserPreferenceFilteredListTypes, UserPreferenceResourceActions, UserPreferenceResourceType } from './types' export const getUserPreferenceResourcesMetadata = (recentlyVisited: BaseAppMetaData[]): UserPreferenceResourceType => ({ diff --git a/src/Shared/Providers/ImageSelectionUtility/ImageSelectionUtility.tsx b/src/Shared/Providers/ImageSelectionUtility/ImageSelectionUtility.tsx index 69d592ad6..2b0858a61 100644 --- a/src/Shared/Providers/ImageSelectionUtility/ImageSelectionUtility.tsx +++ b/src/Shared/Providers/ImageSelectionUtility/ImageSelectionUtility.tsx @@ -15,6 +15,7 @@ */ import { createContext, useContext, useMemo } from 'react' + import { ImageSelectionUtilityContextType, ImageSelectionUtilityProviderProps } from './types' export const ImageSelectionUtilityContext = createContext(null) diff --git a/src/Shared/Providers/MainContextProvider.tsx b/src/Shared/Providers/MainContextProvider.tsx index ad2f81e4b..b8f1238ab 100644 --- a/src/Shared/Providers/MainContextProvider.tsx +++ b/src/Shared/Providers/MainContextProvider.tsx @@ -15,6 +15,7 @@ */ import { createContext, useContext } from 'react' + import { MainContext, MainContextProviderProps } from './types' // TODO: (Arun) - Move to separate folder diff --git a/src/Shared/Providers/ThemeProvider/ThemeProvider.tsx b/src/Shared/Providers/ThemeProvider/ThemeProvider.tsx index e759a8f6c..ea0461796 100644 --- a/src/Shared/Providers/ThemeProvider/ThemeProvider.tsx +++ b/src/Shared/Providers/ThemeProvider/ThemeProvider.tsx @@ -15,14 +15,15 @@ */ import { createContext, useContext, useEffect, useMemo, useState } from 'react' + +import { DARK_COLOR_SCHEME_MATCH_QUERY } from './constants' +import { THEME_PREFERENCE_MAP, ThemeConfigType, ThemeContextType, ThemeProviderProps } from './types' import { getAppThemeForAutoPreference, getThemeConfigFromLocalStorage, logThemeToAnalytics, setThemePreferenceInLocalStorage, } from './utils' -import { THEME_PREFERENCE_MAP, ThemeConfigType, ThemeContextType, ThemeProviderProps } from './types' -import { DARK_COLOR_SCHEME_MATCH_QUERY } from './constants' const themeContext = createContext(null) diff --git a/src/Shared/Providers/ThemeProvider/index.ts b/src/Shared/Providers/ThemeProvider/index.ts index f90cf47cb..0a658681f 100644 --- a/src/Shared/Providers/ThemeProvider/index.ts +++ b/src/Shared/Providers/ThemeProvider/index.ts @@ -14,7 +14,7 @@ * limitations under the License. */ +export { THEME_PREFERENCE_STORAGE_KEY } from './constants' export * from './ThemeProvider' export { AppThemeType } from './types' export { getComponentSpecificThemeClass, getThemePreferenceText } from './utils' -export { THEME_PREFERENCE_STORAGE_KEY } from './constants' diff --git a/src/Shared/Providers/ThemeProvider/utils.ts b/src/Shared/Providers/ThemeProvider/utils.ts index ae2a52edc..ecc8ab1f4 100644 --- a/src/Shared/Providers/ThemeProvider/utils.ts +++ b/src/Shared/Providers/ThemeProvider/utils.ts @@ -15,8 +15,9 @@ */ import ReactGA from 'react-ga4' + import { DARK_COLOR_SCHEME_MATCH_QUERY, THEME_PREFERENCE_STORAGE_KEY } from './constants' -import { AppThemeType, THEME_PREFERENCE_MAP, ThemePreferenceType, ThemeConfigType } from './types' +import { AppThemeType, THEME_PREFERENCE_MAP, ThemeConfigType, ThemePreferenceType } from './types' export const getAppThemeForAutoPreference = (): AppThemeType => window.matchMedia && window.matchMedia(DARK_COLOR_SCHEME_MATCH_QUERY).matches diff --git a/src/Shared/Providers/UserEmailProvider/UserEmailProvider.tsx b/src/Shared/Providers/UserEmailProvider/UserEmailProvider.tsx index 5eb5284a2..5dd549994 100644 --- a/src/Shared/Providers/UserEmailProvider/UserEmailProvider.tsx +++ b/src/Shared/Providers/UserEmailProvider/UserEmailProvider.tsx @@ -15,6 +15,7 @@ */ import React, { createContext, useContext, useMemo, useState } from 'react' + import { UseUserEmailContextType } from './types' const context = createContext(null) diff --git a/src/Shared/Providers/UserEmailProvider/index.ts b/src/Shared/Providers/UserEmailProvider/index.ts index 21dea94aa..e31d2d0e3 100644 --- a/src/Shared/Providers/UserEmailProvider/index.ts +++ b/src/Shared/Providers/UserEmailProvider/index.ts @@ -14,5 +14,5 @@ * limitations under the License. */ -export * from './UserEmailProvider' export * from './types' +export * from './UserEmailProvider' diff --git a/src/Shared/Providers/index.ts b/src/Shared/Providers/index.ts index b720d4ffa..3e07be345 100644 --- a/src/Shared/Providers/index.ts +++ b/src/Shared/Providers/index.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -export * from './MainContextProvider' export * from './ImageSelectionUtility' +export * from './MainContextProvider' export * from './ThemeProvider' -export * from './UserEmailProvider' export type { MainContext } from './types' +export * from './UserEmailProvider' diff --git a/src/Shared/Providers/types.ts b/src/Shared/Providers/types.ts index cba73bb29..68af58238 100644 --- a/src/Shared/Providers/types.ts +++ b/src/Shared/Providers/types.ts @@ -15,8 +15,9 @@ */ import { Dispatch, MutableRefObject, ReactNode, SetStateAction } from 'react' -import { ServerInfo } from '../Components/Header/types' + import { SERVER_MODE } from '../../Common' +import { ServerInfo } from '../Components/Header/types' import { DevtronLicenseInfo, LicenseInfoDialogType } from '..' export interface MainContext { @@ -64,6 +65,7 @@ export interface MainContext { */ licenseData: DevtronLicenseInfo setLicenseData: Dispatch> + canFetchHelmAppStatus: boolean } export interface MainContextProviderProps { diff --git a/src/Shared/Services/ToastManager/ToastContent.tsx b/src/Shared/Services/ToastManager/ToastContent.tsx index 8d2be819d..2e9ce70a5 100644 --- a/src/Shared/Services/ToastManager/ToastContent.tsx +++ b/src/Shared/Services/ToastManager/ToastContent.tsx @@ -16,6 +16,7 @@ import { Button, ButtonStyleType, ButtonVariantType } from '@Shared/Components' import { ComponentSizeType } from '@Shared/constants' + import { ToastProps } from './types' export const ToastContent = ({ diff --git a/src/Shared/Services/ToastManager/constants.tsx b/src/Shared/Services/ToastManager/constants.tsx index d5889b61e..0deeaf82b 100644 --- a/src/Shared/Services/ToastManager/constants.tsx +++ b/src/Shared/Services/ToastManager/constants.tsx @@ -15,15 +15,17 @@ */ // eslint-disable-next-line no-restricted-imports -import { ToastOptions, ToastContainerProps } from 'react-toastify' +import { ToastContainerProps, ToastOptions } from 'react-toastify' + +import { ReactComponent as ICCross } from '@Icons/ic-cross.svg' +import { ReactComponent as ICError } from '@Icons/ic-error.svg' import { ReactComponent as ICInfoFilled } from '@Icons/ic-info-filled.svg' +import { ReactComponent as ICLocked } from '@Icons/ic-locked.svg' import { ReactComponent as ICSuccess } from '@Icons/ic-success.svg' -import { ReactComponent as ICError } from '@Icons/ic-error.svg' import { ReactComponent as ICWarning } from '@Icons/ic-warning.svg' -import { ReactComponent as ICLocked } from '@Icons/ic-locked.svg' -import { ReactComponent as ICCross } from '@Icons/ic-cross.svg' import { Button, ButtonStyleType, ButtonVariantType } from '@Shared/Components' import { ComponentSizeType } from '@Shared/constants' + import { ToastProps, ToastVariantType } from './types' export const TOAST_BASE_CONFIG: ToastContainerProps = { diff --git a/src/Shared/Services/ToastManager/index.ts b/src/Shared/Services/ToastManager/index.ts index 6940d8a54..bdbb2277b 100644 --- a/src/Shared/Services/ToastManager/index.ts +++ b/src/Shared/Services/ToastManager/index.ts @@ -15,5 +15,5 @@ */ export { default as ToastManager, ToastManagerContainer } from './toastManager.service' -export { ToastVariantType } from './types' export type { ToastProps } from './types' +export { ToastVariantType } from './types' diff --git a/src/Shared/Services/ToastManager/toastManager.service.tsx b/src/Shared/Services/ToastManager/toastManager.service.tsx index cf929af3b..3b32d585e 100644 --- a/src/Shared/Services/ToastManager/toastManager.service.tsx +++ b/src/Shared/Services/ToastManager/toastManager.service.tsx @@ -16,9 +16,11 @@ // eslint-disable-next-line no-restricted-imports import { toast, ToastContainer, ToastOptions } from 'react-toastify' -import { ToastProps, ToastVariantType } from './types' + import { TOAST_BASE_CONFIG, TOAST_VARIANT_TO_CONFIG_MAP } from './constants' import { ToastContent } from './ToastContent' +import { ToastProps, ToastVariantType } from './types' + import './toastManager.scss' /** diff --git a/src/Shared/Services/ToastManager/types.ts b/src/Shared/Services/ToastManager/types.ts index 4f005be4d..4413f7759 100644 --- a/src/Shared/Services/ToastManager/types.ts +++ b/src/Shared/Services/ToastManager/types.ts @@ -14,9 +14,10 @@ * limitations under the License. */ -import { ButtonComponentType, ButtonProps } from '@Shared/Components' import { ReactElement } from 'react' +import { ButtonComponentType, ButtonProps } from '@Shared/Components' + export enum ToastVariantType { info = 'info', success = 'success', diff --git a/src/Shared/Services/app.service.ts b/src/Shared/Services/app.service.ts index 1fd38400f..7be3abbff 100644 --- a/src/Shared/Services/app.service.ts +++ b/src/Shared/Services/app.service.ts @@ -15,16 +15,17 @@ */ import { AppConfigProps, GetTemplateAPIRouteType } from '@Pages/index' -import { ROUTES, ResponseType, get, getUrlWithSearchParams, showError } from '../../Common' + +import { get, getUrlWithSearchParams, ResponseType, ROUTES, showError } from '../../Common' +import { getTemplateAPIRoute } from '..' import { + AppEnvDeploymentConfigDTO, + AppEnvDeploymentConfigPayloadType, CIMaterialInfoDTO, CIMaterialInfoType, GetCITriggerInfoParamsType, - AppEnvDeploymentConfigDTO, - AppEnvDeploymentConfigPayloadType, } from './app.types' import { getParsedCIMaterialInfo } from './utils' -import { getTemplateAPIRoute } from '..' export const getCITriggerInfo = async (params: GetCITriggerInfoParamsType): Promise => { try { diff --git a/src/Shared/Services/app.types.ts b/src/Shared/Services/app.types.ts index ce4849fb0..399b195af 100644 --- a/src/Shared/Services/app.types.ts +++ b/src/Shared/Services/app.types.ts @@ -14,9 +14,10 @@ * limitations under the License. */ -import { OverrideMergeStrategyType } from '@Pages/Applications' import { TargetPlatformsDTO } from '@Shared/types' -import { ReleaseTag, UserApprovalMetadataType, ResponseType } from '../../Common' +import { OverrideMergeStrategyType } from '@Pages/Applications' + +import { ReleaseTag, ResponseType, UserApprovalMetadataType } from '../../Common' interface WebhookDataType { id: number diff --git a/src/Shared/Services/common.service.ts b/src/Shared/Services/common.service.ts index 67d8e7f02..67357f88e 100644 --- a/src/Shared/Services/common.service.ts +++ b/src/Shared/Services/common.service.ts @@ -15,8 +15,9 @@ */ import { AppConfigProps, GetTemplateAPIRouteType } from '@Pages/index' -import { getTemplateAPIRoute } from '..' + import { get, getUrlWithSearchParams, post, ROUTES } from '../../Common' +import { getTemplateAPIRoute } from '..' import { EnvironmentDataValuesDTO, GetPolicyApiUrlProps, GetResourceApiUrlProps } from './types' export const getResourceApiUrl = ({ baseUrl, kind, version, suffix, queryParams }: GetResourceApiUrlProps) => diff --git a/src/Shared/Services/index.ts b/src/Shared/Services/index.ts index 8ef863d35..cc4e7b5f5 100644 --- a/src/Shared/Services/index.ts +++ b/src/Shared/Services/index.ts @@ -14,10 +14,10 @@ * limitations under the License. */ -export * from './types' -export * from './app.types' export * from './app.service' +export * from './app.types' export * from './common.service' +export * from './template.service' export * from './ToastManager' +export * from './types' export * from './utils' -export * from './template.service' diff --git a/src/Shared/Services/template.service.ts b/src/Shared/Services/template.service.ts index f57e9c874..3683c019b 100644 --- a/src/Shared/Services/template.service.ts +++ b/src/Shared/Services/template.service.ts @@ -14,9 +14,10 @@ * limitations under the License. */ +import { ROUTES } from '@Common/Constants' import { getUrlWithSearchParams } from '@Common/Helper' import { GetTemplateAPIRouteProps } from '@Pages/index' -import { ROUTES } from '@Common/Constants' + import { getResourceApiUrl, ResourceKindType, ResourceVersionType } from '..' export const getTemplateAPIRoute = ({ type, queryParams: { id, ...restQueryParams } }: GetTemplateAPIRouteProps) => diff --git a/src/Shared/Services/types.ts b/src/Shared/Services/types.ts index 7653940ca..2d98e6c76 100644 --- a/src/Shared/Services/types.ts +++ b/src/Shared/Services/types.ts @@ -15,6 +15,7 @@ */ import { MainContext } from '@Shared/Providers' + import { getUrlWithSearchParams } from '../../Common' import { PolicyKindType, ResourceKindType, ResourceVersionType } from '../types' @@ -54,7 +55,7 @@ export interface GetResourceApiUrlProps extends BaseGetApiUrlProps extends Omit, 'baseUrl'> {} -export interface EnvironmentDataValuesDTO extends Pick { +export interface EnvironmentDataValuesDTO extends Pick { isAirGapEnvironment: boolean isManifestScanningEnabled: boolean canOnlyViewPermittedEnvOrgLevel: boolean diff --git a/src/Shared/Services/utils.ts b/src/Shared/Services/utils.ts index 65cf8a72f..ed28a4328 100644 --- a/src/Shared/Services/utils.ts +++ b/src/Shared/Services/utils.ts @@ -15,6 +15,7 @@ */ import { sanitizeTargetPlatforms } from '@Shared/Helpers' + import { createGitCommitUrl, handleUTCTime } from '../../Common' import { CIMaterialInfoDTO, CIMaterialInfoType } from './app.types' diff --git a/src/Shared/Store/IndexStore.tsx b/src/Shared/Store/IndexStore.tsx index 390d6f155..baa1e38b0 100644 --- a/src/Shared/Store/IndexStore.tsx +++ b/src/Shared/Store/IndexStore.tsx @@ -17,8 +17,10 @@ /* eslint-disable eqeqeq */ /* eslint-disable array-callback-return */ import { BehaviorSubject } from 'rxjs' + import { NodeFilters } from '@Shared/Components' -import { AppDetails, AppType, EnvDetails, EnvType, Node, Nodes, PodMetaData, iNode } from '../types' + +import { AppDetails, AppType, EnvDetails, EnvType, iNode, Node, Nodes, PodMetaData } from '../types' const _appDetailsSubject: BehaviorSubject = new BehaviorSubject({} as AppDetails) const _nodesSubject: BehaviorSubject> = new BehaviorSubject([] as Node[]) diff --git a/src/Shared/constants.tsx b/src/Shared/constants.tsx index fc0039ec3..ae2c2d9be 100644 --- a/src/Shared/constants.tsx +++ b/src/Shared/constants.tsx @@ -15,6 +15,7 @@ */ import { OptionType } from '@Common/Types' + import { CDMaterialSidebarType, ConfigKeysWithLockType, ConfigurationType } from './types' export const ARTIFACT_STATUS = { diff --git a/src/Shared/index.ts b/src/Shared/index.ts index 97c0e848b..ca1a15d5c 100644 --- a/src/Shared/index.ts +++ b/src/Shared/index.ts @@ -14,14 +14,14 @@ * limitations under the License. */ +export * from './Analytics' +export * from './API' export * from './Components' -export * from './validations' +export * from './constants' export * from './Helpers' -export * from './types' +export * from './Hooks' export * from './Providers' -export * from './constants' export * from './Services' export * from './Store' -export * from './Hooks' -export * from './API' -export * from './Analytics' +export * from './types' +export * from './validations' diff --git a/src/Shared/types.ts b/src/Shared/types.ts index 399863e3a..4b837338d 100644 --- a/src/Shared/types.ts +++ b/src/Shared/types.ts @@ -14,25 +14,27 @@ * limitations under the License. */ +import { ParsedCountry } from 'react-international-phone' import { Dayjs } from 'dayjs' + import { APIOptions, ApprovalConfigDataType } from '@Common/Types' -import { ParsedCountry } from 'react-international-phone' + import { - OptionType, CommonNodeAttr, - VulnerabilityType, DeploymentAppTypes, + OptionType, + PluginType, + RefVariableType, + SegmentedControlProps, ServerErrors, SortingParams, TriggerBlockType, ValueConstraintType, VariableType, - RefVariableType, - PluginType, - SegmentedControlProps, + VulnerabilityType, } from '../Common' -import { BASE_CONFIGURATION_ENV_ID, EnvironmentTypeEnum, PatchOperationType } from './constants' import { SelectPickerOptionType } from './Components' +import { BASE_CONFIGURATION_ENV_ID, EnvironmentTypeEnum, PatchOperationType } from './constants' export enum EnvType { CHART = 'helm_charts', @@ -1105,3 +1107,46 @@ export type CountryISO2Type = ParsedCountry['iso2'] export enum ResponseHeaders { LICENSE_STATUS = 'X-License-Status', } + +export type IconBaseSizeType = + | 6 + | 8 + | 10 + | 12 + | 14 + | 16 + | 18 + | 20 + | 22 + | 24 + | 28 + | 30 + | 32 + | 34 + | 36 + | 40 + | 42 + | 44 + | 48 + | 72 + | 80 + +export type IconBaseColorType = + | `${'B' | 'N' | 'G' | 'Y' | 'R' | 'V' | 'O'}${`${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00` | '50' | '0'}` + | 'white' + | 'black' + | null + +export interface GetTimeDifferenceParamsType { + startTime: string + endTime: string + /** + * @default '-' + */ + fallbackString?: string +} + +export enum RegistryCredentialsType { + USERNAME_PASSWORD = 'username_password', + ANONYMOUS = 'anonymous', +} diff --git a/src/Shared/validations.tsx b/src/Shared/validations.tsx index feb34474a..7f2c3cf06 100644 --- a/src/Shared/validations.tsx +++ b/src/Shared/validations.tsx @@ -14,12 +14,14 @@ * limitations under the License. */ -import { getSanitizedIframe } from '@Common/Helper' import { customizeValidator } from '@rjsf/validator-ajv8' -import { PATTERNS } from '@Common/Constants' import { parse } from 'yaml' -import { URLProtocolType } from './types' + +import { PATTERNS } from '@Common/Constants' +import { getSanitizedIframe } from '@Common/Helper' + import { SKIP_LABEL_KEY_VALIDATION_PREFIX } from './constants' +import { URLProtocolType } from './types' export interface ValidationResponseType { isValid: boolean diff --git a/src/index.ts b/src/index.ts index b101a0807..f582c59a3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -165,5 +165,5 @@ declare global { } export * from './Common' -export * from './Shared' export * from './Pages' +export * from './Shared' diff --git a/tsconfig.json b/tsconfig.json index cb93d76c5..8ab4b2801 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,69 +1,40 @@ { - "compilerOptions": { - "baseUrl": ".", - "paths": { - "@Icons/*": [ - "./src/Assets/Icon/*" - ], - "@IconsV2/*": [ - "./src/Assets/IconV2/*" - ], - "@Sounds/*": [ - "./src/Assets/Sounds/*" - ], - "@Images/*": [ - "./src/Assets/Img/*" - ], - "@Common/*": [ - "./src/Common/*" - ], - "@Pages/*": [ - "./src/Pages/*" - ], - "@Shared/*": [ - "./src/Shared/*" - ], - "codemirror-json-schema/yaml": ["./node_modules/codemirror-json-schema/dist/yaml"], + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@Icons/*": ["./src/Assets/Icon/*"], + "@IconsV2/*": ["./src/Assets/IconV2/*"], + "@Sounds/*": ["./src/Assets/Sounds/*"], + "@Images/*": ["./src/Assets/Img/*"], + "@Common/*": ["./src/Common/*"], + "@Shared/*": ["./src/Shared/*"], + "@Pages/*": ["./src/Pages/*"], + "codemirror-json-schema/yaml": ["./node_modules/codemirror-json-schema/dist/yaml"] + }, + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "declaration": true, + "strict": false, + "noUnusedLocals": false, + "noUnusedParameters": false, + "noFallthroughCasesInSwitch": false, + "types": ["vite/client"] }, - "target": "ES2020", - "useDefineForClassFields": true, - "lib": [ - "ES2022", - "DOM", - "DOM.Iterable" - ], - "module": "ESNext", - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - /* Bundler mode */ - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx", - "declaration": true, - /* Linting */ - "strict": false, - "noUnusedLocals": false, - "noUnusedParameters": false, - "noFallthroughCasesInSwitch": false, - "types": [ - "vite/client" + "include": ["src"], + "exclude": ["src/**/*.spec.ts", "src/**/*.spec.tsx", "src/**/*.test.ts", "src/**/*.test.tsx"], + "references": [ + { + "path": "./tsconfig.node.json" + } ] - }, - "include": [ - "src" - ], - "exclude": [ - "src/**/*.spec.ts", - "src/**/*.spec.tsx", - "src/**/*.test.ts", - "src/**/*.test.tsx" - ], - "references": [ - { - "path": "./tsconfig.node.json" - } - ] }