Skip to content

Commit 3502619

Browse files
committed
feat: add current version in release notes api
1 parent 589f1db commit 3502619

File tree

5 files changed

+8
-25
lines changed

5 files changed

+8
-25
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ export const InstallationWrapper = ({
761761
updateActionTrigger,
762762
history,
763763
location,
764+
serverInfo.currentVersion,
764765
moduleDetails && (moduleDetails.moduleType ? moduleDetails.moduleType : undefined),
765766
)
766767
} else {

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

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

131131
export const executeModuleEnableAction = (moduleName: string, toolVersion: string): Promise<ModuleActionResponse> =>
132132
post(`${Routes.MODULE_INFO_API}/enable?name=${moduleName}`, { version: toolVersion })
133+
133134
export const executeModuleAction = (
134135
moduleName: string,
135136
moduleActionRequest: ModuleActionRequest,
@@ -173,9 +174,11 @@ export const getAllModules = (): Promise<AllModuleInfoResponse> =>
173174
res.json(),
174175
)
175176

176-
export const getReleasesNotes = async (installationType: InstallationType): Promise<ReleaseNotesResponse> => {
177+
export const getReleasesNotes = async (installationType: InstallationType, serverVersion: string): Promise<ReleaseNotesResponse> => {
177178
const url = getUrlWithSearchParams(`${window._env_.CENTRAL_API_ENDPOINT}/${Routes.RELEASE_NOTES_API}`, {
178179
repo: INSTALLATION_TYPE_TO_REPO_MAP[installationType],
180+
serverVersion,
181+
179182
})
180183
const response = await fetch(url)
181184
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
@@ -77,12 +77,13 @@ export const handleAction = async (
7777
updateActionTrigger: (isActionTriggered: boolean) => void,
7878
history: RouteComponentProps['history'],
7979
location: RouteComponentProps['location'],
80+
currentVersion: string,
8081
moduleType?: string,
8182
) => {
8283
try {
8384
const actionRequest: ModuleActionRequest = {
8485
action: isUpgradeView ? ModuleActions.UPGRADE : ModuleActions.INSTALL,
85-
version: upgradeVersion,
86+
version: isUpgradeView ? upgradeVersion : currentVersion,
8687
moduleType,
8788
}
8889

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)