-
Notifications
You must be signed in to change notification settings - Fork 69
Workbook access dialog legacy #3022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
YankinA
wants to merge
39
commits into
main
Choose a base branch
from
CHARTS-11939-access-dialog
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
483d6b1
add types
YankinA b9d08a5
AccessDialog
YankinA a493146
add MultiSelectInputInput
YankinA 48a0959
add access dialog func and component
YankinA a25d23b
add new access roles translations
YankinA 3d903e5
adding renderSubject prop for custom subject rendering
YankinA ea355a9
add invite types
YankinA 04f2872
refactor organization manager actions and update invitation types
YankinA efa2dab
add displayName property to SubjectClaims interface and export invita…
YankinA 6c025f5
implement invitation management features including resend and delete …
YankinA 9e5bc17
add EnableNewAccessDialog feature and integrate into useActions
YankinA 48ddffb
Merge branch 'main' into CHARTS-11939-access-dialog
YankinA e03605e
Update locale and add updateAccessBindings action to organization man…
YankinA 6b8d805
add description invitation sending in IAM access dialog
YankinA 4153569
Add optional iconSlot property to AclSubjectProps type
YankinA 07bcd61
Remove MultiSelectInput component
YankinA 420887a
Refactor access dialog handling to support new access dialog feature …
YankinA 6b9def7
Add new localization keys for author and public access features
YankinA faeacb8
Remove unused OpenAccessDialog type
YankinA 4a5d280
move AclSubjectSelect to extensions
YankinA 848e274
Remove AclSubjectSelect from regestry
YankinA 382d424
Merge branch 'main' into CHARTS-11939-access-dialog
YankinA 4fa0051
Fix merge
YankinA cc49287
Remove keys from i18n
YankinA 526439a
rename 'canUpdate' to 'canUpdateAccessBindings'
YankinA b427809
fix displayName type
YankinA e0b06bf
fix after review
YankinA 3594ab3
Merge branch 'main' into CHARTS-11939-access-dialog
YankinA a5d7ffc
fix lint
YankinA 5a31d69
Remove unused text
YankinA 3fa9403
Remove unused translation key from IAM access dialog
YankinA 750bd04
Merge branch 'main' into CHARTS-11939-access-dialog
YankinA 9982a00
remove unused code
YankinA 45a5b48
move invite types to extensions
YankinA 13926ab
restore unused componet
YankinA b356819
Add useOrganizationData type and update functions map
YankinA 57c59dc
Merge branch 'main' into CHARTS-11939-access-dialog
YankinA 7a9eed1
hide old dialogs from entry menu
YankinA b6bc0a9
Merge branch 'CHARTS-11939-access-dialog' of github.com:datalens-tech…
YankinA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
src/server/components/features/features-list/EnableNewAccessDialog.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, | ||
| }, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/ui/registry/units/common/types/components/AccessDialog.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }; |
4 changes: 4 additions & 0 deletions
4
src/ui/registry/units/common/types/functions/useOrganizationData.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| export type UseOrganizationData = { | ||
| id: string | undefined; | ||
| title: string | undefined; | ||
| }; |
5 changes: 4 additions & 1 deletion
5
src/ui/registry/units/common/types/functions/useSubjectsListId.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| export type UseSubjectsListId = {type: 'organizationId' | 'cloudId'; id: string | undefined}; | ||
| export type UseSubjectsListId = { | ||
| type: 'organizationId' | 'cloudId'; | ||
| id: string | undefined; | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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'; | ||
|
|
@@ -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); | ||
|
|
||
|
|
@@ -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, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| 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()); | ||
| }, | ||
| }, | ||
| }, | ||
| }), | ||
| ); | ||
| }), | ||
| ); | ||
| } | ||
mournfulCoroner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }); | ||
| } | ||
|
|
@@ -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, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| 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()); | ||
| }, | ||
| }, | ||
| }, | ||
| }), | ||
| ); | ||
| }), | ||
| ); | ||
| } | ||
| }, | ||
| }); | ||
| } | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type is used to receive the params needed to retrieve a list of subjects. The
titleis not required for that. Don't mix logic for different purposes.