Skip to content

Commit

Permalink
[TC-526] Profile Edit Form (#250)
Browse files Browse the repository at this point in the history
* BE changes for profile edit

* FE changes for profile edit

* profile details UI for padding and icons
  • Loading branch information
chelsea-EYDS authored May 24, 2024
1 parent 8e43519 commit bea436c
Show file tree
Hide file tree
Showing 52 changed files with 1,966 additions and 1,160 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ migration-run:
@docker exec tc-backend-${ENV} ./node_modules/.bin/ts-node ./node_modules/typeorm/cli migration:run -d ./src/database/datasource.ts

seed-local:
@docker exec -it tc-backend-${ENV} ./node_modules/.bin/ts-node -e 'require("./dist/database/create-availability-functions.js")'
@docker exec -it tc-backend-${ENV} ./node_modules/.bin/ts-node -e 'require("./src/database/seed.ts")'

seed-local-bcws:
Expand Down
1 change: 1 addition & 0 deletions backend/src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export class AppController {
locations: (await this.locationService.getRegionsAndLocations()).filter(
(itm) => itm.fireCentre !== null,
),
divisions: await this.locationService.getDivisions(),
};
}
}
15 changes: 10 additions & 5 deletions backend/src/common/bcws-seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export const handler = (
}

const bcwsData: CreatePersonnelBcwsDTO = {
homeFireCentre: faker.helpers.arrayElement(locations),
workFireCentre: faker.helpers.arrayElement(locations),


dateApplied: dateApplied,
dateApproved:
status !== Status.PENDING
Expand Down Expand Up @@ -85,25 +85,30 @@ export const handler = (
roles: personnelRoles,
languages: Array.from(new Set(createLanguages())),
division: faker.helpers.arrayElement(divisions).id,
emergencyContactFirstName: faker.person.firstName(),
emergencyContactLastName: faker.person.lastName(),
emergencyContactPhoneNumber: faker.string.numeric('##########'),
emergencyContactRelationship: faker.lorem.word(),
};



const personnelData: CreatePersonnelDTO = {
homeLocation: faker.helpers.arrayElement(locations),
workLocation: faker.helpers.arrayElement(locations),
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
email: faker.internet.email(),
primaryPhone: faker.string.numeric('##########'),
secondaryPhone: faker.string.numeric('##########'),
workPhone: faker.string.numeric('##########'),
ministry: faker.helpers.arrayElement(Object.values(Ministry)),
unionMembership: faker.helpers.arrayElement(Object.values(UnionMembership)),
jobTitle: faker.company.catchPhrase(),
jobTitle: faker.company.buzzNoun(),
supervisorEmail: faker.internet.email(),
supervisorLastName: faker.person.lastName(),
supervisorFirstName: faker.person.firstName(),
remoteOnly: faker.datatype.boolean({ probability: 0.4 }),
driverLicense: [faker.helpers.arrayElement(Object.values(DriverLicense))],
driverLicense: Array.from(new Set([faker.helpers.arrayElement(Object.values(DriverLicense)), faker.helpers.arrayElement(Object.values(DriverLicense)), faker.helpers.arrayElement(Object.values(DriverLicense)), faker.helpers.arrayElement(Object.values(DriverLicense))])),
willingToTravel: faker.datatype.boolean({ probability: 0.8 }),
availability:
status !== Status.PENDING ? (availability() as AvailabilityEntity[]) : [],
Expand Down
17 changes: 8 additions & 9 deletions backend/src/common/emcr-seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ import { AvailabilityEntity } from '../database/entities/availability.entity';
import {
EmcrExperienceEntity,
EmcrFunctionEntity,
EmcrPersonnelEntity,
EmcrTrainingEntity,
LocationEntity,
} from '../database/entities/emcr';
import { CreatePersonnelDTO } from '../personnel';
import { CreatePersonnelEmcrDTO, EmcrLocationDTO } from '../personnel/dto/emcr';
import { CreatePersonnelDTO, LocationDTO } from '../personnel';
import { CreatePersonnelEmcrDTO } from '../personnel/dto/emcr';


export const handler = (
locations: EmcrLocationDTO[],
locations: LocationDTO[],
functions: EmcrFunctionEntity[],
seededTrainings: EmcrTrainingEntity[],
): {
Expand All @@ -38,8 +36,7 @@ const dateApplied = faker.date.past();
const homeLocation = faker.helpers.arrayElement(locations)
const workLocation = faker.helpers.arrayElement(locations)
const emcrData: CreatePersonnelEmcrDTO = {
homeLocation: homeLocation,
workLocation: workLocation,

dateApplied: dateApplied,
logisticsNotes: faker.lorem.paragraph(),
coordinatorNotes: faker.lorem.sentence(),
Expand All @@ -52,6 +49,7 @@ const emcrData: CreatePersonnelEmcrDTO = {
preocExperience: faker.datatype.boolean({ probability: 0.4 }),
emergencyExperience: faker.datatype.boolean({ probability: 0.4 }),
approvedBySupervisor: faker.datatype.boolean({ probability: 0.8 }),
ministry: faker.helpers.arrayElement(Object.values(Ministry)),
trainings: [status !== Status.PENDING && seededTrainings[0]],
dateApproved:
status !== Status.PENDING
Expand All @@ -68,20 +66,21 @@ const emcrData: CreatePersonnelEmcrDTO = {
};

const personnelData: CreatePersonnelDTO = {
homeLocation: homeLocation,
workLocation: workLocation,
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
email: faker.internet.email(),
primaryPhone: faker.string.numeric('##########'),
secondaryPhone: faker.string.numeric('##########'),
workPhone: faker.string.numeric('##########'),
ministry: faker.helpers.arrayElement(Object.values(Ministry)),
unionMembership: faker.helpers.arrayElement(Object.values(UnionMembership)),
jobTitle: faker.company.catchPhrase(),
supervisorEmail: faker.internet.email(),
supervisorLastName: faker.person.lastName(),
supervisorFirstName: faker.person.firstName(),
remoteOnly: faker.datatype.boolean({ probability: 0.4 }),
driverLicense: [faker.helpers.arrayElement(Object.values(DriverLicense))],
driverLicense: Array.from(new Set([faker.helpers.arrayElement(Object.values(DriverLicense)), faker.helpers.arrayElement(Object.values(DriverLicense)), faker.helpers.arrayElement(Object.values(DriverLicense)), faker.helpers.arrayElement(Object.values(DriverLicense))])),
willingToTravel: faker.datatype.boolean({ probability: 0.8 }),
availability:
status !== Status.PENDING ? (availability() as AvailabilityEntity[]) : [],
Expand Down
Loading

0 comments on commit bea436c

Please sign in to comment.