Skip to content

Commit

Permalink
Merge pull request #1166 from ministryofjustice/revert-1162-CAS-603-v…
Browse files Browse the repository at this point in the history
…-1-fe-implement-timeline-for-probation-practitioners

Revert "CAS-603 Implement timeline for probation practitioners"
  • Loading branch information
aliuk2012 authored Dec 10, 2024
2 parents e19dd6d + 012dae1 commit c8fb265
Show file tree
Hide file tree
Showing 18 changed files with 277 additions and 625 deletions.
6 changes: 0 additions & 6 deletions cypress_shared/pages/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,6 @@ export default abstract class Page extends Component {
cy.get('button').contains('Print this page')
}

shouldHaveATimeline(): void {
cy.get('h2').contains('Referral history')

cy.get('.moj-timeline').contains('Referral submitted')
}

shouldPrint(environment: 'integration'): void {
if (environment === 'integration') {
cy.window().then(win => {
Expand Down
15 changes: 0 additions & 15 deletions integration_tests/mockApis/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,6 @@ export default {
jsonBody: args.application,
},
}),
stubApplicationReferralHistoryGet: (args: {
application: TemporaryAccommodationApplication
referralNotes
}): SuperAgentRequest =>
stubFor({
request: {
method: 'GET',
url: `/cas3/timeline/${args.application.assessmentId}`,
},
response: {
status: 200,
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
jsonBody: args.referralNotes,
},
}),
stubApplicationDocuments: (args: {
application: TemporaryAccommodationApplication
documents: Array<Document>
Expand Down
7 changes: 1 addition & 6 deletions integration_tests/tests/apply/apply.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { fakerEN_GB as faker } from '@faker-js/faker'
import {
ApplicationFullPage,
EnterCRNPage,
Expand All @@ -20,7 +19,6 @@ import {
activeOffenceFactory,
applicationFactory,
personFactory,
referralHistorySystemNoteFactory,
risksFactory,
tierEnvelopeFactory,
} from '../../../server/testutils/factories'
Expand Down Expand Up @@ -305,12 +303,10 @@ context('Apply', () => {

it('shows the full submitted application', function test() {
// Given there is a complete and submitted application
const application = { ...this.application, status: 'submitted', assessmentId: faker.string.uuid() }
const referralNotes = [referralHistorySystemNoteFactory.build({ category: 'submitted' })]
const application = { ...this.application, status: 'submitted' }

cy.task('stubApplications', [application])
cy.task('stubApplicationGet', { application })
cy.task('stubApplicationReferralHistoryGet', { application, referralNotes })

// When I visit the application listing page
const listPage = ListPage.visit([], [application])
Expand All @@ -325,7 +321,6 @@ context('Apply', () => {
const applicationFullPage = Page.verifyOnPage(ApplicationFullPage, application)

applicationFullPage.shouldShowPrintButton()
applicationFullPage.shouldHaveATimeline()
applicationFullPage.shouldPrint('integration')

// Then I should see the full application
Expand Down
5 changes: 2 additions & 3 deletions server/controllers/apply/applicationsController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NextFunction, Request, Response } from 'express'

import type { TemporaryAccommodationApplication } from '@approved-premises/api'
import type { ErrorsAndUserInput, GroupedApplications } from '@approved-premises/ui'
import { ApplicationService, PersonService, TimelineService } from '../../services'
import { ApplicationService, PersonService } from '../../services'
import TasklistService from '../../services/tasklistService'
import { activeOffenceFactory, applicationFactory, personFactory } from '../../testutils/factories'
import { catchValidationErrorOrPropogate, fetchErrorsAndUserInput, insertGenericError } from '../../utils/validation'
Expand All @@ -29,13 +29,12 @@ describe('applicationsController', () => {
const next: DeepMocked<NextFunction> = jest.fn()

const applicationService = createMock<ApplicationService>({})
const timelineService = createMock<TimelineService>({})
const personService = createMock<PersonService>({})

let applicationsController: ApplicationsController

beforeEach(() => {
applicationsController = new ApplicationsController(applicationService, timelineService, personService)
applicationsController = new ApplicationsController(applicationService, personService)
request = createMock<Request>()
response = createMock<Response>({})
;(extractCallConfig as jest.MockedFn<typeof extractCallConfig>).mockReturnValue(callConfig)
Expand Down
5 changes: 0 additions & 5 deletions server/controllers/apply/applicationsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import { firstPageOfApplicationJourney, getResponses } from '../../utils/applica
import { DateFormats } from '../../utils/dateUtils'
import extractCallConfig from '../../utils/restUtils'
import { catchValidationErrorOrPropogate, fetchErrorsAndUserInput, insertGenericError } from '../../utils/validation'
import TimelineService from '../../services/assessments/timelineService'

export default class ApplicationsController {
constructor(
private readonly applicationService: ApplicationService,
private readonly timelineService: TimelineService,
private readonly personService: PersonService,
) {}

Expand Down Expand Up @@ -145,11 +143,8 @@ export default class ApplicationsController {
const { id } = req.params
const application = await this.applicationService.findApplication(callConfig, id)

const timelineData = await this.timelineService.getTimelineForAssessment(callConfig, application.assessmentId)

return res.render('applications/full', {
application,
timelineData,
})
}
}
Expand Down
4 changes: 2 additions & 2 deletions server/controllers/apply/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import PeopleController from './peopleController'
import type { Services } from '../../services'

export const controllers = (services: Services) => {
const { applicationService, timelineService, personService, referenceDataService } = services
const applicationsController = new ApplicationsController(applicationService, timelineService, personService)
const { applicationService, personService, referenceDataService } = services
const applicationsController = new ApplicationsController(applicationService, personService)
const pagesController = new PagesController(applicationService, {
personService,
applicationService,
Expand Down
4 changes: 0 additions & 4 deletions server/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { CallConfig } from './restClient'
import RoomClient from './roomClient'
import TokenStore from './tokenStore'
import UserClient from './userClient'
import TimelineClient from './timelineClient'

type RestClientBuilder<T> = (callConfig: CallConfig) => T

Expand All @@ -47,8 +46,6 @@ export const dataAccess = () => ({
bedClientBuilder: ((callConfig: CallConfig) => new BedClient(callConfig)) as RestClientBuilder<BedClient>,
assessmentClientBuilder: ((callConfig: CallConfig) =>
new AssessmentClient(callConfig)) as RestClientBuilder<AssessmentClient>,
timelineClientBuilder: ((callConfig: CallConfig) =>
new TimelineClient(callConfig)) as RestClientBuilder<TimelineClient>,
})

export type DataAccess = ReturnType<typeof dataAccess>
Expand All @@ -66,5 +63,4 @@ export {
ReportClient,
RestClientBuilder,
UserClient,
TimelineClient,
}
48 changes: 0 additions & 48 deletions server/data/timelineClient.test.ts

This file was deleted.

19 changes: 0 additions & 19 deletions server/data/timelineClient.ts

This file was deleted.

3 changes: 0 additions & 3 deletions server/paths/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ const oasysPath = personPath.path('oasys')

const cas3Path = path('/cas3')
const reportsCas3Path = cas3Path.path('reports')
const timelineCas3Path = cas3Path.path('timeline').path(':assessmentId')

const applyPaths = {
applications: {
show: singleApplicationPath,
Expand Down Expand Up @@ -130,7 +128,6 @@ export default {
create: clarificationNotePaths.notes,
update: clarificationNotePaths.notes.path(':clarificationNoteId'),
},
timeline: timelineCas3Path,
},
people: {
risks: {
Expand Down
43 changes: 0 additions & 43 deletions server/services/assessments/timelineService.test.ts

This file was deleted.

21 changes: 0 additions & 21 deletions server/services/assessments/timelineService.ts

This file was deleted.

5 changes: 0 additions & 5 deletions server/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import PersonService from './personService'
import PremisesService from './premisesService'
import ReportService from './reportService'
import TurnaroundService from './turnaroundService'
import TimelineService from './assessments/timelineService'
import UserService from './userService'
import ReferenceDataService from './referenceDataService'

Expand All @@ -37,7 +36,6 @@ export const services = () => {
userClientBuilder,
bedClientBuilder,
assessmentClientBuilder,
timelineClientBuilder,
} = dataAccess()

const userService = new UserService(userClientBuilder)
Expand All @@ -59,7 +57,6 @@ export const services = () => {
const turnaroundService = new TurnaroundService(bookingClientBuilder)
const assessmentsService = new AssessmentsService(assessmentClientBuilder, referenceDataClientBuilder)
const referenceDataService = new ReferenceDataService(referenceDataClientBuilder)
const timelineService = new TimelineService(timelineClientBuilder)

return {
userService,
Expand All @@ -81,7 +78,6 @@ export const services = () => {
turnaroundService,
assessmentsService,
referenceDataService,
timelineService,
}
}

Expand All @@ -103,5 +99,4 @@ export {
TurnaroundService,
UserService,
ReferenceDataService,
TimelineService,
}
Loading

0 comments on commit c8fb265

Please sign in to comment.