From d733f8131f93a071523d0ec4f93acc2a68c83e9f Mon Sep 17 00:00:00 2001 From: Paco Estevez Garcia Date: Tue, 20 Oct 2020 10:48:18 -0700 Subject: [PATCH] Immutable timeline Summary: Removes the "Set current" button if the timeline isn't editable Note that the styling does weird stuff to colors when a field is set as not editable Differential Revision: D24419006 fbshipit-source-id: 84dcee2e04d5ed7ebb3dc0255e99d1756f195284 --- .../data-inspector/DataDescription.tsx | 1 + .../data-inspector/TimelineDataDescription.tsx | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/desktop/app/src/ui/components/data-inspector/DataDescription.tsx b/desktop/app/src/ui/components/data-inspector/DataDescription.tsx index ac9ef5c8b..0e8ede847 100644 --- a/desktop/app/src/ui/components/data-inspector/DataDescription.tsx +++ b/desktop/app/src/ui/components/data-inspector/DataDescription.tsx @@ -572,6 +572,7 @@ class DataDescriptionContainer extends PureComponent<{ return ( <> { this.props.commit({ diff --git a/desktop/app/src/ui/components/data-inspector/TimelineDataDescription.tsx b/desktop/app/src/ui/components/data-inspector/TimelineDataDescription.tsx index f07811ccb..9d6c985e0 100644 --- a/desktop/app/src/ui/components/data-inspector/TimelineDataDescription.tsx +++ b/desktop/app/src/ui/components/data-inspector/TimelineDataDescription.tsx @@ -28,6 +28,7 @@ type Timeline = { }; type Props = { + canSetCurrent?: boolean; timeline: Timeline; onClick: (selected: string) => void; }; @@ -55,13 +56,15 @@ export default class TimelineDataDescription extends Component { })); return ( <> -
- -
+ {this.props.canSetCurrent && ( +
+ +
+ )}