Skip to content

Commit ca3f05c

Browse files
Merge branch 'main' into fix/hotfix-32-main-sync
2 parents 0fdb186 + 33c4ae4 commit ca3f05c

File tree

99 files changed

+2649
-945
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2649
-945
lines changed

.env

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,5 @@ FEATURE_DEFAULT_LANDING_RB_ENABLE=false
6262
FEATURE_ACTION_AUDIOS_ENABLE=true
6363
FEATURE_APPLICATION_TEMPLATES_ENABLE=true
6464
FEATURE_CODE_MIRROR_ENABLE=false
65-
FEATURE_EXPERIMENTAL_THEMING_ENABLE=true
6665
FEATURE_DEFAULT_AUTHENTICATED_VIEW_ENABLE=false
6766
GATEKEEPER_URL=https://license.devtron.ai/dashboard
68-
FEATURE_CD_MANDATORY_PLUGINS_ENABLE=true

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ src/components/app/create/CreateApp.tsx
8686
src/components/app/create/validationRules.ts
8787
src/components/app/details/AboutAppInfoModal.tsx
8888
src/components/app/details/AboutTagEditModal.tsx
89-
src/components/app/details/AppHeader.tsx
9089
src/components/app/details/appDetails/AppMetrics.tsx
9190
src/components/app/details/appDetails/AppStatusCard.tsx
9291
src/components/app/details/appDetails/DeploymentStatusDetailModal.tsx

.storybook/preview.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
useTheme,
1515
} from '@devtron-labs/devtron-fe-common-lib'
1616
import { SwitchThemeDialog } from '../src/Pages/Shared'
17+
import './storybook.css'
1718

1819
const SwitchThemeDialogWrapper = () => {
1920
const { showThemeSwitcherDialog, themePreference, handleThemeSwitcherDialogVisibilityChange } = useTheme()
@@ -22,7 +23,7 @@ const SwitchThemeDialogWrapper = () => {
2223
}
2324

2425
return (
25-
showThemeSwitcherDialog ? <SwitchThemeDialog initialThemePreference={themePreference} handleClose={handleClose} disableAPICalls /> : null
26+
showThemeSwitcherDialog ? <SwitchThemeDialog initialThemePreference={themePreference} handleClose={handleClose} disableAPICalls handleUpdateUserThemePreference={noop} /> : null
2627
)
2728
}
2829

