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

Version 1.2.2 #461

Merged
merged 26 commits into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8368b32
Drop down selector for Connect project instead of text field
jmgasper May 18, 2022
43ad8ea
Deploy for testing
jmgasper May 18, 2022
638b3e3
Updates for timeout
jmgasper May 18, 2022
0ad0c52
Further timeout test
jmgasper May 19, 2022
8d73ae2
Let’s try this
jmgasper May 19, 2022
7077279
Use ui-select (https://angular-ui.github.io/ui-select/) as dropdown s…
gets0ul May 19, 2022
eb360cf
Merge pull request #446 from gets0ul/issue-445
jmgasper May 19, 2022
cef4344
Archived projects still using copilot handle
jmgasper May 20, 2022
446b2c3
https://github.com/topcoder-platform/topcoder-x-ui/issues/448
52cs May 25, 2022
e82f6c6
Merge pull request #449 from 52cs/issue-448
jmgasper May 25, 2022
131b236
Refresh owner user/copilot Gitlab access token automatically when needed
gets0ul May 25, 2022
54055a2
Merge pull request #450 from gets0ul/issue_447
jmgasper May 25, 2022
e29301e
small fix on PR #449 for issue #448
52cs May 27, 2022
595d71c
Merge pull request #451 from 52cs/issue-448-fix
jmgasper May 30, 2022
c4e694f
Changes to Connect ID dropdown:
gets0ul May 31, 2022
8b4bf6b
Merge pull request #454 from gets0ul/issue_452
jmgasper May 31, 2022
9d11673
https://github.com/topcoder-platform/topcoder-x-ui/issues/453
52cs Jun 2, 2022
5e2a247
Merge pull request #455 from 52cs/issue-453
jmgasper Jun 2, 2022
03f10ce
fix lint of PR#455 for Issue453
52cs Jun 2, 2022
855879d
Merge pull request #456 from 52cs/fix-lint-455
jmgasper Jun 2, 2022
2d04d6a
https://github.com/topcoder-platform/topcoder-x-ui/issues/453
52cs Jun 2, 2022
5c2afde
Merge pull request #457 from 52cs/fix-issue-453
jmgasper Jun 2, 2022
c334ca3
fix-empty-tags
52cs Jun 3, 2022
aec774d
Merge pull request #458 from 52cs/fix-empty-tags/Issue#453
jmgasper Jun 3, 2022
9935ebb
https://github.com/topcoder-platform/topcoder-x-ui/issues/459
52cs Jun 14, 2022
c92f485
Merge pull request #460 from 52cs/issue-459
jmgasper Jun 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Drop down selector for Connect project instead of text field
  • Loading branch information
jmgasper committed May 18, 2022
commit 8368b32125ace23b52387ec0a4631b12276f053a
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The following config parameters are supported, they are defined in `src/config.j
|AWS_CONNECTION_TIMEOUT | The timeout used to check if the app is healthy. |10000 |
|TC_LOGIN_URL | TC login url | |
|DYNAMODB_WAIT_TABLE_FOR_ACTIVE_TIMEOUT | Dynamodb wait for active timeout |10 minutes |
|TC_API_V5_URL | Topcoder API v5 url for retrieving list of Connect Projects | |


## GitHub OAuth App Setup
Expand Down
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ module.exports.frontendConfigs = {
TOPCODER_URL: process.env.TOPCODER_URL || 'https://topcoder-dev.com',
GITHUB_TEAM_URL: process.env.GITHUB_TEAM_URL || 'https://github.com/orgs/',
GITLAB_GROUP_URL: process.env.GITLAB_GROUP_URL || 'https://gitlab.com/groups/',
TC_API_V5_URL: process.env.TC_API_V5_URL || 'https://api.topcoder-dev.com/v5',
};
47 changes: 46 additions & 1 deletion src/front/src/app/projects/project.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

angular.module('topcoderX')
.factory('ProjectService', ['Helper', '$http', function (Helper, $http) {
.factory('ProjectService', ['Helper', '$http', '$rootScope', 'AuthService', function (Helper, $http, $rootScope, AuthService) {
// object we will return
var ProjectService = {};
var projectsDataPromise = {};
Expand Down Expand Up @@ -140,5 +140,50 @@ angular.module('topcoderX')
});
};

/**
* Get associated connect projects that the current user has access to
*/
ProjectService.getConnectProjects = function() {
function createProjectRequest(pagingParams) {
return $http({
method: 'GET',
url: $rootScope.appConfig.TC_API_V5_URL + '/projects/',
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer " + AuthService.AuthService.getTokenV3()
},
params: {
fields: 'id,name,status',
sort: 'lastActivityAt desc',
perPage: pagingParams.perPage,
page: pagingParams.page
}
});
}

function getAll(getter, perPage, page, prev) {
return getter({
perPage: perPage,
page: page
}).then(function (res) {
if (res.status === 200) {
var data = res.data;
if (!data.length) return prev || [];
var current = [];
if (prev) {
current = prev.concat(data);
} else {
current = data;
}
return getAll(getter, perPage, 1 + page, current);
}
return prev || [];
});
}
return getAll(function (params) { return createProjectRequest(params) }, 20, 1).then(function(response) {
return response;
});
}

return ProjectService;
}]);
12 changes: 12 additions & 0 deletions src/front/src/app/upsertproject/upsertproject.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ angular.module('topcoderX').controller('ProjectController', ['currentUser', '$sc
}

$scope.isAdminUser = Helper.isAdminUser(currentUser);
$scope.loadingConnectProjects = true;
ProjectService.getConnectProjects().then(function (result) {
$scope.loadingConnectProjects = false;
$scope.connectProjects = result.map(function (p) {
return {
label: 'ID: ' + p.id + ', NAME: ' + p.name + ', STATUS: ' + p.status,
value: p.id
}
});
}).catch(function (error) {
Alert.error(error.data.message, $scope);
});

// function to add labels to the current project.
$scope.addLabels = function () {
Expand Down
9 changes: 5 additions & 4 deletions src/front/src/app/upsertproject/upsertproject.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ <h2>{{title}}</h2>
<br />
<br />
<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 Connect. For example:
"https://connect.topcoder.com/projects/16598" - Enter ID "16598"</small>
<select ng-options="option.value as option.label for option in connectProjects" ng-model="project.tcDirectId"
class="form-control" ng-disabled="loadingConnectProjects" required>
</select>
<small class="form-hint">Select the Topcoder Connect Project ID of the project. The above list contains all Topcoder Connect Projects
you have access to.</small>
<span ng-show="projectForm.project.tcDirectId.$touched && projectForm.project.tcDirectId.$invalid">The
TC Connect Project ID is required.</span>
<br />
Expand Down