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

Update to Angular 18 and standalone API #247

Merged
merged 34 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f7c362a
build: update clr for angular update
boeckMt Oct 4, 2024
6f806fd
BREAKING CHANGE: update to angular 18
boeckMt Oct 7, 2024
4c75c99
BREAKING CHANGE: refactor cookie-alert to standalone
boeckMt Oct 11, 2024
bc49617
fix: type error in template
boeckMt Oct 11, 2024
db24a03
fix: update styles for clr v17
boeckMt Oct 11, 2024
7e16e12
fix: core-ui schemantic ts config no baseUrl
boeckMt Oct 11, 2024
e44a98f
fix: core-ui, icons, replace not found import from cds
boeckMt Oct 11, 2024
0f3ba73
BREAKING CHANGE: refactor core-ui to standalone
boeckMt Oct 11, 2024
4a79d5f
BREAKING CHANGE: refactor core-ui schematics and layer-control to sta…
boeckMt Oct 11, 2024
194fb9a
BREAKING CHANGE: refactor map-ol to standalone
boeckMt Oct 14, 2024
1c3220c
fix: icon shapes in demo from update ng 17
boeckMt Oct 14, 2024
ae656de
BREAKING CHANGE: refactor map-cesium to standalone
boeckMt Oct 14, 2024
9ced053
BREAKING CHANGE: refactor map-maplibre to standalone
boeckMt Oct 14, 2024
e7b4a4f
BREAKING CHANGE: refactor map-three to standalone
boeckMt Oct 14, 2024
5ce22fe
BREAKING CHANGE: refactor map-tools to standalone
boeckMt Oct 14, 2024
59240e2
BREAKING CHANGE: refactor services-layers to standalone
boeckMt Oct 14, 2024
ac48c2d
BREAKING CHANGE: refactor services-map-state to standalone
boeckMt Oct 14, 2024
53ba3a6
BREAKING CHANGE: refactor services-ogc to standalone
boeckMt Oct 14, 2024
44ac68b
BREAKING CHANGE: refactor services-util-store to standalone
boeckMt Oct 14, 2024
6ea37b8
BREAKING CHANGE: refactor user-info to standalone
boeckMt Oct 14, 2024
424abef
docs: refactor tutorials to standalone
boeckMt Oct 14, 2024
cd4092a
refactor: demos to standalone api
boeckMt Oct 14, 2024
26846b7
build: update jasmine to 5
boeckMt Oct 14, 2024
e3dcf0a
refactor: to angular control flow syntax
boeckMt Oct 14, 2024
b50f868
fix: cds icon direction and update of @angular/cdk
boeckMt Oct 14, 2024
b525013
fix: datagrid from migration to control flow syntax
boeckMt Oct 14, 2024
a2c69fe
build: bump a view dependencies
boeckMt Oct 14, 2024
6a97dda
build: pre-version 15.0.0-next.0
boeckMt Oct 14, 2024
832a421
fix: dimension switch
lucas-angermann Oct 18, 2024
79ee484
fix: do not import libs relative - errors with build dist
boeckMt Oct 21, 2024
7ccb75e
fix: Schematics transpile after build
boeckMt Oct 21, 2024
f314883
fix: map-maplibre relativ module paths
lucas-angermann Oct 22, 2024
291a3ee
fix: further relative paths to libs
boeckMt Oct 23, 2024
c682287
build: pre-version 15.0.0-next.1
boeckMt Oct 23, 2024
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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
### Breaking Changes
- Update angular from `^17.3.11` to `^18.2.7`
- Refactor all libraries and apps to [angular standalone API](https://angular.dev/reference/migrations/standalone).
- Refactor all libraries and apps to [angular Control Flow syntax](https://angular.dev/reference/migrations/control-flow).

### Bug Fixes
* **@dlr-eoc/core-ui:**
- Update styles for `@clr 17`
- Schematics add path in tsconfig no baseUrl
- Replace not found import `IconShapeTuple` from `@cds/core`
- Schematics transpile after build because custom buiulder was removed in [v14.0.0](https://github.com/dlr-eoc/ukis-frontend-libraries/tree/v14.0.0/projects/core-ui/schematics).

* **@dlr-eoc/layer-control:**
- Fix direction of `@cds` icon


# [14.0.0](https://github.com/dlr-eoc/ukis-frontend-libraries/tree/v14.0.0) (2024-08-05) (map-cesium, angular update, @clr and @cds update)

### Breaking Changes
Expand Down
148 changes: 80 additions & 68 deletions TUTORIALS.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check the tutorial after the PR with a fresh installation and also look at the map-cesium readme.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install -g @angular/cli@<version>

- Then run:
```
ng new project-tutorial-map --style=scss
ng new project-tutorial-map --style=scss --standalone=true
```
- We do not need angular routing, so decline the prompt with `N`

Expand All @@ -30,35 +30,46 @@ cd project-tutorial-map
npm install @cds/core@<version> @clr/angular@<version> @clr/ui@<version>
```

- Add the Clarity module and icons inside the app.module.ts:
``` import { NgModule } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { ClarityModule } from "@clr/angular";
import { coreCollectionIcons, essentialCollectionIcons, ClarityIcons } from '@cds/core/icon';
import { AppComponent } from "./app.component";
- Add Clarity Styles: This is done later by adding the UKIS Theme

ClarityIcons.addIcons(...coreCollectionIcons);
ClarityIcons.addIcons(...essentialCollectionIcons);
- Add the Clarity module to app.config.ts:
```
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
import { ClarityModule } from '@clr/angular';
import { provideAnimations } from '@angular/platform-browser/animations';
import { BrowserModule } from '@angular/platform-browser';


export const appConfig: ApplicationConfig = {
providers: [
...
importProvidersFrom(BrowserModule, ClarityModule, ...),
provideAnimations() //Replacement for BrowserAnimationsModule
]
};
```

- Add Clarity icons to any component that uses them.

e.g. in AppComponent
```
import { coreCollectionIcons, essentialCollectionIcons, ClarityIcons } from '@cds/core/icon';

ClarityIcons.addIcons(...coreCollectionIcons);
ClarityIcons.addIcons(...essentialCollectionIcons);

@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
ClarityModule,
...
],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
```



- Set Clarity Theme (index.html)
```
<body cds-theme="light" />
```
- For more information see [Adding Clarity to an Angular project](https://clarity.design/documentation/get-started#seedProjectAngular)
- For more information see
- [Adding Clarity to an Angular project](https://clarity.design/documentation/get-started#seedProjectAngular)
- [Step 2: Include the Clarity and Core Styles](https://clarity.design/pages/developing)
- [Step 5: Add Clarity to Angular Application](https://clarity.design/pages/developing)


### 4. Run the ng add command for the UKIS core-ui
Expand Down Expand Up @@ -99,16 +110,21 @@ e.g. in your apps style file (src/styles.css)

```

### 3. Add the following to the app.module.ts:
### 3. Add the following to example-view.component.ts:
```
import { MapOlModule } from '@dlr-eoc/map-ol';
import { MapOlComponent, MapOlService } from '@dlr-eoc/map-ol';
import { LayerControlComponent, LayersService } from '@dlr-eoc/layer-control';
import { MapStateService } from '@dlr-eoc/services-map-state';

...

imports: [
...
MapOlModule
]
providers: [LayersService, MapStateService, MapOlService],
standalone: true,
imports: [
...
MapOlComponent,
LayerControlComponent
]
```

### 4. Also replace the example-view.component.html with:
Expand All @@ -122,41 +138,35 @@ This is necessary, as we do not have a footer or a side nav at the moment.

### 6. Add the following to example-view.component.ts:
```
import { LayersService } from '@dlr-eoc/services-layers';
import { MapStateService } from '@dlr-eoc/services-map-state';
...
import { IMapControls } from '@dlr-eoc/map-ol';
import { OsmTileLayer, EocLitemap, BlueMarbleTile } from '@dlr-eoc/base-layers-raster';

import { OsmTileLayer, EocLitemap, BlueMarbleTile, EocLiteoverlayTile } from '@dlr-eoc/base-layers-raster';
```


```
controls!: IMapControls;
...
controls: IMapControls;
constructor(
public layerSvc: LayersService,
public mapStateSvc: MapStateService
) { }
```

```
ngOnInit() {
this.addBaselayers();
this.addBaselayers();
}

addBaselayers() {
const layers = [
new OsmTileLayer({
visible: false
}),
new EocLitemap({
visible: true
}),
new BlueMarbleTile({
visible: false
})
];

layers.map(l => this.layerSvc.addLayer(l, 'Baselayers'));
const layers = [
new OsmTileLayer({
visible: false
}),
new EocLitemap({
visible: true
}),
new BlueMarbleTile({
visible: false
})
];

layers.map(l => this.layerSvc.addLayer(l, 'Baselayers'));
}
```

Expand All @@ -170,13 +180,13 @@ To enable more interaction with the application we are now adding the layer cont
npm install @dlr-eoc/layer-control
```
```
import { LayerControlModule } from '@dlr-eoc/layer-control';
import { LayerControlComponent } from '@dlr-eoc/layer-control';

...

imports: [
...
LayerControlModule
LayerControlComponent
]
```
More information about this library can be found [in the layer-control library folder](projects/layer-control/README.md).
Expand Down Expand Up @@ -223,21 +233,21 @@ import { LayersService, Layer, WmtsLayer, RasterLayer } from '@dlr-eoc/services-

```
ngOnInit() {
this.addBaselayers();
this.addLayers();
this.addOverlays();
this.addBaselayers();
this.addLayers();
this.addOverlays();
}

addBaselayers() {
const layers: Layer[] = [
...
];
const layers: Layer[] = [
...
];

layers.map(l => this.layerSvc.addLayer(l, 'Baselayers'));
layers.map(l => this.layerSvc.addLayer(l, 'Baselayers'));
}

addLayers() {
const layers: Layer[] = [
const layers: Layer[] = [
new WmtsLayer({
type: 'wmts',
url: 'https://tiles.geoservice.dlr.de/service/wmts',
Expand All @@ -259,6 +269,7 @@ addLayers() {
legendImg: 'https://tiles.geoservice.dlr.de/service/wmts?layer=TDM90_DEM&style=default&tilematrixset=EPSG%3A3857&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix=EPSG%3A3857%3A4&TileCol=8&TileRow=5',
cssClass: 'custom-layer'
}),

new RasterLayer({
type: 'wms',
url: 'https://geoservice.dlr.de/eoc/land/wms',
Expand All @@ -274,6 +285,7 @@ addLayers() {
attribution: ' | GUF®: <a href="https://www.dlr.de/eoc/en/desktopdefault.aspx/tabid-9628/16557_read-40454/">DLR License</a>',
legendImg: '',
}),

new RasterLayer({
type: 'wms',
url: 'https://geoservice.dlr.de/eoc/land/wms',
Expand All @@ -289,18 +301,18 @@ addLayers() {
attribution: 'DLR/EOC: <a href="https://www.dlr.de/eoc/</a>',
legendImg: 'https://geoservice.dlr.de/eoc/land/wms?service=WMS&version=1.3.0&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=WSF_Evolution',
})
];
];

layers.map(l => this.layerSvc.addLayer(l, 'Layers'));
layers.map(l => this.layerSvc.addLayer(l, 'Layers'));
}

addOverlays(){
const layers: Layer[] = [
const layers: Layer[] = [
new EocLiteoverlayTile({
visible: false,
displayName: 'Litelables'
})
];
];

layers.map(l => this.layerSvc.addLayer(l, 'Overlays'));
}
Expand All @@ -317,7 +329,7 @@ import { MapStateService, IMapState } from '@dlr-eoc/services-map-state';
...

controls!: IMapControls;
/** Europe */
/** Europe */
public startState: IMapState = {
zoom: 4.8,
center: {
Expand Down Expand Up @@ -348,7 +360,7 @@ constructor(
scaleLine: true,
zoom: true
};
}
}
```
- As we have made some changes to the application, you should increase the version in the package.json to "1.0.0".
- You can adjust the application title, short title and description inside the corresponding meta tags in the index.html.
Expand Down
Loading
Loading