Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

convert ProjectSearch/*.js files to JSX#3636

Merged
jasonLaster merged 1 commit into
firefox-devtools:masterfrom
aklt:convert-projectsearch-to-jsx
Aug 11, 2017
Merged

convert ProjectSearch/*.js files to JSX#3636
jasonLaster merged 1 commit into
firefox-devtools:masterfrom
aklt:convert-projectsearch-to-jsx

Conversation

@aklt
Copy link
Copy Markdown
Contributor

@aklt aklt commented Aug 11, 2017

Associated Issue: #3506

Converted the files

src/components/ProjectSearch/index.js
src/components/ProjectSearch/SourceSearch.js
src/components/ProjectSearch/TextSearch.js
src/components/ProjectSearch/ToggleSearch.js

To JSX.

The behaviour should be as before. See

https://github.com/devtools-html/debugger.html/pull/3396

For an example gif showing the expected behaviour.

Copy link
Copy Markdown
Contributor

@jasonLaster jasonLaster left a comment

Choose a reason for hiding this comment

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

some small comments

{getRelativePath(file.filepath)}
</span>
<span className="matches-summary">
{` (${file.matches.length} match${file.matches.length > 1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lets move this up to a variable. I'm still not comfortable with JSXy expressions

onClick={e => setExpanded(file, !expanded)}
>
<Arrow
className={classnames({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can this be one line?

return (
<ManagedTree
getRoots={() => results}
getChildren={file => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can this be file => file.matches || []

focused={results[0]}
getParent={item => null}
getPath={getFilePath}
renderItem={(item, depth, focused, _, expanded, { setExpanded }) =>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lets move this out... renderItem={renderItem}

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 11, 2017

Codecov Report

Merging #3636 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3636      +/-   ##
==========================================
- Coverage   54.51%   54.49%   -0.03%     
==========================================
  Files         120      120              
  Lines        4786     4786              
  Branches      992      992              
==========================================
- Hits         2609     2608       -1     
- Misses       2177     2178       +1
Impacted Files Coverage Δ
src/actions/ast.js 76.78% <0%> (-1.79%) ⬇️

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 3f7dd2c...db6b20f. Read the comment docs.

@aklt aklt force-pushed the convert-projectsearch-to-jsx branch from 3519a73 to db6b20f Compare August 11, 2017 18:21
@jasonLaster jasonLaster merged commit c8ba076 into firefox-devtools:master Aug 11, 2017
aklt added a commit to aklt/debugger.html that referenced this pull request Aug 12, 2017
aklt added a commit to aklt/debugger.html that referenced this pull request Aug 12, 2017
jasonLaster pushed a commit that referenced this pull request Aug 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants