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

"Import" Button is Not Disabled Correctly Based on Progress #19

Open
matthewborgman opened this issue Jan 17, 2023 · 1 comment · May be fixed by #20
Open

"Import" Button is Not Disabled Correctly Based on Progress #19

matthewborgman opened this issue Jan 17, 2023 · 1 comment · May be fixed by #20

Comments

@matthewborgman
Copy link
Contributor

The current logic for the "Import" button is that it's disabled when progress is less than 1.

However, the CSS in the ProgressBar component expects 0 ≥ progress ≤ 100 as it divides that number by 100 to get a decimal value for rendering the bar. For example, given that CSS and progress equal to 1 then it will correctly render the progress bar as completely filled.

As a result of this mismatch the "Import" button is not disabled when progress !== 1

Actual

screenshot 2023-01-17 at 15 08 52

Expected

screenshot 2023-01-17 at 15 09 35

matthewborgman added a commit to matthewborgman/sanity-translations-tab that referenced this issue Jan 17, 2023
@cngonzalez
Copy link
Member

cngonzalez commented Jan 27, 2023

Thanks for reporting, Matthew! In this case, I think being able to import partial translations was intended behavior. But I agree that it certainly makes sense to disallow that behavior.

Does it make sense to hoist a boolean to the config, something like allowPartialImports (or a better variable name) that defaults to true but can be overridden and have this behavior?

This would also stop this from being a breaking change and major version update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants