Skip to content

feat: Gets user's saved location if logged in and uses in session - #2739

Merged
hellofanny merged 12 commits into
feat/delivery-promisefrom
feat/profile-address-location
Mar 24, 2025
Merged

hellofanny merged 12 commits into
feat/delivery-promisefrom
feat/profile-address-location

Conversation

@hellofanny

@hellofanny hellofanny commented Mar 21, 2025 •

Copy link
Copy Markdown
Contributor

What's the purpose of this pull request?

This PR implements the scenario where the user is logged in, and when the user's saved location (address and geo-coordinates) is available, it is saved in the current session.

Screenshot 2025-03-12 at 10 52 35

How it works?

  1. First we check if user is loggedIn
  2. If so, gets it's addresses
  3. Check for saved address (using the first of the list) postalCode and geoCoordinate, If available we update the current session with those information.

How to test it?

First, we will need to simulate user logged. (you can follow this docs steps with more detail or follow the steps below)

  1. Go to https://www.vtexfaststore.com/ and sign in, then copy the cookies: VtexIdclientAutCookie_storeframework, vtex_session and vtex_segment
  2. Running the store locally, paste those cookies.
  3. Update the indexDB you should be able to see person object with user's information (that was previously null)
  4. Now, refresh the page.
  5. if there is an address saved for this user, you should be able to see the postalCode and geoCoordinates in the session
image image

Starters Deploy Preview

https://github.com/vtex-sites/starter.store/pull/731

Jira Task

@codesandbox-ci

codesandbox-ci Bot commented Mar 21, 2025 •

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@hellofanny hellofanny changed the title Feat/profile address location feat: Gets user's saved location if logged in and saves to session Mar 21, 2025
@hellofanny hellofanny changed the title feat: Gets user's saved location if logged in and saves to session feat: Gets user's saved location if logged in and uses in session Mar 21, 2025
@hellofanny
hellofanny force-pushed the feat/profile-address-location branch from 884aac3 to 942ecf6 Compare March 21, 2025 15:30
@hellofanny
hellofanny marked this pull request as ready for review March 21, 2025 15:40
@hellofanny
hellofanny requested a review from a team as a code owner March 21, 2025 15:40
@hellofanny
hellofanny requested review from eduardoformiga and lariciamota and removed request for a team March 21, 2025 15:40
@hellofanny hellofanny self-assigned this Mar 21, 2025
@hellofanny
hellofanny requested a review from lucasfp13 March 21, 2025 15:42
Comment thread packages/core/src/sdk/profile/index.ts Resolved
Comment thread packages/core/src/sdk/profile/index.ts Resolved
@hellofanny
hellofanny merged commit df22ddb into feat/delivery-promise Mar 24, 2025
@hellofanny
hellofanny deleted the feat/profile-address-location branch March 24, 2025 22:04
hellofanny added a commit that referenced this pull request Mar 25, 2025
## What's the purpose of this pull request?

We will need to update the faststore/api with `profile`.
To avoid conflicts and potential issues, since multiple feature branches
will be using the same core, I'm extracting part of the logic introduced
in #2739 into the main branch.

## How it works?

Adds profile's type and profile to query.

## How to test it?

The easiest way to test might be running the faststore/api and
faststore/core
- Try querying `profile`
- Pass an profile id (you can get it when logged - see more instructions
on #2739)

<img width="600" alt="image"
src="https://github.com/user-attachments/assets/58dc1f3e-b5e7-458f-af4f-f6003f8961b7"
/>

<img width="1892" alt="image"
src="https://github.com/user-attachments/assets/ea073908-25db-414c-89ce-6e6345550634"
/>
hellofanny added a commit that referenced this pull request Mar 26, 2025
)

## What's the purpose of this pull request?

This PR implements the scenario where the user is logged in, and when
the user's saved location (address and geo-coordinates) is available, it
is saved in the current session.

<img width="400" alt="Screenshot 2025-03-12 at 10 52 35"
src="https://github.com/user-attachments/assets/f5c345cf-395b-4e48-bd84-c5f280e32d65"
/>

## How it works?

1. First we check if user is loggedIn
2. If so, gets it's addresses
3. Check for saved address (using the first of the list) postalCode and
geoCoordinate, If available we update the current session with those
information.

## How to test it?

