@webitel/ui-datalist 26.12.5 → 26.12.6
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/Readme.md +18 -0
- package/package.json +4 -4
- package/src/index.ts +5 -2
- package/src/modules/filters/modules/filterConfig/components/grantee/index.ts +1 -1
- package/src/modules/filters/modules/filterConfig/components/index.ts +8 -0
- package/src/modules/filters/modules/filterConfig/components/trigger-job-state/trigger-job-state-filter-value-field.vue +87 -0
- package/src/modules/filters/modules/filterConfig/components/trigger-job-state/trigger-job-state-filter-value-preview.vue +42 -0
- package/src/modules/filters/modules/filterConfig/enums/FilterOption.ts +2 -0
- package/src/modules/permissions/components/_internal/permissions-role-row.vue +25 -0
- package/src/modules/permissions/components/_internal/permissions-role-select.vue +35 -0
- package/src/modules/permissions/components/_internal/permissions-tab-content.vue +161 -0
- package/src/modules/permissions/components/_internal/permissions-tab-role-popup.vue +94 -0
- package/src/modules/{permissions-page → permissions}/components/permissions-tab.vue +5 -5
- package/src/modules/permissions/composables/useAccessModeOptions.ts +48 -0
- package/src/modules/permissions/index.ts +40 -0
- package/src/modules/permissions/stores/_internals/headers.ts +52 -0
- package/src/modules/{permissions-page → permissions}/stores/createPermissionsStore.ts +19 -44
- package/src/modules/{permissions-page → permissions}/types/Permission.types.ts +2 -2
- package/src/modules/permissions/types/PermissionsUserAccess.ts +10 -0
- package/types/.tsbuildinfo +1 -1
- package/types/index.d.ts +2 -2
- package/types/modules/filter-presets/stores/createFilterPresetsStore.d.ts +1 -1
- package/types/modules/filters/modules/filterConfig/components/grantee/index.d.ts +1 -1
- package/types/modules/filters/modules/filterConfig/components/index.d.ts +4 -2
- package/types/modules/filters/modules/filterConfig/components/trigger-job-state/trigger-job-state-filter-value-field.vue.d.ts +18 -0
- package/types/modules/filters/modules/filterConfig/components/trigger-job-state/trigger-job-state-filter-value-preview.vue.d.ts +6 -0
- package/types/modules/filters/modules/filterConfig/enums/FilterOption.d.ts +2 -0
- package/types/modules/permissions/components/_internal/permissions-role-row.vue.d.ts +17 -0
- package/types/modules/permissions/components/_internal/permissions-role-select.vue.d.ts +11 -0
- package/types/modules/permissions/components/_internal/permissions-tab-content.vue.d.ts +32 -0
- package/types/modules/permissions/components/_internal/permissions-tab-role-popup.vue.d.ts +10 -0
- package/types/modules/{permissions-page → permissions}/components/permissions-tab.vue.d.ts +1 -1
- package/types/modules/permissions/composables/useAccessModeOptions.d.ts +22 -0
- package/types/modules/permissions/index.d.ts +17 -0
- package/types/modules/permissions/stores/_internals/headers.d.ts +22 -0
- package/types/modules/{permissions-page → permissions}/stores/createPermissionsStore.d.ts +5 -3
- package/types/modules/{permissions-page → permissions}/types/Permission.types.d.ts +2 -2
- package/types/modules/permissions/types/PermissionsUserAccess.d.ts +3 -0
- package/src/modules/permissions-page/index.ts +0 -23
- package/src/modules/permissions-page/scripts/PermissionsApiModule.ts +0 -57
- package/src/modules/permissions-page/scripts/__tests__/PermissionsApiModule.spec.ts +0 -31
- package/types/modules/permissions-page/index.d.ts +0 -7
- package/types/modules/permissions-page/scripts/PermissionsApiModule.d.ts +0 -9
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useNestedTableList } from './modules/table/composables/useNestedTableList';
|
|
2
2
|
import { createTableStore } from './modules/table/createTableStore.store';
|
|
3
|
-
import type { DatalistTableHeader } from './modules/types/tableStore.types';
|
|
4
|
-
export type { DatalistTableHeader };
|
|
3
|
+
import type { DatalistTableHeader, PatchItemPropertyParams } from './modules/types/tableStore.types';
|
|
4
|
+
export type { DatalistTableHeader, PatchItemPropertyParams };
|
|
5
5
|
export { createTableStore, useNestedTableList };
|
|
@@ -106,7 +106,7 @@ export declare const filterPresetsStoreBody: (namespace?: string) => {
|
|
|
106
106
|
loadDataList: ({ withLoading, }?: import("../../types/tableStore.types").LoadDataListOptions) => Promise<void>;
|
|
107
107
|
appendToDataList: () => Promise<void>;
|
|
108
108
|
updateSelected: (value: EnginePresetQuery[]) => void;
|
|
109
|
-
patchItemProperty: ({ index, path, value, }: import("
|
|
109
|
+
patchItemProperty: ({ index, path, value, }: import("../../..").PatchItemPropertyParams) => Promise<void>;
|
|
110
110
|
deleteEls: (_els: EnginePresetQuery[]) => Promise<void>;
|
|
111
111
|
resetInfiniteScrollTableParamsToDefaults: () => void;
|
|
112
112
|
updateSearchMode: (newSearch: string) => void;
|
|
@@ -23,7 +23,7 @@ declare class GranteeFilterConfig extends WtSysTypeFilterConfig {
|
|
|
23
23
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
24
24
|
value: Record<string, unknown>[];
|
|
25
25
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
-
searchRecords: import("../../composables/useFilterReadAccess").GatedFilterSearch<[params: import("@webitel/
|
|
26
|
+
searchRecords: import("../../composables/useFilterReadAccess").GatedFilterSearch<[params: import("@webitel/api-services/api/clients/_shared/types").ApiParams], unknown>;
|
|
27
27
|
}
|
|
28
28
|
export declare const createGranteeFilterConfig: (params?: FilterConfigBaseParams) => GranteeFilterConfig;
|
|
29
29
|
export {};
|
|
@@ -103,13 +103,15 @@ import TeamFilter from './team/team-filter-value-field.vue';
|
|
|
103
103
|
import TeamFilterPreview from './team/team-filter-value-preview.vue';
|
|
104
104
|
import TotalDurationFilter from './total-duration/total-duration-filter-value-field.vue';
|
|
105
105
|
import TotalDurationFilterPreview from './total-duration/total-duration-filter-value-preview.vue';
|
|
106
|
+
import TriggerJobStateFilter from './trigger-job-state/trigger-job-state-filter-value-field.vue';
|
|
107
|
+
import TriggerJobStateFilterPreview from './trigger-job-state/trigger-job-state-filter-value-preview.vue';
|
|
106
108
|
import UserFilter from './user/user-filter-value-field.vue';
|
|
107
109
|
import UserFilterPreview from './user/user-filter-value-preview.vue';
|
|
108
110
|
import UtilizationProgressFilter from './utilization-progress/utilization-progress-filter-value-field.vue';
|
|
109
111
|
import UtilizationProgressFilterPreview from './utilization-progress/utilization-progress-filter-value-preview.vue';
|
|
110
112
|
import VariableFilter from './variable/variable-filter-value-field.vue';
|
|
111
113
|
import VariableFilterPreview from './variable/variable-filter-value-preview.vue';
|
|
112
|
-
export { ActionFilter, ActionFilterPreview, AgentFilter, AgentFilterPreview, AgentStatusFilter, AgentStatusFilterPreview, AmdResultFilter, AmdResultFilterPreview, AuditorFilter, AuditorFilterPreview, BucketFilter, BucketFilterPreview, CallDirectionFilterValueField, CallDirectionFilterValuePreview, CallReportingResultFilter, CallReportingResultFilterPreview, CaseActualReactionTimeFilterValueField, CaseActualReactionTimeFilterValuePreview, CaseActualResolutionTimeFilterValueField, CaseActualResolutionTimeFilterValuePreview, CaseAuthorFilterValueField, CaseAuthorFilterValuePreview, CaseCloseReasonGroupsFilterValueField, CaseCloseReasonGroupsFilterValuePreview, CaseImpactedFilterValueField, CaseImpactedFilterValuePreview, CasePriorityFilterValueField, CasePriorityFilterValuePreview, CaseReactionTimeFilterValueField, CaseReactionTimeFilterValuePreview, CaseReporterFilterValueField, CaseReporterFilterValuePreview, CaseResolutionTimeFilterValueField, CaseResolutionTimeFilterValuePreview, CaseServiceFilterValueField, CaseServiceFilterValuePreview, CaseSlaConditionFilterValueField, CaseSlaConditionFilterValuePreview, CaseSlaFilterValueField, CaseSlaFilterValuePreview, CaseSourceFilterValueField, CaseSourceFilterValuePreview, CaseStatusFilterValueField, CaseStatusFilterValuePreview, ContactFilter, ContactFilterPreview, ContactGroupFilter, ContactGroupFilterPreview, ContactLabelFilter, ContactLabelFilterPreview, ContactOwnerFilter, ContactOwnerFilterPreview, DateTimeOptionsFilterValueField, FlowTypeFilter, FlowTypeFilterPreview, GatewayFilter, GatewayFilterPreview, GranteeFilter, GranteeFilterPreview, HangupCauseFilterValueField, HangupCauseFilterValuePreview, HasAttachmentFilter, HasAttachmentFilterPreview, HasFileFilter, HasFileFilterPreview, HasRatingFilterValueField, HasRatingFilterValuePreview, HasTranscriptionFilter, HasTranscriptionFilterPreview, HasUserFilter, HasUserFilterPreview, ObjectFilter, ObjectFilterPreview, QueueFilter, QueueFilterPreview, QueuePeriodFilter, QueuePeriodFilterPreview, QueueTypeFilter, QueueTypeFilterPreview, RatedByFilter, RatedByFilterPreview, RatingFromToFilter, RatingFromToFilterPreview, RegionFilter, RegionFilterPreview, ScoreFilter, ScoreFilterPreview, SkillFilter, SkillFilterPreview, StopCauseFilter, StopCauseFilterPreview, SupervisorFilter, SupervisorFilterPreview, TagFilter, TagFilterPreview, TagsFilter, TagsFilterPreview, TalkDurationFilter, TalkDurationFilterPreview, TeamFilter, TeamFilterPreview, TotalDurationFilter, TotalDurationFilterPreview, UserFilter, UserFilterPreview, UtilizationProgressFilter, UtilizationProgressFilterPreview, VariableFilter, VariableFilterPreview, };
|
|
114
|
+
export { ActionFilter, ActionFilterPreview, AgentFilter, AgentFilterPreview, AgentStatusFilter, AgentStatusFilterPreview, AmdResultFilter, AmdResultFilterPreview, AuditorFilter, AuditorFilterPreview, BucketFilter, BucketFilterPreview, CallDirectionFilterValueField, CallDirectionFilterValuePreview, CallReportingResultFilter, CallReportingResultFilterPreview, CaseActualReactionTimeFilterValueField, CaseActualReactionTimeFilterValuePreview, CaseActualResolutionTimeFilterValueField, CaseActualResolutionTimeFilterValuePreview, CaseAuthorFilterValueField, CaseAuthorFilterValuePreview, CaseCloseReasonGroupsFilterValueField, CaseCloseReasonGroupsFilterValuePreview, CaseImpactedFilterValueField, CaseImpactedFilterValuePreview, CasePriorityFilterValueField, CasePriorityFilterValuePreview, CaseReactionTimeFilterValueField, CaseReactionTimeFilterValuePreview, CaseReporterFilterValueField, CaseReporterFilterValuePreview, CaseResolutionTimeFilterValueField, CaseResolutionTimeFilterValuePreview, CaseServiceFilterValueField, CaseServiceFilterValuePreview, CaseSlaConditionFilterValueField, CaseSlaConditionFilterValuePreview, CaseSlaFilterValueField, CaseSlaFilterValuePreview, CaseSourceFilterValueField, CaseSourceFilterValuePreview, CaseStatusFilterValueField, CaseStatusFilterValuePreview, ContactFilter, ContactFilterPreview, ContactGroupFilter, ContactGroupFilterPreview, ContactLabelFilter, ContactLabelFilterPreview, ContactOwnerFilter, ContactOwnerFilterPreview, DateTimeOptionsFilterValueField, FlowTypeFilter, FlowTypeFilterPreview, GatewayFilter, GatewayFilterPreview, GranteeFilter, GranteeFilterPreview, HangupCauseFilterValueField, HangupCauseFilterValuePreview, HasAttachmentFilter, HasAttachmentFilterPreview, HasFileFilter, HasFileFilterPreview, HasRatingFilterValueField, HasRatingFilterValuePreview, HasTranscriptionFilter, HasTranscriptionFilterPreview, HasUserFilter, HasUserFilterPreview, ObjectFilter, ObjectFilterPreview, QueueFilter, QueueFilterPreview, QueuePeriodFilter, QueuePeriodFilterPreview, QueueTypeFilter, QueueTypeFilterPreview, RatedByFilter, RatedByFilterPreview, RatingFromToFilter, RatingFromToFilterPreview, RegionFilter, RegionFilterPreview, ScoreFilter, ScoreFilterPreview, SkillFilter, SkillFilterPreview, StopCauseFilter, StopCauseFilterPreview, SupervisorFilter, SupervisorFilterPreview, TagFilter, TagFilterPreview, TagsFilter, TagsFilterPreview, TalkDurationFilter, TalkDurationFilterPreview, TeamFilter, TeamFilterPreview, TotalDurationFilter, TotalDurationFilterPreview, TriggerJobStateFilter, TriggerJobStateFilterPreview, UserFilter, UserFilterPreview, UtilizationProgressFilter, UtilizationProgressFilterPreview, VariableFilter, VariableFilterPreview, };
|
|
113
115
|
export declare const FilterOptionToValueComponentMap: Record<FilterOption, Component>;
|
|
114
116
|
export declare const FilterOptionToPreviewComponentMap: Record<FilterOption, Component>;
|
|
115
117
|
export declare const FilterOptionToFilterConfigCreatorMap: {
|
|
@@ -627,7 +629,7 @@ export declare const FilterOptionToFilterConfigCreatorMap: {
|
|
|
627
629
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
628
630
|
value: Record<string, unknown>[];
|
|
629
631
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
630
|
-
searchRecords: import("../composables/useFilterReadAccess").GatedFilterSearch<[params: import("@webitel/
|
|
632
|
+
searchRecords: import("../composables/useFilterReadAccess").GatedFilterSearch<[params: import("@webitel/api-services/api/clients/_shared/types").ApiParams], unknown>;
|
|
631
633
|
label?: ReturnType<MessageResolver> | string;
|
|
632
634
|
staticView?: boolean;
|
|
633
635
|
notDeletable: boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
filterConfig?: WtSysTypeFilterConfig;
|
|
4
|
+
disableValidation?: boolean;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_ModelProps = {
|
|
7
|
+
modelValue?: string[];
|
|
8
|
+
};
|
|
9
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:invalid": (args_0: boolean) => any;
|
|
12
|
+
"update:modelValue": (value: string[] | undefined) => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
14
|
+
"onUpdate:invalid"?: ((args_0: boolean) => any) | undefined;
|
|
15
|
+
"onUpdate:modelValue"?: ((value: string[] | undefined) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
value?: string[];
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -55,6 +55,7 @@ export declare const FilterOption: {
|
|
|
55
55
|
readonly JoinedAt: "joinedAt";
|
|
56
56
|
readonly LeavingAt: "leavingAt";
|
|
57
57
|
readonly OfferingAt: "offeringAt";
|
|
58
|
+
readonly StartedAt: "startedAt";
|
|
58
59
|
readonly UploadedAt: "uploadedAt";
|
|
59
60
|
readonly StopCause: "stopCause";
|
|
60
61
|
readonly MemberPriority: "memberPriority";
|
|
@@ -62,6 +63,7 @@ export declare const FilterOption: {
|
|
|
62
63
|
readonly MemberName: "name";
|
|
63
64
|
readonly MemberDestination: "destination";
|
|
64
65
|
readonly CallReportingResult: "result"; /** queue attempt CallReportingStatus */
|
|
66
|
+
readonly TriggerJobState: "triggerJobState";
|
|
65
67
|
readonly Action: "action";
|
|
66
68
|
readonly Object: "object";
|
|
67
69
|
readonly Date: "date";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PermissionGrantee } from '../../types/Permission.types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
role: PermissionGrantee;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_6: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_6) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PermissionGrantee } from '../../types/Permission.types';
|
|
2
|
+
type __VLS_ModelProps = {
|
|
3
|
+
modelValue: PermissionGrantee | null;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: PermissionGrantee | null) => any;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
8
|
+
"onUpdate:modelValue"?: ((value: PermissionGrantee | null) => any) | undefined;
|
|
9
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { DatalistTableHeader } from '../../../types/tableStore.types';
|
|
2
|
+
import type { ChangeAccessModePayload, PermissionEntity, PermissionGrantee } from '../../types/Permission.types';
|
|
3
|
+
import { type PermissionsUserAccess } from '../../types/PermissionsUserAccess';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
dataList: PermissionEntity[];
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
headers: DatalistTableHeader[];
|
|
8
|
+
error?: unknown;
|
|
9
|
+
refresh: () => unknown;
|
|
10
|
+
sort: (column: DatalistTableHeader) => unknown;
|
|
11
|
+
changeAccessMode: (payload: ChangeAccessModePayload) => unknown;
|
|
12
|
+
existingGranteeIds?: PermissionGrantee['id'][];
|
|
13
|
+
addRolePermissions: (role: PermissionGrantee) => Promise<unknown>;
|
|
14
|
+
access?: PermissionsUserAccess;
|
|
15
|
+
};
|
|
16
|
+
declare var __VLS_54: {};
|
|
17
|
+
type __VLS_Slots = {} & {
|
|
18
|
+
pagination?: (props: typeof __VLS_54) => any;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
21
|
+
isLoading: boolean;
|
|
22
|
+
access: PermissionsUserAccess;
|
|
23
|
+
existingGranteeIds: PermissionGrantee["id"][];
|
|
24
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PermissionGrantee } from '../../types/Permission.types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
existingGranteeIds?: PermissionGrantee['id'][];
|
|
4
|
+
addRolePermissions: (role: PermissionGrantee) => Promise<unknown>;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
|
+
existingGranteeIds: PermissionGrantee["id"][];
|
|
8
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type PermissionsUserAccess } from '@webitel/ui-sdk/modules/ObjectPermissions';
|
|
2
1
|
import type { Id } from '@webitel/ui-sdk/src/api/types/ApiModule';
|
|
3
2
|
import type { PermissionsPiniaStore } from '../stores/createPermissionsStore';
|
|
3
|
+
import { type PermissionsUserAccess } from '../types/PermissionsUserAccess';
|
|
4
4
|
type __VLS_Props = {
|
|
5
5
|
store: () => PermissionsPiniaStore;
|
|
6
6
|
access: PermissionsUserAccess;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
interface AccessModeRow {
|
|
3
|
+
access: Record<string, {
|
|
4
|
+
id: number;
|
|
5
|
+
}>;
|
|
6
|
+
}
|
|
7
|
+
/** [Claude] access mode select options, and the rows with a localized name on every rule */
|
|
8
|
+
export declare const useAccessModeOptions: <Row extends AccessModeRow>(dataList: MaybeRefOrGetter<Row[]>) => {
|
|
9
|
+
accessOptions: import("vue").ComputedRef<{
|
|
10
|
+
id: 2 | 1 | 3;
|
|
11
|
+
name: any;
|
|
12
|
+
}[]>;
|
|
13
|
+
localizedDataList: import("vue").ComputedRef<(Row & {
|
|
14
|
+
access: {
|
|
15
|
+
[k: string]: {
|
|
16
|
+
name: any;
|
|
17
|
+
id: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
})[]>;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import PermissionsRoleRow from './components/_internal/permissions-role-row.vue';
|
|
2
|
+
import PermissionsRoleSelect from './components/_internal/permissions-role-select.vue';
|
|
3
|
+
import PermissionsTabContent from './components/_internal/permissions-tab-content.vue';
|
|
4
|
+
import PermissionsRolePopup from './components/_internal/permissions-tab-role-popup.vue';
|
|
5
|
+
import PermissionsTab from './components/permissions-tab.vue';
|
|
6
|
+
/** [Claude] the acl enums and grants logic live in api-services; re-exported to keep permissions in one place */
|
|
7
|
+
export { AccessMode, AccessRuleColumn, AccessRuleName, } from '@webitel/api-services/enums';
|
|
8
|
+
export type { ResolveGrantsParams } from '@webitel/api-services/scripts';
|
|
9
|
+
export { resolveGrants } from '@webitel/api-services/scripts';
|
|
10
|
+
export { useAccessModeOptions } from './composables/useAccessModeOptions';
|
|
11
|
+
export { headers, headersWithCreate } from './stores/_internals/headers';
|
|
12
|
+
export type { PermissionsPiniaStore } from './stores/createPermissionsStore';
|
|
13
|
+
export { createPermissionsStore, permissionsStoreBody, } from './stores/createPermissionsStore';
|
|
14
|
+
export type { ChangeAccessModePayload, PermissionAccessRule, PermissionEntity, PermissionGrantee, PermissionsChange, RawPermissionsApiModule, } from './types/Permission.types';
|
|
15
|
+
export type { PermissionsUserAccess } from './types/PermissionsUserAccess';
|
|
16
|
+
export { DEFAULT_PERMISSIONS_USER_ACCESS } from './types/PermissionsUserAccess';
|
|
17
|
+
export { PermissionsRolePopup, PermissionsRoleRow, PermissionsRoleSelect, PermissionsTab, PermissionsTabContent, };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [Claude] Each rule column keeps its own `field` (`r`, `w`, `d`), so sorting
|
|
3
|
+
* one marks only that column and sends `sort=+r` / `+w` / `+d`. `GET
|
|
4
|
+
* <object>/:id/acl` has no such attributes in `fields` though — it returns the
|
|
5
|
+
* three rules merged into one `granted` string — so `PermissionsApiModule`
|
|
6
|
+
* asks for `granted` in their place.
|
|
7
|
+
*/
|
|
8
|
+
export declare const headers: {
|
|
9
|
+
value: string;
|
|
10
|
+
locale: string;
|
|
11
|
+
field: string;
|
|
12
|
+
show: boolean;
|
|
13
|
+
sort: null;
|
|
14
|
+
}[];
|
|
15
|
+
/** [Claude] object classes OBAC also grants "create" (`x`), right after the grantee */
|
|
16
|
+
export declare const headersWithCreate: {
|
|
17
|
+
value: string;
|
|
18
|
+
locale: string;
|
|
19
|
+
field: string;
|
|
20
|
+
show: boolean;
|
|
21
|
+
sort: null;
|
|
22
|
+
}[];
|
|
@@ -2,7 +2,9 @@ import type { Id } from '@webitel/ui-sdk/src/api/types/ApiModule';
|
|
|
2
2
|
import type { StoreGeneric } from 'pinia';
|
|
3
3
|
import type { useTableStoreConfig } from '../../types/tableStore.types';
|
|
4
4
|
import type { ChangeAccessModePayload, PermissionEntity, RawPermissionsApiModule } from '../types/Permission.types';
|
|
5
|
-
export declare const permissionsStoreBody: (namespace: string, config: useTableStoreConfig<PermissionEntity
|
|
5
|
+
export declare const permissionsStoreBody: (namespace: string, config: useTableStoreConfig<PermissionEntity>,
|
|
6
|
+
/** [Claude] the entity api, whose `patchPermissions` takes acl changes, not a row patch */
|
|
7
|
+
permissionsApi: RawPermissionsApiModule) => {
|
|
6
8
|
parentId: import("vue").Ref<Id | undefined, Id | undefined>;
|
|
7
9
|
initialize: ({ parentId: storeParentId, }?: {
|
|
8
10
|
parentId?: string | number;
|
|
@@ -111,7 +113,7 @@ export declare const permissionsStoreBody: (namespace: string, config: useTableS
|
|
|
111
113
|
loadDataList: ({ withLoading, }?: import("../../types/tableStore.types").LoadDataListOptions) => Promise<void>;
|
|
112
114
|
appendToDataList: () => Promise<void>;
|
|
113
115
|
updateSelected: (value: PermissionEntity[]) => void;
|
|
114
|
-
patchItemProperty: ({ index, path, value, }: import("
|
|
116
|
+
patchItemProperty: ({ index, path, value, }: import("../../..").PatchItemPropertyParams) => Promise<void>;
|
|
115
117
|
deleteEls: (_els: PermissionEntity[]) => Promise<void>;
|
|
116
118
|
resetInfiniteScrollTableParamsToDefaults: () => void;
|
|
117
119
|
updateSearchMode: (newSearch: string) => void;
|
|
@@ -249,7 +251,7 @@ export declare const createPermissionsStore: (namespace: string, config: Omit<us
|
|
|
249
251
|
loadDataList: ({ withLoading, }?: import("../../types/tableStore.types").LoadDataListOptions) => Promise<void>;
|
|
250
252
|
appendToDataList: () => Promise<void>;
|
|
251
253
|
updateSelected: (value: PermissionEntity[]) => void;
|
|
252
|
-
patchItemProperty: ({ index, path, value, }: import("
|
|
254
|
+
patchItemProperty: ({ index, path, value, }: import("../../..").PatchItemPropertyParams) => Promise<void>;
|
|
253
255
|
deleteEls: (_els: PermissionEntity[]) => Promise<void>;
|
|
254
256
|
resetInfiniteScrollTableParamsToDefaults: () => void;
|
|
255
257
|
updateSearchMode: (newSearch: string) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccessRuleName } from '@webitel/
|
|
1
|
+
import type { AccessRuleName } from '@webitel/api-services/enums';
|
|
2
2
|
import type { ApiModule, Id } from '@webitel/ui-sdk/src/api/types/ApiModule';
|
|
3
3
|
export interface PermissionGrantee {
|
|
4
4
|
id: Id;
|
|
@@ -24,7 +24,7 @@ export interface PermissionsChange {
|
|
|
24
24
|
* spread into every card API module (e.g. `...generatePermissionsApi(baseUrl)`).
|
|
25
25
|
*/
|
|
26
26
|
export interface RawPermissionsApiModule {
|
|
27
|
-
getPermissionsList: ApiModule<PermissionEntity>['getList']
|
|
27
|
+
getPermissionsList: NonNullable<ApiModule<PermissionEntity>['getList']>;
|
|
28
28
|
patchPermissions: (payload: {
|
|
29
29
|
id: Id;
|
|
30
30
|
changes: PermissionsChange[];
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import PermissionsTab from './components/permissions-tab.vue';
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
AccessMode,
|
|
5
|
-
AccessRuleName,
|
|
6
|
-
headers,
|
|
7
|
-
PermissionsRolePopup,
|
|
8
|
-
} from '@webitel/ui-sdk/modules/ObjectPermissions';
|
|
9
|
-
|
|
10
|
-
export { PermissionsApiModule } from './scripts/PermissionsApiModule';
|
|
11
|
-
export type { PermissionsPiniaStore } from './stores/createPermissionsStore';
|
|
12
|
-
export {
|
|
13
|
-
createPermissionsStore,
|
|
14
|
-
permissionsStoreBody,
|
|
15
|
-
} from './stores/createPermissionsStore';
|
|
16
|
-
export type {
|
|
17
|
-
PermissionEntity,
|
|
18
|
-
PermissionGrantee,
|
|
19
|
-
PermissionsChange,
|
|
20
|
-
RawPermissionsApiModule,
|
|
21
|
-
} from './types/Permission.types';
|
|
22
|
-
|
|
23
|
-
export { PermissionsTab };
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { AccessRuleName } from '@webitel/ui-sdk/modules/ObjectPermissions/enums';
|
|
2
|
-
import type { TableApiModule } from '../../types/tableStore.types';
|
|
3
|
-
import type {
|
|
4
|
-
PermissionEntity,
|
|
5
|
-
RawPermissionsApiModule,
|
|
6
|
-
} from '../types/Permission.types';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Every card API in api-services/ui-sdk already exposes permissions
|
|
10
|
-
* via `...generatePermissionsApi(baseUrl)` under `getPermissionsList`/`patchPermissions`.
|
|
11
|
-
* This adapts that shape to the generic `ApiModule` contract expected by createTableStore,
|
|
12
|
-
* so no parent API module needs to be rewritten to plug into the permissions store.
|
|
13
|
-
*/
|
|
14
|
-
export const PermissionsApiModule = (
|
|
15
|
-
rawApiModule: RawPermissionsApiModule,
|
|
16
|
-
): TableApiModule<PermissionEntity> => {
|
|
17
|
-
/**
|
|
18
|
-
* [Claude] The rule columns are keyed by their letter (`r`, `w`, `d`), so
|
|
19
|
-
* each sorts on its own, but the endpoint has no such attributes in `fields`:
|
|
20
|
-
* it returns the three rules merged into one `granted` string, asked for once.
|
|
21
|
-
*/
|
|
22
|
-
const toAclFields = (fields?: string[]) => {
|
|
23
|
-
if (!fields) return fields;
|
|
24
|
-
const ruleFields = Object.values(AccessRuleName).filter(
|
|
25
|
-
(rule) => rule !== AccessRuleName.X,
|
|
26
|
-
);
|
|
27
|
-
return [
|
|
28
|
-
...new Set(
|
|
29
|
-
fields
|
|
30
|
-
.filter((field) => field !== 'id')
|
|
31
|
-
.map((field) => (ruleFields.includes(field) ? 'granted' : field)),
|
|
32
|
-
),
|
|
33
|
-
];
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* The table store always asks for `id` (every registry needs it to open or
|
|
38
|
-
* delete a row), but an access rule has no such attribute and the endpoint
|
|
39
|
-
* answers `400 app.search.fields.invalid` — a rule is addressed by its
|
|
40
|
-
* grantee. Rows are patched through the parent id, so nothing here needs it.
|
|
41
|
-
*/
|
|
42
|
-
const getList = ({
|
|
43
|
-
fields,
|
|
44
|
-
...params
|
|
45
|
-
}: {
|
|
46
|
-
fields?: string[];
|
|
47
|
-
} & Record<string, unknown>) =>
|
|
48
|
-
rawApiModule.getPermissionsList?.({
|
|
49
|
-
...params,
|
|
50
|
-
fields: toAclFields(fields),
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
return {
|
|
54
|
-
getList,
|
|
55
|
-
patch: rawApiModule.patchPermissions,
|
|
56
|
-
} as unknown as TableApiModule<PermissionEntity>;
|
|
57
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
-
|
|
3
|
-
import { PermissionsApiModule } from '../PermissionsApiModule';
|
|
4
|
-
|
|
5
|
-
describe('PermissionsApiModule', () => {
|
|
6
|
-
it('asks for one `granted` in place of the rule columns, and never for `id`', async () => {
|
|
7
|
-
const getPermissionsList = vi.fn();
|
|
8
|
-
const { getList } = PermissionsApiModule({
|
|
9
|
-
getPermissionsList,
|
|
10
|
-
} as never);
|
|
11
|
-
|
|
12
|
-
await getList({
|
|
13
|
-
fields: [
|
|
14
|
-
'id',
|
|
15
|
-
'grantee',
|
|
16
|
-
'r',
|
|
17
|
-
'w',
|
|
18
|
-
'd',
|
|
19
|
-
],
|
|
20
|
-
sort: '+w',
|
|
21
|
-
} as never);
|
|
22
|
-
|
|
23
|
-
expect(getPermissionsList).toHaveBeenCalledWith({
|
|
24
|
-
fields: [
|
|
25
|
-
'grantee',
|
|
26
|
-
'granted',
|
|
27
|
-
],
|
|
28
|
-
sort: '+w',
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import PermissionsTab from './components/permissions-tab.vue';
|
|
2
|
-
export { AccessMode, AccessRuleName, headers, PermissionsRolePopup, } from '@webitel/ui-sdk/modules/ObjectPermissions';
|
|
3
|
-
export { PermissionsApiModule } from './scripts/PermissionsApiModule';
|
|
4
|
-
export type { PermissionsPiniaStore } from './stores/createPermissionsStore';
|
|
5
|
-
export { createPermissionsStore, permissionsStoreBody, } from './stores/createPermissionsStore';
|
|
6
|
-
export type { PermissionEntity, PermissionGrantee, PermissionsChange, RawPermissionsApiModule, } from './types/Permission.types';
|
|
7
|
-
export { PermissionsTab };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { TableApiModule } from '../../types/tableStore.types';
|
|
2
|
-
import type { PermissionEntity, RawPermissionsApiModule } from '../types/Permission.types';
|
|
3
|
-
/**
|
|
4
|
-
* Every card API in api-services/ui-sdk already exposes permissions
|
|
5
|
-
* via `...generatePermissionsApi(baseUrl)` under `getPermissionsList`/`patchPermissions`.
|
|
6
|
-
* This adapts that shape to the generic `ApiModule` contract expected by createTableStore,
|
|
7
|
-
* so no parent API module needs to be rewritten to plug into the permissions store.
|
|
8
|
-
*/
|
|
9
|
-
export declare const PermissionsApiModule: (rawApiModule: RawPermissionsApiModule) => TableApiModule<PermissionEntity>;
|