-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Clean up of dbt cloud prototype UI code #18894
Conversation
<Text className={styles.contextExplanation}> | ||
<FormattedMessage id="connection.dbtCloudJobs.explanation" /> | ||
</Text> | ||
{jobs.map((_j, i) => ( |
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.
Removing the unused _j
binding was mentioned in review, but since this is a function argument list, it's a syntax error to have no binding in that position.
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.
Sorry oversaw that. Could we instead rename it just job
in this case? Since we don't use the _
notation for those, and that way it would be a better descriptive (not used) variable.
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.
I think @typescript-eslint/no-unused-vars
will complain then . If we need a convention for unused vars, isn't _
the best choice?
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.
Yep, the underscore is needed as a cue for the linter. While my default preference was to use a name which communicates the value, that's superfluous here (by jobs.map
, a reader ought to have a good sense of what's going on 😄) and a quick grep (I ran rg '\b_\b'
in airbyte-webapp/
) shows that using _
for unused arguments is already a somewhat-established convention. It helps that we only import lodash functions individually, so there's no risk of shadowing needed utility functions.
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.
Sorry did not notice that we have that checked via TS
and not eslint. We could (not as part of this PR!) maybe disable the TS check and replace it by the eslint rule, which actually allows to configure an after-used
so it's not failing on parameters that need to be there because we use the ones after it still.
4d8f042
to
7b8d233
Compare
</label> | ||
<Input {...field} type="text" /> | ||
</> | ||
)} | ||
</Field> | ||
</div> | ||
<button type="button" className={styles.jobListItemDelete} onClick={removeJob}> | ||
<button type="button" className={styles.jobListItemDelete} onClick={removeJob} aria-label="Delete job"> |
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.
The aria-label
should be i18n
ed as well.
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.
I could be wrong - but I think we can use <Button type="clear">
for this sort of transparent/unstyled button?
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.
We can indeed. It isn't quite as good a match for the designs (the main issue is that it's slightly smaller even at size="lg"
) and adds a pointless div around the button contents, but it's more consistent with the rest of the app and adds small improvements like higher contrast against the background and a subtle darkening of the icon on hover.
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.
Just a few minor comments!
also a nitpick: could we export DbtCloudTransformationsCard
from an index.ts
barrel file so we don't have a long import like this:
// ConnectionTransformationTab.tsx
import { DbtCloudTransformationsCard } from "./ConnectionTransformationTab/DbtCloudTransformationsCard";
...pages/ConnectionItemPage/ConnectionTransformationTab/DbtCloudTransformationsCard.module.scss
Outdated
Show resolved
Hide resolved
<Text className={styles.contextExplanation}> | ||
<FormattedMessage id="connection.dbtCloudJobs.explanation" /> | ||
</Text> | ||
{jobs.map((_j, i) => ( |
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.
I think @typescript-eslint/no-unused-vars
will complain then . If we need a convention for unused vars, isn't _
the best choice?
...ionPage/pages/ConnectionItemPage/ConnectionTransformationTab/DbtCloudTransformationsCard.tsx
Show resolved
Hide resolved
...ionPage/pages/ConnectionItemPage/ConnectionTransformationTab/DbtCloudTransformationsCard.tsx
Show resolved
Hide resolved
</label> | ||
<Input {...field} type="text" /> | ||
</> | ||
)} | ||
</Field> | ||
</div> | ||
<button type="button" className={styles.jobListItemDelete} onClick={removeJob}> | ||
<button type="button" className={styles.jobListItemDelete} onClick={removeJob} aria-label="Delete job"> |
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.
I could be wrong - but I think we can use <Button type="clear">
for this sort of transparent/unstyled button?
...ionPage/pages/ConnectionItemPage/ConnectionTransformationTab/DbtCloudTransformationsCard.tsx
Outdated
Show resolved
Hide resolved
7b8d233
to
6e8c2d0
Compare
- i18nize the aria-label - replace most custom scss by using `<Button variant="clear" size="lg">`
8119dc2
to
c349a1a
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.
LGTM 🚀
* Clean up of dbt cloud prototype UI code * Remove variables->vars alias from scss files * Remove obsolete comments * Improvements to delete job button - i18nize the aria-label - replace most custom scss by using `<Button variant="clear" size="lg">` * Use `_` for unused function arg
What
Closes https://github.com/airbytehq/airbyte-cloud/issues/3186.
js code style changes
executionUrl
match destructuringisDbtWebhookConfig
predicateexecutionUrl
regexyup
import syntax in transformation tabscss code style changes
tsx improvements
<Formik />
unlesshasDbtIntegration
img
in dbt transformation tab scssemptyListContent
styles intojobListContainer
s/<p>/<Text>/g
aria-label
to “remove dbt job” X buttonDbtCloudSignupBanner
componenttext content
<FormattedMessage />
images
🚨 User Impact 🚨
None; the only differences in app behavior are slight changes to text content and a few cases where a formerly-invisible component is now not rendered at all.