@o3r/configuration 11.0.0-prerelease.1 → 11.0.0-prerelease.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -77
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -12,9 +12,11 @@ This package is an [Otter Framework Module](https://github.com/AmadeusITGroup/ot
|
|
|
12
12
|
[](https://www.npmjs.com/package/@o3r/configuration)
|
|
13
13
|
[](https://www.npmjs.com/package/@o3r/configuration)
|
|
14
14
|
|
|
15
|
-
This module contains configuration-related features (CMS
|
|
15
|
+
This module contains configuration-related features (compatibility with the generic configuration UI -- also known as CMS -- being used, configuration override, store, and debugging).
|
|
16
16
|
It comes with an integrated ng builder to help you generate configurations supporting the Otter CMS integration.
|
|
17
17
|
|
|
18
|
+
The aim of implementing `Configuration` inside components is to extract metadata from the application that will be used to override the application's configuration (such as the interface of a CMS).
|
|
19
|
+
|
|
18
20
|
## How to install
|
|
19
21
|
|
|
20
22
|
```shell
|
|
@@ -24,85 +26,14 @@ ng add @o3r/configuration
|
|
|
24
26
|
> [!WARNING]
|
|
25
27
|
> This module requires [@o3r/core](https://www.npmjs.com/package/@o3r/core) to be installed.
|
|
26
28
|
|
|
27
|
-
## Description
|
|
28
|
-
|
|
29
|
-
The aim of this document is to help developers to implement configuration inside components, in order to be compliant
|
|
30
|
-
with the **CMS architecture**. This will give the possibility to **Business Analysts** to configure the
|
|
31
|
-
application/components.
|
|
32
|
-
|
|
33
|
-
### Component config types
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
store config
|
|
38
|
-
│ Input config
|
|
39
|
-
│ (from parent)
|
|
40
|
-
│ Component default config │
|
|
41
|
-
│ (in config.ts file) │
|
|
42
|
-
│ │ │
|
|
43
|
-
│ overrides │ │
|
|
44
|
-
└──────────────────────────────>│ │
|
|
45
|
-
│ │
|
|
46
|
-
global config │ │
|
|
47
|
-
(no common props) │ │
|
|
48
|
-
│ │ │
|
|
49
|
-
│ │ │
|
|
50
|
-
│ merge │ │
|
|
51
|
-
└──────────────────────────────>│ │
|
|
52
|
-
│ │
|
|
53
|
-
│ │
|
|
54
|
-
│ overrides │
|
|
55
|
-
│<────────────────────────────────────
|
|
56
|
-
│
|
|
57
|
-
↓
|
|
58
|
-
Final component config
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
A component will have to handle different types of configurations.
|
|
62
|
-
|
|
63
|
-
#### Default configuration
|
|
64
|
-
|
|
65
|
-
- Each **component type** will have a default configuration which will be defined in the _.config.ts_ file associated to the
|
|
66
|
-
component
|
|
67
|
-
|
|
68
|
-
> [!WARNING]
|
|
69
|
-
> The field name 'id' should not be used in the configuration, as we created a unique one for the entity configuration store
|
|
70
|
-
|
|
71
|
-
#### Configuration coming from config store
|
|
72
|
-
|
|
73
|
-
- Each **component type** can have a customized config (compliant with the store model). This custom config can be
|
|
74
|
-
asynchronously loaded from a backend server or it can be injected in the body tag of the app. In both cases, this
|
|
75
|
-
content will be used to update the store.
|
|
76
|
-
- If present, it will override the default config. (Don't worry for the implementation now, we'll see it later)
|
|
77
|
-
|
|
78
|
-
#### Global config
|
|
79
|
-
|
|
80
|
-
- The common configuration is the one used in multiple components (it can be a date format, price display, type of input
|
|
81
|
-
form fields from an Angular material input element ...)
|
|
82
|
-
- A common configuration is defined in every library. The application common configuration (**global config**) will be
|
|
83
|
-
the result of the **merge of all common** configurations.
|
|
84
|
-
- The common configuration is **not overridden** at component type (there will be no properties with the same name in
|
|
85
|
-
common config and components).
|
|
86
|
-
- At runtime the components can access fields from global configuration thanks to the configuration service
|
|
87
|
-
|
|
88
|
-
#### Input config
|
|
89
|
-
|
|
90
|
-
- The configuration of a **component instance** can be overridden via @Input config
|
|
91
|
-
|
|
92
|
-
**The priorities for the config**:
|
|
93
|
-
|
|
94
|
-
- the highest priority is the one passed as input from a parent component
|
|
95
|
-
- the second priority is the one by component type set in the store
|
|
96
|
-
- the lowest priority is the default config set on the component (in the config.ts file of the component)
|
|
97
|
-
|
|
98
29
|
## Generators
|
|
99
30
|
|
|
100
|
-
Otter framework provides a set of code generators based on [
|
|
31
|
+
The Otter framework provides a set of code generators based on [Angular schematics](https://angular.io/guide/schematics).
|
|
101
32
|
|
|
102
|
-
| Schematics | Description
|
|
103
|
-
| --------------------------
|
|
104
|
-
| add | Include Otter configuration module in a library / application
|
|
105
|
-
| configuration-to-component | Add configuration to an Otter component
|
|
33
|
+
| Schematics | Description | How to use |
|
|
34
|
+
| -------------------------- |-------------------------------------------------------------------| --------------------------------- |
|
|
35
|
+
| add | Include the Otter configuration module in a library / application | `ng add @o3r/configuration` |
|
|
36
|
+
| configuration-to-component | Add configuration to an Otter component | `ng g configuration-to-component` |
|
|
106
37
|
|
|
107
38
|
|
|
108
39
|
## More details
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/configuration",
|
|
3
|
-
"version": "11.0.0-prerelease.
|
|
3
|
+
"version": "11.0.0-prerelease.10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"@angular/platform-browser-dynamic": "~17.3.0",
|
|
52
52
|
"@ngrx/entity": "~17.2.0",
|
|
53
53
|
"@ngrx/store": "~17.2.0",
|
|
54
|
-
"@o3r/core": "^11.0.0-prerelease.
|
|
55
|
-
"@o3r/logger": "^11.0.0-prerelease.
|
|
56
|
-
"@o3r/schematics": "^11.0.0-prerelease.
|
|
57
|
-
"@o3r/testing": "^11.0.0-prerelease.
|
|
54
|
+
"@o3r/core": "^11.0.0-prerelease.10",
|
|
55
|
+
"@o3r/logger": "^11.0.0-prerelease.10",
|
|
56
|
+
"@o3r/schematics": "^11.0.0-prerelease.10",
|
|
57
|
+
"@o3r/testing": "^11.0.0-prerelease.10",
|
|
58
58
|
"@schematics/angular": "~17.3.0",
|
|
59
59
|
"cheerio": "^1.0.0-rc.10",
|
|
60
60
|
"express-interceptor": "^1.2.0",
|