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

[TASK-114] Split out AccountFieldsEditor from AccountSettingsRoute #4709

Merged
merged 19 commits into from Nov 6, 2023

Conversation

magicznyleszek
Copy link
Member

@magicznyleszek magicznyleszek commented Oct 30, 2023

Checklist

  1. If you've added code that should be tested, add tests
  2. If you've changed APIs, update (or create!) the documentation
  3. Ensure the tests pass
  4. Make sure that your code lints and that you've followed our coding style
  5. Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. Open an issue in the docs if there are UI/UX changes

Description

Internal code improvement in preparation for upcoming feture.

Notes

I will be needing AccountFieldsEditor for the TOS feature.

Changes here:

  • New component AccountFieldsEditor that displays a selected list of user metadata fields and allows editing their values (locally)
  • AccountSettingsRoute is using AccountFieldsEditor now
  • Added error option to KoboSelect
  • Updated kobo-common version to latest one (needed it for linter rules for enums)

Needed for #4711

@magicznyleszek magicznyleszek changed the title Split out AccountFieldsEditor from AccountSettingsRoute [TASK-114] Split out AccountFieldsEditor from AccountSettingsRoute Oct 31, 2023
@notion-workspace
Copy link

TOS Form

@magicznyleszek magicznyleszek marked this pull request as ready for review October 31, 2023 06:04
@RuthShryock RuthShryock self-requested a review October 31, 2023 12:33
@RuthShryock RuthShryock self-assigned this Oct 31, 2023
Copy link
Member

@RuthShryock RuthShryock left a comment

Choose a reason for hiding this comment

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

Everything looks good to me!

@magicznyleszek magicznyleszek mentioned this pull request Nov 1, 2023
@LMNTL LMNTL self-requested a review November 2, 2023 12:03
jsapp/js/components/common/koboSelect.tsx Show resolved Hide resolved
jsapp/js/account/accountFieldsEditor.component.tsx Outdated Show resolved Hide resolved
jsapp/js/account/accountFieldsEditor.component.tsx Outdated Show resolved Hide resolved
jsapp/js/account/account.constants.ts Outdated Show resolved Hide resolved
Comment on lines 103 to 111
.k-select__error {
font-size: sizes.$x12;
line-height: 1.6;
font-weight: 400;
font-style: normal;
color: colors.$kobo-red;
margin-top: sizes.$x6;
}

Copy link
Contributor

@LMNTL LMNTL Nov 2, 2023

Choose a reason for hiding this comment

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

Could this message get positioned somehow so that the layout doesn't jump when it appears/disappears? Also, it would be nice if the error state had the same red border as the TextBox (when unfocused).

Copy link
Member Author

Choose a reason for hiding this comment

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

The layout jumping is actually consistent with how the TextBox error is being displayed. I think this will require us having similar errors in all the common components, and then unfiying the functionality.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added the styles for the select trigger (for all the types: outline, blue, and gray)

Copy link
Contributor

@LMNTL LMNTL Nov 2, 2023

Choose a reason for hiding this comment

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

I agree that it's consistent with how the TextBox works, but I wonder if keeping it consistent is worth it in this case - especially since the refactor of the of the KoboSelect fields makes them look more distinct from the TextBoxes. You could keep the same layout/position and avoid the content jumping by adding a very short animation to a height property/transform of the error message.

Still, I take your point - this shouldn't hold up this task👍I don't need it to give approval.

package.json Show resolved Hide resolved
@LMNTL
Copy link
Contributor

LMNTL commented Nov 3, 2023

Note: the CI is consistently failing during the Run coveralls for back-end code step of pytest / build (3.10) (only on this branch so far), but this doesn't seem to be related to any of the code changes. I'll keep an eye on beta after this gets merged to make sure it's just some branch-specific issue.

Copy link
Contributor

@LMNTL LMNTL left a comment

Choose a reason for hiding this comment

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

Looking good! I have one last small change to request: the select elements on the old account profile could accept tab focus, but ones in this PR can't. It looks like adding tabindex={0} to bem.KoboDropdown (or some other appropriate element in the component tree) would fix that.

@magicznyleszek magicznyleszek merged commit 6ac0d66 into beta Nov 6, 2023
3 of 4 checks passed
@magicznyleszek magicznyleszek deleted the split-out-account-fields-editor branch November 6, 2023 16:49
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.

None yet

4 participants