@webitel/ui-datalist 1.1.80 → 1.1.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/modules/filter-presets/api/PresetQuery.ts +18 -22
- package/src/modules/filters/components/table-filters-panel.vue +2 -2
- package/src/modules/filters/composables/useFilterConfigsToolkit.ts +3 -3
- package/src/modules/filters/modules/filterConfig/components/_custom/filterConfig.ts +6 -6
- package/src/modules/filters/modules/filterConfig/components/agent/config.js +1 -1
- package/src/modules/filters/modules/filterConfig/components/case-assignee/filterConfig.ts +1 -1
- package/src/modules/filters/modules/filterConfig/components/case-author/config.js +1 -1
- package/src/modules/filters/modules/filterConfig/components/case-close-reason-groups/config.js +4 -2
- package/src/modules/filters/modules/filterConfig/components/case-impacted/config.js +1 -1
- package/src/modules/filters/modules/filterConfig/components/case-priority/config.js +1 -1
- package/src/modules/filters/modules/filterConfig/components/case-reporter/config.js +1 -1
- package/src/modules/filters/modules/filterConfig/components/case-service/config.js +1 -2
- package/src/modules/filters/modules/filterConfig/components/case-sla/config.js +1 -1
- package/src/modules/filters/modules/filterConfig/components/case-sla-condition/config.js +1 -2
- package/src/modules/filters/modules/filterConfig/components/case-source/config.js +1 -1
- package/src/modules/filters/modules/filterConfig/components/case-status/config.js +4 -2
- package/src/modules/filters/modules/filterConfig/components/contact/config.js +1 -1
- package/src/modules/filters/modules/filterConfig/components/contact-group/index.ts +1 -1
- package/src/modules/filters/modules/filterConfig/components/contact-label/index.ts +1 -1
- package/src/modules/filters/modules/filterConfig/components/contact-owner/index.ts +1 -1
- package/src/modules/filters/modules/filterConfig/components/gateway/config.js +1 -1
- package/src/modules/filters/modules/filterConfig/components/queue/index.ts +1 -1
- package/src/modules/filters/modules/filterConfig/components/rated-by/config.js +1 -1
- package/src/modules/filters/modules/filterConfig/components/team/index.ts +1 -1
- package/src/modules/filters/modules/filterConfig/components/user/config.js +1 -1
- package/types/.tsbuildinfo +1 -1
- package/types/modules/filter-presets/api/PresetQuery.d.ts +1 -1
- package/types/modules/filters/components/table-filters-panel.vue.d.ts +2 -2
- package/types/modules/filters/composables/useFilterConfigsToolkit.d.ts +2 -2
- package/types/modules/filters/modules/filterConfig/components/_custom/filterConfig.d.ts +5 -5
- package/types/modules/filters/modules/filterConfig/components/agent/config.d.ts +7 -2
- package/types/modules/filters/modules/filterConfig/components/case-author/config.d.ts +4 -1
- package/types/modules/filters/modules/filterConfig/components/case-close-reason-groups/config.d.ts +16 -4
- package/types/modules/filters/modules/filterConfig/components/case-impacted/config.d.ts +7 -2
- package/types/modules/filters/modules/filterConfig/components/case-priority/config.d.ts +7 -2
- package/types/modules/filters/modules/filterConfig/components/case-reporter/config.d.ts +7 -2
- package/types/modules/filters/modules/filterConfig/components/case-service/config.d.ts +14 -4
- package/types/modules/filters/modules/filterConfig/components/case-sla/config.d.ts +7 -2
- package/types/modules/filters/modules/filterConfig/components/case-sla-condition/config.d.ts +16 -4
- package/types/modules/filters/modules/filterConfig/components/case-source/config.d.ts +7 -1
- package/types/modules/filters/modules/filterConfig/components/case-status/config.d.ts +17 -4
- package/types/modules/filters/modules/filterConfig/components/contact/config.d.ts +7 -2
- package/types/modules/filters/modules/filterConfig/components/gateway/config.d.ts +7 -2
- package/types/modules/filters/modules/filterConfig/components/rated-by/config.d.ts +4 -1
- package/types/modules/filters/modules/filterConfig/components/user/config.d.ts +4 -1
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
EngineCreatePresetQueryRequest,
|
|
3
|
+
EnginePresetQuery,
|
|
4
|
+
} from '@webitel/api-services/gen/models';
|
|
5
|
+
import { getPresetQueryService } from '@webitel/api-services/gen-wire';
|
|
1
6
|
import {
|
|
2
7
|
getDefaultGetListResponse,
|
|
3
8
|
getDefaultGetParams,
|
|
4
|
-
getDefaultInstance,
|
|
5
|
-
getDefaultOpenAPIConfig,
|
|
6
9
|
} from '@webitel/ui-sdk/api/defaults/index';
|
|
7
10
|
import applyTransform, {
|
|
8
11
|
camelToSnake,
|
|
@@ -13,16 +16,6 @@ import applyTransform, {
|
|
|
13
16
|
starToSearch,
|
|
14
17
|
} from '@webitel/ui-sdk/api/transformers/index';
|
|
15
18
|
import type { Id } from '@webitel/ui-sdk/api/types/ApiModule';
|
|
16
|
-
import {
|
|
17
|
-
type EngineCreatePresetQueryRequest,
|
|
18
|
-
type EnginePresetQuery,
|
|
19
|
-
PresetQueryServiceApiFactory,
|
|
20
|
-
} from 'webitel-sdk';
|
|
21
|
-
|
|
22
|
-
const instance = getDefaultInstance();
|
|
23
|
-
const configuration = getDefaultOpenAPIConfig();
|
|
24
|
-
|
|
25
|
-
const service = PresetQueryServiceApiFactory(configuration, '', instance);
|
|
26
19
|
|
|
27
20
|
const isConflictError = (err: unknown): boolean =>
|
|
28
21
|
typeof err === 'object' &&
|
|
@@ -53,22 +46,23 @@ const getPresetList = async (
|
|
|
53
46
|
useStarToSearch ? starToSearch('search')(params) : params,
|
|
54
47
|
]);
|
|
55
48
|
try {
|
|
56
|
-
const response = await
|
|
49
|
+
const response = await getPresetQueryService().searchPresetQuery({
|
|
57
50
|
page,
|
|
58
51
|
size,
|
|
59
|
-
search
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
// the generated param is `q`; `search` is what the datalist store sends
|
|
53
|
+
q: search,
|
|
54
|
+
sort: sort || '-created_at',
|
|
55
|
+
fields: fields || [
|
|
62
56
|
'id',
|
|
63
57
|
'name',
|
|
64
58
|
'preset',
|
|
65
59
|
'description',
|
|
66
60
|
],
|
|
67
61
|
id,
|
|
68
|
-
[
|
|
62
|
+
section: [
|
|
69
63
|
presetNamespace,
|
|
70
64
|
],
|
|
71
|
-
);
|
|
65
|
+
});
|
|
72
66
|
const { items, next } = applyTransform(response.data, [
|
|
73
67
|
snakeToCamel(),
|
|
74
68
|
merge(getDefaultGetListResponse()),
|
|
@@ -86,7 +80,7 @@ const getPresetList = async (
|
|
|
86
80
|
|
|
87
81
|
const getPreset = async ({ id }: { id?: Id | null }) => {
|
|
88
82
|
try {
|
|
89
|
-
const response = await
|
|
83
|
+
const response = await getPresetQueryService().readPresetQuery(Number(id));
|
|
90
84
|
return applyTransform(response.data, [
|
|
91
85
|
snakeToCamel(),
|
|
92
86
|
]);
|
|
@@ -118,7 +112,7 @@ const addPreset = async ({
|
|
|
118
112
|
},
|
|
119
113
|
]);
|
|
120
114
|
try {
|
|
121
|
-
const response = await
|
|
115
|
+
const response = await getPresetQueryService().createPresetQuery(item);
|
|
122
116
|
return applyTransform(response.data, [
|
|
123
117
|
snakeToCamel(),
|
|
124
118
|
]);
|
|
@@ -152,7 +146,7 @@ const updatePreset = async ({
|
|
|
152
146
|
},
|
|
153
147
|
]);
|
|
154
148
|
try {
|
|
155
|
-
const response = await
|
|
149
|
+
const response = await getPresetQueryService().updatePresetQuery(id, item);
|
|
156
150
|
return applyTransform(response.data, [
|
|
157
151
|
snakeToCamel(),
|
|
158
152
|
]);
|
|
@@ -165,7 +159,9 @@ const updatePreset = async ({
|
|
|
165
159
|
|
|
166
160
|
const deletePreset = async ({ id }: { id?: Id | null }) => {
|
|
167
161
|
try {
|
|
168
|
-
const response = await
|
|
162
|
+
const response = await getPresetQueryService().deletePresetQuery(
|
|
163
|
+
Number(id),
|
|
164
|
+
);
|
|
169
165
|
return applyTransform(response.data, []);
|
|
170
166
|
} catch (err) {
|
|
171
167
|
throw applyTransform(err, [
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
</template>
|
|
71
71
|
|
|
72
72
|
<script lang="ts" setup>
|
|
73
|
+
import type { DataField } from '@webitel/api-services/gen/models';
|
|
73
74
|
import { WtIconAction } from '@webitel/ui-sdk/components';
|
|
74
75
|
import { StoreGeneric } from 'pinia';
|
|
75
76
|
import { computed } from 'vue';
|
|
76
|
-
import { WebitelProtoDataField } from 'webitel-sdk';
|
|
77
77
|
|
|
78
78
|
import { ApplyPresetAction, SavePresetAction } from '../../filter-presets';
|
|
79
79
|
import { FilterInitParams, IFilter } from '../classes/Filter';
|
|
@@ -109,7 +109,7 @@ type Props = {
|
|
|
109
109
|
* Props.filterOptions, because this functionality can be expanded to many
|
|
110
110
|
* filter panels
|
|
111
111
|
*/
|
|
112
|
-
filterableExtensionFields?:
|
|
112
|
+
filterableExtensionFields?: DataField[];
|
|
113
113
|
/**
|
|
114
114
|
* @description
|
|
115
115
|
* QueryPreset "section" field
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { DataField } from '@webitel/api-services/gen/models';
|
|
1
2
|
import { type ComputedRef, computed } from 'vue';
|
|
2
3
|
import { useI18n } from 'vue-i18n';
|
|
3
|
-
import type { WebitelProtoDataField } from 'webitel-sdk';
|
|
4
4
|
|
|
5
5
|
import type { FilterName, IFilter } from '../classes/Filter';
|
|
6
6
|
import type { IFiltersManager } from '../classes/FiltersManager';
|
|
@@ -44,7 +44,7 @@ export type FilterConfigToolkit = {
|
|
|
44
44
|
export type FilterConfigToolkitParams = {
|
|
45
45
|
filterOptions: (FilterOption | BaseFilterConfig)[];
|
|
46
46
|
filtersManager: IFiltersManager;
|
|
47
|
-
filterableExtensionFields?:
|
|
47
|
+
filterableExtensionFields?: DataField[];
|
|
48
48
|
staticMode?: boolean;
|
|
49
49
|
};
|
|
50
50
|
|
|
@@ -91,7 +91,7 @@ export const useFilterConfigsToolkit = ({
|
|
|
91
91
|
* add filterConfigs for extension fields
|
|
92
92
|
*/
|
|
93
93
|
.concat(
|
|
94
|
-
filterableExtensionFields.map((field:
|
|
94
|
+
filterableExtensionFields.map((field: DataField) => {
|
|
95
95
|
return createTypeExtensionFilterConfig(
|
|
96
96
|
{
|
|
97
97
|
name: field.id,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { sysTypes } from '@webitel/
|
|
1
|
+
import { SysTypesAPI as sysTypes } from '@webitel/api-services/api';
|
|
2
|
+
import type { DataField } from '@webitel/api-services/gen/models';
|
|
2
3
|
import { WtTypeExtensionFieldKind } from '@webitel/ui-sdk/enums';
|
|
3
4
|
import { get } from 'lodash';
|
|
4
|
-
import type { WebitelProtoDataField } from 'webitel-sdk';
|
|
5
5
|
import type {
|
|
6
6
|
BaseFilterConfig,
|
|
7
7
|
FilterConfigBaseParams,
|
|
@@ -13,7 +13,7 @@ import TypeExtensionFilterValueField from './type-extension-filter-value-field.v
|
|
|
13
13
|
import TypeExtensionFilterValuePreview from './type-extension-filter-value-preview.vue';
|
|
14
14
|
|
|
15
15
|
export interface ITypeExtensionFilterConfig extends BaseFilterConfig {
|
|
16
|
-
readonly field:
|
|
16
|
+
readonly field: DataField;
|
|
17
17
|
searchRecords?: IWtSysTypeFilterConfig['searchRecords'];
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -21,14 +21,14 @@ class TypeExtensionFilterConfig
|
|
|
21
21
|
extends FilterConfig
|
|
22
22
|
implements ITypeExtensionFilterConfig
|
|
23
23
|
{
|
|
24
|
-
readonly field:
|
|
24
|
+
readonly field: DataField;
|
|
25
25
|
|
|
26
26
|
constructor(
|
|
27
27
|
{ name }: FilterConfigBaseParams,
|
|
28
28
|
{
|
|
29
29
|
field,
|
|
30
30
|
}: {
|
|
31
|
-
field:
|
|
31
|
+
field: DataField;
|
|
32
32
|
},
|
|
33
33
|
) {
|
|
34
34
|
super({
|
|
@@ -99,7 +99,7 @@ export const createTypeExtensionFilterConfig = (
|
|
|
99
99
|
{
|
|
100
100
|
field,
|
|
101
101
|
}: {
|
|
102
|
-
field:
|
|
102
|
+
field: DataField;
|
|
103
103
|
},
|
|
104
104
|
) => {
|
|
105
105
|
switch (field.kind) {
|
package/src/modules/filters/modules/filterConfig/components/case-close-reason-groups/config.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
CaseCloseReasonGroupsAPI,
|
|
3
|
+
CaseCloseReasonsAPI,
|
|
4
|
+
} from '@webitel/api-services/api';
|
|
3
5
|
|
|
4
6
|
export const caseCloseReasonsGroupsSearchMethod =
|
|
5
7
|
CaseCloseReasonGroupsAPI.getLookup;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import ServiceCatalogsAPI from '@webitel/
|
|
2
|
-
import ServicesAPI from '@webitel/ui-sdk/api/clients/caseServices/services';
|
|
1
|
+
import { ServiceCatalogsAPI, ServicesAPI } from '@webitel/api-services/api';
|
|
3
2
|
|
|
4
3
|
export const searchMethod = ServiceCatalogsAPI.getList;
|
|
5
4
|
export const servicesSearchMethod = ServicesAPI.getLookup;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import SLAConditionsAPI from '@webitel/
|
|
2
|
-
import SlasAPI from '@webitel/ui-sdk/api/clients/slas/slas';
|
|
1
|
+
import { SLAConditionsAPI, SlasAPI } from '@webitel/api-services/api';
|
|
3
2
|
|
|
4
3
|
export const slasConditionsSearchMethod = SLAConditionsAPI.getLookup;
|
|
5
4
|
export const slasSearchMethod = SlasAPI.getLookup;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
CaseStatusConditionsAPI,
|
|
3
|
+
CaseStatusesAPI as CaseStatusesApi,
|
|
4
|
+
} from '@webitel/api-services/api';
|
|
3
5
|
|
|
4
6
|
export const caseStatusesSearchMethod = CaseStatusesApi.getLookup;
|
|
5
7
|
export const caseStatusConditionsSearchMethod =
|