Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
483d6b1
add types
YankinA Oct 15, 2025
b9d08a5
AccessDialog
YankinA Oct 28, 2025
a493146
add MultiSelectInputInput
YankinA Oct 30, 2025
48a0959
add access dialog func and component
YankinA Nov 5, 2025
a25d23b
add new access roles translations
YankinA Nov 6, 2025
3d903e5
adding renderSubject prop for custom subject rendering
YankinA Nov 7, 2025
ea355a9
add invite types
YankinA Nov 9, 2025
04f2872
refactor organization manager actions and update invitation types
YankinA Nov 10, 2025
efa2dab
add displayName property to SubjectClaims interface and export invita…
YankinA Nov 11, 2025
6c025f5
implement invitation management features including resend and delete …
YankinA Nov 11, 2025
9e5bc17
add EnableNewAccessDialog feature and integrate into useActions
YankinA Nov 12, 2025
48ddffb
Merge branch 'main' into CHARTS-11939-access-dialog
YankinA Nov 12, 2025
e03605e
Update locale and add updateAccessBindings action to organization man…
YankinA Nov 13, 2025
6b8d805
add description invitation sending in IAM access dialog
YankinA Nov 13, 2025
4153569
Add optional iconSlot property to AclSubjectProps type
YankinA Nov 13, 2025
07bcd61
Remove MultiSelectInput component
YankinA Nov 14, 2025
420887a
Refactor access dialog handling to support new access dialog feature …
YankinA Nov 17, 2025
6b9def7
Add new localization keys for author and public access features
YankinA Nov 20, 2025
faeacb8
Remove unused OpenAccessDialog type
YankinA Nov 25, 2025
4a5d280
move AclSubjectSelect to extensions
YankinA Nov 25, 2025
848e274
Remove AclSubjectSelect from regestry
YankinA Nov 26, 2025
382d424
Merge branch 'main' into CHARTS-11939-access-dialog
YankinA Nov 26, 2025
4fa0051
Fix merge
YankinA Nov 26, 2025
cc49287
Remove keys from i18n
YankinA Nov 27, 2025
526439a
rename 'canUpdate' to 'canUpdateAccessBindings'
YankinA Nov 28, 2025
b427809
fix displayName type
YankinA Nov 30, 2025
e0b06bf
fix after review
YankinA Dec 3, 2025
3594ab3
Merge branch 'main' into CHARTS-11939-access-dialog
YankinA Dec 10, 2025
a5d7ffc
fix lint
YankinA Dec 10, 2025
5a31d69
Remove unused text
YankinA Dec 10, 2025
3fa9403
Remove unused translation key from IAM access dialog
YankinA Dec 10, 2025
750bd04
Merge branch 'main' into CHARTS-11939-access-dialog
YankinA Dec 10, 2025
9982a00
remove unused code
YankinA Dec 10, 2025
45a5b48
move invite types to extensions
YankinA Dec 10, 2025
13926ab
restore unused componet
YankinA Dec 10, 2025
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {Feature} from '../../../../shared';
import {createFeatureConfig} from '../utils';