First, we will need to simulate user logged. (you can follow this
[docs](https://docs.google.com/document/d/1DSwrD19dOvzFc650UAlLg4diyxmYTHaBD_4lxWQT8YY/edit?tab=t.0)
steps with more detail or follow the steps below)
1. Go to https://www.vtexfaststore.com/ and sign in, then copy the
cookies: _VtexIdclientAutCookie_storeframework_, _vtex_session_ and
_vtex_segment_
2. Running the store locally, paste those cookies.
3. Update the indexDB you should be able to see `person` object with
user's information (that was previously `null`)
4. Now, refresh the page.
5. if there is an address saved for this user, you should be able to see
the `postalCode` and `geoCoordinates` in the session
<img width="823" alt="image"
src="https://github.com/user-attachments/assets/1ecbb614-aa9f-4a46-bc0c-51b7e756aba6"
/>
<img width="885" alt="image"
src="https://github.com/user-attachments/assets/6dc80260-d705-4422-9c01-785a11982f94"
/>


### Starters Deploy Preview
https://github.com/vtex-sites/starter.store/pull/731

[Jira
Task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2205)
lariciamota pushed a commit that referenced this pull request Mar 27, 2025
)

## What's the purpose of this pull request?

This PR implements the scenario where the user is logged in, and when
the user's saved location (address and geo-coordinates) is available, it
is saved in the current session.

<img width="400" alt="Screenshot 2025-03-12 at 10 52 35"
src="https://github.com/user-attachments/assets/f5c345cf-395b-4e48-bd84-c5f280e32d65"
/>

## How it works?

1. First we check if user is loggedIn
2. If so, gets it's addresses
3. Check for saved address (using the first of the list) postalCode and
geoCoordinate, If available we update the current session with those
information.

## How to test it?

First, we will need to simulate user logged. (you can follow this
[docs](https://docs.google.com/document/d/1DSwrD19dOvzFc650UAlLg4diyxmYTHaBD_4lxWQT8YY/edit?tab=t.0)
steps with more detail or follow the steps below)
1. Go to https://www.vtexfaststore.com/ and sign in, then copy the
cookies: _VtexIdclientAutCookie_storeframework_, _vtex_session_ and
_vtex_segment_
2. Running the store locally, paste those cookies.
3. Update the indexDB you should be able to see `person` object with
user's information (that was previously `null`)
4. Now, refresh the page.
5. if there is an address saved for this user, you should be able to see
the `postalCode` and `geoCoordinates` in the session
<img width="823" alt="image"
src="https://github.com/user-attachments/assets/1ecbb614-aa9f-4a46-bc0c-51b7e756aba6"
/>
<img width="885" alt="image"
src="https://github.com/user-attachments/assets/6dc80260-d705-4422-9c01-785a11982f94"
/>


### Starters Deploy Preview
https://github.com/vtex-sites/starter.store/pull/731

[Jira
Task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2205)
lariciamota pushed a commit that referenced this pull request Mar 28, 2025
)

## What's the purpose of this pull request?

This PR implements the scenario where the user is logged in, and when
the user's saved location (address and geo-coordinates) is available, it
is saved in the current session.

<img width="400" alt="Screenshot 2025-03-12 at 10 52 35"
src="https://github.com/user-attachments/assets/f5c345cf-395b-4e48-bd84-c5f280e32d65"
/>

## How it works?

1. First we check if user is loggedIn
2. If so, gets it's addresses
3. Check for saved address (using the first of the list) postalCode and
geoCoordinate, If available we update the current session with those
information.

## How to test it?

First, we will need to simulate user logged. (you can follow this
[docs](https://docs.google.com/document/d/1DSwrD19dOvzFc650UAlLg4diyxmYTHaBD_4lxWQT8YY/edit?tab=t.0)
steps with more detail or follow the steps below)
1. Go to https://www.vtexfaststore.com/ and sign in, then copy the
cookies: _VtexIdclientAutCookie_storeframework_, _vtex_session_ and
_vtex_segment_
2. Running the store locally, paste those cookies.
3. Update the indexDB you should be able to see `person` object with
user's information (that was previously `null`)
4. Now, refresh the page.
5. if there is an address saved for this user, you should be able to see
the `postalCode` and `geoCoordinates` in the session
<img width="823" alt="image"
src="https://github.com/user-attachments/assets/1ecbb614-aa9f-4a46-bc0c-51b7e756aba6"
/>
<img width="885" alt="image"
src="https://github.com/user-attachments/assets/6dc80260-d705-4422-9c01-785a11982f94"
/>


### Starters Deploy Preview
https://github.com/vtex-sites/starter.store/pull/731

[Jira
Task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2205)
lariciamota pushed a commit that referenced this pull request Apr 8, 2025
)

## What's the purpose of this pull request?

This PR implements the scenario where the user is logged in, and when
the user's saved location (address and geo-coordinates) is available, it
is saved in the current session.

<img width="400" alt="Screenshot 2025-03-12 at 10 52 35"
src="https://github.com/user-attachments/assets/f5c345cf-395b-4e48-bd84-c5f280e32d65"
/>

