Skip to content

Commit e401613

Browse files
Add a learn more flyout to the collaborators page (opensearch-project#9145)
* Add a learn more flyout to the collaborators page Signed-off-by: Kapian1234 <[email protected]> * Changeset file for PR opensearch-project#9145 created/updated * Update the link Signed-off-by: Kapian1234 <[email protected]> * Update snapshots Signed-off-by: Kapian1234 <[email protected]> * Modify flyout size Signed-off-by: Kapian1234 <[email protected]> * Update collaborators description Signed-off-by: Kapian1234 <[email protected]> * Move learn_more link into the description Signed-off-by: Kapian1234 <[email protected]> --------- Signed-off-by: Kapian1234 <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
1 parent 32b0602 commit e401613

File tree

9 files changed

+596
-19
lines changed

9 files changed

+596
-19
lines changed

changelogs/fragments/9145.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
feat:
2+
- Add a "Learn More" flyout providing additional information to the collaborators page. ([#9145](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9145))

src/core/public/doc_links/doc_links_service.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,10 @@ export class DocLinksService {
437437
advancedSettings: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}management/advanced-settings/`,
438438
},
439439
workspace: {
440-
// https://opensearch.org/docs/latest/dashboards/workspace/workspace-acl/
441-
acl: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}workspace/workspace-acl/`,
440+
// https://opensearch.org/docs/latest/dashboards/workspace/workspace-acl/#defining-workspace-collaborators
441+
collaborators: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}workspace/workspace-acl/#defining-workspace-collaborators`,
442+
// https://opensearch.org/docs/latest/dashboards/workspace/workspace-acl/#workspace-privacy
443+
privacy: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}workspace/workspace-acl/#workspace-privacy`,
442444
},
443445
},
444446
noDocumentation: {
@@ -854,6 +856,7 @@ export interface DocLinksStart {
854856
readonly visualize: Record<string, string>;
855857
readonly dashboards: Record<string, string>;
856858
readonly management: Record<string, string>;
859+
readonly workspace: Record<string, string>;
857860
};
858861
readonly noDocumentation: {
859862
readonly auditbeat: string;

src/plugins/advanced_settings/public/management_app/__snapshots__/advanced_settings.test.tsx.snap

+16-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/dashboard/public/application/components/dashboard_top_nav/__snapshots__/dashboard_top_nav.test.tsx.snap

+12-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/data/public/ui/query_editor/__snapshots__/language_selector.test.tsx.snap

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/workspace/public/components/workspace_collaborators/workspace_collaborators.tsx

+19-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import React from 'react';
6+
import React, { useState } from 'react';
77
import { EuiPage, EuiPanel, EuiSpacer } from '@elastic/eui';
88
import { i18n } from '@osd/i18n';
99

@@ -14,6 +14,7 @@ import { CoreStart } from '../../../../../core/public';
1414
import {
1515
NavigationPublicPluginStart,
1616
TopNavControlDescriptionData,
17+
TopNavControlLinkData,
1718
} from '../../../../navigation/public';
1819
import { WorkspacePermissionSetting } from '../workspace_form/types';
1920
import { WorkspaceCollaboratorTable } from '../workspace_form/workspace_collaborator_table';
@@ -25,6 +26,7 @@ import {
2526
} from '../workspace_form';
2627
import { WorkspaceAttributeWithPermission } from '../../../../../core/types';
2728
import { WorkspaceClient } from '../../workspace_client';
29+
import { WorkspacePrivacyFlyout } from '../workspace_form/workspace_privacy_flyout';
2830
import { WorkspaceCollaboratorPrivacySettingPanel } from '../workspace_form/workspace_collaborator_privacy_setting_panel';
2931

3032
export const WorkspaceCollaborators = () => {
@@ -43,6 +45,8 @@ export const WorkspaceCollaborators = () => {
4345
collaboratorTypes: WorkspaceCollaboratorTypesService;
4446
workspaceClient: WorkspaceClient;
4547
}>();
48+
49+
const [isPrivacyFlyoutVisible, setIsPrivacyFlyoutVisible] = useState(false);
4650
const displayedCollaboratorTypes = useObservable(collaboratorTypes.getTypes$()) ?? [];
4751

4852
const currentWorkspace = useObservable(
@@ -90,6 +94,10 @@ export const WorkspaceCollaborators = () => {
9094
if (!currentWorkspace || !isPermissionEnabled) {
9195
return null;
9296
}
97+
98+
const handleLearnMoreClick = (targetElement: HTMLElement) => {
99+
setIsPrivacyFlyoutVisible((value) => !value);
100+
};
93101
return (
94102
<EuiPage data-test-subj="workspace-collaborators-panel">
95103
<HeaderControl
@@ -98,6 +106,13 @@ export const WorkspaceCollaborators = () => {
98106
description: i18n.translate('workspace.collaborators.description', {
99107
defaultMessage: 'Manage workspace access and permissions.',
100108
}),
109+
links: {
110+
label: i18n.translate('workspace.form.panels.collaborator.learnMore', {
111+
defaultMessage: 'Learn more',
112+
}),
113+
controlType: 'link',
114+
run: handleLearnMoreClick,
115+
} as TopNavControlLinkData,
101116
} as TopNavControlDescriptionData,
102117
]}
103118
setMountPoint={application.setAppDescriptionControls}
@@ -130,6 +145,9 @@ export const WorkspaceCollaborators = () => {
130145
/>
131146
</EuiPanel>
132147
</div>
148+
{isPrivacyFlyoutVisible && (
149+
<WorkspacePrivacyFlyout onClose={() => setIsPrivacyFlyoutVisible(false)} />
150+
)}
133151
</EuiPage>
134152
);
135153
};

0 commit comments

Comments
 (0)