Skip to content

Commit 3e5f283

Browse files
authored
Memodel validation: fix wording, redirect to analysis tab on validation finish (#239)
1 parent 4396521 commit 3e5f283

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/components/build-section/virtual-lab/me-model/BluePyEModelContainer.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ import CentralLoadingWheel from '@/components/CentralLoadingWheel';
99
import { VirtualLabInfo } from '@/types/virtual-lab/common';
1010
import { generateVlProjectUrl } from '@/util/virtual-lab/urls';
1111
import { to64 } from '@/util/common';
12+
import { EmodelTabKeys } from '@/components/explore-section/EModel/DetailView/SectionTabs';
1213

13-
function getMEModelPageUrl(meModelId: string, virtualLabInfo: VirtualLabInfo) {
14+
function getMEModelPageUrl(meModelId: string, virtualLabInfo: VirtualLabInfo, tab?: EmodelTabKeys) {
1415
const { virtualLabId, projectId } = virtualLabInfo;
1516

1617
const vlProjectUrl = generateVlProjectUrl(virtualLabId, projectId);
1718
const idSegment = to64(`${virtualLabId}/${projectId}!/!${meModelId}`);
1819

19-
return `${vlProjectUrl}/explore/interactive/model/me-model/${idSegment}`;
20+
const searchParams = new URLSearchParams();
21+
if (tab) searchParams.set('tab', tab);
22+
const searchStr = searchParams.toString();
23+
24+
return `${vlProjectUrl}/explore/interactive/model/me-model/${idSegment}?${searchStr}`;
2025
}
2126

2227
// Format elapsed time as HH:mm:ss
@@ -80,7 +85,7 @@ function ValidationInit({
8085
<CentralLoadingWheel
8186
text={
8287
<>
83-
<div>Please dont close the window</div>
88+
<div>Please don&apos;t close the window</div>
8489
<span className="text-sm font-light">Validation is launching</span>
8590
</>
8691
}
@@ -115,8 +120,9 @@ function ValidationRunning({
115120
<p className="text-primary-8">
116121
You can close the window at any time now. Analysis results will appear under the
117122
<Link className="ml-2 font-bold underline" href={meModelPageUrl}>
118-
EModel details page
123+
ME-model details page
119124
</Link>
125+
.
120126
</p>
121127

122128
<CentralLoadingWheel
@@ -145,7 +151,7 @@ function ValidationSuccess({
145151
}) {
146152
const router = useRouter();
147153

148-
const meModelPageUrl = getMEModelPageUrl(meModelId, virtualLabInfo);
154+
const meModelPageUrl = getMEModelPageUrl(meModelId, virtualLabInfo, 'analysis');
149155

150156
useEffect(() => {
151157
const timer = setTimeout(() => {
@@ -160,10 +166,10 @@ function ValidationSuccess({
160166
<h2 className="items-start gap-x-2 text-4xl font-bold text-primary-8">
161167
Validation finished successfully
162168
</h2>
163-
<p className="text-primary-8">You will be redirected to ME-Model page shortly</p>
169+
<p className="text-primary-8">You will be redirected to ME-model page shortly</p>
164170

165171
<Link className="border border-primary-8 px-4 py-2 text-primary-8" href={meModelPageUrl}>
166-
View EModel details
172+
View ME-model details
167173
</Link>
168174
</div>
169175
);
@@ -184,7 +190,7 @@ function ValidationError({
184190
<p className="text-primary-8">An unexpected error occurred during the validation process.</p>
185191

186192
<Link className="border border-primary-8 px-4 py-2 text-primary-8" href={meModelPageUrl}>
187-
EModel details
193+
ME-model details
188194
</Link>
189195
</div>
190196
);

0 commit comments

Comments
 (0)