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

Release build #307

Merged
merged 50 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
437b037
start of notifications
carlsixsmith-moj Sep 14, 2024
e5e0b86
Add filter
carlsixsmith-moj Sep 15, 2024
b486407
WIP: Not working quite yet
carlsixsmith-moj Sep 15, 2024
be32191
filter was incorrect
carlsixsmith-moj Sep 15, 2024
3cd71a3
menu displays + fix migration
carlsixsmith-moj Sep 16, 2024
a177a57
start of notifications
carlsixsmith-moj Sep 14, 2024
92c803c
Add filter
carlsixsmith-moj Sep 15, 2024
f83f254
WIP: Not working quite yet
carlsixsmith-moj Sep 15, 2024
3f0b9a6
menu displays + fix migration
carlsixsmith-moj Sep 16, 2024
8d15dcf
added return notifications and notifications screen
vks333 Oct 9, 2024
82893e2
added read/unread notifications
vks333 Oct 14, 2024
a99f8cd
removed inmemory service refs
vks333 Oct 14, 2024
d0437fc
Separated Read and Unread Notifications list
vks333 Oct 17, 2024
26b627d
As suggested, added separate event handlers and replaced MarkRead and…
vks333 Oct 17, 2024
424fbab
Adjustments
carlsixsmith-moj Oct 22, 2024
ea45ae2
Playwright initialisation & configuration
samgibsonmoj Oct 17, 2024
2b4c792
authentication playwright tests
samgibsonmoj Oct 17, 2024
4cec45a
Participant Ownership History
samgibsonmoj Oct 22, 2024
2bd528d
Participant Location History
samgibsonmoj Oct 18, 2024
4fb2a81
Merge branch 'develop' into feature/notifications
carlsixsmith-moj Oct 23, 2024
95f2545
dashboard changes
carlsixsmith-moj Oct 23, 2024
5b368c1
dashboard changes
carlsixsmith-moj Oct 25, 2024
5f97f96
(WIP) layout issues
carlsixsmith-moj Oct 28, 2024
652a314
Playwright initialisation & configuration
samgibsonmoj Oct 17, 2024
409715b
authentication playwright tests
samgibsonmoj Oct 17, 2024
9604ae7
Participant Ownership History
samgibsonmoj Oct 22, 2024
1a759ca
Participant Location History
samgibsonmoj Oct 18, 2024
124ea1e
Merge branch 'develop' into feature/notifications
carlsixsmith-moj Oct 28, 2024
5a0a54b
Record tenant for ownership history
samgibsonmoj Oct 25, 2024
0b69cd9
finish notifications
carlsixsmith-moj Oct 29, 2024
1e6c0c6
Merge pull request #279 from ministryofjustice/feature/notifications
carlsixsmith-moj Oct 29, 2024
22951e0
Merge pull request #293 from ministryofjustice/feature/ownership-hist…
carlsixsmith-moj Oct 29, 2024
f9d09ff
Only allow submission to PQA when participant is in enrolling status
samgibsonmoj Oct 22, 2024
411d9a1
Merge pull request #296 from ministryofjustice/CFODEV-782
carlsixsmith-moj Nov 1, 2024
092a7fc
Force logout if session has been kept alive by chromium browsers
carlsixsmith-moj Oct 31, 2024
3f14709
Undo notification migrations
samgibsonmoj Nov 1, 2024
da6b803
Redo notification migrations
samgibsonmoj Nov 1, 2024
2d36fe2
CFODEV-748 - Add Archive reason and justification
PaulCooperWorkJustice Nov 1, 2024
96fc40f
Merge pull request #299 from ministryofjustice/CFODEV-748
carlsixsmith-moj Nov 1, 2024
a884d22
Add performance manager role
carlsixsmith-moj Nov 4, 2024
d874760
clean up dashboard (badge looks awful > 9)
carlsixsmith-moj Nov 4, 2024
a59419b
Update Inductions.razor
carlsixsmith-moj Nov 5, 2024
13b4df6
update tooling
carlsixsmith-moj Nov 6, 2024
be2a517
More heading text corrections
carlsixsmith-moj Nov 6, 2024
3b59685
adjustments as per comments on CFODEV-729
carlsixsmith-moj Nov 6, 2024
1d5db25
adjustments as per comments on CFODEV-729
carlsixsmith-moj Nov 6, 2024
6580ffc
Use a notification date so we can update it
carlsixsmith-moj Nov 8, 2024
c3d3f3e
fix to use qauser not owner
carlsixsmith-moj Nov 8, 2024
7f84c2b
Remove playwright tests for now
carlsixsmith-moj Nov 11, 2024
773137a
Merge branch 'main' into develop
carlsixsmith-moj Nov 11, 2024
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
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.8",
"version": "8.0.10",
"commands": [
"dotnet-ef"
],
"rollForward": false
},
"cake.tool": {
"version": "4.0.0",
"version": "4.2.0",
"commands": [
"dotnet-cake"
],
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -471,3 +471,6 @@ Uploads/
Files/

/.vscode/settings.json
/playwright-report/
/blob-report/
/playwright/.cache/
91 changes: 91 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "cfo-caseassessmenttrackingsystem",
"version": "1.0.0",
"description": "[![.NET Core Unit Tests](https://github.com/ministryofjustice/CFO-CaseAssessmentTrackingSystem/actions/workflows/unittest.yml/badge.svg?branch=develop)](https://github.com/ministryofjustice/CFO-CaseAssessmentTrackingSystem/actions/workflows/unittest.yml)",
"main": "index.js",
"directories": {
"test": "test"
},
"scripts": {},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@playwright/test": "^1.48.1",
"@types/node": "^22.7.6"
}
}
82 changes: 82 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// import dotenv from 'dotenv';
// import path from 'path';
// dotenv.config({ path: path.resolve(__dirname, '.env') });

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './test/playwright',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'https://localhost:7062/',