export default createFeatureConfig({
name: Feature.EnableNewAccessDialog,
state: {
development: false,
production: false,
},
});
11 changes: 11 additions & 0 deletions src/shared/schema/extensions/actions/iam-access-dialog.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {createAction} from '../../gateway-utils';
import type {GetDatalensOperationResponse} from '../../us/types/operations';
import type {
BatchListAccessBindingsArgs,
BatchListAccessBindingsResponse,
BatchListMembersArgs,
BatchListMembersResponse,
GetClaimsArgs,
Expand Down Expand Up @@ -53,4 +55,13 @@ export const iamAccessDialogActions = {
batchListMembers: createAction<BatchListMembersResponse, BatchListMembersArgs>(async () => {
return {members: [], nextPageToken: ''};
}),
batchListAccessBindings: createAction<
BatchListAccessBindingsResponse,
BatchListAccessBindingsArgs
>(async () => {
return {
subjectsWithBindings: [],
nextPageToken: '',
};
}),
};
41 changes: 41 additions & 0 deletions src/shared/schema/extensions/types/iam-access-dialog.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {Lang} from '../../..';

export enum AccessServiceResourceType {
Organization = 'organization-manager.organization',
Collection = 'datalens.collection',
Workbook = 'datalens.workbook',
}
Expand All @@ -20,6 +21,7 @@ export enum SubjectType {
}

export enum ClaimsSubjectType {
Unspecified = 'SUBJECT_TYPE_UNSPECIFIED',
UserAccount = 'USER_ACCOUNT',
Group = 'GROUP',
Invitee = 'INVITEE',
Expand Down Expand Up @@ -122,6 +124,7 @@ export interface SubjectClaims {
pictureData?: string;
picture?: string;
idpType?: string | null;
displayName?: string;
}

export type SubjectDetails = {
Expand All @@ -146,3 +149,41 @@ export type BatchListMembersResponse = {
members: SubjectClaims[];
nextPageToken: string;
};

export interface BatchListAccessBindingsResponse {
subjectsWithBindings: SubjectWithBindings[];
nextPageToken: string;
}

export interface SubjectWithBindings {
subjectClaims: SubjectClaims;
accessBindings: InheritedAccessBindings[];
inheritedAccessBindings: InheritedAccessBindings[];
}

export interface InheritedAccessBindings {
roleId: string;
inheritedFrom: AccessBindingsResource | null;
}

export interface AccessBindingsResource {
id: string;
type: string;
}

export type BatchListAccessBindingsArgs = {
resourcePath: AccessBindingsResource[];
getInheritedBindings?: boolean;
filter?: string;
pageSize?: number;
pageToken?: string;
};

export enum ResourceType {
Collection = 'collection',
Workbook = 'workbook',
}

export type UpdateAccessBindingsRequest = {
accessBindingDeltas: AccessBindingDelta[];
};
3 changes: 3 additions & 0 deletions src/shared/types/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export enum Feature {
EnableSharedEntries = 'EnableSharedEntries',

EnableMobileFixedHeader = 'EnableMobileFixedHeader',

/** enabled redesign/moving to drawers existing settings */
EnableCommonChartDashSettings = 'EnableCommonChartDashSettings',
/** Enable a setting in the Selector settings dialog that allows you to make the selector pass-through for all or several tabs */
Expand All @@ -101,6 +102,8 @@ export enum Feature {
EnableNewDashSettings = 'EnableNewDashSettings',
/** Shows updated settings page */
EnableNewServiceSettings = 'EnableNewServiceSettings',
/** Enable new access dialog (AccessDialog) */
EnableNewAccessDialog = 'EnableNewAccessDialog',
}

export type FeatureConfig = Record<string, boolean>;
8 changes: 8 additions & 0 deletions src/ui/components/AccessDialog/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type {AccessDialogProps} from 'ui/registry/units/common/types/components/AccessDialog';

export const DIALOG_ACCESS = Symbol('DIALOG_ACCESS');

export type OpenDialogAccessDialogArgs = {
id: typeof DIALOG_ACCESS;
props: AccessDialogProps;
};
2 changes: 2 additions & 0 deletions src/ui/registry/units/common/components-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {makeDefaultEmpty} from '../../components/DefaultEmpty';

import {Example} from './components/Example/Example';
import {EXAMPLE_COMPONENT} from './constants/components';
import type {AccessDialogProps} from './types/components/AccessDialog';
import type {AccessRightsProps} from './types/components/AccessRights';
import type {AccessRightsUrlOpenProps} from './types/components/AccessRightsUrlOpen';
import type {AclSubjectProps} from './types/components/AclSubject';
Expand Down Expand Up @@ -66,4 +67,5 @@ export const commonComponentsMap = {
WorkbookEntriesTableTabs: makeDefaultEmpty<WorkbookEntriesTableTabsProps>(),
WorkbookEntryExtended: makeDefaultEmpty<WorkbookEntriesTableTabsProps>(),
DialogEntryDescription: makeDefaultEmpty<DialogEntryDescriptionProps>(),
AccessDialog: makeDefaultEmpty<AccessDialogProps>(),
} as const;
9 changes: 9 additions & 0 deletions src/ui/registry/units/common/types/components/AccessDialog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export type AccessDialogProps = {
entryId?: string;
workbookId?: string;
collectionId?: string;
resourceTitle?: string;
canUpdateAccessBindings: boolean;
onClose?: () => void;
defaultTab?: string;
};
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
export type UseSubjectsListId = {type: 'organizationId' | 'cloudId'; id: string | undefined};
export type UseSubjectsListId = {
type: 'organizationId' | 'cloudId';
id: string | undefined;
title: string | undefined;
};
3 changes: 3 additions & 0 deletions src/ui/store/actions/openDialogTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import type {OpenDialogExportWorkbookArgs} from 'ui/components/CollectionsStruct
import type {OpenDialogDefaultArgs} from 'ui/components/DialogDefault/DialogDefault';
import type {OpenDialogCreatePublicGalleryWorkbookArgs} from 'ui/components/CollectionsStructure/CreatePublicGalleryWorkbookDialog';
import type {OpenDialogEntryDescriptionArgs} from 'ui/components/DialogEntryDescription/DialogEntryDescriptionWrapper';
import type {OpenDialogAccessDialogArgs} from 'ui/components/AccessDialog';
import type {OpenDialogSharedEntryBindingArgs} from 'ui/components/DialogSharedEntryBindings/DialogSharedEntryBindings';
import type {OpenDialogSharedEntryUnbindArgs} from 'ui/components/DialogSharedEntryUnbind/DialogSharedEntryUnbind';
import type {OpenDialogSharedEntryPermissionsArgs} from 'ui/components/DialogSharedEntryPermissions/DialogSharedEntryPermissions';
Expand Down Expand Up @@ -126,6 +127,8 @@ export type OpenDialogArgs<T = unknown> =
| OpenDialogExportWorkbookArgs
| OpenDialogDefaultArgs
| OpenDialogCreatePublicGalleryWorkbookArgs
| OpenDialogEntryDescriptionArgs
| OpenDialogAccessDialogArgs
| OpenDialogSharedEntryBindingArgs
| OpenDialogSharedEntryUnbindArgs
| OpenDialogSharedEntryPermissionsArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {I18n} from 'i18n';
import {useDispatch} from 'react-redux';
import {useHistory} from 'react-router-dom';
import {WORKBOOK_STATUS} from 'shared/constants/workbooks';
import {DIALOG_ACCESS} from 'ui/components/AccessDialog';
import {DIALOG_EXPORT_WORKBOOK} from 'ui/components/CollectionsStructure/ExportWorkbookDialog/ExportWorkbookDialog';
import {DIALOG_SHARED_ENTRY_BINDINGS} from 'ui/components/DialogSharedEntryBindings/DialogSharedEntryBindings';
import {isEnabledFeature} from 'ui/utils/isEnabledFeature';
Expand Down Expand Up @@ -49,6 +50,31 @@ type UseActionsArgs = {
onCloseMoveDialog: (structureChanged: boolean) => void;
};

const openAccessDialog = (
dispatch: AppDispatch,
params: {
collectionId?: string;
workbookId?: string;
resourceTitle?: string;
canUpdateAccessBindings?: boolean;
},
) => {
dispatch(
openDialog({
id: DIALOG_ACCESS,
props: {
collectionId: params.collectionId,
workbookId: params.workbookId,
resourceTitle: params.resourceTitle,
canUpdateAccessBindings: params.canUpdateAccessBindings ?? false,
onClose: () => {
dispatch(closeDialog());
},
},
}),
);
};

export const useActions = ({fetchStructureItems, onCloseMoveDialog}: UseActionsArgs) => {
const collectionsAccessEnabled = isEnabledFeature(Feature.CollectionsAccessEnabled);

Expand Down Expand Up @@ -115,25 +141,34 @@ export const useActions = ({fetchStructureItems, onCloseMoveDialog}: UseActionsA
}

if (collectionsAccessEnabled && item.permissions.listAccessBindings) {
const isNewAccessDialogEnabled = isEnabledFeature(Feature.EnableNewAccessDialog);
actions.push({
text: <DropdownAction icon={LockOpen} text={i18n('action_access')} />,
action: () => {
dispatch(
openDialog({
id: DIALOG_IAM_ACCESS,
props: {
open: true,
resourceId: item.collectionId,
resourceType: ResourceType.Collection,
resourceTitle: item.title,
parentId: item.parentId,
canUpdate: item.permissions.updateAccessBindings,
onClose: () => {
dispatch(closeDialog());
if (isNewAccessDialogEnabled) {
openAccessDialog(dispatch, {
collectionId: item?.collectionId ?? undefined,
resourceTitle: item?.title,
canUpdateAccessBindings: item?.permissions.updateAccessBindings,
});
} else {
dispatch(
openDialog({
id: DIALOG_IAM_ACCESS,
props: {
open: true,
resourceId: item.collectionId,
resourceType: ResourceType.Collection,
resourceTitle: item.title,
parentId: item.parentId,
canUpdate: item.permissions.updateAccessBindings,
onClose: () => {
dispatch(closeDialog());
},
},
},
}),
);
}),
);
}
},
});
}
Expand Down Expand Up @@ -293,25 +328,35 @@ export const useActions = ({fetchStructureItems, onCloseMoveDialog}: UseActionsA
}

if (collectionsAccessEnabled && item.permissions.listAccessBindings) {
const isNewAccessDialogEnabled = isEnabledFeature(Feature.EnableNewAccessDialog);
actions.push({
text: <DropdownAction icon={LockOpen} text={i18n('action_access')} />,
action: () => {
dispatch(
openDialog({
id: DIALOG_IAM_ACCESS,
props: {
open: true,
resourceId: item.workbookId,
resourceType: ResourceType.Workbook,
resourceTitle: item.title,
parentId: item.collectionId,
canUpdate: item.permissions.updateAccessBindings,
onClose: () => {
dispatch(closeDialog());
if (isNewAccessDialogEnabled) {
openAccessDialog(dispatch, {
workbookId: item?.workbookId ?? undefined,
collectionId: item?.collectionId ?? undefined,
resourceTitle: item?.title,
canUpdateAccessBindings: item?.permissions.updateAccessBindings,
});
} else {
dispatch(
openDialog({
id: DIALOG_IAM_ACCESS,
props: {
open: true,
resourceId: item.workbookId,
resourceType: ResourceType.Workbook,
resourceTitle: item.title,
parentId: item.collectionId,
canUpdate: item.permissions.updateAccessBindings,
onClose: () => {
dispatch(closeDialog());
},
},
},
}),
);
}),
);
}
},
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import block from 'bem-cn-lite';
import {I18n} from 'i18n';
import {batch, useDispatch, useSelector} from 'react-redux';
import {useHistory} from 'react-router-dom';
import {DIALOG_ACCESS} from 'ui/components/AccessDialog';
import {getParentCollectionPath} from 'ui/units/collections-navigation/utils';
import {isEnabledFeature} from 'ui/utils/isEnabledFeature';

Expand Down Expand Up @@ -259,24 +260,47 @@ export const useLayout = ({
}}
onEditAccessClick={() => {
if (collectionsAccessEnabled && curCollectionId && collection) {
dispatch(
openDialog({
id: DIALOG_IAM_ACCESS,
props: {
open: true,
resourceId: collection.collectionId,
resourceType: ResourceType.Collection,
resourceTitle: collection.title,
parentId: collection.parentId,
canUpdate: Boolean(
collection.permissions?.updateAccessBindings,
),
onClose: () => {
dispatch(closeDialog());
},
},
}),
const isNewAccessDialogEnabled = isEnabledFeature(
Feature.EnableNewAccessDialog,
);
if (isNewAccessDialogEnabled) {
dispatch(
openDialog({
id: DIALOG_ACCESS,
props: {
collectionId: collection.collectionId,
resourceTitle: collection.title,
canUpdateAccessBindings: Boolean(
collection.permissions
?.updateAccessBindings,
),
onClose: () => {
dispatch(closeDialog());
},
},
}),
);
} else {
dispatch(
openDialog({
id: DIALOG_IAM_ACCESS,
props: {
open: true,
resourceId: collection.collectionId,
resourceType: ResourceType.Collection,
resourceTitle: collection.title,
parentId: collection.parentId,
canUpdate: Boolean(
collection.permissions
?.updateAccessBindings,
),
onClose: () => {
dispatch(closeDialog());
},
},
}),
);
}
}
}}
/>
Expand Down
Loading
Loading