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

refactor: Transform URLShortLinkModal to Typescript #11971

Merged

Conversation

maloun96
Copy link
Contributor

@maloun96 maloun96 commented Dec 9, 2020

SUMMARY
Transform URLShortLinkModal to Typescript

@codecov-io
Copy link

codecov-io commented Dec 9, 2020

Codecov Report

Merging #11971 (8a1797d) into master (7e6f04f) will decrease coverage by 9.37%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11971      +/-   ##
==========================================
- Coverage   63.75%   54.37%   -9.38%     
==========================================
  Files         941      432     -509     
  Lines       45654    15250   -30404     
  Branches     4389     3891     -498     
==========================================
- Hits        29106     8292   -20814     
+ Misses      16371     6958    -9413     
+ Partials      177        0     -177     
Flag Coverage Δ
cypress 54.37% <75.00%> (?)
javascript ?
python ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...rset-frontend/src/components/URLShortLinkModal.tsx 77.77% <75.00%> (ø)
...uperset-frontend/src/dashboard/util/dnd-reorder.js 0.00% <0.00%> (-100.00%) ⬇️
...rset-frontend/src/dashboard/util/getEmptyLayout.js 0.00% <0.00%> (-100.00%) ⬇️
...dashboard/components/resizable/ResizableHandle.jsx 0.00% <0.00%> (-100.00%) ⬇️
.../src/dashboard/util/getFilterScopeFromNodesTree.js 0.00% <0.00%> (-93.48%) ⬇️
...src/dashboard/components/gridComponents/Header.jsx 10.52% <0.00%> (-86.85%) ⬇️
...rc/dashboard/components/gridComponents/Divider.jsx 13.33% <0.00%> (-86.67%) ⬇️
...ontend/src/dashboard/util/getDashboardFilterKey.ts 14.28% <0.00%> (-85.72%) ⬇️
...nd/src/views/CRUD/data/query/QueryPreviewModal.tsx 14.70% <0.00%> (-82.97%) ⬇️
...set-frontend/src/views/CRUD/welcome/EmptyState.tsx 5.71% <0.00%> (-82.10%) ⬇️
... and 859 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e6f04f...8a1797d. Read the comment docs.

@junlincc junlincc requested a review from etr2460 December 9, 2020 14:34
@junlincc
Copy link
Member

junlincc commented Dec 9, 2020

@etr2460 🙏

emailContent?: string;
title?: string;
addDangerToast: (msg: string) => void;
triggerNode: JSX.Element;
Copy link
Member

Choose a reason for hiding this comment

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

any reason for JSX.Element and not React.ReactNode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what are the differences? I checked and it's not clear

Copy link
Member

Choose a reason for hiding this comment

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

ReactNode includes JSX.Element (an alias of ReactElement<any, any>), as well as string, null, undefined and node arrays.

Copy link
Member

Choose a reason for hiding this comment

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

In this case it’s probably better to use JSX.Element since you’d want the trigger element to always exist and not be a text node.

> {
static defaultProps = {
url: window.location.href.substring(window.location.origin.length),
emailSubject: '',
Copy link
Member

Choose a reason for hiding this comment

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

if we default this to empty string, can we make the props type themselves non-undefined? Or maybe get rid of the empty string default val

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed!

@etr2460 etr2460 merged commit 12e086d into apache:master Dec 15, 2020
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.0.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants