Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 102033e

Browse files
committed
Production issues fixes
1 parent e9cd8cc commit 102033e

File tree

9 files changed

+28
-14
lines changed

9 files changed

+28
-14
lines changed

Diff for: README.md

+7
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,10 @@ Note: heroku domain should match subdomain of topcoder-dev or topcoder depending
8787
- click get link button to get the shareable link which can be used by topcoder member to self assign to the repository. Click to icon next to url to copy to clipboard.
8888
- normal member cannot use the application, allowed roles are configured in API, if normal user tries to access the app, error is shown in login page.
8989

90+
## Topcoder Direct ID to Connect ID migration
91+
92+
Direct ID migration can be done with script located in **topcoder-x-processor** codebase called direct-connect-migration
93+
```shell
94+
npm run direct-connect-migration
95+
```
96+
By default it takes 15 projects at time, but you can change this by specifying BATCH_SIZE environment variable.

Diff for: src/config.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const frontendConfigs = {
7878
API_URL: 'https://127.0.0.1:8443',
7979
ADMIN_TOOL_URL: 'http://localhost:8080/api/v2',
8080
ACCOUNTS_CONNECTOR_URL: 'https://accounts.topcoder-dev.com/connector.html',
81-
DIRECT_URL_BASE: 'https://www.topcoder-dev/direct/projectOverview?formData.projectId=',
81+
CONNECT_URL_BASE: 'https://connect.topcoder-dev/projects/',
8282
OWNER_LOGIN_GITHUB_URL: '/api/v1/github/owneruser/login',
8383
OWNER_LOGIN_GITLAB_URL: '/api/v1/gitlab/owneruser/login',
8484
TOPCODER_URL: 'https://topcoder-dev.com',
@@ -93,7 +93,7 @@ const frontendConfigs = {
9393
API_URL: 'https://api.topcoder-dev.com',
9494
ADMIN_TOOL_URL: 'https://api.topcoder-dev.com/v2',
9595
ACCOUNTS_CONNECTOR_URL: 'https://accounts.topcoder-dev.com/connector.html',
96-
DIRECT_URL_BASE: 'https://www.topcoder-dev.com/direct/projectOverview?formData.projectId=',
96+
CONNECT_URL_BASE: 'https://connect.topcoder-dev.com/projects/',
9797
OWNER_LOGIN_GITHUB_URL: '/api/v1/github/owneruser/login',
9898
OWNER_LOGIN_GITLAB_URL: '/api/v1/gitlab/owneruser/login',
9999
TOPCODER_URL: 'https://topcoder-dev.com',
@@ -108,7 +108,7 @@ const frontendConfigs = {
108108
API_URL: 'https://api.topcoder-dev.com',
109109
ADMIN_TOOL_URL: 'https://api.topcoder-dev.com/v2',
110110
ACCOUNTS_CONNECTOR_URL: 'https://accounts.topcoder-dev.com/connector.html',
111-
DIRECT_URL_BASE: 'https://www.topcoder-dev.com/direct/projectOverview?formData.projectId=',
111+
CONNECT_URL_BASE: 'https://connect.topcoder-dev.com/projects/',
112112
OWNER_LOGIN_GITHUB_URL: '/api/v1/github/owneruser/login',
113113
OWNER_LOGIN_GITLAB_URL: '/api/v1/gitlab/owneruser/login',
114114
TOPCODER_URL: 'https://topcoder-dev.com',
@@ -123,7 +123,7 @@ const frontendConfigs = {
123123
API_URL: 'https://api.topcoder-qa.com',
124124
ADMIN_TOOL_URL: 'https://api.topcoder-qa.com/v2',
125125
ACCOUNTS_CONNECTOR_URL: 'https://accounts.topcoder-qa.com/connector.html',
126-
DIRECT_URL_BASE: 'https://www.topcoder-dev.com/direct/projectOverview?formData.projectId=',
126+
CONNECT_URL_BASE: 'https://connect.topcoder-dev.com/projects/',
127127
OWNER_LOGIN_GITHUB_URL: '/api/v1/github/owneruser/login',
128128
OWNER_LOGIN_GITLAB_URL: '/api/v1/gitlab/owneruser/login',
129129
TOPCODER_URL: 'https://topcoder-dev.com',
@@ -138,7 +138,7 @@ const frontendConfigs = {
138138
API_URL: 'https://api.topcoder.com',
139139
ADMIN_TOOL_URL: 'https://api.topcoder.com/v2',
140140
ACCOUNTS_CONNECTOR_URL: 'https://accounts.topcoder.com/connector.html',
141-
DIRECT_URL_BASE: 'https://www.topcoder.com/direct/projectOverview?formData.projectId=',
141+
CONNECT_URL_BASE: 'https://connect.topcoder.com/projects/',
142142
OWNER_LOGIN_GITHUB_URL: '/api/v1/github/owneruser/login',
143143
OWNER_LOGIN_GITLAB_URL: '/api/v1/gitlab/owneruser/login',
144144
TOPCODER_URL: 'https://topcoder-dev.com',
@@ -159,7 +159,7 @@ module.exports.frontendConfigs = {
159159
API_URL: process.env.API_URL || frontendConfigs[activeEnv].API_URL,
160160
ADMIN_TOOL_URL: process.env.ADMIN_TOOL_URL || frontendConfigs[activeEnv].ADMIN_TOOL_URL,
161161
ACCOUNTS_CONNECTOR_URL: process.env.ACCOUNTS_CONNECTOR_URL || frontendConfigs[activeEnv].ACCOUNTS_CONNECTOR_URL,
162-
DIRECT_URL_BASE: process.env.DIRECT_URL_BASE || frontendConfigs[activeEnv].DIRECT_URL_BASE,
162+
CONNECT_URL_BASE: process.env.CONNECT_URL_BASE || frontendConfigs[activeEnv].CONNECT_URL_BASE,
163163
OWNER_LOGIN_GITHUB_URL: process.env.OWNER_LOGIN_GITHUB_URL || frontendConfigs[activeEnv].OWNER_LOGIN_GITHUB_URL,
164164
OWNER_LOGIN_GITLAB_URL: process.env.OWNER_LOGIN_GITLAB_URL || frontendConfigs[activeEnv].OWNER_LOGIN_GITLAB_URL,
165165
TOPCODER_URL: process.env.TOPCODER_URL || frontendConfigs[activeEnv].TOPCODER_URL,

Diff for: src/front/src/app/projects/projects.controller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ angular.module('topcoderX')
77
$scope.title = 'Project Management';
88

99
//direct base
10-
$scope.directUrlBase = $rootScope.appConfig.DIRECT_URL_BASE;
10+
$scope.connectUrlBase = $rootScope.appConfig.CONNECT_URL_BASE;
1111
$scope.isAdminUser = Helper.isAdminUser(currentUser);
1212
$scope.filter = {
1313
showAll: $scope.isAdminUser,

Diff for: src/front/src/app/projects/projects.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h4>You don't have active projects right now. Please
6969
ng-class-odd="'footable-odd'">
7070
<td class="col-lg-2">{{project.title}}</td>
7171
<td class="col-lg-2">
72-
<a href="{{directUrlBase}}{{project.tcDirectId}}"
72+
<a href="{{connectUrlBase}}{{project.tcDirectId}}"
7373
target="_blank">{{project.tcDirectId}}</a>
7474
</td>
7575
<td class="col-lg-2">

Diff for: src/front/src/app/upsertproject/upsertproject.controller.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,14 @@ angular.module('topcoderX').controller('ProjectController', ['currentUser', '$sc
8686
if ($scope.editing) {
8787
ProjectService.update($scope.project).then(function () {
8888
Alert.info('Project Updated Successfully', $scope);
89-
$state.go('app.projects');
89+
setTimeout(function() {
90+
$state.go('app.projects');
91+
}, 3000);
9092
}).catch(function (error) {
9193
Alert.error(error.data.message, $scope);
94+
setTimeout(function() {
95+
$state.go('app.projects');
96+
}, 3000);
9297
});
9398
} else {
9499
ProjectService.create($scope.project).then(function () {

Diff for: src/front/src/app/upsertproject/upsertproject.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ <h2>{{title}}</h2>
5555
project Title is required.</span>
5656
<br />
5757
<br />
58-
<label class="form-label">Direct ID:</label>
58+
<label class="form-label">Connect ID:</label>
5959
<input class="form-control" type="number" ng-model="project.tcDirectId" required />
6060
<small class="form-hint">The Topcoder Connect Project ID of the project. You can obtain this through the URL to the
61-
project in Topcoder Direct. For example:
61+
project in Topcoder Connect. For example:
6262
"https://connect.topcoder.com/projects/16598" - Enter ID "16598"</small>
6363
<span ng-show="projectForm.project.tcDirectId.$touched && projectForm.project.tcDirectId.$invalid">The
6464
TC Connect Project ID is required.</span>

Diff for: src/models/Issue.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const schema = new Schema({
4848
},
4949
},
5050
labels: {
51-
type: [String],
51+
type: Array,
5252
required: false,
5353
},
5454
assignee: {type: String, required: false},

Diff for: src/models/Project.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ const schema = new Schema({
4343
type: Date,
4444
default: Date.now,
4545
},
46-
createCopilotPayments: {type: String, required: false}
46+
createCopilotPayments: {type: String, required: false},
47+
isConnect: {type: Boolean, required: false, default: true}
4748
});
4849

4950
module.exports = schema;

Diff for: src/services/ProjectService.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ const projectSchema = {
4646
registeredWebhookId: Joi.string().allow(null),
4747
createdAt: Joi.date(),
4848
updatedAt: Joi.date(),
49-
createCopilotPayments: Joi.boolean()
49+
createCopilotPayments: Joi.boolean(),
50+
isConnect: Joi.boolean().allow(null)
5051
},
5152
currentUser: currentUserSchema,
5253
};

0 commit comments

Comments
 (0)