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

Use PascalCase for preact component modules and related assets #2933

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

lyzadanger
Copy link
Contributor

This PR makes the following changes:

  • Make sidebar preact component modules (filenames) use PascalCase
  • Make tests for these preact component modules use PascalCase (e.g. AnnotationBody-test.js)
  • Make corresponding SCSS modules PascalCase
  • Update imports and CSS class names to use Pascal-Cased variants

Annotator components haven't been touched (yet).

@lyzadanger lyzadanger force-pushed the Pascal-case-ify-components branch from bfc579d to c2eee0a Compare January 28, 2021 17:34
@lyzadanger lyzadanger marked this pull request as draft January 28, 2021 17:35
@lyzadanger
Copy link
Contributor Author

Putting this in draft as I work through fixing CI issues: pitfalls of working on OS that isn't truly case-sensitive.

@codecov
Copy link

codecov bot commented Jan 28, 2021

Codecov Report

Merging #2933 (a8d51a7) into master (2675e63) will decrease coverage by 0.00%.
The diff coverage is 95.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2933      +/-   ##
==========================================
- Coverage   97.80%   97.80%   -0.01%     
==========================================
  Files         206      206              
  Lines        7757     7755       -2     
  Branches     1723     1722       -1     
==========================================
- Hits         7587     7585       -2     
  Misses        170      170              
Impacted Files Coverage Δ
src/sidebar/components/AnnotationActionBar.js 100.00% <ø> (ø)
src/sidebar/components/AnnotationEditor.js 100.00% <ø> (ø)
src/sidebar/components/AnnotationLicense.js 33.33% <ø> (ø)
src/sidebar/components/AnnotationPublishControl.js 100.00% <ø> (ø)
src/sidebar/components/AnnotationQuote.js 100.00% <ø> (ø)
src/sidebar/components/AnnotationShareControl.js 100.00% <ø> (ø)
src/sidebar/components/AnnotationUser.js 100.00% <ø> (ø)
src/sidebar/components/AnnotationView.js 100.00% <ø> (ø)
src/sidebar/components/AutocompleteList.js 100.00% <ø> (ø)
src/sidebar/components/Excerpt.js 92.68% <ø> (ø)
... and 50 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 2675e63...a8d51a7. Read the comment docs.

@lyzadanger lyzadanger marked this pull request as ready for review January 28, 2021 18:36
@lyzadanger
Copy link
Contributor Author

That testcov fail ain't my doing.

Copy link
Contributor

@LMS007 LMS007 left a comment

Choose a reason for hiding this comment

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

I just found one questionable class name that I think should change then this looks GTG. Also we will need to switch out components in frontend-shared/src perhaps with or after the annotator changes. Currently there is no /components folder in frontend-shared but that maybe should change.

@@ -25,17 +25,17 @@ import VersionInfo from './version-info';
*/
function HelpPanelTab({ linkText, url }) {
return (
<div className="help-panel-tabs__tab">
<div className="HelpPanel-tabs__tab">
Copy link
Contributor

Choose a reason for hiding this comment

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

This one looks off.

Should be this HelpPanelTab__tab or perhaps just HelpPanelTab

@@ -4,13 +4,13 @@ import { createElement } from 'preact';
* Loading indicator.
*/
export default function Spinner() {
// The `spinner__container` div only exists to center the spinner within
// the `<spinner>` Angular component element. Once consumers of this component
Copy link
Contributor

Choose a reason for hiding this comment

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

hah, good catch

@robertknight robertknight force-pushed the Pascal-case-ify-components branch from c2eee0a to a8d51a7 Compare February 1, 2021 12:06
@robertknight
Copy link
Member

I have rebased this on master after the change to move SvgIcon into the frontend-shared package.

Copy link
Member

@robertknight robertknight left a comment

Choose a reason for hiding this comment

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

LGTM.

@@ -53,14 +53,14 @@ export default function AutocompleteList({
// The parent <input> field should capture keyboard events
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
<li
key={`autocomplete-list-${index}`}
key={`AutocompleteList-${index}`}
Copy link
Member

Choose a reason for hiding this comment

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

The key could just be index here, since it only needs to be unique amongst its siblings.

@lyzadanger lyzadanger merged commit 44a12cd into master Feb 1, 2021
@lyzadanger lyzadanger deleted the Pascal-case-ify-components branch February 1, 2021 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants