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

ft: product visibility-#187419124 #8

Merged
merged 6 commits into from
Jun 28, 2024
Merged

Conversation

soleil00
Copy link
Collaborator

@soleil00 soleil00 commented Jun 18, 2024

What does this PR do?

in this PR i added product visibility allowing user to see products when he visit th ewebsit

Description of Task to be completed?

  • allow user to fetch products

How should this be manually tested?

  1. Clone the repository.
  2. Checkout to the branch `ft-product-display-##187419124.
  3. Run npm install to install dependencies.
  4. navigate to / or /products

What are the relevant pivotal tracker stories?

Delivers #187419124

Screenshots

Screenshot 2024-06-25 at 12 10 22 Screenshot 2024-06-25 at 12 11 30

#187419120 Users should be able to Login with Email and Password
Copy link

vercel bot commented Jun 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eagles-ec-fe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 28, 2024 10:50am

<div className="w-full bg-black text-white p-4">
<div className="max-w-[1440px] w-[90%] mx-auto py-5">
<Grid container spacing={4}>
<Grid item xs={12} sm={6} md={3}>
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 4 locations. Consider refactoring.

<Typography variant="body2">+250 780 693 425</Typography>
<Typography variant="body2">[email protected]</Typography>
</Grid>
<Grid item xs={12} sm={6} md={3}>
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 4 locations. Consider refactoring.

<Typography variant="body2">Mobile phones & accessories</Typography>
<Typography variant="body2">Home Furnitures</Typography>
</Grid>
<Grid item xs={12} sm={6} md={3}>
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 4 locations. Consider refactoring.

<Typography variant="body2">Contact</Typography>
<Typography variant="body2">Forum</Typography>
</Grid>
<Grid item xs={12} sm={6} md={3}>
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 4 locations. Consider refactoring.

Featured Products
</Typography>

<Grid
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.


const ProductPageSkeleton = () => (
<div>
<Grid
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

<span className="ml-2 font-semibold text-[15px]">$150.00</span>
</Stack>
</Stack>
<Stack direction="row" className="flex items-center">
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

animation="wave"
/>

<div className=" absolute top-0 right-0 p-0 ">
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

)}
</div>

<div className=" absolute top-0 right-0 p-0 ">
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

<Stack
direction="row"
className="flex justify-between items-center gap-2 bg-white"
>
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

<FaLinkedinIn />
</NavLink>
</div>
<div className="border-t border-gray-700 mt-6 pt-4 text-center">
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.


if (data?.lenght < 1) {
return (
<div className="my-5 px-4">
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.


fireEvent.click(screen.getByLabelText("Price: Low to high"));

expect(onFilter).toHaveBeenCalledWith([
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.


fireEvent.click(screen.getByLabelText("Price: High to low"));

expect(onFilter).toHaveBeenCalledWith([
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

</div>

<div className="rounded-md p-2">
<div className="p-2 flex items-center gap-2">
Copy link

Choose a reason for hiding this comment

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

Identical blocks of code found in 2 locations. Consider refactoring.

alignItems="center"
className="mb-4"
>
{currentItems.map((product) => (
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

alignItems="center"
className="mb-4"
>
{products?.slice(0, 8).map((product: IProduct) => (
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

</div>
</div>
<Divider />
<div className="p-2 flex items-center gap-2">
Copy link

Choose a reason for hiding this comment

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

Identical blocks of code found in 2 locations. Consider refactoring.

});
});

it("should render loading skeleton while fetching products", () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

});
});

it('should render "no product found" message when data is empty', () => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

</Stack>
<Divider />

<div className="flex justify-between items-center">
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

onFilter: (filteredProducts: IProduct[]) => void;
}

const priceRanges = [
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.


import dummyProducts from "./__mock__/product";

const priceRanges = [
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.


describe("Testing React components", () => {
it("should render home page components", () => {
render(
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 9 locations. Consider refactoring.


describe("Testing AdvertisedCategory Component", () => {
it("should render advertised category section", () => {
render(
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 9 locations. Consider refactoring.

Copy link
Collaborator

@MugemaneBertin2001 MugemaneBertin2001 left a comment

Choose a reason for hiding this comment

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

LGTM

@MugemaneBertin2001 MugemaneBertin2001 self-requested a review June 26, 2024 14:46
@soleil00 soleil00 removed the In progress a work in progress label Jun 26, 2024
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 15780 lines exceeds the maximum allowed for the inline comments feature.

@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 82.95455% with 15 lines in your changes missing coverage. Please review.

Project coverage is 78.07%. Comparing base (4a4d5f0) to head (b01e7f7).

Files Patch % Lines
...ents/common/featured-products/FeaturedProducts.tsx 70.37% 8 Missing ⚠️
src/components/cards/ProductCard.tsx 74.07% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev       #8      +/-   ##
==========================================
+ Coverage   77.35%   78.07%   +0.71%     
==========================================
  Files          42       49       +7     
  Lines         711      789      +78     
  Branches       76       85       +9     
==========================================
+ Hits          550      616      +66     
- Misses        159      171      +12     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@soleil00 soleil00 force-pushed the ft-product-display-##187419124 branch from 04243b9 to 81f1cd2 Compare June 26, 2024 16:38
@soleil00 soleil00 changed the title feature: product visibility ft: product visibility Jun 27, 2024
@soleil00 soleil00 changed the title ft: product visibility ft: product visibility-#187419124 Jun 27, 2024
@soleil00 soleil00 force-pushed the ft-product-display-##187419124 branch from d01b744 to d105a6a Compare June 27, 2024 08:16
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 15413 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 15405 lines exceeds the maximum allowed for the inline comments feature.

Copy link

codeclimate bot commented Jun 27, 2024

Code Climate has analyzed commit 2d7dd24 and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Style 2

View more on Code Climate.

Copy link
Collaborator

@Heisjabo Heisjabo left a comment

Choose a reason for hiding this comment

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

you can update screenshots and some homepage fonts sizes

Copy link

gitguardian bot commented Jun 28, 2024

⚠️ GitGuardian has uncovered 4 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
12081800 Triggered Generic Password b01e7f7 src/test/updatePasswordApiSlice.test.tsx View secret
12081800 Triggered Generic Password b01e7f7 src/test/updatePasswordApiSlice.test.tsx View secret
12081800 Triggered Generic Password b01e7f7 src/test/updatePasswordApiSlice.test.tsx View secret
12081800 Triggered Generic Password b01e7f7 src/test/updatePasswordApiSlice.test.tsx View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@teerenzo teerenzo merged commit 9652708 into dev Jun 28, 2024
6 of 7 checks passed
soleil00 pushed a commit that referenced this pull request Jul 2, 2024
soleil00 pushed a commit that referenced this pull request Jul 3, 2024
soleil00 pushed a commit that referenced this pull request Jul 3, 2024
soleil00 pushed a commit that referenced this pull request Jul 4, 2024
soleil00 pushed a commit that referenced this pull request Jul 4, 2024
soleil00 pushed a commit that referenced this pull request Jul 4, 2024
soleil00 pushed a commit that referenced this pull request Jul 5, 2024
soleil00 pushed a commit that referenced this pull request Jul 5, 2024
soleil00 pushed a commit that referenced this pull request Jul 5, 2024
soleil00 pushed a commit that referenced this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants