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

Commit b1c1e6c

Browse files
committed
1 parent 47bc236 commit b1c1e6c

17 files changed

+410
-141
lines changed

configuration.md

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The following config parameters are supported, they are defined in `src/config.j
2626
|LABELS| Labels we are going to add to the repository in the form of array of object with `name` and `color` property. Color should be hex code without hash||
2727
|ALLOWED_TOPCODER_ROLES| The allowed Topcoder role to use Topcoder X app| see configuration |
2828
|COPILOT_ROLE| The role to identify copilot|'copilot'|
29+
|HELP_LINK| The link for help| 'https://github.com/topcoder-platform/topcoder-x-ui/wiki'|
2930

3031
## GitHub OAuth App Setup
3132

src/assets/WorkingWithTickets.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# How to work with git tickets
2+
3+
The basic flow for handling a ticket is as follows:
4+
5+
1. Assign the ticket to yourself, change the label to "tcx_Assigned", remove the "tcx_OpenForPickup" label. Please only assign tickets to yourself when you are ready to work on it. I don't want tickets assigned to someone and then not have them work on a ticket for 24 hours. The goal here is a quick turnaround for the client. If you can't work on a ticket immediately, leave it for someone else.
6+
7+
1. Complete the ticket and create a merge request within 24 hours. Please ensure your merge request can be merged automatically and that it's against the latest commit in Git when you create it.
8+
9+
1. Change the label on the ticket to "tcx_ReadyForReview"
10+
11+
After seeing a ticket marked as "tcx_ReadyForReview", the copilot will review that ticket, usually within 24 hours.
12+
13+
Note that you are expected to keep your changes in-sync with Git - make sure to do a pull before you push changes to make sure there aren't any merge issues.
14+
15+
### Accepted fix
16+
17+
If a fix is accepted, a payment ticket will be created on the Topcoder platform within 5-10 minutes of the issue being closed. You should see the payment in your PACTs within 24 hours.
18+
19+
### Rejected fix
20+
21+
If a fix is rejected, a comment, and possibly a screenshot, will be added to the ticket explaining why the fix was rejected. The status will be changed to "tcx_Feedback".
22+
23+
**If a fix is rejected, that ticket is your priority. You should not assign yourself any more tickets until you complete the required additional fixes!**
24+
25+
# Payment amounts
26+
27+
Each ticket in GitLab has a dollar value. That is the amount you will be paid when the ticket is completed, merged, and verified by the copilot. Note that there is still a 30 day waiting period as the payment will be treated as a regular TopCoder challenge payment.
28+
29+
# Important Rules:
30+
31+
- You can assign any unassigned issue to yourself with an "Open for pick up" label (first come first serve)
32+
33+
- You can only assign **ONE AT A TIME**. The nature of it being assigned will indicate it is not available to anyone else.
34+
35+
- You will fix the ticket by committing changes to the master branch.
36+
37+
- After marking a ticket "tcx_ReadyForReview" you are eligible to accept another. You do _NOT_ need to wait for the copilot to validate your fix.
38+
39+
- You can do as many tickets as you want, as long as you follow the rules above.
40+
41+
- If an assigned task is not done in 24 hours, you will need to explain why it is not completed as a comment on the ticket.
42+
43+
- You can ask questions directly on the GitLab ticket.
44+
45+
### ANYONE NOT FOLLOWING THE RULES ABOVE WILL BE WARNED AND POTENTIALLY LOSE THEIR GITLAB ACCESS!

src/config.js

+1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ module.exports = {
3838
LABELS: process.env.LABELS || [{ name: 'tcx_OpenForPickup', color: '428BCA' }, { name: 'tcx_Assigned', color: '004E00' }, { name: 'tcx_ReadyForReview', color: 'D1D100' }, { name: 'tcx_Paid', color: '7F8C8D' }, { name: 'tcx_Feedback', color: 'FF0000' }, { name: 'tcx_FixAccepted', color: '69D100' }],
3939
ALLOWED_TOPCODER_ROLES: process.env.ALLOWED_TOPCODER_ROLES || ['administrator', 'admin', 'connect manager', 'connect admin', 'copilot', 'connect copilot'],
4040
COPILOT_ROLE: process.env.COPILOT_ROLE || 'copilot',
41+
HELP_LINK: process.env.HELP_LINK || 'https://github.com/topcoder-platform/topcoder-x-ui/wiki',
4142
};
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2018 TopCoder, Inc. All rights reserved.
3+
*/
4+
5+
/**
6+
* This controller exposes application configuration related endpoints.
7+
*
8+
* @author veshu
9+
* @version 1.0
10+
*/
11+
const helper = require('../common/helper');
12+
const AppConfigService = require('../services/AppConfigService');
13+
14+
/**
15+
* gets the application configuration required for frontend
16+
* @returns {Object} the configuration details
17+
*/
18+
async function getAppConfig() {
19+
return await AppConfigService.getAppConfig();
20+
}
21+
22+
module.exports = {
23+
getAppConfig,
24+
};
25+
26+
helper.buildController(module.exports);

src/controllers/ProjectController.js

+11
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,23 @@ async function createHook(req) {
6060
return await ProjectService.createHook(req.body, req.currentUser.handle);
6161
}
6262

63+
/**
64+
* adds the wiki rules the project's repository
65+
* @param {Object} req the request
66+
* @param {Object} res the response
67+
* @returns {Object} the result
68+
*/
69+
async function addWikiRules(req) {
70+
return await ProjectService.addWikiRules(req.body, req.currentUser.handle);
71+
}
72+
6373
module.exports = {
6474
create,
6575
update,
6676
getAll,
6777
createLabel,
6878
createHook,
79+
addWikiRules,
6980
};
7081

7182
helper.buildController(module.exports);

src/front/src/app/copilot-payments/copilot-payments-controller.js

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ angular.module('topcoderX')
66
$scope.title = 'Copilot payment page';
77
$scope.payments = [];
88
$scope.isLoaded = false;
9+
$scope.totalPendingAmounts = 0;
910
$scope.topcoderUrl = '';
1011
$scope.status = '';
1112
$scope.goPayment = function (payment) {
@@ -32,6 +33,10 @@ angular.module('topcoderX')
3233
CopilotPaymentService.getAll('project').then(function (res) {
3334
if (status === 'active') {
3435
$scope.payments = res.data.activePayments;
36+
$scope.totalPendingAmounts = 0;
37+
for (var i = 0; i < $scope.payments.length; i++) {
38+
$scope.totalPendingAmounts += $scope.payments[i].amount;
39+
}
3540
$scope.isLoaded = true;
3641
$scope.status = 'active';
3742
}

0 commit comments

Comments
 (0)