Skip to content

Feature/userinfo - #273

Open
JasonRobertFrancis wants to merge 69 commits into
mainfrom
feature/userinfo
Open

Feature/userinfo#273
JasonRobertFrancis wants to merge 69 commits into
mainfrom
feature/userinfo

Conversation

@JasonRobertFrancis

Copy link
Copy Markdown
Contributor

No description provided.

@codecov-commenter

codecov-commenter commented Jul 28, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 280 bytes (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
viper-frontend-esm 2.2MB 280 bytes (0.01%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: viper-frontend-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/GenericError-*.css 266 bytes 210.87kB 0.13%
assets/SchoolSummary-*.js 14 bytes 3.97kB 0.35%

Files in assets/SchoolSummary-*.js:

  • ./src/Effort/pages/SchoolSummary.vue → Total Size: 230 bytes

@codecov-commenter

codecov-commenter commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 19.55610% with 3262 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.73%. Comparing base (e746ac9) to head (d75d786).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
web/Areas/Directory/Services/UserInfoService.cs 54.96% 518 Missing and 49 partials ⚠️
web/Areas/Directory/Views/UserInfo.cshtml 0.00% 431 Missing ⚠️
web/Models/PPS/JobDV.cs 0.00% 113 Missing ⚠️
web/Models/PPS/JpmJpItemDV.cs 0.00% 98 Missing ⚠️
web/Models/PPS/PositionDV.cs 0.00% 95 Missing ⚠️
web/Models/PPS/PsJpmJpItemsV.cs 0.00% 92 Missing ⚠️
web/Models/PPS/PayGroupDV.cs 0.00% 84 Missing ⚠️
web/Models/PPS/PsJobV.cs 0.00% 81 Missing ⚠️
web/Models/PPS/JobCodeDV.cs 0.00% 69 Missing ⚠️
web/Models/PPS/PsPositionDataV.cs 0.00% 53 Missing ⚠️
... and 153 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #273      +/-   ##
==========================================
- Coverage   45.36%   43.73%   -1.63%     
==========================================
  Files         948     1108     +160     
  Lines       49529    53518    +3989     
  Branches     6696     7034     +338     
==========================================
+ Hits        22467    23408     +941     
- Misses      26096    29067    +2971     
- Partials      966     1043      +77     
Flag Coverage Δ
backend 40.73% <19.55%> (-1.61%) ⬇️
frontend 64.66% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...eb/Areas/CMS/Controllers/CMSUserPhotoController.cs 100.00% <100.00%> (ø)
web/Areas/Directory/Models/InstinctResult.cs 100.00% <100.00%> (ø)
web/Areas/Directory/Models/UserInfoResult.cs 100.00% <100.00%> (ø)
web/Models/EquipmentLoan/Asset.cs 100.00% <100.00%> (ø)
web/Models/EquipmentLoan/Loan.cs 100.00% <100.00%> (ø)
web/Models/EquipmentLoan/LoanItem.cs 100.00% <100.00%> (ø)
web/Models/IDCards/DvtCardStatus.cs 100.00% <100.00%> (ø)
web/Models/IDCards/DvtReason.cs 100.00% <100.00%> (ø)
web/Models/IDCards/IdCard.cs 100.00% <100.00%> (ø)
web/Models/Keys/Key.cs 100.00% <100.00%> (ø)
... and 164 more

... and 5 files with indirect coverage changes

Comment thread test/Services/UserInfoServiceUnitTests.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Classes/Utilities/IamApi.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Views/UserInfo.cshtml Fixed

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Classes/Utilities/IamApi.cs Fixed
@rlorenzo

This comment was marked as resolved.

Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
Comment thread web/Areas/Directory/Services/UserInfoService.cs Fixed
@rlorenzo

This comment was marked as resolved.

Comment thread .oxlintrc.json Outdated
Comment thread web/wwwroot/css/directory.css Outdated
Comment thread web/Areas/Directory/Services/UserInfoService.cs
Comment thread web/Areas/Directory/Services/UserInfoService.cs
@bsedwards

Copy link
Copy Markdown
Collaborator

@JasonRobertFrancis I was testing this on TEST: https://secure-test.vetmed.ucdavis.edu/2/UserInfo/02725606 and comparing against VIPER1: https://secure-test.vetmed.ucdavis.edu/default.cfm?page=userinfo&id=1000610632&mothraID=02725606

1. Why do 2 photos render?

2. The UC Path section is missing "Position: 000652 APPLICATIONS PROGR 4 — 072000 VM: DEANS OFFICE" that is on VIPER1. Also, this must be a data issue, but why is my hire date set to 2/28/2025?

3. For "System Permissions," VIPER has me with RAPS (52) and SVMSecure (356), but the VIPER2 version has me with RAPS (21), SVMSecure (291), and VIPERForms (1). Why the difference in numbers?

For the effective date, it looks like this is pulling the effective date of the last change to the position. It might make more sense to show the effdt on the job record (the effective date of the last change to the job) in the summary and history views.

Employees have an original hire date, but not a hire date to a specific job.

I would also suggest removing the reports to column from the uc path history. I removed this from the uc path view on the current directory because it can be ambiguous when looking at historical data (which is why it looks like Rex is reporting to Dan).

I checked Rex's permissions on test and the counts look good. The prod user info page is double counting some permissions.

Comment thread web/Classes/SQLContext/PPSContext.cs
Comment thread web/Areas/Directory/Services/UserInfoService.cs Outdated
Comment thread web/Areas/Directory/Services/UserInfoService.cs
Comment thread web/Views/Shared/_VIPERLayout.cshtml
Comment thread web/Areas/Directory/Services/UserInfoService.cs Outdated
Comment thread web/Areas/Directory/Controllers/DirectoryController.cs
@rlorenzo

rlorenzo commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@JasonRobertFrancis, I've resolved all my open comment threads. Some minor issues:

  1. Do we want 2 profile images rendered? On https://secure-test.vetmed.ucdavis.edu/2/UserInfo/02725606 I see both "User Photo" and "Alternative Photo" but they are the same for me.
  2. I see this alert: "Some information may be unavailable. The following sections could not be loaded and may be showing incomplete data: Instinct." What is not loading?
  3. Do we want "launchBrowser" to be true here? https://github.com/ucdavis/VIPER/pull/273/changes#r3707682628

@rlorenzo rlorenzo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JasonRobertFrancis c3de7d7 "Represses Instinct error if API is not available" is on Development only, not on feature/userinfo. It is the commit that actually suppresses the Instinct error on TEST (IsDevelopmentEnvironment to IsInstinctOptionalEnvironment, covering Test as well as Development). Since Development is never a base and never merges to main, that change disappears when this PR merges. Please cherry-pick it onto feature/userinfo and re-merge into Development.

string? mothraId, bool altPhoto, CancellationToken ct)
{
var photo = await _photoService.GetUserPhotoAsync(mailId, loginId, iamId, mothraId, altPhoto, ct);
CmsUserPhotoResult? photo = altPhoto

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

altPhoto=true used to mean "prefer the alternate photo, fall back to the ID card, then the placeholder". After this split it means "alternate photo or 404", and the two list views still send it, so every person without an uploaded profile photo now renders the #error template instead of their ID-card photo. Confirmed on TEST: /2/Directory search results have no photos, while PROD's /2/Directory still shows them (it goes through getbase64image.cfm?...&altphoto=1, which keeps the fallback).

GetAlternatePhotoAsync returning null is right for UserInfo's dedicated "Alternative Photo" slot, but it needs to be a distinct mode rather than a redefinition of altPhoto. Suggest keeping altPhoto=true as prefer-with-fallback and adding a separate strict flag for UserInfo:

CmsUserPhotoResult? photo = altPhotoOnly
    ? await _photoService.GetAlternatePhotoAsync(mailId, loginId, iamId, mothraId, ct)
    : altPhoto
        ? await _photoService.GetAlternatePhotoAsync(mailId, loginId, iamId, mothraId, ct)
          ?? await _photoService.GetUserPhotoAsync(mailId, loginId, iamId, mothraId, ct)
        : await _photoService.GetUserPhotoAsync(mailId, loginId, iamId, mothraId, ct);

The alternative is dropping altPhoto=true from Table.cshtml:41 and Card.cshtml:79, but that also drops the alternate-photo preference for people who did upload one, which the legacy page honors.

<template v-slot:body-cell-photo="props">
<q-td :props="props">
<q-img :src="'@HttpHelper.GetOldViperRootURL()' + '/public/utilities/getbase64image.cfm?mothraID=' + props.row.mothraId + '&altphoto=1'" style="width:87px; height:111px" fit="cover" :alt="'Photo of ' + props.row.displayFirstName + ' ' + props.row.displayLastName">
<q-img :src="'@HttpHelper.GetRootURL()' + '/api/cms/photos/by-mothra/' + props.row.mothraId + '?altPhoto=true'" style="width:87px; height:111px" fit="cover" :alt="'Photo of ' + props.row.displayFirstName + ' ' + props.row.displayLastName">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ?altPhoto=true now 404s for anyone without an uploaded profile photo, so the #error template's grey person icon replaces what used to be their ID-card photo. This is why search results on TEST show no photos. See the note on CMSUserPhotoController.cs:58.

<q-card-section class="col photo">
<q-img
:src="'@HttpHelper.GetOldViperRootURL()/public/utilities/getbase64image.cfm?mailid=' + user.mailId + '&altphoto=1'"
<q-img :src="'@HttpHelper.GetRootURL()/api/cms/photos/by-iam/' + user.iamId + '?altphoto=true'"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as Table.cshtml:41: ?altphoto=true 404s without an uploaded profile photo and falls through to the grey person icon. See CMSUserPhotoController.cs:58.

"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"launchBrowser": true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still flipped false to true versus main, on the https profile. npm run dev opens the browser already, so this gives you two tabs. Unrelated to the feature.

</span>
<span class="photo2">
<b>Alternative Photo</b>
@* Not every person has an alternate photo; the endpoint 404s when there isn't

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment documents an implementation that isn't here: it describes an error listener attached via addEventListener before .src is set, but the script at line 615 uses fetch plus URL.createObjectURL. Also URL.createObjectURL(blob) at line 668 is never revoked.

If the controller keeps a strict alt-only mode (see CMSUserPhotoController.cs:58), a Model.HasAlternatePhoto resolved server-side plus an @if around the <span class="photo2"> block replaces all 60 lines of this script and sidesteps the Vue-remount problem it exists to work around.

public async Task GetByMailId_AltPhotoMissing_ReturnsNotFound()
{
_photoService.GetAlternatePhotoAsync("mail@example.com", null, null, null, Arg.Any<CancellationToken>())
.Returns((CmsUserPhotoResult?)null);
Resolves ReSharper S8969 warnings flagged by the PR-scoped gate: the compiler already narrows InstinctInfo.ErrorMessage to non-null after the preceding Assert.NotNull check, so the ! was redundant.

Assert.NotNull(result);
Assert.NotNull(result.InstinctInfo?.ErrorMessage);
Assert.Contains("Downstream service unavailable", result.InstinctInfo.ErrorMessage);

Assert.NotNull(result);
Assert.NotNull(result.InstinctInfo?.ErrorMessage);
Assert.Contains("Instinct:ApiUrl is not configured", result.InstinctInfo.ErrorMessage);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants