Bug fixes and general code clean up related to the IDAA Archives.
This commit is contained in:
@@ -28,6 +28,9 @@ export const load = (async ({ params, parent }) => { // route
|
||||
api_cfg: ae_acct.api,
|
||||
archive_id: archive_id,
|
||||
inc_content_li: true,
|
||||
enabled: 'enabled',
|
||||
hidden: 'all', // 'not_hidden' to load only visible entries
|
||||
limit: 99,
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
.then((results) => {
|
||||
|
||||
@@ -895,10 +895,18 @@ $effect(() => {
|
||||
onclick={() => {
|
||||
if (!confirm('Are you sure you want to delete this archive content?')) {return false;}
|
||||
|
||||
let method = 'disable';
|
||||
|
||||
if ($ae_loc.administrator_access && $ae_loc.edit_mode) {
|
||||
// if (confirm('You have trusted access. Do you want to permanently delete this archive content? (OK = Permanent Delete, Cancel = Disable)')) {
|
||||
method = 'delete';
|
||||
// }
|
||||
}
|
||||
|
||||
prom_api__archive_content_obj = archives_func.delete_ae_obj_id__archive_content({
|
||||
api_cfg: $ae_api,
|
||||
archive_content_id: $idaa_slct.archive_content_id,
|
||||
method: 'disable',
|
||||
method: method,
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
|
||||
@@ -918,7 +926,11 @@ $effect(() => {
|
||||
<span class="fas fa-minus m-1"></span>
|
||||
Delete
|
||||
{#if $ae_loc.administrator_access}
|
||||
(Disable)
|
||||
{#if $ae_loc.edit_mode}
|
||||
(Permanent Delete)
|
||||
{:else}
|
||||
(Disable)
|
||||
{/if}
|
||||
{/if}
|
||||
</button>
|
||||
{:else if $idaa_slct.archive_content_obj.hosted_file_id}
|
||||
|
||||
@@ -100,13 +100,18 @@ file_icons['zip'] = 'file-archive';
|
||||
|
||||
<div
|
||||
class="container archive archive_content_obj border p-2 mb-2 space-y-2 w-full max-w-(--breakpoint-lg) flex flex-col items-center justify-center bg-white rounded-lg"
|
||||
class:dim={idaa_archive_content_obj.hide}
|
||||
class:hidden={(idaa_archive_content_obj.hide || !idaa_archive_content_obj?.enable) && !$ae_loc.edit_mode}
|
||||
class:dim={idaa_archive_content_obj.hide && $ae_loc.edit_mode}
|
||||
class:dim_warning={!idaa_archive_content_obj?.enable && $ae_loc.edit_mode}
|
||||
class:bg-warning-100={!idaa_archive_content_obj?.enable}
|
||||
class:text-warning-900={!idaa_archive_content_obj?.enable}
|
||||
|
||||
>
|
||||
|
||||
<header class="ae_header flex flex-row gap-2 items-center">
|
||||
<h3 class="archive__name h4">
|
||||
<span class="archive__name">{@html idaa_archive_content_obj.name}</span>
|
||||
{idaa_archive_content_obj.hide}
|
||||
</h3>
|
||||
|
||||
{#if idaa_archive_content_obj.original_location}
|
||||
|
||||
@@ -102,20 +102,6 @@ let { log_lvl = 0, lq__archive_obj, lq__archive_content_obj_li }: Props = $props
|
||||
$idaa_loc.archives.qry__limit = 250;
|
||||
// ae_trigger = 'load__event_obj_li';
|
||||
$idaa_trig.archive_content_li = true;
|
||||
|
||||
// let load_archive_content_obj_li = archives_func.load_ae_obj_li__archive_content({
|
||||
// api_cfg: $ae_api,
|
||||
// for_obj_type: 'archive',
|
||||
// for_obj_id: $ae_loc.archive_id,
|
||||
// enabled: $idaa_loc.archives.qry__enabled,
|
||||
// hidden: $idaa_loc.archives.qry__hidden,
|
||||
// limit: $idaa_loc.archives.qry__limit,
|
||||
// order_by_li: $idaa_loc.archives.qry__order_by_li,
|
||||
// try_cache: true,
|
||||
// log_lvl: log_lvl
|
||||
// });
|
||||
// console.log(`load_archive_content_obj_li = `, load_archive_content_obj_li);
|
||||
// $idaa_slct.archive_content_obj_li = load_archive_content_obj_li;
|
||||
}}
|
||||
class="novi_btn btn_show_archives_archive_content ae_btn btn btn-info btn-sm preset-tonal-secondary border border-secondary-500"
|
||||
>
|
||||
@@ -130,20 +116,6 @@ let { log_lvl = 0, lq__archive_obj, lq__archive_content_obj_li }: Props = $props
|
||||
$idaa_loc.archives.qry__limit = 250;
|
||||
// ae_trigger = 'load__event_obj_li';
|
||||
$idaa_trig.archive_content_li = true;
|
||||
|
||||
// let load_archive_content_obj_li = archives_func.load_ae_obj_li__archive_content({
|
||||
// api_cfg: $ae_api,
|
||||
// for_obj_type: 'archive',
|
||||
// for_obj_id: $ae_loc.archive_id,
|
||||
// enabled: $idaa_loc.archives.qry__enabled,
|
||||
// hidden: $idaa_loc.archives.qry__hidden,
|
||||
// limit: $idaa_loc.archives.qry__limit,
|
||||
// order_by_li: $idaa_loc.archives.qry__order_by_li,
|
||||
// try_cache: true,
|
||||
// log_lvl: log_lvl
|
||||
// });
|
||||
// console.log(`load_archive_content_obj_li = `, load_archive_content_obj_li);
|
||||
// $idaa_slct.archive_content_obj_li = load_archive_content_obj_li;
|
||||
}}
|
||||
class="novi_btn btn_hide_archives_archive_content ae_btn btn btn-info btn-sm preset-tonal-secondary border border-secondary-500"
|
||||
>
|
||||
@@ -160,18 +132,6 @@ let { log_lvl = 0, lq__archive_obj, lq__archive_content_obj_li }: Props = $props
|
||||
$idaa_loc.archives.qry__limit = 500;
|
||||
// ae_trigger = 'load__event_obj_li';
|
||||
$idaa_trig.archive_content_li = true;
|
||||
|
||||
// let load_archive_content_obj_li = archives_func.load_ae_obj_li__archive_content({
|
||||
// api_cfg: $ae_api,
|
||||
// for_obj_type: 'archive',
|
||||
// for_obj_id: $ae_loc.archive_id,
|
||||
// enabled: $idaa_loc.archives.qry__enabled,
|
||||
// hidden: $idaa_loc.archives.qry__hidden,
|
||||
// limit: $idaa_loc.archives.qry__limit,
|
||||
// order_by_li: $idaa_loc.archives.qry__order_by_li,
|
||||
// try_cache: true,
|
||||
// log_lvl: log_lvl
|
||||
// });
|
||||
}}
|
||||
class="novi_btn btn_show_archive_content ae_btn btn btn-warning btn-sm preset-tonal-secondary border border-secondary-500"
|
||||
>
|
||||
@@ -186,18 +146,6 @@ let { log_lvl = 0, lq__archive_obj, lq__archive_content_obj_li }: Props = $props
|
||||
$idaa_loc.archives.qry__limit = 500;
|
||||
$idaa_trig.archive_content_li = true;
|
||||
// ae_trigger = 'load__event_obj_li';
|
||||
|
||||
// let load_archive_content_obj_li = archives_func.load_ae_obj_li__archive_content({
|
||||
// api_cfg: $ae_api,
|
||||
// for_obj_type: 'archive',
|
||||
// for_obj_id: $ae_loc.archive_id,
|
||||
// enabled: $idaa_loc.archives.qry__enabled,
|
||||
// hidden: $idaa_loc.archives.qry__hidden,
|
||||
// limit: $idaa_loc.archives.qry__limit,
|
||||
// order_by_li: $idaa_loc.archives.qry__order_by_li,
|
||||
// try_cache: true,
|
||||
// log_lvl: log_lvl
|
||||
// });
|
||||
}}
|
||||
class="novi_btn btn_hide_bb_post ae_btn btn btn-warning btn-sm preset-tonal-secondary border border-secondary-500"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user