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

View file

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

View file

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

View file

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

View file

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

View file

@ -82,14 +82,6 @@ export interface ContactOptions {
phones?: Phone[]; phones?: Phone[];
uri?: string; uri?: string;
} }
export interface Phone {
can_sms: boolean;
e164: string;
}
export interface PhoneReporter {
can_sms: boolean;
number: string;
}
export class Contact { export class Contact {
emails: string[]; emails: string[];
name: string; name: string;
@ -111,13 +103,26 @@ export interface ContactDTO {
phones: Phone[]; phones: Phone[];
uri: string; uri: string;
} }
export interface ContactReporterOptions {
email?: string;
name?: string;
phone?: Phone;
uri?: string;
}
export class ContactReporter { export class ContactReporter {
constructor( email: string;
public name: string, name: string;
public email: string, phone: Phone;
public phone: Phone, uri: string;
public 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 { export interface District {
name: string; name: string;
@ -839,6 +844,14 @@ export interface Organization {
lob_address_id: string; lob_address_id: string;
service_area?: Bounds; service_area?: Bounds;
} }
export interface Phone {
can_sms: boolean;
e164: string;
}
export interface PhoneReporter {
can_sms: boolean;
number: string;
}
export interface UserNotificationCounts { export interface UserNotificationCounts {
communication: number; communication: number;
home: number; home: number;