parent
0f013304ef
commit
6a91bd53e2
@ -2,9 +2,11 @@
|
|||||||
import { _ } from "svelte-i18n";
|
import { _ } from "svelte-i18n";
|
||||||
import Toastify from "toastify-js";
|
import Toastify from "toastify-js";
|
||||||
import { GroupContactService } from "@odit/lfk-client-js";
|
import { GroupContactService } from "@odit/lfk-client-js";
|
||||||
const promise = GroupContactService.groupContactControllerGetAll().then(result=>{
|
const promise = GroupContactService.groupContactControllerGetAll().then(
|
||||||
current_contacts=result;
|
(result) => {
|
||||||
})
|
current_contacts = result;
|
||||||
|
}
|
||||||
|
);
|
||||||
import store from "../store";
|
import store from "../store";
|
||||||
import ContactsEmptyState from "./ContactsEmptyState.svelte";
|
import ContactsEmptyState from "./ContactsEmptyState.svelte";
|
||||||
$: searchvalue = "";
|
$: searchvalue = "";
|
||||||
@ -77,18 +79,18 @@
|
|||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<div class="ml-4">
|
<div class="ml-4">
|
||||||
<div class="text-sm font-medium text-gray-900">
|
<div class="text-sm font-medium text-gray-900">
|
||||||
{#if t.groups.length>0}
|
{#if t.groups.length > 0}
|
||||||
{#each t.groups as g}
|
{#each t.groups as g}
|
||||||
{#if g.responseType==="RUNNERORGANIZATION"}
|
{#if g.responseType === 'RUNNERORGANIZATION'}
|
||||||
<a
|
<a
|
||||||
href="../orgs/{g.id}"
|
href="../orgs/{g.id}"
|
||||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800">{g.name}</a>
|
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800">{g.name}</a>
|
||||||
{:else}
|
{:else}
|
||||||
<a
|
<a
|
||||||
href="../teams/{g.id}"
|
href="../teams/{g.id}"
|
||||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800">{g.name}</a>
|
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800">{g.name}</a>
|
||||||
{/if}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
{:else}no groups{/if}
|
{:else}no groups{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -98,11 +100,13 @@
|
|||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<div class="ml-4">
|
<div class="ml-4">
|
||||||
<div class="text-sm font-medium text-gray-900">
|
<div class="text-sm font-medium text-gray-900">
|
||||||
{t.address.address1}<br>
|
{#if t.address.address1 !== null}
|
||||||
{t.address.address2 || ''}<br>
|
{t.address.address1}<br />
|
||||||
{t.address.postalcode}
|
{t.address.address2 || ''}<br />
|
||||||
{t.address.city}
|
{t.address.postalcode}
|
||||||
{t.address.country}
|
{t.address.city}
|
||||||
|
{t.address.country}
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -119,16 +123,19 @@
|
|||||||
Delete</button>
|
Delete</button>
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
GroupContactService.groupContactControllerRemove(t.id, false)
|
GroupContactService.groupContactControllerRemove(t.id, false).then(
|
||||||
.then((resp) => {
|
(resp) => {
|
||||||
current_contacts = current_contacts.filter((obj) => obj.id !== t.id);
|
current_contacts = current_contacts.filter(
|
||||||
|
(obj) => obj.id !== t.id
|
||||||
|
);
|
||||||
Toastify({
|
Toastify({
|
||||||
text: 'Contact deleted',
|
text: 'Contact deleted',
|
||||||
duration: 500,
|
duration: 500,
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
'linear-gradient(to right, #00b09b, #96c93d)',
|
'linear-gradient(to right, #00b09b, #96c93d)',
|
||||||
}).showToast();
|
}).showToast();
|
||||||
})
|
}
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">Confirm
|
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">Confirm
|
||||||
|
Loading…
x
Reference in New Issue
Block a user