Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed tab request approval issue #842

Merged
merged 2 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

// Get request page.
[Route("request")]
public ActionResult Request()

Check warning on line 42 in samples/tab-request-approval/csharp/TabRequestApproval/Controllers/HomeController.cs

View workflow job for this annotation

GitHub Actions / Build All "tab-request-approval" csharp

'HomeController.Request()' hides inherited member 'ControllerBase.Request'. Use the new keyword if hiding was intended.

Check warning on line 42 in samples/tab-request-approval/csharp/TabRequestApproval/Controllers/HomeController.cs

View workflow job for this annotation

GitHub Actions / Build All "tab-request-approval" csharp

'HomeController.Request()' hides inherited member 'ControllerBase.Request'. Use the new keyword if hiding was intended.
{
ViewBag.clientId = _configuration["AzureAd:MicrosoftAppId"];

Expand All @@ -49,7 +49,7 @@
// Get request list.
[HttpGet]
[Route("GetRequestList")]
public async Task<List<RequestInfo>> GetRequestList()

Check warning on line 52 in samples/tab-request-approval/csharp/TabRequestApproval/Controllers/HomeController.cs

View workflow job for this annotation

GitHub Actions / Build All "tab-request-approval" csharp

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 52 in samples/tab-request-approval/csharp/TabRequestApproval/Controllers/HomeController.cs

View workflow job for this annotation

GitHub Actions / Build All "tab-request-approval" csharp

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
var currentTaskList = new List<RequestInfo>();
_taskList.TryGetValue("taskList", out currentTaskList);
Expand Down Expand Up @@ -112,7 +112,7 @@
}

var graphClient = SimpleGraphClient.GetGraphClient(taskInfo.access_token);
var user = await graphClient.Users[taskInfo.managerName]
var user = await graphClient.Users[taskInfo.personaName]
.Request()
.GetAsync();

Expand Down Expand Up @@ -162,7 +162,7 @@
// Respond to user request.
[HttpPost]
[Route("RespondRequest")]
public async Task<ActionResult> RespondRequest(RequestInfo taskInfo)

Check warning on line 165 in samples/tab-request-approval/csharp/TabRequestApproval/Controllers/HomeController.cs

View workflow job for this annotation

GitHub Actions / Build All "tab-request-approval" csharp

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 165 in samples/tab-request-approval/csharp/TabRequestApproval/Controllers/HomeController.cs

View workflow job for this annotation

GitHub Actions / Build All "tab-request-approval" csharp

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
var currentTaskList = new List<RequestInfo>();
_taskList.TryGetValue("taskList", out currentTaskList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class RequestInfo

public string userName { get; set; }

public string managerName { get; set; }
public string personaName { get; set; }

public string status { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<td style="margin-left:1px"> ${i+1} </td>
<td style="margin-left:1px"> ${userList[i].title} </td>
<td style="margin-left:1px"> ${userList[i].description} </td>
<td style="margin-left:1px"> ${userList[i].managerName} </td>
<td style="margin-left:1px"> ${userList[i].personaName} </td>
<td style="margin-left:1px"> ${userList[i].status} </td>
</tr>`
);
Expand All @@ -108,7 +108,7 @@

if (list != undefined && list.length > 0) {
list.map(item => {
if (item.status == "Pending" && item.managerName == username) {
if (item.status == "Pending" && item.personaName == username) {
managerList.push(item);
}
})
Expand Down Expand Up @@ -202,7 +202,7 @@
title: $('#title').val(),
description: $('#description').val(),
userName: username,
managerName: person[0].userPrincipalName,
personaName: person[0].scoredEmailAddresses[0].address,
access_token: token,
};

Expand Down
Loading