Skip to content
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

Add a learn more flyout to the collaborators page #9145

Merged
merged 9 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions changelogs/fragments/9145.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Add a "Learn More" flyout providing additional information to the collaborators page. ([#9145](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9145))
7 changes: 5 additions & 2 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,10 @@ export class DocLinksService {
advancedSettings: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}management/advanced-settings/`,
},
workspace: {
// https://opensearch.org/docs/latest/dashboards/workspace/workspace-acl/
acl: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}workspace/workspace-acl/`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to delete this entry?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a mistake. It should be removed in this pr but I forgot it. So I remove it here.

// https://opensearch.org/docs/latest/dashboards/workspace/workspace-acl/#defining-workspace-collaborators
collaborators: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}workspace/workspace-acl/#defining-workspace-collaborators`,
// https://opensearch.org/docs/latest/dashboards/workspace/workspace-acl/#workspace-privacy
privacy: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}workspace/workspace-acl/#workspace-privacy`,
},
},
noDocumentation: {
Expand Down Expand Up @@ -854,6 +856,7 @@ export interface DocLinksStart {
readonly visualize: Record<string, string>;
readonly dashboards: Record<string, string>;
readonly management: Record<string, string>;
readonly workspace: Record<string, string>;
};
readonly noDocumentation: {
readonly auditbeat: string;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import React from 'react';
import React, { useState } from 'react';
import { EuiPage, EuiPanel, EuiSpacer } from '@elastic/eui';
import { i18n } from '@osd/i18n';

Expand All @@ -14,6 +14,7 @@
import {
NavigationPublicPluginStart,
TopNavControlDescriptionData,
TopNavControlLinkData,
} from '../../../../navigation/public';
import { WorkspacePermissionSetting } from '../workspace_form/types';
import { WorkspaceCollaboratorTable } from '../workspace_form/workspace_collaborator_table';
Expand All @@ -25,6 +26,7 @@
} from '../workspace_form';
import { WorkspaceAttributeWithPermission } from '../../../../../core/types';
import { WorkspaceClient } from '../../workspace_client';
import { WorkspacePrivacyFlyout } from '../workspace_form/workspace_privacy_flyout';
import { WorkspaceCollaboratorPrivacySettingPanel } from '../workspace_form/workspace_collaborator_privacy_setting_panel';

export const WorkspaceCollaborators = () => {
Expand All @@ -43,6 +45,8 @@
collaboratorTypes: WorkspaceCollaboratorTypesService;
workspaceClient: WorkspaceClient;
}>();

const [isPrivacyFlyoutVisible, setIsPrivacyFlyoutVisible] = useState(false);
const displayedCollaboratorTypes = useObservable(collaboratorTypes.getTypes$()) ?? [];

const currentWorkspace = useObservable(
Expand Down Expand Up @@ -90,6 +94,10 @@
if (!currentWorkspace || !isPermissionEnabled) {
return null;
}

const handleLearnMoreClick = (targetElement: HTMLElement) => {
setIsPrivacyFlyoutVisible((value) => !value);

Check warning on line 99 in src/plugins/workspace/public/components/workspace_collaborators/workspace_collaborators.tsx

View check run for this annotation

Codecov / codecov/patch

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

Added line #L99 was not covered by tests
};
return (
<EuiPage data-test-subj="workspace-collaborators-panel">
<HeaderControl
Expand All @@ -98,6 +106,13 @@
description: i18n.translate('workspace.collaborators.description', {
defaultMessage: 'Manage workspace access and permissions.',
}),
links: {
label: i18n.translate('workspace.form.panels.collaborator.learnMore', {
defaultMessage: 'Learn more',
}),
controlType: 'link',
run: handleLearnMoreClick,
} as TopNavControlLinkData,
} as TopNavControlDescriptionData,
]}
setMountPoint={application.setAppDescriptionControls}
Expand Down Expand Up @@ -130,6 +145,9 @@
/>
</EuiPanel>
</div>
{isPrivacyFlyoutVisible && (
<WorkspacePrivacyFlyout onClose={() => setIsPrivacyFlyoutVisible(false)} />

Check warning on line 149 in src/plugins/workspace/public/components/workspace_collaborators/workspace_collaborators.tsx

View check run for this annotation

Codecov / codecov/patch

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

Added line #L149 was not covered by tests
)}
</EuiPage>
);
};
Loading
Loading