parent
d6c315ab8e
commit
1a52aaf8d1
@ -7,7 +7,8 @@
|
|||||||
import Toastify from "toastify-js";
|
import Toastify from "toastify-js";
|
||||||
export let edit_modal_open;
|
export let edit_modal_open;
|
||||||
export let current_cards;
|
export let current_cards;
|
||||||
export let edit_card_id;
|
export let edit_card;
|
||||||
|
export let runner;
|
||||||
const getRunnerLabel = (option) =>
|
const getRunnerLabel = (option) =>
|
||||||
option.firstname + " " + (option.middlename || "") + " " + option.lastname;
|
option.firstname + " " + (option.middlename || "") + " " + option.lastname;
|
||||||
const filterRunners = (label, filterText, option) =>
|
const filterRunners = (label, filterText, option) =>
|
||||||
@ -27,7 +28,7 @@
|
|||||||
return { label: getRunnerLabel(r), value: r };
|
return { label: getRunnerLabel(r), value: r };
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
RunnerCardService.runnerCardControllerGetOne(edit_card_id).then((val) => {
|
RunnerCardService.runnerCardControllerGetOne(edit_card.id).then((val) => {
|
||||||
runner = Object.assign(
|
runner = Object.assign(
|
||||||
{ runner },
|
{ runner },
|
||||||
{ label: getRunnerLabel(val.runner), value: val.runner }
|
{ label: getRunnerLabel(val.runner), value: val.runner }
|
||||||
@ -73,7 +74,7 @@
|
|||||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||||
}).showToast();
|
}).showToast();
|
||||||
current_cards[
|
current_cards[
|
||||||
current_cards.findIndex((c) => c.id === edit_card_id)
|
current_cards.findIndex((c) => c.id === edit_card.id)
|
||||||
] = result;
|
] = result;
|
||||||
current_cards = current_cards;
|
current_cards = current_cards;
|
||||||
})
|
})
|
||||||
@ -88,7 +89,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if edit_modal_open}
|
{#if edit_modal_open}
|
||||||
<div
|
<div
|
||||||
class="fixed z-10 inset-0 overflow-y-auto"
|
class="fixed z-10 inset-0 overflow-y-auto"
|
||||||
|
@ -3,13 +3,10 @@
|
|||||||
import store from "../../store";
|
import store from "../../store";
|
||||||
import AddCardBulkModal from "./AddCardBulkModal.svelte";
|
import AddCardBulkModal from "./AddCardBulkModal.svelte";
|
||||||
import AddCardModal from "./AddCardModal.svelte";
|
import AddCardModal from "./AddCardModal.svelte";
|
||||||
import CardDetailModal from "./CardDetailModal.svelte";
|
|
||||||
import CardsOverview from "./CardsOverview.svelte";
|
import CardsOverview from "./CardsOverview.svelte";
|
||||||
$: current_cards = [];
|
$: current_cards = [];
|
||||||
export let modal_open = false;
|
export let modal_open = false;
|
||||||
export let bulk_modal_open = false;
|
export let bulk_modal_open = false;
|
||||||
export let edit_modal_open = true;
|
|
||||||
export let edit_card_id = 1;
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="container p-5">
|
<section class="container p-5">
|
||||||
@ -41,6 +38,3 @@ import CardDetailModal from "./CardDetailModal.svelte";
|
|||||||
<AddCardModal bind:current_cards bind:modal_open />
|
<AddCardModal bind:current_cards bind:modal_open />
|
||||||
<AddCardBulkModal bind:current_cards bind:bulk_modal_open />
|
<AddCardBulkModal bind:current_cards bind:bulk_modal_open />
|
||||||
{/if}
|
{/if}
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes('CARD:UPDATE')}
|
|
||||||
<CardDetailModal bind:current_cards bind:edit_modal_open bind:edit_card_id/>
|
|
||||||
{/if}
|
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
import store from "../../store";
|
import store from "../../store";
|
||||||
import Toastify from "toastify-js";
|
import Toastify from "toastify-js";
|
||||||
import CardsEmptyState from "./CardsEmptyState.svelte";
|
import CardsEmptyState from "./CardsEmptyState.svelte";
|
||||||
|
import CardDetailModal from "./CardDetailModal.svelte";
|
||||||
|
import {init} from "./CardDetailModal.svelte";
|
||||||
|
export let edit_modal_open = false;
|
||||||
|
export let edit_card_id = 0;
|
||||||
$: searchvalue = "";
|
$: searchvalue = "";
|
||||||
$: active_deletes = [];
|
$: active_deletes = [];
|
||||||
export let current_cards = [];
|
export let current_cards = [];
|
||||||
@ -19,6 +23,9 @@
|
|||||||
return id.toString() === searchvalue;
|
return id.toString() === searchvalue;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
{#if store.state.jwtinfo.userdetails.permissions.includes('CARD:UPDATE')}
|
||||||
|
<CardDetailModal bind:current_cards bind:edit_modal_open bind:edit_card_id/>
|
||||||
|
{/if}
|
||||||
|
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes('CARD:GET')}
|
{#if store.state.jwtinfo.userdetails.permissions.includes('CARD:GET')}
|
||||||
{#await cards_promise}
|
{#await cards_promise}
|
||||||
@ -140,9 +147,11 @@
|
|||||||
{:else}
|
{:else}
|
||||||
<td
|
<td
|
||||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||||
<a
|
<button
|
||||||
href="./{card.id}"
|
on:click={(card)=>{
|
||||||
class="text-indigo-600 hover:text-indigo-900">{$_('details')}</a>
|
init();
|
||||||
|
}}
|
||||||
|
class="text-indigo-600 hover:text-indigo-900">{$_('details')}</button>
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes('CARD:DELETE')}
|
{#if store.state.jwtinfo.userdetails.permissions.includes('CARD:DELETE')}
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user