Chore: remove comments feature (#64644)

This commit is contained in:
Ryan McKinley
2023-03-11 04:28:12 -08:00
committed by GitHub
parent 18e3e0ca8d
commit d5a9a0cea0
30 changed files with 2 additions and 1262 deletions

View File

@@ -25,7 +25,6 @@ import { useAppNotification } from 'app/core/copy/appNotification';
import { appEvents } from 'app/core/core';
import { useBusEvent } from 'app/core/hooks/useBusEvent';
import { t, Trans } from 'app/core/internationalization';
import { DashboardCommentsModal } from 'app/features/dashboard/components/DashboardComments/DashboardCommentsModal';
import { SaveDashboardDrawer } from 'app/features/dashboard/components/SaveDashboard/SaveDashboardDrawer';
import { ShareModal } from 'app/features/dashboard/components/ShareModal';
import { playlistSrv } from 'app/features/playlist/PlaylistSrv';
@@ -244,26 +243,6 @@ export const DashNav = React.memo<Props>((props) => {
);
}
if (dashboard.uid && config.featureToggles.dashboardComments) {
buttons.push(
<ModalsController key="button-dashboard-comments">
{({ showModal, hideModal }) => (
<DashNavButton
tooltip={t('dashboard.toolbar.comments-show', 'Show dashboard comments')}
icon="comment-alt-message"
iconSize="lg"
onClick={() => {
showModal(DashboardCommentsModal, {
dashboard,
onDismiss: hideModal,
});
}}
/>
)}
</ModalsController>
);
}
addCustomContent(customLeftActions, buttons);
return buttons;
};

View File

@@ -1,30 +0,0 @@
import { css } from '@emotion/css';
import React from 'react';
import { GrafanaTheme2 } from '@grafana/data';
import { Modal, useStyles2 } from '@grafana/ui';
import { CommentManager } from 'app/features/comments/CommentManager';
import { DashboardModel } from '../../state/DashboardModel';
type Props = {
dashboard: DashboardModel;
onDismiss: () => void;
};
export const DashboardCommentsModal = ({ dashboard, onDismiss }: Props) => {
const styles = useStyles2(getStyles);
return (
<Modal isOpen={true} title="Dashboard comments" icon="save" onDismiss={onDismiss} className={styles.modal}>
<CommentManager objectType={'dashboard'} objectId={dashboard.uid} />
</Modal>
);
};
const getStyles = (theme: GrafanaTheme2) => ({
modal: css`
width: 500px;
height: 60vh;
`,
});