Skip to content

Commit

Permalink
Merge pull request #190 from webitel/fix/display-wt-empty-component
Browse files Browse the repository at this point in the history
Fix/display wt empty component
  • Loading branch information
Lera24 authored Dec 13, 2024
2 parents d5a950a + 353dd94 commit 2abca0e
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
/>

<div
v-if="dataList.length && !isLoading"
class="table-section__table-wrapper"
>

Expand All @@ -57,43 +56,45 @@

<wt-loader v-show="isLoading" />

<wt-table
:data="dataList"
:headers="headers"
:selected="selected"
sortable
@sort="sort"
@update:selected="setSelected"
>
<template #name="{ item }">
<wt-item-link
:link="{ name: `${CrmSections.SLAS}-card`, params: { id: item.id } }"
>
{{ item.name }}
</wt-item-link>
</template>
<template #description="{ item }">
{{ item.description }}
</template>
<template #calendar="{ item }">
{{ item.calendar.name }}
</template>
<template #actions="{ item }">
<wt-icon-action
v-if="hasEditAccess"
action="edit"
@click="edit(item)"
/>
<wt-icon-action
v-if="hasDeleteAccess"
action="delete"
@click="askDeleteConfirmation({
<div v-if="dataList.length && !isLoading">
<wt-table
:data="dataList"
:headers="headers"
:selected="selected"
sortable
@sort="sort"
@update:selected="setSelected"
>
<template #name="{ item }">
<wt-item-link
:link="{ name: `${CrmSections.SLAS}-card`, params: { id: item.id } }"
>
{{ item.name }}
</wt-item-link>
</template>
<template #description="{ item }">
{{ item.description }}
</template>
<template #calendar="{ item }">
{{ item.calendar.name }}
</template>
<template #actions="{ item }">
<wt-icon-action
v-if="hasEditAccess"
action="edit"
@click="edit(item)"
/>
<wt-icon-action
v-if="hasDeleteAccess"
action="delete"
@click="askDeleteConfirmation({
deleted: [item],
callback: () => deleteData(item),
})"
/>
</template>
</wt-table>
/>
</template>
</wt-table>
</div>
<filter-pagination
:namespace="filtersNamespace"
:is-next="isNext"
Expand All @@ -112,7 +113,6 @@ import { useStore } from 'vuex';
import { useClose } from '@webitel/ui-sdk/src/composables/useClose/useClose.js';
import IconAction from '@webitel/ui-sdk/src/enums/IconAction/IconAction.enum.js';
import { useAccessControl } from '@webitel/ui-sdk/src/composables/useAccessControl/useAccessControl.js';
import WtTableTransition from '@webitel/ui-sdk/src/components/on-demand/wt-table-transition/wt-table-transition.vue';
import CrmSections from '@webitel/ui-sdk/src/enums/WebitelApplications/CrmSections.enum.js';
import {
useDeleteConfirmationPopup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
</header>

<div
v-if="dataList.length && !isLoading"
class="table-section__table-wrapper"
>

Expand All @@ -46,64 +45,66 @@

<wt-loader v-show="isLoading" />

<wt-table
:data="dataList"
:headers="headers"
:selected="selected"
sortable
@sort="sort"
@update:selected="setSelected"
>
<template #name="{ item }">
{{ item.name }}
</template>
<template #priorities="{ item }">
<div
v-if="item.priorities?.length"
class="opened-sla-conditions__priorities"
>
<p>{{ item.priorities[0]?.name }}</p>
<wt-tooltip
v-if="item.priorities?.length > 1"
:triggers="['click']"
<div v-if="dataList.length && !isLoading">
<wt-table
:data="dataList"
:headers="headers"
:selected="selected"
sortable
@sort="sort"
@update:selected="setSelected"
>
<template #name="{ item }">
{{ item.name }}
</template>
<template #priorities="{ item }">
<div
v-if="item.priorities?.length"
class="opened-sla-conditions__priorities"
>
<template #activator>
<wt-chip>
+{{ item.priorities?.length - 1 }}
</wt-chip>
</template>

<ul>
<li
v-for="({ id, name }) of item.priorities?.slice(1)"
:key="id"
>
<p>{{ name }}</p>
</li>
</ul>
</wt-tooltip>
</div>
</template>
<template #reactionTime="{ item }">
{{ convertDurationWithMinutes(item.reactionTime / 60) }}
</template>
<template #resolutionTime="{ item }">
{{ convertDurationWithMinutes(item.resolutionTime / 60) }}
</template>
<template #actions="{ item }">
<wt-icon-action
action="edit"
@click="router.push({ ...route, params: { conditionId: item.id } })"
/>
<wt-icon-action
action="delete"
@click="askDeleteConfirmation({
<p>{{ item.priorities[0]?.name }}</p>
<wt-tooltip
v-if="item.priorities?.length > 1"
:triggers="['click']"
>
<template #activator>
<wt-chip>
+{{ item.priorities?.length - 1 }}
</wt-chip>
</template>

<ul>
<li
v-for="({ id, name }) of item.priorities?.slice(1)"
:key="id"
>
<p>{{ name }}</p>
</li>
</ul>
</wt-tooltip>
</div>
</template>
<template #reactionTime="{ item }">
{{ convertDurationWithMinutes(item.reactionTime / 60) }}
</template>
<template #resolutionTime="{ item }">
{{ convertDurationWithMinutes(item.resolutionTime / 60) }}
</template>
<template #actions="{ item }">
<wt-icon-action
action="edit"
@click="router.push({ ...route, params: { conditionId: item.id } })"
/>
<wt-icon-action
action="delete"
@click="askDeleteConfirmation({
deleted: [item],
callback: () => deleteData(item),
})"
/>
</template>
</wt-table>
/>
</template>
</wt-table>
</div>
<filter-pagination
:namespace="filtersNamespace"
:next="isNext"
Expand Down Expand Up @@ -131,7 +132,6 @@ import ConditionPopup from './opened-sla-condition-popup.vue';
import convertDurationWithMinutes from '@webitel/ui-sdk/src/scripts/convertDurationWithMinutes.js';
import { useTableEmpty } from '@webitel/ui-sdk/src/modules/TableComponentModule/composables/useTableEmpty.js';
import filters from '../modules/filters/store/filters.js';
import WtTableTransition from '@webitel/ui-sdk/src/components/on-demand/wt-table-transition/wt-table-transition.vue';
const props = defineProps({
namespace: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
/>

<div
v-if="dataList.length && !isLoading"
class="table-section__table-wrapper"
>
<wt-empty
Expand All @@ -56,46 +55,48 @@

<wt-loader v-show="isLoading" />

<wt-table
:data="dataList"
:headers="headers"
:selected="selected"
sortable
@sort="sort"
@update:selected="setSelected"
>
<template #name="{ item }">
<wt-item-link
:link="{ name: `${CrmSections.SOURCES}-card`, params: { id: item.id } }"
>
{{ item.name }}
</wt-item-link>
</template>

<template #type="{ item }">
{{ t(`lookups.sources.types.${item.type}`) }}
</template>

<template #description="{ item }">
{{ item.description }}
</template>

<template #actions="{ item }">
<wt-icon-action
v-if="hasEditAccess"
action="edit"
@click="edit(item)"
/>
<wt-icon-action
v-if="hasDeleteAccess"
action="delete"
@click="askDeleteConfirmation({
<div v-if="dataList.length && !isLoading">
<wt-table
:data="dataList"
:headers="headers"
:selected="selected"
sortable
@sort="sort"
@update:selected="setSelected"
>
<template #name="{ item }">
<wt-item-link
:link="{ name: `${CrmSections.SOURCES}-card`, params: { id: item.id } }"
>
{{ item.name }}
</wt-item-link>
</template>

<template #type="{ item }">
{{ t(`lookups.sources.types.${item.type}`) }}
</template>

<template #description="{ item }">
{{ item.description }}
</template>

<template #actions="{ item }">
<wt-icon-action
v-if="hasEditAccess"
action="edit"
@click="edit(item)"
/>
<wt-icon-action
v-if="hasDeleteAccess"
action="delete"
@click="askDeleteConfirmation({
deleted: [item],
callback: () => deleteData(item),
})"
/>
</template>
</wt-table>
/>
</template>
</wt-table>
</div>
<filter-pagination
:namespace="filtersNamespace"
:is-next="isNext"
Expand All @@ -110,7 +111,6 @@
import { useClose } from '@webitel/ui-sdk/src/composables/useClose/useClose.js';
import IconAction from '@webitel/ui-sdk/src/enums/IconAction/IconAction.enum.js';
import { useAccessControl } from '@webitel/ui-sdk/src/composables/useAccessControl/useAccessControl.js';
import WtTableTransition from '@webitel/ui-sdk/src/components/on-demand/wt-table-transition/wt-table-transition.vue';
import CrmSections from '@webitel/ui-sdk/src/enums/WebitelApplications/CrmSections.enum.js';
import {
useDeleteConfirmationPopup,
Expand Down

0 comments on commit 2abca0e

Please sign in to comment.