Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
bedefbb
chore(deps): bump path-to-regexp from 1.8.0 to 1.9.0
dependabot[bot] Oct 10, 2024
5dce4a3
chore(deps): bump jsonpath-plus from 9.0.0 to 10.0.0
dependabot[bot] Oct 15, 2024
df58d63
chore(deps-dev): bump @sentry/browser from 7.118.0 to 7.119.1
dependabot[bot] Oct 15, 2024
d20eb5b
chore(deps): bump rollup from 4.21.2 to 4.24.0
dependabot[bot] Oct 15, 2024
5cfe2c6
Merge branch 'main' into dependabot/npm_and_yarn/path-to-regexp-1.9.0
Elessar1802 Oct 21, 2024
e7567d9
Merge branch 'chore/dependabot-updates' into dependabot/npm_and_yarn/…
Elessar1802 Oct 21, 2024
2b4a181
Merge pull request #301 from devtron-labs/dependabot/npm_and_yarn/pat…
Elessar1802 Oct 21, 2024
4a74bfe
Merge pull request #329 from devtron-labs/dependabot/npm_and_yarn/rol…
Elessar1802 Oct 21, 2024
1a6f4b0
Merge pull request #334 from devtron-labs/dependabot/npm_and_yarn/sen…
Elessar1802 Oct 21, 2024
14db365
Merge pull request #352 from devtron-labs/dependabot/npm_and_yarn/jso…
Elessar1802 Oct 21, 2024
9fe6431
chore: dependabot version bumps
Elessar1802 Oct 21, 2024
32cec2d
chore: version bump
Elessar1802 Oct 21, 2024
0819f44
chore: update package-lock.json to latest values
Elessar1802 Oct 21, 2024
7e7b913
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
Elessar1802 Oct 21, 2024
33892da
chore: update package-lock.json to latest values
Elessar1802 Oct 21, 2024
5d4e420
chore: version bump
Elessar1802 Oct 21, 2024
df685e6
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
Elessar1802 Oct 21, 2024
cc79c7b
Merge pull request #364 from devtron-labs/chore/dependabot-updates
Elessar1802 Oct 21, 2024
1c31c90
feat: try button added
shivani170 Oct 23, 2024
53ba9da
chore: version bump
shivani170 Oct 23, 2024
e3f767a
fix: create button css
shivani170 Oct 23, 2024
90287e7
chore: version bump
shivani170 Oct 23, 2024
eb7a466
chore: css fixes
shivani170 Oct 23, 2024
0230e3e
chore:version bump
shivani170 Oct 23, 2024
bf71d36
chore: variable name update
shivani170 Oct 23, 2024
859ae0e
chore: renaming of variable
shivani170 Oct 23, 2024
5eb8299
chore: renaming of cm values
shivani170 Oct 23, 2024
d7d21b6
chore: code refactoring
shivani170 Oct 23, 2024
2caa3a7
chore: version bump
shivani170 Oct 23, 2024
1282423
url check added
shivani170 Oct 23, 2024
6a1d40d
chore: code refactoring
shivani170 Oct 23, 2024
6f2b307
empty state for no iframe
shivani170 Oct 23, 2024
805160d
chore: version bump
shivani170 Oct 23, 2024
104843d
chore: version change
shivani170 Oct 23, 2024
6ca8ab0
Merge pull request #366 from devtron-labs/feat/try-devtron
shivani170 Oct 23, 2024
bf6aa40
chore: verion bump to 0.6.0
arunjaindev Oct 24, 2024
37093cf
Merge branch 'release-candidate-v0.21.0' of https://github.com/devtro…
arunjaindev Oct 24, 2024
e9c189e
Merge pull request #367 from devtron-labs/chore/versio-bump
arunjaindev Oct 24, 2024
506cf9e
Merge pull request #368 from devtron-labs/release-candidate-v0.21.0
arunjaindev Oct 24, 2024
596572b
Merge branch 'main' of https://github.com/devtron-labs/devtron-fe-com…
arunjaindev Oct 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,910 changes: 1,975 additions & 1,935 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtron-labs/devtron-fe-common-lib",
"version": "0.5.8",
"version": "0.6.0",
"description": "Supporting common component library",
"type": "module",
"main": "dist/index.js",
Expand Down Expand Up @@ -35,7 +35,7 @@
},
"devDependencies": {
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
"@sentry/browser": "^7.31.1",
"@sentry/browser": "^7.119.1",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.4",
"@tippyjs/react": "^4.2.0",
Expand Down Expand Up @@ -94,7 +94,7 @@
"ansi_up": "^5.2.1",
"dayjs": "^1.11.13",
"fast-json-patch": "^3.1.1",
"jsonpath-plus": "^9.0.0",
"jsonpath-plus": "^10.0.0",
"react-dates": "^21.8.0",
"react-monaco-editor": "^0.54.0",
"sass": "^1.69.7",
Expand Down
3 changes: 3 additions & 0 deletions src/Assets/Icon/ic-caret-down-small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Common/RJSF/templates/FieldErrorTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { errorId, FieldErrorProps } from '@rjsf/utils'
import { ReactComponent as Error } from '../../../Assets/Icon/ic-warning.svg'

export const FieldErrorTemplate = ({ errors = [], idSchema }: FieldErrorProps) => {
const id = errorId(idSchema)
const id = errorId(idSchema as Parameters<typeof errorId>[0])

return (
errors.length > 0 && (
Expand Down
2 changes: 1 addition & 1 deletion src/Common/RJSF/templates/ObjectFieldTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const ObjectFieldTemplate = (props: ObjectFieldTemplateProps<any, RJSFFor
<fieldset id={idSchema.$id}>
{showTitle && (
<TitleField
id={titleId(idSchema)}
id={titleId(idSchema as Parameters<typeof titleId>[0])}
title={title}
required={required}
schema={schema}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@

import { useState } from 'react'
import { useHistory, useLocation, useParams } from 'react-router-dom'
import { Modal, SERVER_MODE, URLS } from '../../../../Common'
import Button from '@Shared/Components/Button/Button.component'
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 { ReactComponent as DropDown } from '../../../../Assets/Icon/ic-dropdown-filled.svg'
import { ReactComponent as ChartIcon } from '../../../../Assets/Icon/ic-charts.svg'
import { ReactComponent as AddIcon } from '../../../../Assets/Icon/ic-add.svg'
import { ReactComponent as JobIcon } from '../../../../Assets/Icon/ic-k8s-job.svg'
import { AppListConstants } from '../../../constants'
import { Modal, SERVER_MODE, URLS } from '../../../../Common'
import { AppListConstants, ComponentSizeType } from '../../../constants'
import './HeaderWithCreateButton.scss'
import { useMainContext } from '../../../Providers'

Expand Down Expand Up @@ -56,23 +57,28 @@ export const HeaderWithCreateButton = ({ headerName }: HeaderWithCreateButtonPro

const renderActionButtons = () =>
serverMode === SERVER_MODE.FULL ? (
<button
type="button"
className="flex cta h-32 lh-n"
<Button
text="Create"
onClick={handleCreateButton}
data-testid="create-app-button-on-header"
>
Create
<DropDown className="icon-dim-20" />
</button>
dataTestId="create-app-button-on-header"
endIcon={<DropDown className="icon-dim-20" />}
size={ComponentSizeType.small}
/>
) : (
<button type="button" className="flex cta h-32 lh-n" onClick={redirectToHelmAppDiscover}>
Deploy helm charts
</button>
<Button
text="Deploy helm charts"
onClick={redirectToHelmAppDiscover}
dataTestId="deploy-helm-chart-on-header"
size={ComponentSizeType.small}
/>
)

const renderCreateSelectionModal = () => (
<Modal rootClassName="create-modal-wrapper" onClick={handleCreateButton}>
<Modal
rootClassName={`create-modal-wrapper
${window._env_.FEATURE_PROMO_EMBEDDED_BUTTON_TEXT ? 'create-modal-wrapper--try-devtron' : ''}`}
onClick={handleCreateButton}
>
<div
className="create-modal-child cursor"
onClick={openCreateDevtronAppModel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@
background-color: var(--N100);
}
}

&--try-devtron {
right: 84px !important;
}
}
73 changes: 73 additions & 0 deletions src/Shared/Components/Header/IframePromoButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { GenericEmptyState, VisibleModal } from '@Common/index'
import { ComponentSizeType } from '@Shared/constants'
import { useState, useCallback } from 'react'
import { ReactComponent as Close } from '@Icons/ic-close.svg'
import { Button, ButtonStyleType, ButtonVariantType } from '../Button'

export const IframePromoButton = () => {
const [showEmbeddedIframeModal, setEmbeddedIframeModal] = useState(false)

const {
FEATURE_PROMO_EMBEDDED_BUTTON_TEXT,
FEATURE_PROMO_EMBEDDED_MODAL_TITLE,
FEATURE_PROMO_EMBEDDED_IFRAME_URL,
} = window._env_

const onClickShowIframeModal = useCallback(() => setEmbeddedIframeModal(true), [])
const onClickCloseIframeModal = useCallback(() => setEmbeddedIframeModal(false), [])

const renderIframeDrawer = () => (
<VisibleModal close={onClickCloseIframeModal}>
<div className="modal-body--ci-material h-100 dc__overflow-hidden dc__border-left flex column dc__content-space w-100">
<div className="trigger-modal__header w-100">
<h1 className="modal__title flex left fs-16 fw-6-imp" data-testid="app-details-url-heading">
{FEATURE_PROMO_EMBEDDED_MODAL_TITLE || FEATURE_PROMO_EMBEDDED_BUTTON_TEXT}
</h1>
<Button
ariaLabel="promo-header-button"
dataTestId="iframe-modal-close-button"
size={ComponentSizeType.small}
onClick={onClickCloseIframeModal}
style={ButtonStyleType.negativeGrey}
variant={ButtonVariantType.borderLess}
icon={<Close />}
showAriaLabelInTippy={false}
/>
</div>
{FEATURE_PROMO_EMBEDDED_IFRAME_URL ? (
<iframe
title={FEATURE_PROMO_EMBEDDED_MODAL_TITLE || FEATURE_PROMO_EMBEDDED_BUTTON_TEXT}
src={FEATURE_PROMO_EMBEDDED_IFRAME_URL}
width="100%"
height="100%"
className="dc__no-border"
sandbox="allow-same-origin allow-scripts"
referrerPolicy="no-referrer"
/>
) : (
<div className="flex h-100">
<GenericEmptyState
title="Nothing to show"
subTitle="An iframe appears here in a parallel universe"
/>
</div>
)}
</div>
</VisibleModal>
)

return (
<div>
{FEATURE_PROMO_EMBEDDED_BUTTON_TEXT && (
<Button
dataTestId="iframe-header-button"
size={ComponentSizeType.small}
onClick={onClickShowIframeModal}
text={FEATURE_PROMO_EMBEDDED_BUTTON_TEXT}
variant={ButtonVariantType.secondary}
/>
)}
{showEmbeddedIframeModal && renderIframeDrawer()}
</div>
)
}
13 changes: 9 additions & 4 deletions src/Shared/Components/Header/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { ReactComponent as DropDownIcon } from '../../../Assets/Icon/ic-chevron-
import AnnouncementBanner from '../AnnouncementBanner/AnnouncementBanner'
import { useMainContext, useUserEmail } from '../../Providers'
import { InfoIconTippy } from '../InfoIconTippy'
import { IframePromoButton } from './IframePromoButton'

const PageHeader = ({
headerName,
Expand Down Expand Up @@ -121,8 +122,8 @@ const PageHeader = ({

const renderLogoutHelpSection = () => (
<>
<div className="flex left cursor mr-16" onClick={onClickHelp}>
<span className="icon-dim-24 fcn-9 mr-4 ml-16">
<div className="flex left cursor dc__gap-8" onClick={onClickHelp}>
<span className="icon-dim-24 fcn-9">
<Question />
</span>
<span className="fs-13 cn-9" data-testid="go-to-get-started">
Expand Down Expand Up @@ -156,6 +157,8 @@ const PageHeader = ({
<span className="fs-12 fw-4 lh-18 pt-1 pb-1 pl-6 pr-6 ml-8 cn-9 bcy-5 br-4">Beta</span>
)

const renderIframeButton = () => <IframePromoButton />

return (
<div
className={`dc__page-header dc__content-space cn-9 bcn-0 pl-20 pr-20 ${
Expand Down Expand Up @@ -220,7 +223,8 @@ const PageHeader = ({
{markAsBeta && renderBetaTag()}
</div>
{showTabs && (
<div className="flex left">
<div className="flex left dc__gap-12">
{renderIframeButton()}
{typeof renderActionButtons === 'function' && renderActionButtons()}
{renderLogoutHelpSection()}
</div>
Expand Down Expand Up @@ -258,8 +262,9 @@ const PageHeader = ({
/>
)}
{!showTabs && (
<div className="flex left">
<div className="flex left dc__gap-12">
{typeof renderActionButtons === 'function' && renderActionButtons()}
{renderIframeButton()}
{renderLogoutHelpSection()}
</div>
)}
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export interface customEnv {
FEATURE_STEP_WISE_LOGS_ENABLE?: boolean
FEATURE_IMAGE_PROMOTION_ENABLE?: boolean
FEATURE_CONFIG_DRIFT_ENABLE: boolean
FEATURE_PROMO_EMBEDDED_BUTTON_TEXT?: string
FEATURE_PROMO_EMBEDDED_MODAL_TITLE?: string
FEATURE_PROMO_EMBEDDED_IFRAME_URL?: string
}
declare global {
interface Window {
Expand Down