From 5589120ed73d394db88148446bcc65e4b8a5eed4 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Mon, 17 Jun 2019 11:46:28 +0100 Subject: [PATCH] [ADF-4657] Upgrade Guide (#4855) * fix documentation missing params * fix index * fix aftere release * fix aftere review * upgrade guide from 3.2.0 to 3.3.0 * upgrade guide from 3.2.0 to 3.3.0 --- docs/README.md | 2 +- docs/core/pipes/localized-date.pipe.md | 18 ++++- docs/upgrade-guide/README.md | 12 +++ docs/upgrade-guide/upgrade32-33.md | 103 +++++++++++++++++++++++++ 4 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 docs/upgrade-guide/README.md create mode 100644 docs/upgrade-guide/upgrade32-33.md diff --git a/docs/README.md b/docs/README.md index fbb74f4f9b..b583b2eaae 100644 --- a/docs/README.md +++ b/docs/README.md @@ -40,7 +40,7 @@ A few other pages of information are also available: libraries used by ADF along with links to their Open Source licenses. - The [Breaking changes](breaking-changes/breaking-change-2.6.0-3.0.0.md) section lists all breaking changes between major versions, such as removal of deprecated items. -- The [Upgrade guide](upgrade-guide/upgrade26-30.md) explains how to upgrade your project from an earlier version of ADF to the current version. +- The [Upgrade guide](upgrade-guide/README.md) explains how to upgrade your project from an earlier version of ADF to the current version. ## Contents diff --git a/docs/core/pipes/localized-date.pipe.md b/docs/core/pipes/localized-date.pipe.md index 103669a998..7f8d9d6b63 100644 --- a/docs/core/pipes/localized-date.pipe.md +++ b/docs/core/pipes/localized-date.pipe.md @@ -31,4 +31,20 @@ Converts a date to a given format and locale. The pipe takes a date and formats it and localizes it so the date is displayed in the proper format for the region. It uses the [Angular Date Pipe](https://angular.io/api/common/DatePipe#custom-format-options) so all the pre-defined and custom formats can be used. -When localizing a date, you will need to add the specific locale file for your region in order to use it. Read more about internationalization [here](https://angular.io/guide/i18n#i18n-pipes). +To localize the dates in your application, you will need to add the specific locale file for your region in order to use it. Read more about internationalization [here](https://angular.io/guide/i18n#i18n-pipes). + +If you want add the japanese date localization in your ADF app you can add in your ```app.module.ts```: + +```typescript +import { AppConfigService, TRANSLATION_PROVIDER, DebugAppConfigService, CoreModule, CoreAutomationService } from '@alfresco/adf-core'; + +..... +..... + +import { registerLocaleData } from '@angular/common'; +import localeJa from '@angular/common/locales/ja'; + +registerLocaleData(localeJa); + + +``` diff --git a/docs/upgrade-guide/README.md b/docs/upgrade-guide/README.md new file mode 100644 index 0000000000..e81bf00dc1 --- /dev/null +++ b/docs/upgrade-guide/README.md @@ -0,0 +1,12 @@ +--- +Title: Upgrade guides +--- + +# Upgrade guides + +Below are links to the upgrade guides notes for all released versions of ADF back to v2.6.0 + +- [Upgrading from ADF v2.6 to v3.0](upgrade26-30.md) +- [Upgrading from ADF v3.0 to v3.1](upgrade30-31.md) +- [Upgrading from ADF v3.1 to v3.2](upgrade31-32.md) +- [Upgrading from ADF v3.2 to v3.3](upgrade32-33.md) diff --git a/docs/upgrade-guide/upgrade32-33.md b/docs/upgrade-guide/upgrade32-33.md new file mode 100644 index 0000000000..a631fccddd --- /dev/null +++ b/docs/upgrade-guide/upgrade32-33.md @@ -0,0 +1,103 @@ +--- +Title: Upgrading from ADF v3.2 to v3.3 +--- + +# Upgrading from ADF v3.2 to v3.3 + +This guide explains how to upgrade your ADF v3.2 project to work with v3.3. + +Do not skip this task, if you want your application to be updated to a most recent version of ADF. Upgrades of multiple versions of ADF cannot be done in one step only, but should follow the chain of sequential updates. + +**Note:** the steps described below might involve making changes +to your code. If you are working with a versioning system then you should +commit any changes you are currently working on. If you aren't using versioning +then be sure to make a backup copy of your project before going ahead with the +upgrade. + +## Library updates + +### Automatic update using the Yeoman Generator + +If your application has few changes from the original app created by the +[Yeoman generator](https://github.com/Alfresco/generator-ng2-alfresco-app) +then you may be able to update your project with the following steps: + +1. Update the Yeoman generator to the latest version (3.3.0). Note that + you might need to run these commands with `sudo` on Linux or MacOS: + + ```sh + npm uninstall -g generator-alfresco-adf-app + npm install -g generator-alfresco-adf-app + ``` + +2. Run the new yeoman app generator: + + ```sh + yo alfresco-adf-app + ``` + +3. Clean your old distribution and dependencies by deleting the `node_modules` folder + and the `package-lock.json` file. + +4. Install the dependencies: + ```sh + npm install + ``` + +At this point, the generator might have overwritten some of your code where it differs from +the original generated app. Be sure to check for any differences from your project code +(using a versioning system might make this easier) and if there are any differences, +retrofit your changes. When you have done this, you should be able to start the application +as usual: + +```sh +npm run start +``` + +After starting the app, if everything is working fine, that's all and you don't need to do anything else. However, if things don't work as they should then recover the original version of the project and try the manual approach. + +### Manual update + +1. Update the `package.json` file with the latest library versions: + ```json + "dependencies": { + ... + "@alfresco/adf-core": "3.3.0", + "@alfresco/adf-content-services": "3.3.0", + "@alfresco/adf-process-services-cloud": "3.3.0", + "@alfresco/adf-insights": "3.3.0", + "@alfresco/js-api": "3.3.0", + ... + ``` + +2. Clean your old distribution and dependencies by deleting `node_modules` and `package-lock.json`. + +3. Reinstall your dependencies + ```sh + npm install + ``` + +## Using the localized date pipe + +Date values are also localized in your ADF app. By default they are localized to en-US, although you can easily change this by adding the localization files provided by Angular. + +If you want to use a different locale simply add the locale file for your region in your `app.module.ts`. + + + + import { registerLocaleData } from '@angular/common'; + import localeFr from '@angular/common/locales/fr'; + + registerLocaleData(localeFr); + + + +Usage of the [localized date pipe](../core/pipes/localized-date.pipe.md). + + + + {{ date | adfLocalizedDate: format : locale }} + + + +Find more info about this in the [Angular sDocs](https://angular.io/guide/i18n#setting-up-the-locale-of-your-app).