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

FSA - Updated the upgrade document #1423

Merged
merged 2 commits into from
Mar 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 25 additions & 36 deletions _pages/fsa/fsa-updating-to-version-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,46 +85,14 @@ For more information, see the official [Angular Update Guide](https://update.ang

Before upgrading your FSA Spartacus libraries to version 4.x, you must address the following prerequisites:

- **Angular CLI**: Version [12.0.5](https://update.angular.io/) or later
- **node.js**: Version 14.18.1 or later
- **Angular CLI**: Version [12.0.5](https://update.angular.io/) or later.
- **node.js**: Version 14.18.1 or later.
- **Spartacus**: Minimum version [4.0](https://sap.github.io/spartacus-docs/updating-to-version-4/), the latest minor/patch version is recommended.

**NOTE**: In order for this upgrade to proceed without any errors, you need to have the new Spartacus app directory structure in place.
Simply changing the version in `package.json` file is not enough.
For instructions on how to create new app directory structure, see [Spartacus documentation](https://sap.github.io/spartacus-docs/updating-to-version-4/).

### Specifying Configuration Options for FSA Spartacus

Once you have created the new app directory structure as described in the previous step, you need to specify configuration options necessary for FSA.
This configuration should be declared after all other Spartacus modules, and should contain the following:

```ts
provideConfig(<OccConfig | SiteContextConfig>{
backend: {
occ: {
prefix: '/occ/v2/',
baseUrl: '/--path to the server--/',
},
},
context: {
baseSite: ['financial'],
language: ['en', 'de'],
currency: ['EUR'],
urlParameters: ['baseSite', 'language', 'currency'],
},
authentication: {
client_id: 'financial_customer',
client_secret: 'secret',
},
features: {
consignmentTracking: true,
},
}),
```

### Updating FSA Spartacus

1. Depending on whether you use yarn or npm for installations, delete `yarn.lock` file or `package-lock.json` file from your project.
1. Depending on whether you use `yarn` or `npm` for installations, delete `yarn.lock` file or `package-lock.json` file from your project.

2. Go to the `package.json` file at the root of your project and replace existing dependencies with the following:

Expand Down Expand Up @@ -190,9 +158,30 @@ provideConfig(<OccConfig | SiteContextConfig>{
"zone.js": "~0.11.4"
```

3. To complete the update, run the following commands:
3. Next, install dependencies with the following command:

```shell
yarn install
```

4. After the installation is completed, your app structure needs to be updated to meet new Spartacus requirements.
To do that, you need to replace the existing `app` folder with the one that contains the required structure.
You can download a ready-made `app` folder with the new structure on the link provided below.
Perform the following steps:
- [Download new app.zip](https://github.com/SAP/spartacus-financial-services-accelerator/releases/download/fsa-storefront-4.0.0/app.zip).
- Navigate to `mystore/src/`.
- Delete the existing `app` folder.
- Unpack the downloaded `app.zip` folder to that same location (`mystore/src/`).

5. Now that you have the new app structure, you need to set the `baseUrl`:
- Navigate to `app/spartacus`.
- Find and open `fs-configuration.module.ts`, which holds the configuration necessary for the FSA to function correctly.
- Edit `baseUrl` property so that it points to your back-end server.

6. To complete the update, run the following command:

```shell
yarn start
```