## How it works?

1. First we check if user is loggedIn
2. If so, gets it's addresses
3. Check for saved address (using the first of the list) postalCode and
geoCoordinate, If available we update the current session with those
information.

## How to test it?

First, we will need to simulate user logged. (you can follow this
[docs](https://docs.google.com/document/d/1DSwrD19dOvzFc650UAlLg4diyxmYTHaBD_4lxWQT8YY/edit?tab=t.0)
steps with more detail or follow the steps below)
1. Go to https://www.vtexfaststore.com/ and sign in, then copy the
cookies: _VtexIdclientAutCookie_storeframework_, _vtex_session_ and
_vtex_segment_
2. Running the store locally, paste those cookies.
3. Update the indexDB you should be able to see `person` object with
user's information (that was previously `null`)
4. Now, refresh the page.
5. if there is an address saved for this user, you should be able to see
the `postalCode` and `geoCoordinates` in the session
<img width="823" alt="image"
src="https://github.com/user-attachments/assets/1ecbb614-aa9f-4a46-bc0c-51b7e756aba6"
/>
<img width="885" alt="image"
src="https://github.com/user-attachments/assets/6dc80260-d705-4422-9c01-785a11982f94"
/>


### Starters Deploy Preview
https://github.com/vtex-sites/starter.store/pull/731

[Jira
Task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2205)
lariciamota pushed a commit that referenced this pull request Apr 11, 2025
)

## What's the purpose of this pull request?

This PR implements the scenario where the user is logged in, and when
the user's saved location (address and geo-coordinates) is available, it
is saved in the current session.

<img width="400" alt="Screenshot 2025-03-12 at 10 52 35"
src="https://github.com/user-attachments/assets/f5c345cf-395b-4e48-bd84-c5f280e32d65"
/>

## How it works?

1. First we check if user is loggedIn
2. If so, gets it's addresses
3. Check for saved address (using the first of the list) postalCode and
geoCoordinate, If available we update the current session with those
information.

## How to test it?

First, we will need to simulate user logged. (you can follow this
[docs](https://docs.google.com/document/d/1DSwrD19dOvzFc650UAlLg4diyxmYTHaBD_4lxWQT8YY/edit?tab=t.0)
steps with more detail or follow the steps below)
1. Go to https://www.vtexfaststore.com/ and sign in, then copy the
cookies: _VtexIdclientAutCookie_storeframework_, _vtex_session_ and
_vtex_segment_
2. Running the store locally, paste those cookies.
3. Update the indexDB you should be able to see `person` object with
user's information (that was previously `null`)
4. Now, refresh the page.
5. if there is an address saved for this user, you should be able to see
the `postalCode` and `geoCoordinates` in the session
<img width="823" alt="image"
src="https://github.com/user-attachments/assets/1ecbb614-aa9f-4a46-bc0c-51b7e756aba6"
/>
<img width="885" alt="image"
src="https://github.com/user-attachments/assets/6dc80260-d705-4422-9c01-785a11982f94"
/>


### Starters Deploy Preview
https://github.com/vtex-sites/starter.store/pull/731

[Jira
Task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2205)
lariciamota pushed a commit that referenced this pull request Apr 22, 2025
)

## What's the purpose of this pull request?

This PR implements the scenario where the user is logged in, and when
the user's saved location (address and geo-coordinates) is available, it
is saved in the current session.

<img width="400" alt="Screenshot 2025-03-12 at 10 52 35"
src="https://github.com/user-attachments/assets/f5c345cf-395b-4e48-bd84-c5f280e32d65"
/>

## How it works?

1. First we check if user is loggedIn
2. If so, gets it's addresses
3. Check for saved address (using the first of the list) postalCode and
geoCoordinate, If available we update the current session with those
information.

## How to test it?

First, we will need to simulate user logged. (you can follow this
[docs](https://docs.google.com/document/d/1DSwrD19dOvzFc650UAlLg4diyxmYTHaBD_4lxWQT8YY/edit?tab=t.0)
steps with more detail or follow the steps below)
1. Go to https://www.vtexfaststore.com/ and sign in, then copy the
cookies: _VtexIdclientAutCookie_storeframework_, _vtex_session_ and
_vtex_segment_
2. Running the store locally, paste those cookies.
3. Update the indexDB you should be able to see `person` object with
user's information (that was previously `null`)
4. Now, refresh the page.
5. if there is an address saved for this user, you should be able to see
the `postalCode` and `geoCoordinates` in the session
<img width="823" alt="image"
src="https://github.com/user-attachments/assets/1ecbb614-aa9f-4a46-bc0c-51b7e756aba6"
/>
<img width="885" alt="image"
src="https://github.com/user-attachments/assets/6dc80260-d705-4422-9c01-785a11982f94"
/>


### Starters Deploy Preview
https://github.com/vtex-sites/starter.store/pull/731

[Jira
Task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2205)
lariciamota pushed a commit that referenced this pull request May 8, 2025
)

