Cleaning up and updating the person related sections. Prep for LCI opening.
This commit is contained in:
@@ -587,7 +587,7 @@ let properties_to_save = [
|
||||
'comments',
|
||||
|
||||
'allow_auth_key', // For sign in without password
|
||||
// 'auth_key',
|
||||
// 'auth_key', // Should this be saved locally?
|
||||
'passcode',
|
||||
|
||||
// 'passcode_timeout',
|
||||
@@ -625,6 +625,27 @@ let properties_to_save = [
|
||||
'user_manager',
|
||||
'user_administrator',
|
||||
'user_public',
|
||||
|
||||
'organization_id',
|
||||
'organization_id_random',
|
||||
'organization_name',
|
||||
|
||||
'contact_id',
|
||||
'contact_id_random',
|
||||
'contact_name',
|
||||
'contact_email',
|
||||
'contact_cc_email',
|
||||
'contact_phone_mobile',
|
||||
'contact_phone_home',
|
||||
'contact_phone_office',
|
||||
'contact_phone_land',
|
||||
'contact_phone_fax',
|
||||
'contact_phone_other',
|
||||
|
||||
'address_id',
|
||||
'address_id_random',
|
||||
'address_city',
|
||||
'address_country_alpha_2_code', // contact_address_country_alpha_2_code
|
||||
];
|
||||
|
||||
|
||||
@@ -742,6 +763,27 @@ export async function process_ae_obj__person_props(
|
||||
user_manager: obj.user_manager,
|
||||
user_administrator: obj.user_administrator,
|
||||
user_public: obj.user_public,
|
||||
|
||||
organization_id: obj.organization_id_random,
|
||||
organization_id_random: obj.organization_id_random,
|
||||
organization_name: obj.organization_name,
|
||||
|
||||
contact_id: obj.contact_id_random,
|
||||
contact_id_random: obj.contact_id_random,
|
||||
contact_name: obj.contact_name,
|
||||
contact_email: obj.contact_email,
|
||||
contact_cc_email: obj.contact_cc_email,
|
||||
contact_phone_mobile: obj.contact_phone_mobile,
|
||||
contact_phone_home: obj.contact_phone_home,
|
||||
contact_phone_office: obj.contact_phone_office,
|
||||
contact_phone_land: obj.contact_phone_land,
|
||||
contact_phone_fax: obj.contact_phone_fax,
|
||||
contact_phone_other: obj.contact_phone_other,
|
||||
|
||||
address_id: obj.contact_address_id_random,
|
||||
address_id_random: obj.contact_address_id_random,
|
||||
address_city: obj.contact_address_city,
|
||||
address_country_alpha_2_code: obj.contact_address_country_alpha_2_code, // contact_address_country_alpha_2_code
|
||||
};
|
||||
|
||||
processed_obj_li.push(processed_obj);
|
||||
|
||||
@@ -81,7 +81,7 @@ export interface Person {
|
||||
comments?: null|string;
|
||||
|
||||
allow_auth_key?: null|boolean; // For sign in without password
|
||||
auth_key?: null|string;
|
||||
auth_key?: null|string; // Should this be saved locally?
|
||||
passcode?: null|string;
|
||||
|
||||
data_json?: null|string;
|
||||
@@ -95,6 +95,11 @@ export interface Person {
|
||||
created_on: Date;
|
||||
updated_on?: null|Date;
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1?: null|string;
|
||||
tmp_sort_2?: null|string;
|
||||
tmp_sort_3?: null|string;
|
||||
|
||||
// Additional fields for convenience (database views)
|
||||
username?: string;
|
||||
user_name?: null|string;
|
||||
@@ -104,6 +109,27 @@ export interface Person {
|
||||
user_manager?: boolean;
|
||||
user_administrator?: boolean;
|
||||
user_public?: boolean;
|
||||
|
||||
organization_id?: null|string; // The organization this person belongs to, if any.
|
||||
organization_id_random?: null|string; // The random ID of the organization this person belongs to, if any.
|
||||
organization_name?: null|string;
|
||||
|
||||
contact_id?: null|string; // The contact ID of the person, if any.
|
||||
contact_id_random?: null|string; // The random ID of the contact, if any.
|
||||
contact_name?: null|string;
|
||||
contact_email?: null|string;
|
||||
contact_cc_email?: null|string;
|
||||
contact_phone_mobile?: null|string;
|
||||
contact_phone_home?: null|string;
|
||||
contact_phone_office?: null|string;
|
||||
contact_phone_landline?: null|string;
|
||||
contact_phone_fax?: null|string;
|
||||
contact_phone_other?: null|string;
|
||||
|
||||
address_id?: null|string; // The address ID of the person, if any.
|
||||
address_id_random?: null|string; // The random ID of the address, if any.
|
||||
address_city?: null|string;
|
||||
address_country_alpha_2_code?: null|string; // ISO 3166-1 alpha-2 country code
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -125,6 +125,8 @@ const ae_app_local_data_defaults: key_val = {
|
||||
primary_email: null, // The primary email of the logged-in person/user
|
||||
user_id: null, // The user ID of the logged-in user
|
||||
|
||||
qry_limit__people: 100,
|
||||
|
||||
show_content__person_page_help: false,
|
||||
},
|
||||
|
||||
@@ -143,6 +145,8 @@ const ae_app_local_data_defaults: key_val = {
|
||||
public: false, // Is the user a public user (can view public content)
|
||||
person_id: null, // The person ID of the logged-in user
|
||||
access_type: null, // The access type of the logged-in user
|
||||
|
||||
qry_limit__users: 100,
|
||||
},
|
||||
|
||||
'qry__enabled': 'enabled', // all, disabled, enabled
|
||||
|
||||
@@ -78,8 +78,10 @@ let lq_kv__person_obj_li = liveQuery(
|
||||
<a
|
||||
href="/core/person/{person_obj?.person_id_random}"
|
||||
class="text-blue-500 underline hover:text-blue-800"
|
||||
title="View {person_obj?.full_name ?? 'no name'} (ID={person_obj?.person_id_random})"
|
||||
>
|
||||
{@html person_obj?.full_name ?? ae_snip.html__not_set}
|
||||
<!-- {@html person_obj?.full_name ?? ae_snip.html__not_set} -->
|
||||
{@html person_obj?.full_name ? person_obj?.full_name : ae_snip.html__not_set}
|
||||
</a>
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
|
||||
@@ -29,7 +29,7 @@ export async function load({ params, parent }) { // route
|
||||
let load_person_obj = await core_func.load_ae_obj_id__person({
|
||||
api_cfg: ae_acct.api,
|
||||
person_id: person_id,
|
||||
try_cache: false
|
||||
try_cache: true
|
||||
});
|
||||
|
||||
ae_acct.slct.person_obj = load_person_obj;
|
||||
|
||||
@@ -177,7 +177,7 @@ onMount(() => {
|
||||
on:ae_crud_updated={e => {
|
||||
console.log(`ae_crud_updated:`, e.detail);
|
||||
|
||||
core_func.load_ae_obj_id__person({api_cfg: $ae_api, person_id: $lq__person_obj.person_id_random, log_lvl: 1})
|
||||
core_func.load_ae_obj_id__person({api_cfg: $ae_api, person_id: $lq__person_obj?.person_id_random, log_lvl: 1})
|
||||
.then(function (load_results) {
|
||||
// Maybe reload page?
|
||||
// window.location.reload();
|
||||
@@ -204,7 +204,7 @@ onMount(() => {
|
||||
on:ae_crud_updated={e => {
|
||||
console.log(`ae_crud_updated:`, e.detail);
|
||||
|
||||
core_func.load_ae_obj_id__person({api_cfg: $ae_api, person_id: $lq__person_obj.person_id_random, log_lvl: 1})
|
||||
core_func.load_ae_obj_id__person({api_cfg: $ae_api, person_id: $lq__person_obj?.person_id_random, log_lvl: 1})
|
||||
.then(function (load_results) {
|
||||
// Maybe reload page?
|
||||
// window.location.reload();
|
||||
@@ -233,7 +233,7 @@ onMount(() => {
|
||||
on:ae_crud_updated={e => {
|
||||
console.log(`ae_crud_updated:`, e.detail);
|
||||
|
||||
core_func.load_ae_obj_id__person({api_cfg: $ae_api, person_id: $lq__person_obj.person_id_random, log_lvl: 1})
|
||||
core_func.load_ae_obj_id__person({api_cfg: $ae_api, person_id: $lq__person_obj?.person_id_random, log_lvl: 1})
|
||||
.then(function (load_results) {
|
||||
// Maybe reload page?
|
||||
// window.location.reload();
|
||||
|
||||
Reference in New Issue
Block a user