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

Improve local search + improve Navigator Search UI #5009

Merged
merged 10 commits into from
Jul 1, 2024

Conversation

Cloud11PL
Copy link
Member

@Cloud11PL Cloud11PL commented Jun 28, 2024

  • Replaces fuzzaldrin with fuse.js
  • Ports Navigator to new macaw-ui

What type of PR is this?

  • 💅 Refactor
  • 🌟 Feature
  • 🔥 Bug Fix
  • 🔩 Maintenance
  • 🛠 Workflow CI/CD changes

Related Issues or Documents

  • closes #

Usage Instructions, Screenshots, Recordings

Search:
CleanShot 2024-07-01 at 12 15 25
CleanShot 2024-07-01 at 12 15 58

Navigator Search:
CleanShot 2024-07-01 at 12 14 26

Have you written tests?

  • Yes!
  • No... here is why: Writing tests are mandatory, please replace this text with why test are not included in this PR

[Optional] Description

@Cloud11PL Cloud11PL requested a review from a team as a code owner June 28, 2024 11:02
@Cloud11PL Cloud11PL requested review from 2can and Droniu June 28, 2024 11:02
Copy link

changeset-bot bot commented Jun 28, 2024

🦋 Changeset detected

Latest commit: 7bae942

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
saleor-dashboard Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Cloud11PL Cloud11PL mentioned this pull request Jun 28, 2024
7 tasks
@Cloud11PL Cloud11PL marked this pull request as draft June 28, 2024 11:04
@github-actions github-actions bot temporarily deployed to pr-5009 June 28, 2024 11:08 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5009 July 1, 2024 08:33 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5009 July 1, 2024 08:44 Destroyed
@Cloud11PL Cloud11PL changed the title Migrate from fuzzaldrin to Fuse.js Improve local search + improve Navigator's UI Jul 1, 2024
@Cloud11PL Cloud11PL force-pushed the MERX-625-migrate-from-fuzzaldrin branch from 8b42733 to 881f086 Compare July 1, 2024 10:14
@Cloud11PL Cloud11PL marked this pull request as ready for review July 1, 2024 10:16
@github-actions github-actions bot temporarily deployed to pr-5009 July 1, 2024 10:16 Destroyed
@Cloud11PL Cloud11PL changed the title Improve local search + improve Navigator's UI Improve local search + improve Navigator Search UI Jul 1, 2024
poulch
poulch previously approved these changes Jul 1, 2024
Comment on lines 6 to 14
const reactIntl = jest.requireActual("react-intl");
const intl = reactIntl.createIntl({
locale: "en",
});

return {
...reactIntl,
useIntl: () => intl,
};
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: using actual react-intl does not have sense because it doesn't work without context

Copy link
Member Author

Choose a reason for hiding this comment

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

It does 😄 Related issue: formatjs/formatjs#1477 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

Nope it doesn't, it works in your case because you mocked useIntl, but you could do this like that:

Suggested change
const reactIntl = jest.requireActual("react-intl");
const intl = reactIntl.createIntl({
locale: "en",
});
return {
...reactIntl,
useIntl: () => intl,
};
jest.mock("react-intl", () => ({
useIntl: jest.fn(() => ({
formatMessage: jest.fn(x => x.defaultMessage),
})),
}));

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 meant that it does work 😄

Copy link
Member

Choose a reason for hiding this comment

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

@Cloud11PL test should mock dependencies, not mock and provide their actual implementation. You are not testing react-intl here, you test only your code and the only you care about is that your code calls intl with proper arguments.

src/components/NavigatorSearch/modes/utils.ts Outdated Show resolved Hide resolved
src/components/NavigatorSearch/modes/utils.ts Outdated Show resolved Hide resolved
src/misc.ts Show resolved Hide resolved
src/misc.ts Outdated Show resolved Hide resolved
src/components/NavigatorSearch/modes/utils.ts Outdated Show resolved Hide resolved
src/components/NavigatorSearch/modes/utils.ts Outdated Show resolved Hide resolved
.changeset/perfect-crews-speak.md Show resolved Hide resolved
@Cloud11PL Cloud11PL requested review from poulch and andrzejewsky July 1, 2024 12:33
@github-actions github-actions bot temporarily deployed to pr-5009 July 1, 2024 12:34 Destroyed
src/misc.ts Outdated Show resolved Hide resolved
@Cloud11PL Cloud11PL requested a review from poulch July 1, 2024 13:06
@github-actions github-actions bot temporarily deployed to pr-5009 July 1, 2024 13:09 Destroyed
@Cloud11PL Cloud11PL merged commit 56eb4d6 into main Jul 1, 2024
12 of 14 checks passed
@Cloud11PL Cloud11PL deleted the MERX-625-migrate-from-fuzzaldrin branch July 1, 2024 15:14
luiz-linkezio pushed a commit to luiz-linkezio/PENTEST-saleor-dashboard that referenced this pull request Jul 4, 2024
* migrate from fuzzaldrin to fusejs

* fix types

* improve navigator search + port to new macaw-ui

* fix type issue

* fixes

* final fixes

* add fuzzySearch separate test

* cr fixes

* cr fixes
luiz-linkezio pushed a commit to luiz-linkezio/PENTEST-saleor-dashboard that referenced this pull request Jul 4, 2024
* migrate from fuzzaldrin to fusejs

* fix types

* improve navigator search + port to new macaw-ui

* fix type issue

* fixes

* final fixes

* add fuzzySearch separate test

* cr fixes

* cr fixes
luiz-linkezio pushed a commit to luiz-linkezio/PENTEST-saleor-dashboard that referenced this pull request Jul 4, 2024
* migrate from fuzzaldrin to fusejs

* fix types

* improve navigator search + port to new macaw-ui

* fix type issue

* fixes

* final fixes

* add fuzzySearch separate test

* cr fixes

* cr fixes
Cloud11PL added a commit that referenced this pull request Jul 8, 2024
* migrate from fuzzaldrin to fusejs

* fix types

* improve navigator search + port to new macaw-ui

* fix type issue

* fixes

* final fixes

* add fuzzySearch separate test

* cr fixes

* cr fixes
Cloud11PL added a commit that referenced this pull request Jul 8, 2024
* migrate from fuzzaldrin to fusejs

* fix types

* improve navigator search + port to new macaw-ui

* fix type issue

* fixes

* final fixes

* add fuzzySearch separate test

* cr fixes

* cr fixes
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.

3 participants