Skip to content

Commit

Permalink
Merge pull request #25 from bcgov/feat/project-name-ui
Browse files Browse the repository at this point in the history
feat: Add project name to page titles, display permits alphabetically
  • Loading branch information
kyle1morel authored Feb 7, 2024
2 parents 389086a + c1f4eec commit ab8a381
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 7 deletions.
3 changes: 2 additions & 1 deletion app/src/controllers/chefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const controller = {
return {
formId: x.id,
submissionId: data.form.submissionId,
companyNameRegistered: data.companyNameRegistered,
confirmationId: data.form.confirmationId,
contactEmail: data.contactEmail,
contactPhoneNumber: data.contactPhoneNumber,
Expand All @@ -37,7 +38,7 @@ const controller = {
latitude: data.latitude,
longitude: data.longitude,
naturalDisaster: data.naturalDisasterInd,
projectName: data.companyNameRegistered,
projectName: data.projectName,
queuePriority: data.queuePriority,
singleFamilyUnits: data.singleFamilyUnits ?? data.multiFamilyUnits,
streetAddress: data.streetAddress,
Expand Down
1 change: 1 addition & 0 deletions app/src/db/migrations/20231212000000_init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export async function up(knex: Knex): Promise<void> {
table.timestamp('submittedAt', { useTz: true }).notNullable();
table.text('submittedBy').notNullable();
table.text('locationPIDs');
table.text('companyNameRegistered');
table.text('contactName');
table.text('contactPhoneNumber');
table.text('contactEmail');
Expand Down
4 changes: 3 additions & 1 deletion app/src/db/models/submission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ export default {
return {
submissionId: input.submissionId,
confirmationId: input.confirmationId,
projectName: input.projectName,
submittedAt: new Date(input.submittedAt ?? Date.now()),
submittedBy: input.submittedBy,
locationPIDs: input.locationPIDs,
contactName: input.contactName,
contactPhoneNumber: input.contactPhoneNumber,
contactEmail: input.contactEmail,
projectName: input.projectName,
companyNameRegistered: input.companyNameRegistered,
singleFamilyUnits: input.singleFamilyUnits,
streetAddress: input.streetAddress,
latitude: input.latitude,
Expand Down Expand Up @@ -88,6 +89,7 @@ export default {
contactPhoneNumber: input.contactPhoneNumber,
contactEmail: input.contactEmail,
projectName: input.projectName,
companyNameRegistered: input.companyNameRegistered,
singleFamilyUnits: input.singleFamilyUnits,
streetAddress: input.streetAddress,
latitude: input.latitude,
Expand Down
1 change: 1 addition & 0 deletions app/src/db/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ model submission {
submittedAt DateTime @db.Timestamptz(6)
submittedBy String
locationPIDs String?
companyNameRegistered String?
contactName String?
contactPhoneNumber String?
contactEmail String?
Expand Down
3 changes: 2 additions & 1 deletion app/src/services/chefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const service = {
submissionId: response.submission.id,
applicationStatus: APPLICATION_STATUS_LIST.NEW,
confirmationId: response.submission.confirmationId,
companyNameRegistered: submission.companyNameRegistered,
contactEmail: submission.contactEmail,
contactPhoneNumber: submission.contactPhoneNumber,
contactName: `${submission.contactFirstName} ${submission.contactLastName}`,
Expand All @@ -127,7 +128,7 @@ const service = {
latitude: parseInt(submission.latitude),
longitude: parseInt(submission.longitude),
naturalDisaster: submission.naturalDisasterInd,
projectName: submission.companyNameRegistered,
projectName: submission.projectName,
queuePriority: parseInt(submission.queuePriority),
singleFamilyUnits: maxUnits,
streetAddress: submission.streetAddress,
Expand Down
4 changes: 3 additions & 1 deletion app/src/services/permit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ const service = {
submissionId: submissionId
},
orderBy: {
updatedAt: 'asc'
permit_type: {
name: 'asc'
}
}
});

Expand Down
1 change: 1 addition & 0 deletions app/src/types/ChefsSubmissionForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type ChefsSubmissionForm = {
submittedAt: string;
submittedBy: string;
locationPIDs: string | null;
companyNameRegistered: string | null;
contactName: string | null;
contactPhoneNumber: string | null;
contactEmail: string | null;
Expand Down
1 change: 1 addition & 0 deletions app/src/types/ChefsSubmissionFormExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export type ChefsSubmissionFormExport = {
latitude: number;
longitude: number;
naturalDisasterInd: boolean;
projectName: string;
companyNameRegistered: string;
queuePriority: number;
singleFamilyUnits: string;
Expand Down
11 changes: 9 additions & 2 deletions frontend/src/components/submission/SubmissionForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ const formSchema = object({
confirmationId: string().required().label('Confirmation ID'),
contactEmail: string().email().label('Contact Email'),
intakeStatus: string().oneOf(IntakeStatusList).label('Intake state'),
companyNameRegistered: string().notRequired().label('Company'),
latitude: number().notRequired().min(48).max(60).label('Latitude'),
longitude: number().notRequired().min(-139).max(-114).label('Longitude'),
projectName: string().notRequired().label('Project Name'),
queuePriority: number()
.required()
.min(0)
Expand Down Expand Up @@ -147,6 +149,12 @@ const onSubmit = (values: any) => {
label="Activity"
:disabled="true"
/>
<InputText
class="col-4"
name="projectName"
label="Project Name"
:disabled="!props.editable"
/>
<Calendar
class="col-4"
name="submittedAt"
Expand Down Expand Up @@ -181,7 +189,7 @@ const onSubmit = (values: any) => {
/>
<InputText
class="col-4"
name="projectName"
name="companyNameRegistered"
label="Company"
:disabled="!props.editable"
/>
Expand All @@ -191,7 +199,6 @@ const onSubmit = (values: any) => {
label="Units"
:disabled="!props.editable"
/>
<div class="col-4" />
<InputText
class="col-4"
name="streetAddress"
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/components/submission/SubmissionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ const filters = ref({
</div>
</template>
</Column>
<Column
field="projectName"
header="Project Name"
:sortable="true"
style="min-width: 200px"
/>
<Column
field="contactName"
header="Contact"
Expand Down
1 change: 1 addition & 0 deletions frontend/src/types/ChefsSubmissionForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type ChefsSubmissionForm = {
contactPhoneNumber?: string;
contactEmail?: string;
projectName?: string;
companyNameRegistered?: string;
singleFamilyUnits?: string;
streetAddress?: string;
latitude?: number;
Expand Down
14 changes: 13 additions & 1 deletion frontend/src/views/SubmissionView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,19 @@ onMounted(async () => {
/>
<span>Back to Submissions</span>
</router-link>
<h1>Activity submission</h1>
<h1>
Activity submission:
<span
v-if="submission?.confirmationId"
class="mr-1"
>
{{ submission.confirmationId }}
</span>
<span v-if="submission?.projectName">
-
<span class="ml-1">{{ submission.projectName }}</span>
</span>
</h1>

<TabView>
<TabPanel header="Info">
Expand Down

0 comments on commit ab8a381

Please sign in to comment.