From f15d19e2ae39e663f0f0e5e28bddf6fa71f6b1b8 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Thu, 2 Dec 2021 16:46:34 +0530 Subject: [PATCH] change(ui) - metadata popup --- .../Client/ProfileSettings/ProfileSettings.js | 23 +++++++----- .../Session_/EventsBlock/Metadata/Metadata.js | 37 +++++++++++++------ 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/frontend/app/components/Client/ProfileSettings/ProfileSettings.js b/frontend/app/components/Client/ProfileSettings/ProfileSettings.js index c6fbda5ec..5df0d1aec 100644 --- a/frontend/app/components/Client/ProfileSettings/ProfileSettings.js +++ b/frontend/app/components/Client/ProfileSettings/ProfileSettings.js @@ -11,10 +11,11 @@ import { connect } from 'react-redux'; @withPageTitle('Account - OpenReplay Preferences') @connect(state => ({ account: state.getIn([ 'user', 'account' ]), + isEnterprise: state.getIn([ 'user', 'client', 'edition' ]) === 'ee', })) export default class ProfileSettings extends React.PureComponent { render() { - const { account } = this.props; + const { account, isEnterprise } = this.props; return (
@@ -55,15 +56,19 @@ export default class ProfileSettings extends React.PureComponent {
-
+ { !isEnterprise && ( + <> +
+
+
+

{ 'Data Collection' }

+
{ 'Enables you to control how OpenReplay captures data on your organization’s usage to improve our product.' }
+
+
+
+ + )} -
-
-

{ 'Data Collection' }

-
{ 'Enables you to control how OpenReplay captures data on your organization’s usage to improve our product.' }
-
-
-
{ account.license && ( <>
diff --git a/frontend/app/components/Session_/EventsBlock/Metadata/Metadata.js b/frontend/app/components/Session_/EventsBlock/Metadata/Metadata.js index 6d24be57b..8b26459f3 100644 --- a/frontend/app/components/Session_/EventsBlock/Metadata/Metadata.js +++ b/frontend/app/components/Session_/EventsBlock/Metadata/Metadata.js @@ -1,6 +1,6 @@ import React, { useCallback, useState } from 'react'; import { connect } from 'react-redux'; -import { NoContent, IconButton } from 'UI'; +import { NoContent, IconButton, Popup } from 'UI'; import withToggle from 'HOCs/withToggle'; import MetadataItem from './MetadataItem'; import stl from './metadata.css'; @@ -9,19 +9,32 @@ export default connect(state => ({ metadata: state.getIn([ 'sessions', 'current', 'metadata' ]), }))(function Metadata ({ metadata }) { const [ visible, setVisible ] = useState(false); - const toggle = useCallback(() => setVisible(v => !v), []); + const toggle = useCallback(() => metadata.size > 0 && setVisible(v => !v), []); return ( <> - + } + content={ +
+ Metadata must be explicitly specified from the dashboard from Preferences > Metadata. +
+ } + on="click" + disabled={metadata.length > 0} + size="tiny" + inverted + position="top center" /> { visible &&