-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Disable Lift export when Frontier is empty #3440
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3440 +/- ##
==========================================
+ Coverage 74.58% 74.64% +0.05%
==========================================
Files 285 285
Lines 10999 11003 +4
Branches 1339 1339
==========================================
+ Hits 8204 8213 +9
+ Misses 2410 2405 -5
Partials 385 385
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
4b593ca
to
998c218
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r2, all commit messages.
Reviewable status: 1 of 2 files reviewed, 3 unresolved discussions (waiting on @andracc)
src/components/ProjectExport/ExportButton.tsx
line 16 at r2 (raw file):
projectId: string; buttonProps?: ButtonProps & { "data-testid"?: string }; disabled?: boolean;
It looks like this new optional prop isn't been used.
src/components/ProjectExport/ExportButton.tsx
line 22 at r2 (raw file):
export default function ExportButton(props: ExportButtonProps): ReactElement { const dispatch = useAppDispatch(); const [exports, setExports] = useState<boolean>(false);
The <boolean>
can be dropped, since the type is implied from the default value.
src/components/ProjectExport/ExportButton.tsx
line 43 at r2 (raw file):
setExports(true); } });
Because setExports
is a function that takes a boolean, you should be able to condense this to
await isFrontierNonempty(props.propjectId).then(setExports);
(There's no performance concern for updating a state to what it already is, because rerenders are only triggered when states and props change.)
src/components/ProjectExport/ExportButton.tsx
line 53 at r2 (raw file):
<LoadingButton loading={loading} disabled={loading}
Since the LoadingButton
has a disabled
prop, probably better to update that with loading || !exports
than to conflict with it via the buttonProps
.
Resolves #3441
This change is