## What's the purpose of this pull request?

This PR implements the scenario where the user is logged in, and when
the user's saved location (address and geo-coordinates) is available, it
is saved in the current session.

<img width="400" alt="Screenshot 2025-03-12 at 10 52 35"
src="https://github.com/user-attachments/assets/f5c345cf-395b-4e48-bd84-c5f280e32d65"
/>

## How it works?

1. First we check if user is loggedIn
2. If so, gets it's addresses
3. Check for saved address (using the first of the list) postalCode and
geoCoordinate, If available we update the current session with those
information.

## How to test it?

First, we will need to simulate user logged. (you can follow this
[docs](https://docs.google.com/document/d/1DSwrD19dOvzFc650UAlLg4diyxmYTHaBD_4lxWQT8YY/edit?tab=t.0)
steps with more detail or follow the steps below)
1. Go to https://www.vtexfaststore.com/ and sign in, then copy the
cookies: _VtexIdclientAutCookie_storeframework_, _vtex_session_ and
_vtex_segment_
2. Running the store locally, paste those cookies.
3. Update the indexDB you should be able to see `person` object with
user's information (that was previously `null`)
4. Now, refresh the page.
5. if there is an address saved for this user, you should be able to see
the `postalCode` and `geoCoordinates` in the session
<img width="823" alt="image"
src="https://github.com/user-attachments/assets/1ecbb614-aa9f-4a46-bc0c-51b7e756aba6"
/>
<img width="885" alt="image"
src="https://github.com/user-attachments/assets/6dc80260-d705-4422-9c01-785a11982f94"
/>


### Starters Deploy Preview
https://github.com/vtex-sites/starter.store/pull/731

[Jira
Task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2205)
lariciamota pushed a commit that referenced this pull request May 12, 2025
)

## What's the purpose of this pull request?

This PR implements the scenario where the user is logged in, and when
the user's saved location (address and geo-coordinates) is available, it
is saved in the current session.

<img width="400" alt="Screenshot 2025-03-12 at 10 52 35"
src="https://github.com/user-attachments/assets/f5c345cf-395b-4e48-bd84-c5f280e32d65"
/>

## How it works?

1. First we check if user is loggedIn
2. If so, gets it's addresses
3. Check for saved address (using the first of the list) postalCode and
geoCoordinate, If available we update the current session with those
information.

## How to test it?

First, we will need to simulate user logged. (you can follow this
[docs](https://docs.google.com/document/d/1DSwrD19dOvzFc650UAlLg4diyxmYTHaBD_4lxWQT8YY/edit?tab=t.0)
steps with more detail or follow the steps below)
1. Go to https://www.vtexfaststore.com/ and sign in, then copy the
cookies: _VtexIdclientAutCookie_storeframework_, _vtex_session_ and
_vtex_segment_
2. Running the store locally, paste those cookies.
3. Update the indexDB you should be able to see `person` object with
user's information (that was previously `null`)
4. Now, refresh the page.
5. if there is an address saved for this user, you should be able to see
the `postalCode` and `geoCoordinates` in the session
<img width="823" alt="image"
src="https://github.com/user-attachments/assets/1ecbb614-aa9f-4a46-bc0c-51b7e756aba6"
/>
<img width="885" alt="image"
src="https://github.com/user-attachments/assets/6dc80260-d705-4422-9c01-785a11982f94"
/>


### Starters Deploy Preview
https://github.com/vtex-sites/starter.store/pull/731

[Jira
Task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2205)
lariciamota added a commit that referenced this pull request May 13, 2025
## What's the purpose of this pull request?

Feature branch for the Delivery Promise feature - phase 1 (navigation
based on shopper location).

- #2708 
- #2728
- #2739 
- #2745 
- #2749
- #2750
- #2768
- #2772 
- #2775
- #2809
- #2817 
- #2824 
- #2835

## How it works?


## How to test it?


### Starters Deploy Preview


## References
- [Jira epic](https://vtex-dev.atlassian.net/browse/SFS-1696)


## Checklist

- [ ] For documentation changes, ping `@Mariana-Caetano` to review and
update (Or submit a doc request)
- [ ] TODO: Request Doc for PopOver
- [ ] TODO: Remind to run cms sync in the default account when the
feature branch is merged since new section was added. (And add the new
section in the admin!)

---------

Co-authored-by: Lucas Feijó <[email protected]>
Co-authored-by: Fanny Chien <[email protected]>
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