Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import ActivityTypeRoutes from '../../modules/lookups/modules/activity-types/rou
import AgentPauseCauseRoutes from '../../modules/lookups/modules/agent-pause-cause/router/agentPauseCause';
import AgentSkillsRoutes from '../../modules/lookups/modules/agent-skills/router/agentSkills.js';
import BlacklistsRoutes from '../../modules/lookups/modules/blacklists/router/blacklists.js';
import BucketsRoutes from '../../modules/lookups/modules/buckets/router/buckets.js';
import BucketsRoutes from '../../modules/lookups/modules/buckets/router/buckets';
import CalendarsRoutes from '../../modules/lookups/modules/calendars/router/calendars';
import CommunicationsRoutes from '../../modules/lookups/modules/communications/router/communications.js';
import MediaRoutes from '../../modules/lookups/modules/media/router/media.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@
</template>

<script lang="ts" setup>
import { AgentsAPI, CalendarsAPI } from '@webitel/api-services/api';
import { AgentsAPI, BucketsAPI, CalendarsAPI } from '@webitel/api-services/api';
import type { EngineMemberInQueue } from '@webitel/api-services/gen/models';
import { WtObject } from '@webitel/ui-sdk/enums';
import { useI18n } from 'vue-i18n';
import { useUserAccessControl } from '../../../../../../../app/composables/useUserAccessControl';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

аліас)

import BucketsAPI from '../../../../../../lookups/modules/buckets/api/buckets';
import OpenedQueueMemberCommunication from './communications/opened-queue-member-communication.vue';

const modelValue = defineModel<EngineMemberInQueue>({
Expand Down
3 changes: 0 additions & 3 deletions src/modules/lookups/modules/buckets/api/buckets.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<template>
<section class="opened-bucket-general">
<header class="opened-card-header">
<h3 class="opened-card-header__title">
{{ t('objects.generalInfo') }}
</h3>
</header>
<div class="opened-card-input-grid opened-card-input-grid--1-col opened-card-input-grid--w50">
<wt-input-text
v-model:model-value="modelValue.name"
Expand All @@ -23,9 +18,8 @@
</template>

<script setup lang="ts">
import type { RegleSchemaFieldStatus } from '@regle/schemas';
import type { EngineBucket } from '@webitel/api-services/gen/models';
import { WtInputText, WtTextarea } from '@webitel/ui-sdk/components';
import type { CardValidationFields } from '@webitel/ui-datalist/card';
import { useI18n } from 'vue-i18n';

import { useUserAccessControl } from '../../../../../app/composables/useUserAccessControl';
Expand All @@ -35,9 +29,7 @@ const modelValue = defineModel<EngineBucket>({
});

defineProps<{
validationFields?: {
[K in keyof EngineBucket]?: RegleSchemaFieldStatus<EngineBucket[K]>;
};
validationFields?: CardValidationFields<EngineBucket>;
}>();

const { t } = useI18n();
Expand Down
16 changes: 13 additions & 3 deletions src/modules/lookups/modules/buckets/components/opened-bucket.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,23 @@

<script setup lang="ts">
import type { EngineBucket } from '@webitel/api-services/gen/models';
import { useCardComponent, useCardTabs } from '@webitel/ui-datalist/card';
import {
type CardTab,
useCardComponent,
useCardTabs,
} from '@webitel/ui-datalist/card';
import { useClose } from '@webitel/ui-sdk/composables';
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';

import { useUserAccessControl } from '../../../../../app/composables/useUserAccessControl';
import RouteNames from '../../../../../app/router/_internals/RouteNames.enum';
import BucketsRouteNames from '../router/_internals/BucketsRouteNames.enum';
import { useBucketsCardStore } from '../stores';
import { useBucketsCardStore } from '../stores/card/bucketsCardStore';

const { t } = useI18n();
const route = useRoute();
const { hasSaveActionAccess } = useUserAccessControl();

const {
Expand All @@ -68,7 +74,7 @@ const {
hasSaveAccess: hasSaveActionAccess,
});

const tabs = computed(() => [
const tabs = computed<CardTab[]>(() => [
{
text: t('objects.general'),
value: 'general',
Expand All @@ -89,6 +95,10 @@ const path = computed(() => [
},
{
name: isNew.value ? t('objects.new') : originalItemInstance.value?.name,
route: {
name: currentTab.value?.pathName,
query: route.query,
},
},
]);
</script>
45 changes: 33 additions & 12 deletions src/modules/lookups/modules/buckets/components/the-buckets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
{{ t('objects.lookups.buckets.allBuckets') }}
</h3>
<wt-action-bar
:include="[IconAction.REFRESH, IconAction.DELETE]"
:include="[
IconAction.REFRESH,
IconAction.DELETE,
IconAction.COLUMNS,
]"
:disabled:delete="!hasDeleteAccess || !selected.length"
@click:refresh="loadDataList"
@click:delete="
Expand All @@ -37,6 +41,12 @@
@filter:delete="deleteFilter"
/>
</template>
<template #columns>
<wt-table-column-select
:headers="headers"
@change="updateShownHeaders"
/>
</template>
</wt-action-bar>
</header>

Expand All @@ -54,7 +64,7 @@
:text="textEmpty"
:primary-action-text="primaryActionTextEmpty"
:disabled-primary-action="!hasCreateAccess"
@click:primary="add"
@click:primary="add()"
/>

<wt-loader v-show="isLoading" />
Expand All @@ -64,17 +74,23 @@
:data="dataList"
:selected="selected"
:headers="shownHeaders"
reorderable-columns
resizable-columns
sortable
@column-reorder="columnReorder"
@column-resize="columnResize"
@sort="updateSort"
@update:selected="updateSelected"
>
<template #name="{ item }">
<adm-item-link
:id="item.id"
:route-name="RouteNames.BUCKETS"
<wt-item-link
:link="{
name: `${RouteNames.BUCKETS}-card`,
params: { id: item.id },
}"
>
{{ item.name }}
</adm-item-link>
</wt-item-link>
</template>

<template #description="{ item }">
Expand Down Expand Up @@ -114,7 +130,8 @@
</wt-page-wrapper>
</template>

<script setup>
<script setup lang="ts">
import type { EngineBucket } from '@webitel/api-services/gen/models';
import { DynamicFilterSearchComponent as DynamicFilterSearch } from '@webitel/ui-datalist/filters';
import { IconAction } from '@webitel/ui-sdk/enums';
import DeleteConfirmationPopup from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue';
Expand All @@ -127,12 +144,12 @@ import { useRouter } from 'vue-router';

import { useUserAccessControl } from '../../../../../app/composables/useUserAccessControl';
import RouteNames from '../../../../../app/router/_internals/RouteNames.enum';
import { useBucketsDatalistStore } from '../stores';
import { useBucketsDatalistStore } from '../stores/datalist/bucketsDatalistStore';

const { hasCreateAccess, hasUpdateAccess, hasDeleteAccess } =
useUserAccessControl();

const tableStore = useBucketsDatalistStore();
const bucketsDatalistStore = useBucketsDatalistStore();

const {
dataList,
Expand All @@ -142,22 +159,26 @@ const {
size,
next,
selected,
headers,
shownHeaders,
filtersManager,
} = storeToRefs(tableStore);
} = storeToRefs(bucketsDatalistStore);

const {
initialize,
loadDataList,
updatePage,
updateSize,
updateSort,
columnResize,
columnReorder,
updateShownHeaders,
deleteEls,
addFilter,
updateFilter,
deleteFilter,
updateSelected,
} = tableStore;
} = bucketsDatalistStore;

initialize();

Expand Down Expand Up @@ -190,7 +211,7 @@ const add = () =>
},
});

