Skip to content

Commit

Permalink
Production issues fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgasper committed Jan 17, 2021
1 parent e9cd8cc commit 102033e
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 14 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,10 @@ Note: heroku domain should match subdomain of topcoder-dev or topcoder depending
- 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.
- 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.

## Topcoder Direct ID to Connect ID migration

Direct ID migration can be done with script located in **topcoder-x-processor** codebase called direct-connect-migration
```shell
npm run direct-connect-migration
```
By default it takes 15 projects at time, but you can change this by specifying BATCH_SIZE environment variable.
12 changes: 6 additions & 6 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const frontendConfigs = {
API_URL: 'https://127.0.0.1:8443',
ADMIN_TOOL_URL: 'http://localhost:8080/api/v2',
ACCOUNTS_CONNECTOR_URL: 'https://accounts.topcoder-dev.com/connector.html',
DIRECT_URL_BASE: 'https://www.topcoder-dev/direct/projectOverview?formData.projectId=',
CONNECT_URL_BASE: 'https://connect.topcoder-dev/projects/',
OWNER_LOGIN_GITHUB_URL: '/api/v1/github/owneruser/login',
OWNER_LOGIN_GITLAB_URL: '/api/v1/gitlab/owneruser/login',
TOPCODER_URL: 'https://topcoder-dev.com',
Expand All @@ -93,7 +93,7 @@ const frontendConfigs = {
API_URL: 'https://api.topcoder-dev.com',
ADMIN_TOOL_URL: 'https://api.topcoder-dev.com/v2',
ACCOUNTS_CONNECTOR_URL: 'https://accounts.topcoder-dev.com/connector.html',
DIRECT_URL_BASE: 'https://www.topcoder-dev.com/direct/projectOverview?formData.projectId=',
CONNECT_URL_BASE: 'https://connect.topcoder-dev.com/projects/',
OWNER_LOGIN_GITHUB_URL: '/api/v1/github/owneruser/login',
OWNER_LOGIN_GITLAB_URL: '/api/v1/gitlab/owneruser/login',
TOPCODER_URL: 'https://topcoder-dev.com',
Expand All @@ -108,7 +108,7 @@ const frontendConfigs = {
API_URL: 'https://api.topcoder-dev.com',
ADMIN_TOOL_URL: 'https://api.topcoder-dev.com/v2',
ACCOUNTS_CONNECTOR_URL: 'https://accounts.topcoder-dev.com/connector.html',
DIRECT_URL_BASE: 'https://www.topcoder-dev.com/direct/projectOverview?formData.projectId=',
CONNECT_URL_BASE: 'https://connect.topcoder-dev.com/projects/',
OWNER_LOGIN_GITHUB_URL: '/api/v1/github/owneruser/login',
OWNER_LOGIN_GITLAB_URL: '/api/v1/gitlab/owneruser/login',
TOPCODER_URL: 'https://topcoder-dev.com',
Expand All @@ -123,7 +123,7 @@ const frontendConfigs = {
API_URL: 'https://api.topcoder-qa.com',
ADMIN_TOOL_URL: 'https://api.topcoder-qa.com/v2',
ACCOUNTS_CONNECTOR_URL: 'https://accounts.topcoder-qa.com/connector.html',
DIRECT_URL_BASE: 'https://www.topcoder-dev.com/direct/projectOverview?formData.projectId=',
CONNECT_URL_BASE: 'https://connect.topcoder-dev.com/projects/',
OWNER_LOGIN_GITHUB_URL: '/api/v1/github/owneruser/login',
OWNER_LOGIN_GITLAB_URL: '/api/v1/gitlab/owneruser/login',
TOPCODER_URL: 'https://topcoder-dev.com',
Expand All @@ -138,7 +138,7 @@ const frontendConfigs = {
API_URL: 'https://api.topcoder.com',
ADMIN_TOOL_URL: 'https://api.topcoder.com/v2',
ACCOUNTS_CONNECTOR_URL: 'https://accounts.topcoder.com/connector.html',
DIRECT_URL_BASE: 'https://www.topcoder.com/direct/projectOverview?formData.projectId=',
CONNECT_URL_BASE: 'https://connect.topcoder.com/projects/',
OWNER_LOGIN_GITHUB_URL: '/api/v1/github/owneruser/login',
OWNER_LOGIN_GITLAB_URL: '/api/v1/gitlab/owneruser/login',
TOPCODER_URL: 'https://topcoder-dev.com',
Expand All @@ -159,7 +159,7 @@ module.exports.frontendConfigs = {
API_URL: process.env.API_URL || frontendConfigs[activeEnv].API_URL,
ADMIN_TOOL_URL: process.env.ADMIN_TOOL_URL || frontendConfigs[activeEnv].ADMIN_TOOL_URL,
ACCOUNTS_CONNECTOR_URL: process.env.ACCOUNTS_CONNECTOR_URL || frontendConfigs[activeEnv].ACCOUNTS_CONNECTOR_URL,
DIRECT_URL_BASE: process.env.DIRECT_URL_BASE || frontendConfigs[activeEnv].DIRECT_URL_BASE,
CONNECT_URL_BASE: process.env.CONNECT_URL_BASE || frontendConfigs[activeEnv].CONNECT_URL_BASE,
OWNER_LOGIN_GITHUB_URL: process.env.OWNER_LOGIN_GITHUB_URL || frontendConfigs[activeEnv].OWNER_LOGIN_GITHUB_URL,
OWNER_LOGIN_GITLAB_URL: process.env.OWNER_LOGIN_GITLAB_URL || frontendConfigs[activeEnv].OWNER_LOGIN_GITLAB_URL,
TOPCODER_URL: process.env.TOPCODER_URL || frontendConfigs[activeEnv].TOPCODER_URL,
Expand Down
2 changes: 1 addition & 1 deletion src/front/src/app/projects/projects.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ angular.module('topcoderX')
$scope.title = 'Project Management';

//direct base
$scope.directUrlBase = $rootScope.appConfig.DIRECT_URL_BASE;
$scope.connectUrlBase = $rootScope.appConfig.CONNECT_URL_BASE;
$scope.isAdminUser = Helper.isAdminUser(currentUser);
$scope.filter = {
showAll: $scope.isAdminUser,
Expand Down
2 changes: 1 addition & 1 deletion src/front/src/app/projects/projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h4>You don't have active projects right now. Please
ng-class-odd="'footable-odd'">
<td class="col-lg-2">{{project.title}}</td>
<td class="col-lg-2">
<a href="{{directUrlBase}}{{project.tcDirectId}}"
<a href="{{connectUrlBase}}{{project.tcDirectId}}"
target="_blank">{{project.tcDirectId}}</a>
</td>
<td class="col-lg-2">
Expand Down
7 changes: 6 additions & 1 deletion src/front/src/app/upsertproject/upsertproject.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,14 @@ angular.module('topcoderX').controller('ProjectController', ['currentUser', '$sc
if ($scope.editing) {
ProjectService.update($scope.project).then(function () {
Alert.info('Project Updated Successfully', $scope);
$state.go('app.projects');
setTimeout(function() {
$state.go('app.projects');
}, 3000);
}).catch(function (error) {
Alert.error(error.data.message, $scope);
setTimeout(function() {
$state.go('app.projects');
}, 3000);
});
} else {
ProjectService.create($scope.project).then(function () {
Expand Down
4 changes: 2 additions & 2 deletions src/front/src/app/upsertproject/upsertproject.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ <h2>{{title}}</h2>
project Title is required.</span>
<br />
<br />
<label class="form-label">Direct ID:</label>
<label class="form-label">Connect ID:</label>
<input class="form-control" type="number" ng-model="project.tcDirectId" required />
<small class="form-hint">The Topcoder Connect Project ID of the project. You can obtain this through the URL to the
project in Topcoder Direct. For example:
project in Topcoder Connect. For example:
"https://connect.topcoder.com/projects/16598" - Enter ID "16598"</small>
<span ng-show="projectForm.project.tcDirectId.$touched && projectForm.project.tcDirectId.$invalid">The
TC Connect Project ID is required.</span>
Expand Down
2 changes: 1 addition & 1 deletion src/models/Issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const schema = new Schema({
},
},
labels: {
type: [String],
type: Array,
required: false,
},
assignee: {type: String, required: false},
Expand Down
3 changes: 2 additions & 1 deletion src/models/Project.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ const schema = new Schema({
type: Date,
default: Date.now,
},
createCopilotPayments: {type: String, required: false}
createCopilotPayments: {type: String, required: false},
isConnect: {type: Boolean, required: false, default: true}
});

module.exports = schema;
3 changes: 2 additions & 1 deletion src/services/ProjectService.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ const projectSchema = {
registeredWebhookId: Joi.string().allow(null),
createdAt: Joi.date(),
updatedAt: Joi.date(),
createCopilotPayments: Joi.boolean()
createCopilotPayments: Joi.boolean(),
isConnect: Joi.boolean().allow(null)
},
currentUser: currentUserSchema,
};
Expand Down

0 comments on commit 102033e

Please sign in to comment.