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 5 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: 7 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,12 @@ export class DocLinksService {
// https://opensearch.org/docs/latest/dashboards/management/advanced-settings/
advancedSettings: `${OPENSEARCH_DASHBOARDS_VERSIONED_DOCS}management/advanced-settings/`,
},
workspace: {
// 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: {
auditbeat: `${OPENSEARCH_WEBSITE_DOCS}tools/index/#downloads`,
Expand Down Expand Up @@ -850,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 } 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';

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

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

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

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

Check warning on line 98 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#L98

Added line #L98 was not covered by tests
};
return (
<EuiPage data-test-subj="workspace-collaborators-panel">
<HeaderControl
Expand All @@ -99,6 +106,13 @@
defaultMessage: 'Manage workspace access and permissions.',
}),
} as TopNavControlDescriptionData,
{
label: i18n.translate('workspace.form.panels.collaborator.learnMore', {
defaultMessage: 'Learn more',
}),
controlType: 'link',
run: handleLearnMoreClick,
} as TopNavControlLinkData,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be part of description?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Thank you for the reminder!

]}
setMountPoint={application.setAppDescriptionControls}
/>
Expand All @@ -123,6 +137,9 @@
handleSubmitPermissionSettings={handleSubmitPermissionSettings}
/>
</EuiPanel>
{isPrivacyFlyoutVisible && (
<WorkspacePrivacyFlyout onClose={() => setIsPrivacyFlyoutVisible(false)} />

Check warning on line 141 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#L141

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