const edit = (item) =>
const edit = (item: EngineBucket) =>
router.push({
name: `${RouteNames.BUCKETS}-card`,
params: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import RouteNames from '../../../../../../app/router/_internals/RouteNames.enum.js';
import RouteNames from '../../../../../../app/router/_internals/RouteNames.enum';

export default Object.freeze({
GENERAL: `${RouteNames.BUCKETS}-general`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AdminSections, WtObject } from '@webitel/ui-sdk/enums';

import RouteNames from '../../../../../app/router/_internals/RouteNames.enum.js';
import BucketsRouteNamesEnum from './_internals/BucketsRouteNames.enum.js';
import RouteNames from '../../../../../app/router/_internals/RouteNames.enum';
import BucketsRouteNamesEnum from './_internals/BucketsRouteNames.enum';

const Buckets = () => import('../components/the-buckets.vue');
const OpenedBucket = () => import('../components/opened-bucket.vue');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { BucketsAPI } from '@webitel/api-services/api';
import type { EngineBucket } from '@webitel/api-services/gen/models';
import { createTableStore } from '@webitel/ui-datalist';

import { BucketsNamespace } from '../namespace';
import { headers } from './_internals/headers';

export const useBucketsDatalistStore = createTableStore(
export const useBucketsDatalistStore = createTableStore<EngineBucket>(
`${BucketsNamespace}/datalist`,
{
apiModule: BucketsAPI,
Expand Down
3 changes: 0 additions & 3 deletions src/modules/lookups/modules/buckets/stores/index.ts

This file was deleted.

Loading