Fix references to public report reporter contact methods

This commit is contained in:
Eli Ribble 2026-05-16 18:12:28 +00:00
parent 1c8b13b31e
commit 0256b9bb42
No known key found for this signature in database
6 changed files with 46 additions and 30 deletions

View file

@ -61,21 +61,21 @@
</div>
<div class="col-md-6">
<label
v-if="report.reporter.emails.length"
v-if="report.reporter.email != ''"
class="form-label text-muted small mb-0"
>
<i class="bi bi-envelope"></i>
<a :href="'mailto:' + report.reporter.emails[0]">{{
report.reporter.emails[0]
<a :href="'mailto:' + report.reporter.email">{{
report.reporter.email
}}</a>
</label>
<label
v-if="report.reporter.phones.length"
v-if="report.reporter.phone.e164 != ''"
class="form-label text-muted small mb-0"
>
<i class="bi bi-phone"></i>
<a :href="'tel:+' + report.reporter.phones[0]">{{
report.reporter.phones[0]
<a :href="'tel:+' + report.reporter.phone.e164">{{
report.reporter.phone.e164
}}</a>
</label>
</div>

View file

@ -78,8 +78,8 @@
<div
v-if="
!(
selectedReport?.reporter.emails.length ||
selectedReport?.reporter.phones.length
selectedReport?.reporter.email ||
selectedReport?.reporter.phone.e164 != ''
)
"
class="mb-3"
@ -91,8 +91,8 @@
</div>
<div
v-if="
selectedReport?.reporter.emails.length ||
selectedReport?.reporter.phones.length
selectedReport?.reporter.email ||
selectedReport?.reporter.phone.e164 != ''
"
class="mb-3"
>

View file

@ -248,8 +248,8 @@ const hasCompleteResponse = computed(() => {
r.images.length > 0 ||
r.permission_type == PermissionType.GRANTED ||
r.reporter.name ||
r.reporter.phones.length ||
r.reporter.emails.length
r.reporter.phone.e164 != "" ||
r.reporter.email
) {
return true;
}

View file

@ -61,7 +61,7 @@
id="contact-phone"
name="phone"
placeholder="(555) 123-4567"
v-model="modelValue.reporter.phone.number"
v-model="modelValue.reporter.phone.e164"
/>
</div>
@ -72,7 +72,7 @@
class="form-check-input"
type="checkbox"
id="can-text"
v-model="modelValue.reporter.can_sms"
v-model="modelValue.reporter.phone.can_sms"
/>
<label class="form-check-label" for="can-text">
You may send text messages to this number

View file

@ -199,11 +199,14 @@
<div
class="summary-value"
v-if="
modelValue.reporter?.phone || modelValue.reporter?.phone != ''
modelValue.reporter?.phone ||
modelValue.reporter?.phone.e164 != ''
"
>
{{ modelValue.reporter.phone }}
<small class="text-muted" v-if="modelValue.reporter?.can_sms"
<small
class="text-muted"
v-if="modelValue.reporter?.phone.can_sms"
>(texting OK)</small
>
</div>

View file

@ -82,14 +82,6 @@ export interface ContactOptions {
phones?: Phone[];
uri?: string;
}
export interface Phone {
can_sms: boolean;
e164: string;
}
export interface PhoneReporter {
can_sms: boolean;
number: string;
}
export class Contact {
emails: string[];
name: string;
@ -111,13 +103,26 @@ export interface ContactDTO {
phones: Phone[];
uri: string;
}
export interface ContactReporterOptions {
email?: string;
name?: string;
phone?: Phone;
uri?: string;
}
export class ContactReporter {
constructor(
public name: string,
public email: string,
public phone: Phone,
public uri: string,
) {}
email: string;
name: string;
phone: Phone;
uri: string;
constructor(options?: ContactReporterOptions) {
this.email = options?.email ?? "";
this.name = options?.name ?? "";
this.phone = options?.phone ?? {
e164: "",
can_sms: true,
};
this.uri = options?.uri ?? "";
}
}
export interface District {
name: string;
@ -839,6 +844,14 @@ export interface Organization {
lob_address_id: string;
service_area?: Bounds;
}
export interface Phone {
can_sms: boolean;
e164: string;
}
export interface PhoneReporter {
can_sms: boolean;
number: string;
}
export interface UserNotificationCounts {
communication: number;
home: number;