Skip to content

Commit 75ce0cc

Browse files
authored
Release 3.35.0
2 parents b53deb3 + 3455ddd commit 75ce0cc

File tree

118 files changed

+5624
-1450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+5624
-1450
lines changed

build/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ RUN if [ "$SENTRY_AUTH_TOKEN" != "" ] ; then \
7070

7171
### PROD image
7272

73-
FROM nginx:1.25.4-alpine
73+
FROM nginx:1.25.5-alpine
7474
COPY ./build/default.conf /etc/nginx/templates/default.conf
7575
COPY --from=builder /app/dist/ /usr/share/nginx/html
7676
# The port on which the app will run in the Docker container
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# How to create a custom View Component
2+
We aim to build flexible, reusable components.
3+
If you implement a custom component using the building blocks of Aam Digital's platform, this can seamlessly be displayed both in modal forms and as a fullscreen view.
4+
5+
## Architecture & Generic wrapper components
6+
The following architecture allows you to implement components that only have `@Input` properties
7+
and do not access either Route or Dialog data directly.
8+
Instead, the platform always uses `RoutedViewComponent` or `DialogViewComponent` to parse such context and pass it into your component as simple Angular @Inputs.
9+
10+
![](../../images/routed-views.png)
11+
12+
If you implement a special view to display a single entities' details, you should also extend `AbstractEntityDetailsComponent` with your component.
13+
This takes care of loading the entity from the database, in case it is passed in as an id from the URL.
14+
15+
## Implementing a custom view Component
16+
17+
1. Create a new component class
18+
2. Add any `@Input()` properties for values that are provided from the config.
19+
3. For EntityDetails views, you get access to an `@Input() entity` and `@Input() entityConstructor` via the `AbstractEntityDetailsComponent` automatically. Otherwise, you do not have to extend from this.
20+
4. Use `<app-view-title>` and `<app-view-actions>` in your template to wrap the elements (if any) that you want to display as a header and action buttons.
21+
These parts are automatically placed differently in the layout depending on whether your component is display as a fullscreen, routed view (actions displayed top right) or as a dialog/modal (actions displayed fixed at bottom).
22+
5. Register your component under a name (string) with the `ComponentRegistry` (usually we do this in one of the modules), so that it can be referenced under this string form the config.
23+
6. You can then use it in config, as shown below.
24+
25+
Example template for a custom view component:
26+
```html
27+
<app-view-title>
28+
<!-- the title is specially fixed and receives a back button or dialog close -->
29+
My Entity {{ entity.name }}
30+
</app-view-title>
31+
32+
<!-- anything in the template not specially marked/wrapped is used as main content -->
33+
<div>
34+
My Custom View Content
35+
</div>
36+
37+
<app-view-actions>
38+
<!-- some action buttons, e.g. using the app-dialog-buttons or anything else -->
39+
<app-dialog-buttons [form]="form" [entity]="entity"></app-dialog-buttons>
40+
</app-view-actions>
41+
```
42+
43+
An example config for the above:
44+
```json
45+
{
46+
"component": "MyView",
47+
"config": { "showDescription": true }
48+
}
49+
```
50+
51+
Use the `ComponentRegistry` to register your component,
52+
e.g. in its Module:
53+
```javascript
54+
export class MyModule {
55+
constructor(components: ComponentRegistry) {
56+
components.addAll([
57+
[
58+
"MyView", // this is the name to use in the config document
59+
() => import("./my-view/my-view.component").then((c) => c.MyViewComponent),
60+
],
61+
]);
62+
}
63+
}
64+
```

doc/compodoc_sources/how-to-guides/create-entity-details-panel.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Those background details aside, what that means for your implementation is:
2121
(e.g. `@Input() showDescription: boolean;`, which you can use in your template or code to adapt the component.)
2222
These values are automatically set to whatever value is specified in the config object for your component at runtime in the database.
2323
4. Register the new component in its parent module, so that it can be loaded under its name through the config.
24+
(for details see [Create a custom View Component](./create-a-custom-view-component.html))
2425

2526
An example config for the above:
2627
```json
@@ -29,18 +30,3 @@ An example config for the above:
2930
"config": { "showDescription": true }
3031
}
3132
```
32-
33-
Use the `ComponentRegistry` to register your component,
34-
e.g. in its Module:
35-
```javascript
36-
export class MyModule {
37-
constructor(components: ComponentRegistry) {
38-
components.addAll([
39-
[
40-
"MySubView", // this is the name to use in the config document
41-
() => import("./my-sub-view/my-sub-view.component").then((c) => c.MySubViewComponent),
42-
],
43-
]);
44-
}
45-
}
46-
```

doc/compodoc_sources/summary.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@
119119
"title": "Create a New Entity Type",
120120
"file": "how-to-guides/create-new-entity-type.md"
121121
},
122+
{
123+
"title": "Create a custom View Component",
124+
"file": "how-to-guides/create-custom-view.md"
125+
},
122126
{
123127
"title": "Create an Entity Details Panel",
124128
"file": "how-to-guides/create-entity-details-panel.md"

doc/images/routed-views.png

77.8 KB
Loading

package-lock.json

Lines changed: 71 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@
3838
"@casl/angular": "^8.2.3",
3939
"@faker-js/faker": "^8.4.0",
4040
"@fortawesome/angular-fontawesome": "^0.14.1",
41-
"@fortawesome/fontawesome-svg-core": "^6.5.1",
42-
"@fortawesome/free-regular-svg-icons": "^6.5.1",
43-
"@fortawesome/free-solid-svg-icons": "^6.5.1",
41+
"@fortawesome/fontawesome-svg-core": "^6.5.2",
42+
"@fortawesome/free-regular-svg-icons": "^6.5.2",
43+
"@fortawesome/free-solid-svg-icons": "^6.5.2",
4444
"@ngneat/until-destroy": "^10.0.0",
45-
"@sentry/browser": "^7.102.0",
45+
"@sentry/browser": "^7.108.0",
4646
"angulartics2": "^12.2.1",
4747
"assert": "^2.1.0",
4848
"crypto-es": "^2.1.0",
4949
"deep-object-diff": "^1.1.9",
5050
"hammerjs": "^2.0.8",
5151
"json-query": "^2.2.2",
5252
"keycloak-angular": "^15.1.0",
53-
"keycloak-js": "^24.0.1",
53+
"keycloak-js": "^24.0.2",
5454
"leaflet": "^1.9.4",
5555
"lodash-es": "^4.17.21",
5656
"md5": "^2.3.0",

0 commit comments

Comments
 (0)