@@ -37,9 +38,7 @@ const preview: Preview = {
3738
},
3839
decorators: (Story) => {
3940
if (!window._env_) {
40-
window._env_ = {
41-
FEATURE_EXPERIMENTAL_THEMING_ENABLE: true,
42-
} as customEnv
41+
window._env_ = {} as customEnv
4342
}
4443

4544
return (
@@ -58,6 +57,7 @@ const preview: Preview = {
5857
<SwitchThemeDialogWrapper />
5958

6059
<div id="animated-dialog-backdrop" />
60+
<div id="visible-modal" />
6161

6262
<BaseConfirmationModal />
6363
</ConfirmationModalProvider>

.storybook/storybook.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background: var(--bg-primary);
3+
}

config.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,5 @@
4545
| TRIGGER_API_TIMEOUT | 60000 | Default timeout for all API requests for Trigger calls (Deploy artifacts, charts) in DASHBOARD |
4646
| FEATURE_HIDE_USER_DIRECT_PERMISSIONS_FOR_NON_SUPER_ADMINS | "true" | Would hide the user direct permissions for non-super admin users in User Permissions |
4747
| FEATURE_ACTION_AUDIOS_ENABLE | true | Would enable audios in dashboard |
48-
| FEATURE_EXPERIMENTAL_THEMING_ENABLE | true | Would enable theming in dashboard |
4948

5049
# DASHBOARD CONFIG SECRET

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "1.10.0-patch-9",
7+
"@devtron-labs/devtron-fe-common-lib": "1.11.0",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

src/Pages/App/CreateAppModal/AppToCloneSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const AppToCloneSelector = ({ isJobView, error, handleCloneIdChange }: AppToClon
3333
const onInputChange: SelectPickerProps['onInputChange'] = async (val) => {
3434
setInputValue(val)
3535
setAreOptionsLoading(true)
36-
const fetchedOptions = await appListOptions(val, isJobView)
36+
const fetchedOptions = await appListOptions({ inputValue: val, isJobView })
3737
setAreOptionsLoading(false)
3838
setOptions(fetchedOptions)
3939
}

src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/AppComposeRouter.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ const AppComposeRouter = () => {
151151
onErrorRedirectURL={lastUnlockedStage}
152152
appName={currentAppName}
153153
envName=""
154+
isExceptionUser={false}
154155
isTemplateView={isTemplateView}
155156
/>
156157
</Route>,
@@ -168,6 +169,7 @@ const AppComposeRouter = () => {
168169
onErrorRedirectURL={lastUnlockedStage}
169170
appName={currentAppName}
170171
envName=""
172+
isExceptionUser={false}
171173
isTemplateView={isTemplateView}
172174
/>
173175
</Route>,
@@ -242,6 +244,10 @@ const AppComposeRouter = () => {
242244
)}
243245
reloadEnvironments={reloadEnvironments}
244246
fetchEnvConfig={fetchEnvConfig}
247+
isExceptionUser={
248+
approvalConfigMapForBaseConfiguration?.[ApprovalConfigDataKindType.deploymentTemplate]
249+
.isExceptionUser ?? false
250+
}
245251
isTemplateView={isTemplateView}
246252
/>
247253
</Route>
@@ -290,6 +296,10 @@ const AppComposeRouter = () => {
290296
onErrorRedirectURL={lastUnlockedStage}
291297
appName={currentAppName}
292298
envName=""
299+
isExceptionUser={
300+
approvalConfigMapForBaseConfiguration?.[ApprovalConfigDataKindType.configMap]
301+
.isExceptionUser
302+
}
293303
isTemplateView={isTemplateView}
294304
/>
295305
</Route>,
@@ -308,6 +318,10 @@ const AppComposeRouter = () => {
308318
onErrorRedirectURL={lastUnlockedStage}
309319
appName={currentAppName}
310320
envName=""
321+
isExceptionUser={
322+
approvalConfigMapForBaseConfiguration?.[ApprovalConfigDataKindType.configSecret]
323+
.isExceptionUser
324+
}
311325
isTemplateView={isTemplateView}
312326
/>
313327
</Route>,

src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/CompareConfigView.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616

1717
import { importComponentFromFELibrary } from '@Components/common'
18-
import { ReactComponent as ICCheck } from '@Icons/ic-check.svg'
1918
import { ReactComponent as ICFileEdit } from '@Icons/ic-file-edit.svg'
2019
import { DeploymentHistoryDiffView, ErrorScreenManager } from '@devtron-labs/devtron-fe-common-lib'
2120
import { CompareConfigViewProps } from './types'
@@ -42,9 +41,8 @@ const CompareConfigView = ({
4241
}: CompareConfigViewProps) => (
4342
<div className={`flexbox-col ${className ?? ''}`}>
4443
<div className="dc__grid-half bg__primary dc__position-sticky dc__top-0 dc__zi-10">
45-
<div className="dc__border-right px-12 py-6 flexbox dc__gap-8 dc__border-bottom dc__align-items-center">
46-
<ICCheck className="scn-9 icon-dim-16 dc__no-shrink" />
47-
<span className="cn-9 fs-12 fw-6 lh-20">Published</span>
44+
<div className="dc__border-right px-12 py-6 dc__border-bottom">
45+
<span className="cn-9 fs-12 fw-6 lh-20">Comparing with Published</span>
4846
</div>
4947

5048
<div className="px-12 py-6 dc__gap-8 dc__border-bottom flexbox dc__align-items-center">

src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigToolbar.tsx

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
import { Fragment } from 'react'
18+
import ReactGA from 'react-ga4'
1819
import {
1920
Button,
2021
ButtonStyleType,
@@ -26,6 +27,7 @@ import {
2627
ComponentSizeType,
2728
InvalidYAMLTippyWrapper,
2829
ToggleResolveScopedVariables,
30+
Icon,
2931
} from '@devtron-labs/devtron-fe-common-lib'
3032
import { useParams } from 'react-router-dom'
3133
import { importComponentFromFELibrary } from '@Components/common'
@@ -40,6 +42,7 @@ import SelectMergeStrategy from './SelectMergeStrategy'
4042
const ProtectionViewTabGroup = importComponentFromFELibrary('ProtectionViewTabGroup', null, 'function')
4143
const MergePatchWithTemplateCheckbox = importComponentFromFELibrary('MergePatchWithTemplateCheckbox', null, 'function')
4244
const ConfigApproversInfoTippy = importComponentFromFELibrary('ConfigApproversInfoTippy', null, 'function')
45+
const ExpressEditButton = importComponentFromFELibrary('ExpressEditButton', null, 'function')
4346
const ProtectConfigShowCommentsButton = importComponentFromFELibrary(
4447
'ProtectConfigShowCommentsButton',
4548
null,
@@ -114,6 +117,7 @@ const ConfigToolbar = ({
114117
isApprovalPolicyConfigured = false,
115118
isApprovalPending,
116119
isDraftPresent,
120+
isUnpublished = false,
117121
draftId,
118122
draftVersionId,
119123
requestedUserId,
@@ -125,6 +129,10 @@ const ConfigToolbar = ({
125129
isPublishedConfigPresent = true,
126130
headerMessage,
127131
showDeleteOverrideDraftEmptyState,
132+
133+
isExceptionUser,
134+
isExpressEditView,
135+
expressEditButtonConfig,
128136
}: ConfigToolbarProps) => {
129137
const { envId } = useParams<BaseURLParams>()
130138
const isDisabled = disableAllActions || !!parsingError
@@ -148,9 +156,9 @@ const ConfigToolbar = ({
148156

149157
const isEditView = !!(
150158
configHeaderTab === ConfigHeaderTabType.VALUES &&
151-
(isApprovalPolicyConfigured && isDraftPresent
152-
? selectedProtectionViewTab === ProtectConfigTabsType.EDIT_DRAFT
153-
: true)
159+
(!isApprovalPolicyConfigured ||
160+
!isDraftPresent ||
161+
selectedProtectionViewTab === ProtectConfigTabsType.EDIT_DRAFT)
154162
)
155163

156164
const showProtectedTabs =
@@ -159,7 +167,28 @@ const ConfigToolbar = ({
159167
configHeaderTab === ConfigHeaderTabType.VALUES &&
160168
!!ProtectionViewTabGroup
161169

170+
const hideMergeStrategy =
171+
!mergeStrategy ||
172+
!envId ||
173+
showDeleteOverrideDraftEmptyState ||
174+
(!isEditView && !(isPublishedValuesView && !!isPublishedConfigPresent))
175+
176+
const showExpressEditButton =
177+
!!ExpressEditButton && isExceptionUser && !isExpressEditView && isEditView && !showDeleteOverrideDraftEmptyState
178+
162179
const getLHSActionNodes = (): JSX.Element => {
180+
if (isExpressEditView) {
181+
return (
182+
<>
183+
<div className="flex dc__gap-6">
184+
<Icon name="ic-pencil" color="N700" />
185+
<p className="m-0 fs-12 lh-18 cn-9">Editing Published</p>
186+
</div>
187+
{(children || !hideMergeStrategy) && <div className="divider__secondary" />}
188+
</>
189+
)
190+
}
191+
163192
if (configHeaderTab === ConfigHeaderTabType.INHERITED) {
164193
return (
165194
<div className="flexbox dc__align-items-center dc__gap-6">
@@ -186,6 +215,7 @@ const ConfigToolbar = ({
186215
selectedTab={selectedProtectionViewTab}
187216
handleProtectionViewTabChange={handleProtectionViewTabChange}
188217
isApprovalPending={isApprovalPending}
218+
hasPublishedConfig={isPublishedConfigPresent}
189219
isDisabled={isDisabled}
190220
parsingError={parsingError}
191221
restoreLastSavedYAML={restoreLastSavedYAML}
@@ -224,7 +254,7 @@ const ConfigToolbar = ({
224254
const shouldRenderCommentsView = !!isDraftPresent
225255
const hasNothingToRender = !shouldRenderApproverInfoTippy && !shouldRenderCommentsView
226256

227-
if (!isApprovalPolicyConfigured || hasNothingToRender) {
257+
if (!isApprovalPolicyConfigured || hasNothingToRender || isExpressEditView) {
228258
return null
229259
}
230260

@@ -293,12 +323,7 @@ const ConfigToolbar = ({
293323
}
294324

295325
const renderSelectMergeStrategy = () => {
296-
if (
297-
!mergeStrategy ||
298-
!envId ||
299-
showDeleteOverrideDraftEmptyState ||
300-
(!isEditView && !(isPublishedValuesView && !!isPublishedConfigPresent))
301-
) {
326+
if (hideMergeStrategy) {
302327
return null
303328
}
304329

@@ -391,11 +416,28 @@ const ConfigToolbar = ({
391416
{renderSelectMergeStrategy()}
392417
</div>
393418

394-
{isPublishedValuesView && !isPublishedConfigPresent ? null : (
419+
{(showExpressEditButton || !isPublishedValuesView || isPublishedConfigPresent) && (
395420
<div className="flexbox dc__align-items-center dc__gap-8">
396-
{renderProtectedConfigActions()}
397-
{renderReadmeAndScopedVariablesBlock()}
398-
{renderPopupMenu()}
421+
{showExpressEditButton && (
422+
<ExpressEditButton
423+
disabled={isUnpublished}
424+
{...(expressEditButtonConfig ?? {})}
425+
onClick={() => {
426+
ReactGA.event({
427+
category: 'APP_EXPRESS_EDIT_ACCESSED',
428+
action: 'APP_EXPRESS_EDIT_ACCESSED',
429+
})
430+
expressEditButtonConfig?.onClick?.()
431+
}}
432+
/>
433+
)}
434+
{isPublishedValuesView && !isPublishedConfigPresent ? null : (
435+
<>
436+
{renderProtectedConfigActions()}
437+
{renderReadmeAndScopedVariablesBlock()}
438+
{renderPopupMenu()}
439+
</>
440+
)}
399441
</div>
400442
)}
401443
</div>

0 commit comments

Comments
 (0)