Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Make Homepage and Searchbar RTL-compatible #427

Merged
merged 6 commits into from
Nov 18, 2021

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Nov 18, 2021

Fixes

Related to #428 by @obulat
Fixes #424 by @dhruvkb

Description

This PR made the Homepage and Search page RTL-compatible:

The search bar both on the Homepage and on the Search page has corners of the input and button correctly rounded both in LTR and RTL modes.
The "safer browsing" icon is removed, as in the transitional styles mockup, and its padding is adjusted.
The scroll to top button is moved to the opposite corner.

Testing Instructions

You can set the language to Arabic using the Locale chooser in the footer of non-embedded page: http://localhost:8443?embedded=false, and then look at the RTL styles.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@obulat obulat added 🛠 goal: fix Bug fix 🕹 aspect: interface Concerns end-users' experience with the software labels Nov 18, 2021
@obulat obulat requested a review from a team as a code owner November 18, 2021 06:32
@obulat obulat requested review from krysal and dhruvkb November 18, 2021 06:32
@obulat obulat self-assigned this Nov 18, 2021
@obulat obulat changed the title Make search bar rtl-compatible Make search bar RTL-compatible Nov 18, 2021
obulat and others added 3 commits November 18, 2021 11:31
* Remove all styling to make the component RTL-compatible

* Change `.hero-search__form` and `.hero-search__control` to Tailwind

* Remove redundant CSS

* Fix rounded-corners on input and button

* Center text inside the legend

Co-authored-by: Olga Bulat <obulat@gmail.com>
@obulat obulat changed the title Make search bar RTL-compatible Make Homepage and Searchbar RTL-compatible Nov 18, 2021
Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

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

Amazing work!

Screenshot 2021-11-18 at 2 13 32 PM

@@ -16,7 +16,8 @@
{{ $t('filters.title') }}
</button>
<div
class="search-field field has-addons control search-control has-icons-left ms-2"
class="search-field field has-addons control search-control"
:class="isFilterVisible ? '' : 'ms-2'"
Copy link
Member

Choose a reason for hiding this comment

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

Would be preferable to use the { 'class': boolean } syntax here.

Copy link
Contributor

@sarayourfriend sarayourfriend left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@@ -109,7 +110,7 @@ describe('SearchGridFilter', () => {
})
expect(checkedFilters.length).toEqual(0)
// Filters are reset with the initial `filterData`
expect(uncheckedFilters.length).toEqual(22)
expect(uncheckedFilters.length).toEqual(25)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this changing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because previously we didn't have the sizes in mock filters in this test. Without them, the filter handling in search store fails. And after adding the sizes option, the number of filters goes up 3 (for small, medium and large, IIRC). The filters filtering (or typing, maybe) needs to be a bit more robust, I guess, because sometimes tests pass non-array objects to some functions that use .filter over them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah okay, thanks for explaining 🙂 I saw that we added the sizes to the filter but I didn't realize it added three more options instead of just one size 😂 But I get it now!

@obulat obulat merged commit 8539e42 into main Nov 18, 2021
@obulat obulat deleted the fix/home_page_search_form_rtl branch November 18, 2021 14:29
rbadillap added a commit that referenced this pull request Nov 30, 2021
* main:
  Fix state errors (#417)
  Add Checkbox component (#406)
  Fix package-lock.json engines (#430)
  Make Homepage and Searchbar RTL-compatible (#427)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🕹 aspect: interface Concerns end-users' experience with the software 🛠 goal: fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Homepage RTL-compatible
3 participants