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

Show manual frequency in connection table and use intl for frequency values #13621

Merged
merged 7 commits into from
Jun 10, 2022

Conversation

edmundito
Copy link
Contributor

@edmundito edmundito commented Jun 8, 2022

What

When the connection frequency is set to manual, it now shows in the connection table:

image

And when the replication settings, except for when it's a new connection:
Screen Shot 2022-06-09 at 15 17 54

The frequency values were not part of intl so they were also moved there.

How

The reason why it wasn't showing before was a missed comparison between undefined and null. This comparison is now made when getting the frequency with the new getFrequencyConfig util, which is mostly used to track events.

This issue may have been introduced with #12071 because some of the types changed there and what was once set to null may now be set to undefined, and null !=== undefined

For the actual display of the frequency now it's using strings from the en.json file instead of what was hard-coded in the config. In order to avoid confusion, the text property in the config was renamed to type.

Recommended reading order

Top to bottom

@edmundito edmundito added area/frontend area/frontend Related to the Airbyte webapp labels Jun 8, 2022
@edmundito edmundito requested a review from a team as a code owner June 8, 2022 20:32
@github-actions github-actions bot added the area/platform issues related to the platform label Jun 8, 2022
{
id: `frequency.${
item.config.timeUnit === "hours" && item.config.units === 1 ? "hour" : item.config.timeUnit
}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that you have some logic for singular/plural in the en.json... are the "hour" entry and this logic needed with the singular/plural logic you have for "hours"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sometimes we want to display "Every hour" (in the replication settings) but in other cases we display "1 hour" (in the connections table). Maybe I should replace the "frequency.hour" key to be more clear?

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we maybe replace the form.every with two different keys we're using here instead for form.every.hours and form.every.minutes. that way we could use the pluralization inside en.json to take care of this, which imho would read a bit nicer (and would make it easier for translators later).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@timroes I was thinking the same thing because it made this a little too convoluted.

Copy link
Contributor

@teallarson teallarson left a comment

Choose a reason for hiding this comment

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

Tested locally. Just had one question about what seems like repeated logic in the code, not blocking.

@edmundito edmundito requested a review from teallarson June 9, 2022 19:20
@edmundito
Copy link
Contributor Author

@tealjulia There was one more thing I needed to fix in regards to showing "Manual" as the frequency in the Replication settings. It was a very small fix so I included it as part of this change since it also fixes the issue where "Manual" was not showing.

@edmundito edmundito force-pushed the edmundito/show-manual-frequency branch from 8821e15 to 6291021 Compare June 10, 2022 14:48
@edmundito edmundito requested a review from timroes June 10, 2022 14:50
Copy link
Contributor

@timroes timroes left a comment

Choose a reason for hiding this comment

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

Have not tested locally (since Teal already did), reviewed code LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp area/platform issues related to the platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants