Skip to content

Commit

Permalink
Add changes requested to assigned view 106
Browse files Browse the repository at this point in the history
  • Loading branch information
javiertuya committed Oct 11, 2024
1 parent be988c0 commit 2735235
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
This dashboard provides:
- A consolidated view of multiple GitHub and GitLab repositories.
- Different views of your work items
(open issues, pull requests, review requests),
(open issues and pull requests, unread mentions, review requests, requests for changes),
triage (unassigned),
branches and dependabot updates.
- Build statuses of all branches and notifications
Expand Down
7 changes: 5 additions & 2 deletions dashgit-web/app/GitHubApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const gitHubApi = {
const assigned = `is:open assignee:${provider.user} archived:false`;
const unassigned = `is:open no:assignee owner:${provider.user} ${this.additionalOwners(provider, provider.unassignedAdditionalOwner)} archived:false`;
const reviewer = `is:open user-review-requested:${provider.user} archived:false`
const revise= `is:open type:pr review:changes_requested author:${provider.user} archived:false`
const created = `is:open author:${provider.user} archived:false`
const involved = `is:open involves:${provider.user} archived:false`
const dependabot = `is:open is:pr author:app/dependabot owner:${provider.user} ${this.additionalOwners(provider, provider.dependabotAdditionalOwner)} archived:false`;
Expand All @@ -35,6 +36,7 @@ const gitHubApi = {
octokit.rest.search.issuesAndPullRequests({ q: assigned, }),
//To allow the ui to mark this as a review request, the api call is wrapped to add a special attribute (called custom_actions) to the response
this.wrapIssuesAndPullRequestsCall(octokit, { q: reviewer, }, "review_request"),
this.wrapIssuesAndPullRequestsCall(octokit, { q: revise, }, "changes_requested"),
//Also show work items that need follow-up
gitStoreApi.followUpAll(provider, true),
];
Expand Down Expand Up @@ -158,8 +160,9 @@ const gitHubApi = {
//When the model is completed, calls controller to update the status value of the current target
updateStatusesAsync: function (provider, updateSince) {
this.log(provider.uid, "Get Statuses from the GraphQL api");
const t0 = Date.now();
this.getStatusesRequest(provider, updateSince).then(function (model) {
gitHubApi.log(provider.uid, "ASYNC Statuses model:", model);
gitHubApi.log(provider.uid, `ASYNC Statuses model [${Date.now() - t0}ms]:`, model);
wiController.updateStatuses(provider.uid, model, updateSince); //direct call instead of using a callback
}).catch(function (error) {
console.error("GitHub GraphQL transformation failed");
Expand All @@ -186,7 +189,7 @@ const gitHubApi = {
return `{
viewer {
login, resourcePath, url, repositories(first: ${maxProjects}, ownerAffiliations: [${affiliations}],
${forks} orderBy: {field: PUSHED_AT, direction: DESC}) {
${forks} isArchived:false, orderBy: {field: PUSHED_AT, direction: DESC}) {
nodes {
name, nameWithOwner, url, pushedAt
${includeAll ? this.getProjectsRefsSubquery(provider) : ""}
Expand Down
6 changes: 3 additions & 3 deletions dashgit-web/app/GitLabApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ const gitLabApi = {
let query0 = this.getProjectsQuery(provider, provider.graphql.maxProjects, true);
const t0 = Date.now();
let gqlresponse0 = await this.callGraphqlApi(provider, query0, true);
console.log(`time to get projects: ${Date.now() - t0}`)
this.log(provider.uid, "Statuses graphql response (projects):", gqlresponse0);
this.log(provider.uid, `Statuses graphql response (projects) [${Date.now() - t0}ms]:`, gqlresponse0);

if (updateSince != "") { //filter out oldest projects to do a partial update
this.filterOldProjects(gqlresponse0, updateSince);
Expand Down Expand Up @@ -204,8 +203,9 @@ const gitLabApi = {
//When the model is completed, calls controller to update the status valueof the current target
updateStatusesAsync: function (provider, updateSince) {
this.log(provider.uid, "Get Statuses from the GraphQL api");
const t0 = Date.now();
this.getStatusesRequest(provider, updateSince).then(function (model) {
gitLabApi.log(provider.uid, "ASYNC Statuses model:", model);
gitLabApi.log(provider.uid, `ASYNC Statuses model [${Date.now() - t0}ms]:`, model);
wiController.updateStatuses(provider.uid, model, updateSince); //direct call instead of using a callback
}).catch(function (error) {
console.error("GitLab GraphQL transformation failed");
Expand Down
4 changes: 3 additions & 1 deletion dashgit-web/app/WiViewRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ const wiRender = {
return "";
let html = "";
if (actions["review_request"])
html += `<span class="wi-item-column-clickable badge text-dark bg-warning wi-action-badge" title="A review on this PR has been requested"><i class="fa-solid fa-magnifying-glass"></i> review</span> `;
html += `<span class="wi-item-column-clickable badge text-dark bg-info wi-action-badge" title="A review on this PR has been requested"><i class="fa-solid fa-magnifying-glass"></i> review request</span> `;
if (actions["changes_requested"])
html += `<span class="wi-item-column-clickable badge text-light bg-primary wi-action-badge" title="A reviewer commented and requested changes on this PR"><i class="fa-regular fa-comment"></i> changes requested</span> `;
if (actions["follow_up"])
html += `<span class="wi-item-column-clickable badge text-dark bg-warning wi-action-badge" title="This work item has been flagged for follow up"><i class="fa-regular fa-flag"></i> follow up</span> `;
return html;
Expand Down

0 comments on commit 2735235

Please sign in to comment.