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

[bot] Run grit migration: Apply a GritQL pattern #700

Closed
wants to merge 2 commits into from

Conversation

grit-app[bot]
Copy link

@grit-app grit-app bot commented Dec 16, 2023

⚠️ This migration is out of date with the main branch. Update with Grit ⚠️

⚠️ This pull request was auto-generated with Grit. ⚠️

This pull request was created with these settings:

  • Target branch: master
  • Source files: src/explore/components/controls/AnnotationLayerControl
  • Preset pattern: react_to_hooks – This pattern converts React class components to functional components, with hooks.
Pattern body
engine marzano(0.1)
language js

// Most of the logic for this pattern is in react_hooks.grit
// https://github.com/getgrit/js/blob/main/.grit/patterns/react_hooks.grit

pattern regular_first_step() {
  $use_ref_from = .,
  $handler_callback_suffix = "Handler",
  first_step($use_ref_from, $handler_callback_suffix)
}

sequential {
    file(body = program(statements = some bubble($program) regular_first_step())),
    // Run it 3 times to converge
    file(body = second_step(handler_callback_suffix = "Handler")),
    file(body = second_step(handler_callback_suffix = "Handler")),
    file(body = second_step(handler_callback_suffix = "Handler")),
    file($body) where {
      $body <: program($statements),
      $statements <: bubble($body, $program) and {
        maybe adjust_imports(),
        add_more_imports(),
      }
    }
}

grit-app bot and others added 2 commits December 16, 2023 01:03
<!-- grit:execution_id:3bff9e6d-7ac9-4b1a-ab37-bb1b7f9494cd -->
@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8450cca) 69.18% compared to head (23dc9cf) 69.19%.
Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #700      +/-   ##
==========================================
+ Coverage   69.18%   69.19%   +0.01%     
==========================================
  Files        1945     1945              
  Lines       75968    75858     -110     
  Branches     8467     8451      -16     
==========================================
- Hits        52557    52491      -66     
+ Misses      21224    21187      -37     
+ Partials     2187     2180       -7     
Flag Coverage Δ
hive 53.67% <ø> (ø)
mysql 78.08% <ø> (ø)
postgres 78.18% <ø> (ø)
presto 53.63% <ø> (ø)
python 82.86% <ø> (ø)
sqlite 76.84% <ø> (ø)
unit 55.79% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

isNew: !name,
isLoadingOptions: true,
valueOptions: [],
};
Copy link
Member

Choose a reason for hiding this comment

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

We need all of these values to go into the react state, but it looks like it only added the ones that had a key/value that were different.

handleAnnotationSourceTypeHandler =
handleAnnotationSourceTypeHandler.bind(this);
handleValueHandler = handleValueHandler.bind(this);
isValidFormHandler = isValidFormHandler.bind(this);
Copy link
Member

Choose a reason for hiding this comment

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

these should all be removed

fetchOptions(annotationType, sourceType, isLoadingOptions);
}, [annotationType, isLoadingOptions]);
useEffect(() => {
if (prevState.sourceType !== sourceType) {
Copy link
Member

@eschutho eschutho Dec 23, 2023

Choose a reason for hiding this comment

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

prevState does not exist/has not been defined

@@ -267,38 +190,33 @@ class AnnotationLayer extends React.PureComponent {
errors.push(validateNonEmpty(intervalEndColumn));
}
}
errors.push(!this.isValidFormulaAnnotation(value, annotationType));
errors.push(!isValidFormulaAnnotationHandler(value, annotationType));
Copy link
Member

@eschutho eschutho Dec 23, 2023

Choose a reason for hiding this comment

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

  name,
  annotationType,
  sourceType,
  value,
  timeColumn,
  intervalEndColumn,

should all be referencing state, but they are referencing props.

} = props;

// Only allow override whole time_range
if ('since' in overrides || 'until' in overrides) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure why this condition was removed.

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