Skip to content

Commit 550aa85

Browse files
committed
fix: change vanilla forum link
1 parent c95460c commit 550aa85

File tree

6 files changed

+19
-17
lines changed

6 files changed

+19
-17
lines changed

.deploy/circleci/token.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ database.password=1nf0rm1x
1212
database.INFORMIXSERVER=informixoltp_tcp
1313
database.locale=en_us.utf8
1414

15-
# context.security.url - URL for JNDI lookup
15+
# context.security.url - URL for JNDI lookup
1616
context.security.url=localhost:11199
1717

1818
## Used by cache.properties
@@ -35,7 +35,7 @@ WINFORMULA_SERVER_NAME=tc.cloud.topcoder.com/winformula
3535
CSF_SERVER_NAME=csf.dev.topcoder.com
3636
CORP_SERVER_NAME=tc.cloud.topcoder.com/corp
3737
SOFTWARE_SERVER_NAME=tcs.cloud.topcoder.com
38-
FORUMS_SERVER_NAME=vanilla.topcoder-dev.com
38+
FORUMS_SERVER_NAME=discussions.topcoder-dev.com
3939
HOST_URL=localhost:11199
4040
FORUMS_HOST_URL=jnp://localhost:1199
4141
CONTEST_HOST_URL=63.118.154.180:10099

scripts/auto_pilot/ApplicationServer.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ WINFORMULA_SERVER_NAME=tc.cloud.topcoder.com/winformula
1515
CSF_SERVER_NAME=csf.dev.topcoder.com
1616
CORP_SERVER_NAME=tc.cloud.topcoder.com/corp
1717
SOFTWARE_SERVER_NAME=tcs.cloud.topcoder.com
18-
FORUMS_SERVER_NAME=vanilla.topcoder-dev.com
18+
FORUMS_SERVER_NAME=discussions.topcoder-dev.com
1919
HOST_URL=localhost:11199
2020
FORUMS_HOST_URL=localhost:1199
2121
CONTEST_HOST_URL=63.118.154.180:10099

src/main/java/com/cronos/onlinereview/util/ConfigHelper.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ public class ConfigHelper {
10581058
* JWT default expiration time (1 day)
10591059
*/
10601060
private static final int DEFAULT_EXPIRATION_TIME = 60 * 24;
1061-
1061+
10621062
/**
10631063
* New Auth URL for Iframe to refresh the RS256 token
10641064
*/
@@ -1691,7 +1691,7 @@ public class ConfigHelper {
16911691
} catch (Exception e) {
16921692
preSignedExpTimeMilis = 60 * 60 * 1000;
16931693
}
1694-
1694+
16951695
ConfigManager.Property newAuth = cfgMgr.getPropertyObject(ONLINE_REVIEW_CFG_NS, "new_auth");
16961696
newAuthUrl = newAuth.getValue("new_auth_url");
16971697

@@ -2570,18 +2570,18 @@ public static String getS3BucketDmz() {
25702570
public static long getPreSignedExpTimeMilis() {
25712571
return preSignedExpTimeMilis;
25722572
}
2573-
2573+
25742574
/**
2575-
* Get new auth url
2576-
* @return url
2575+
* Get new auth url
2576+
* @return url
25772577
*/
25782578
public static String getNewAuthUrl() {
25792579
return newAuthUrl;
25802580
}
25812581

25822582
/**
25832583
* Get challenge by legacy id url
2584-
* @return url
2584+
* @return url
25852585
*/
25862586
public static String getChallengeByLegacyIdUrlV5() {
25872587
return challengeByLegacyIdUrlV5;

src/main/resources/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2095,4 +2095,4 @@
20952095
<Property name="challenge_by_legacy_id_url_v5">
20962096
<Value>@topcoder_api_base_url_v5@/challenges?legacyId=</Value>
20972097
</Property>
2098-
</Config>
2098+
</Config>

token.properties.local

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ WINFORMULA_SERVER_NAME=tc.cloud.topcoder.com/winformula
7474
CSF_SERVER_NAME=csf.dev.topcoder.com
7575
CORP_SERVER_NAME=www.topcoder-dev.com/corp
7676
SOFTWARE_SERVER_NAME=local.topcoder-dev.com:8080
77-
FORUMS_SERVER_NAME=vanilla.topcoder-dev.com
77+
FORUMS_SERVER_NAME=discussions.topcoder-dev.com
7878
HOST_URL=localhost:1099
7979
FORUMS_HOST_URL=jnp://localhost:1099
8080
CONTEST_HOST_URL=63.118.154.180:10099
@@ -115,7 +115,7 @@ DOMAIN_AUTH0 = topcoder-dev.auth0.com
115115
#CSF_SERVER_NAME=csf.dev.topcoder.com
116116
#CORP_SERVER_NAME=tc.cloud.topcoder.com/corp
117117
#SOFTWARE_SERVER_NAME=tcs.cloud.topcoder.com
118-
#FORUMS_SERVER_NAME=vanilla.topcoder-dev.com
118+
#FORUMS_SERVER_NAME=discussions.topcoder-dev.com
119119
#HOST_URL=localhost:11199
120120
#FORUMS_HOST_URL=jnp://localhost:1199
121121
#CONTEST_HOST_URL=63.118.154.180:10099

web/jsp/viewProjectDetails.jsp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
--%>
88
<%@ page contentType="text/html;charset=UTF-8" %>
99
<%@ page language="java" isELIgnored="false" %>
10+
<%@ page import="java.text.DecimalFormat,com.topcoder.onlinereview.component.webcommon.ApplicationServer" %>
1011
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
1112
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
1213
<%@ taglib prefix="s" uri="/struts-tags" %>
@@ -83,13 +84,14 @@
8384
<link type="text/css" rel="stylesheet" href="/css/reskin-or/reskin.css">
8485
<script type="text/javascript">
8586
function updateForumLink(projectId) {
86-
return fetch("https://api.topcoder.com/v5/challenges?legacyId=" + projectId)
87+
return fetch("<%=com.cronos.onlinereview.util.ConfigHelper.getChallengeByLegacyIdUrlV5()%>" + projectId)
8788
.then((response) => response.json())
88-
.then((data) => data?.[0]?.discussions?.[0]?.url)
89-
.then((forumLink) => {
90-
if (forumLink !== undefined) {
89+
.then((data) => {
90+
let with_forum = data.filter(item => 'discussions' in item);
91+
let id = with_forum?.[0]?.id;
92+
if (id !== undefined) {
9193
let forumLinkEl = document.querySelector('.projectInfo__forumLink');
92-
return forumLinkEl.href = forumLink;
94+
return forumLinkEl.href = "https://<%=ApplicationServer.FORUMS_SERVER_NAME%>/categories/" + id;
9395
}
9496
});
9597
}

0 commit comments

Comments
 (0)