/* Ignore self-signed SSL errors */
ignoreHTTPSErrors: true,

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},

{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},

{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});
5 changes: 4 additions & 1 deletion src/Application/Common/Interfaces/IApplicationDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Cfo.Cats.Domain.Entities.Inductions;
using Cfo.Cats.Domain.Entities.Notifications;

namespace Cfo.Cats.Application.Common.Interfaces;

Expand Down Expand Up @@ -36,6 +37,8 @@ public interface IApplicationDbContext
DbSet<ParticipantAssessment> ParticipantAssessments { get; }
DbSet<ParticipantBio> ParticipantBios { get; }
DbSet<ParticipantEnrolmentHistory> ParticipantEnrolmentHistories { get; }
DbSet<ParticipantLocationHistory> ParticipantLocationHistories { get; }
DbSet<ParticipantOwnershipHistory> ParticipantOwnershipHistories { get; }

DbSet<Timeline> Timelines { get; }

Expand All @@ -61,6 +64,6 @@ public interface IApplicationDbContext
DbSet<HubInduction> HubInductions { get; }

DbSet<WingInduction> WingInductions { get; }

DbSet<Notification> Notifications { get; }
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Cfo.Cats.Application.Features.Dashboard.DTOs;

public class ParticipantCountSummaryDto
{
public int IdentifiedCases { get; set; }
public int EnrollingCases { get; set; }
public int CasesAtPqa { get; set; }
public int CasesAtCfo { get; set; }
public int ApprovedCases { get; set; }
}

Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
using System.Reflection.Emit;
using Cfo.Cats.Application.Common.Security;
using Cfo.Cats.Application.Features.Dashboard.DTOs;
using Cfo.Cats.Application.SecurityConstants;
using DocumentFormat.OpenXml.Math;

namespace Cfo.Cats.Application.Features.Dashboard.Queries;

public static class GetDashboard
public static class GetMyParticipantsDashboard
{
[RequestAuthorize(Policy = SecurityPolicies.AuthorizedUser)]
public class Query : IRequest<Result<DashboardDto>>
public class Query : IRequest<Result<ParticipantCountSummaryDto>>
{
public UserProfile? CurrentUser { get; set; }
}

public class Handler(IUnitOfWork unitOfWork) : IRequestHandler<Query, Result<DashboardDto>>
public class Handler(IUnitOfWork unitOfWork) : IRequestHandler<Query, Result<ParticipantCountSummaryDto>>
{
public async Task<Result<DashboardDto>> Handle(Query request, CancellationToken cancellationToken)
public async Task<Result<ParticipantCountSummaryDto>> Handle(Query request, CancellationToken cancellationToken)
{
var query = from p in unitOfWork.DbContext.Participants.AsNoTracking()
where p.OwnerId == request.CurrentUser!.UserId
var query = from p in unitOfWork.DbContext
.Participants.AsNoTracking()
where
p.OwnerId == request.CurrentUser!.UserId
group p by p.EnrolmentStatus
into grp
select new
Expand All @@ -29,7 +32,7 @@ into grp

var results = await query.ToArrayAsync(cancellationToken);

DashboardDto dto = new DashboardDto();
ParticipantCountSummaryDto dto = new ParticipantCountSummaryDto();
foreach (var result in results)
{
if (result.Status == EnrolmentStatus.ApprovedStatus)
Expand Down Expand Up @@ -58,7 +61,7 @@ into grp
}
}

return Result<DashboardDto>.Success(dto);
return Result<ParticipantCountSummaryDto>.Success(dto);

}
}
Expand All @@ -72,14 +75,4 @@ public Validator()
}
}

}

public class DashboardDto
{
public int IdentifiedCases { get; set; }
public int EnrollingCases { get; set; }
public int CasesAtPqa { get; set; }
public int CasesAtCfo { get; set; }
public int ApprovedCases { get; set; }
public int UnreadNotifications { get; set; }
}
}
Loading
Loading