Skip to content

Commit 7379254

Browse files
Merge branch 'develop' into fix/rollout-release-css
2 parents b325340 + 87fd79d commit 7379254

File tree

5 files changed

+19
-40
lines changed

5 files changed

+19
-40
lines changed

src/components/v2/devtronStackManager/DevtronStackManager.component.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -729,20 +729,16 @@ export const InstallationWrapper = ({
729729
}, [releaseNotes])
730730

731731
const fetchPreRequisiteListFromReleaseNotes = () => {
732-
const _preRequisiteList = []
733-
for (let index = 0; index < releaseNotes.length; index++) {
734-
const element = releaseNotes[index]
735-
if (element.releaseName === serverInfo?.currentVersion) {
736-
break
737-
}
738-
if (element.prerequisite && element.prerequisiteMessage) {
739-
_preRequisiteList.push({
740-
version: element.releaseName,
741-
prerequisiteMessage: element.prerequisiteMessage,
742-
tagLink: element.tagLink,
743-
})
744-
}
745-
}
732+
const _preRequisiteList = releaseNotes
733+
.filter(
734+
({ releaseName, prerequisite, prerequisiteMessage }) =>
735+
releaseName !== serverInfo?.currentVersion && prerequisite && prerequisiteMessage,
736+
)
737+
.map(({ releaseName, prerequisiteMessage, tagLink }) => ({
738+
version: releaseName,
739+
prerequisiteMessage,
740+
tagLink,
741+
}))
746742
setPreRequisiteList(_preRequisiteList.reverse())
747743
}
748744

@@ -761,6 +757,7 @@ export const InstallationWrapper = ({
761757
updateActionTrigger,
762758
history,
763759
location,
760+
serverInfo.currentVersion,
764761
moduleDetails && (moduleDetails.moduleType ? moduleDetails.moduleType : undefined),
765762
)
766763
} else {
@@ -790,7 +787,7 @@ export const InstallationWrapper = ({
790787
</div>
791788
<CloseIcon className="pointer mt-2" onClick={hidePrerequisiteConfirmationModal} />
792789
</div>
793-
<div className="p-20">
790+
<div className="p-20 mxh-600 dc__overflow-auto">
794791
<div className="fw-6 fs-13 cn-9 mb-12">
795792
Please ensure you follow below pre-requisites steps in order.
796793
</div>

src/components/v2/devtronStackManager/DevtronStackManager.service.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ export const getModuleInfo = async (moduleName: string, forceReload?: boolean):
137137

138138
export const executeModuleEnableAction = (moduleName: string, toolVersion: string): Promise<ModuleActionResponse> =>
139139
post(`${Routes.MODULE_INFO_API}/enable?name=${moduleName}`, { version: toolVersion })
140+
140141
export const executeModuleAction = (
141142
moduleName: string,
142143
moduleActionRequest: ModuleActionRequest,
@@ -180,9 +181,11 @@ export const getAllModules = (): Promise<AllModuleInfoResponse> =>
180181
res.json(),
181182
)
182183

183-
export const getReleasesNotes = async (installationType: InstallationType): Promise<ReleaseNotesResponse> => {
184+
export const getReleasesNotes = async (installationType: InstallationType, serverVersion: string): Promise<ReleaseNotesResponse> => {
184185
const url = getUrlWithSearchParams(`${window._env_.CENTRAL_API_ENDPOINT}/${Routes.RELEASE_NOTES_API}`, {
185186
repo: INSTALLATION_TYPE_TO_REPO_MAP[installationType],
187+
serverVersion,
188+
186189
})
187190
const response = await fetch(url)
188191
return response.json()

src/components/v2/devtronStackManager/DevtronStackManager.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ export default function DevtronStackManager({
347347
})
348348

349349
// 1. Execute all APIs - get all modules, get logPodName & releaseNotes
350-
Promise.allSettled([getAllModules(), getLogPodName(), getReleasesNotes(serverInfo.installationType)])
350+
Promise.allSettled([getAllModules(), getLogPodName(), getReleasesNotes(serverInfo.installationType, serverInfo.currentVersion)])
351351
.then((responses: { status: string; value?: any; reason?: any }[]) => {
352352
const allModulesRes: AllModuleInfoResponse = responses[0].value
353353
const allModulesErrorRes = responses[0].reason

src/components/v2/devtronStackManager/DevtronStackManager.utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,13 @@ export const handleAction = async (
7676
updateActionTrigger: (isActionTriggered: boolean) => void,
7777
history: RouteComponentProps['history'],
7878
location: RouteComponentProps['location'],
79+
currentVersion: string,
7980
moduleType?: string,
8081
) => {
8182
try {
8283
const actionRequest: ModuleActionRequest = {
8384
action: isUpgradeView ? ModuleActions.UPGRADE : ModuleActions.INSTALL,
84-
version: upgradeVersion,
85+
version: isUpgradeView ? upgradeVersion : currentVersion,
8586
moduleType,
8687
}
8788

src/components/v2/devtronStackManager/devtronStackManager.component.scss

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -118,28 +118,6 @@
118118
}
119119

120120
.module-details__install-wrapper {
121-
.module-details__install-button {
122-
width: 100%;
123-
height: 36px;
124-
125-
&.cta {
126-
text-transform: none;
127-
}
128-
129-
.module-details__install-icon {
130-
transform: rotate(90deg);
131-
}
132-
133-
.module-details__retry-install-icon {
134-
path {
135-
fill: none;
136-
}
137-
}
138-
&.disabled-state {
139-
opacity: 0.5;
140-
cursor: not-allowed;
141-
}
142-
}
143121
.module-details__installtion-status {
144122
width: 100%;
145123
border: 1px solid var(--N200);

0 commit comments

Comments
 (0)