Skip to content

Commit

Permalink
Merge pull request #1325 from swisstopo/on_test_2024-08-05
Browse files Browse the repository at this point in the history
Draft On test 2024 08 05
  • Loading branch information
vladyslav-tk authored Aug 19, 2024
2 parents 02495e2 + 4a50406 commit 50611f6
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 35 deletions.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,43 @@ You are welcome to use and adapt this software for your own uses; see [LICENSE](

## Your own version: getting started

Clone the repository
```bash
git clone https://github.com/swissgeol/ngm.git
cd ngm
```

### Linux and Mac OS X

> **Install** *node.js and npm*
> See instructions at [https://nodejs.org/en/download/package-manager](https://nodejs.org/en/download/package-manager)
#### Start frontend

From the root directory change to the ```ui```-dirrectory
```bash
cd ui
```
Install dependencies
```bash
npm install
```
start development server
```bash
npm start
```

open http://localhost:8000

#### Start backend api

> **Install** *Docker*
> See instructions at [https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/)
> **Install** *rust and cargo*
> See instructions at [https://doc.rust-lang.org/cargo/getting-started/installation.html](https://doc.rust-lang.org/cargo/getting-started/installation.html)
Start the api and application
```bash
make run
```

Expand Down
2 changes: 0 additions & 2 deletions ui/locales/app.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@
"header_search_placeholder": "Suche...",
"lsb_cesium_toolbar_label": "Cesium-Toolbar",
"lsb_debug_tools": "Debugtools",
"lsb_login": "Login",
"lsb_logout": "Logout",
"lsb_settings": "Einstellungen",
"lsb_share": "Teilen",
"lyr_3d_model_berne_label": "3D-Modell Stadt Bern",
Expand Down
2 changes: 0 additions & 2 deletions ui/locales/app.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@
"header_search_placeholder": "Search...",
"lsb_cesium_toolbar_label": "Cesium Toolbar",
"lsb_debug_tools": "Debug tools",
"lsb_login": "Login",
"lsb_logout": "Logout",
"lsb_settings": "Settings",
"lsb_share": "Share",
"lyr_3d_model_berne_label": "City of Bern",
Expand Down
2 changes: 0 additions & 2 deletions ui/locales/app.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@
"header_search_placeholder": "Recherche...",
"lsb_cesium_toolbar_label": "Cesium Toolbar",
"lsb_debug_tools": "Debug tools",
"lsb_login": "Connexion",
"lsb_logout": "Déconnexion",
"lsb_settings": "Paramètres",
"lsb_share": "Partager",
"lyr_3d_model_berne_label": "Modèle 3D Ville de Berne",
Expand Down
2 changes: 0 additions & 2 deletions ui/locales/app.it.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@
"header_search_placeholder": "Ricercare...",
"lsb_cesium_toolbar_label": "Cesium Toolbar",
"lsb_debug_tools": "Debug tools",
"lsb_login": "Connessione",
"lsb_logout": "Diconnessione",
"lsb_settings": "Impostazioni",
"lsb_share": "Condividere",
"lyr_3d_model_berne_label": "Modello 3D Città di Berna",
Expand Down
4 changes: 1 addition & 3 deletions ui/src/elements/ngm-auth.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {html} from 'lit';
import type {AuthUser} from '../auth';
import Auth from '../auth';
import i18next from 'i18next';
import {LitElementI18n} from '../i18n.js';
import auth from '../store/auth';
import {classMap} from 'lit/directives/class-map.js';
Expand Down Expand Up @@ -62,8 +61,7 @@ export class NgmAuth extends LitElementI18n {
return html`
<div class="ngm-user ${classMap({'ngm-active-section': !!this.user})}"
@click=${!this.user ? this.login : this.logout}>
<div class="ngm-user-icon"></div>
${!this.user ? i18next.t('lsb_login') : i18next.t('lsb_logout')}
<div class="ngm-user-icon"></div>
</div>`;
}

Expand Down
36 changes: 20 additions & 16 deletions ui/src/elements/ngm-side-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ export class SideBar extends LitElementI18n {
class="ngm-mob-menu-toggle"
@click=${() => this.mobileShowAll = !this.mobileShowAll}>
<div class="${classMap({
'ngm-view-all-icon': !this.mobileShowAll,
'ngm-view-less-icon': this.mobileShowAll
})}"></div>
'ngm-view-all-icon': !this.mobileShowAll,
'ngm-view-less-icon': this.mobileShowAll
})}"></div>
</div>
</div>
<div .hidden=${this.mobileView} class="ngm-menu-2">
Expand Down Expand Up @@ -266,15 +266,19 @@ export class SideBar extends LitElementI18n {
<div class="ngm-close-icon" @click=${() => this.activePanel = ''}></div>
</div>
<div class="toolbar-settings">
<label>${i18next.t('lsb_debug_tools')}</label>
<div class="ngm-checkbox ngm-debug-tools-toggle ${classMap({active: this.debugToolsActive})}"
@click=${() => (<HTMLInputElement> this.querySelector('.ngm-debug-tools-toggle > input')).click()}>
<input type="checkbox" ?checked=${this.debugToolsActive} @change="${this.toggleDebugTools}">
<span class="ngm-checkbox-icon">
</span>
<label>${i18next.t('lsb_cesium_toolbar_label')}</label>
<div class="inner-toolbar-settings">
<label>${i18next.t('lsb_debug_tools')}</label>
<div class="ngm-checkbox ngm-debug-tools-toggle ${classMap({active: this.debugToolsActive})}" @click=${() => (<HTMLInputElement> this.querySelector('.ngm-debug-tools-toggle > input')).click()}>
<input type="checkbox" ?checked=${this.debugToolsActive} @change="${this.toggleDebugTools}">
<span class="ngm-checkbox-icon"></span>
<label>${i18next.t('lsb_cesium_toolbar_label')}</label>
</div>
<a class="contact-mailto-link" target="_blank"
href="mailto:[email protected]">${i18next.t('contact_mailto_text')}</a>
<a class="disclaimer-link" target="_blank"
href="${i18next.t('disclaimer_href')}">${i18next.t('disclaimer_text')}</a>
</div>
</div>
</div>
</div>
<div .hidden=${this.activePanel !== 'data' || this.hideDataDisplayed}
class="ngm-side-bar-panel ngm-extension-panel ngm-data-panel">
Expand All @@ -290,20 +294,20 @@ export class SideBar extends LitElementI18n {
${this.layerOrderChangeActive ? i18next.t('dtd_finish_ordering_label') : i18next.t('dtd_change_order_label')}
</div>
${this.layerOrderChangeActive ?
html`
html`
<ngm-layers-sort
.layers=${this.activeLayers}
.actions=${this.layerActions}
@orderChanged=${(evt) => this.onLayersOrderChange(evt.detail)}>
</ngm-layers-sort>` :
html`
html`
<ngm-layers
.layers=${this.activeLayers}
.actions=${this.layerActions}
@removeDisplayedLayer=${evt => this.onRemoveDisplayedLayer(evt)}
@layerChanged=${evt => this.onLayerChanged(evt)}>
</ngm-layers>`
}
}
<h5 class="ui header">${i18next.t('dtd_user_content_label')}</h5>
<ngm-layers-upload
.toastPlaceholder=${this.toastPlaceholder}
Expand Down Expand Up @@ -345,7 +349,7 @@ export class SideBar extends LitElementI18n {
const callback = attributeParams ?
this.getTileLoadCallback(attributeParams.attributeKey, attributeParams.attributeValue) :
undefined;
const flatLayers = this.getFlatLayers(this.catalogLayers, callback);
const flatLayers = this.getFlatLayers(this.catalogLayers, callback);
const urlLayers = getLayerParams();
const assetIds = getAssetIds();
const ionToken = MainStore.ionToken.value;
Expand Down Expand Up @@ -713,7 +717,7 @@ export class SideBar extends LitElementI18n {
// done like this to have correct rerender of component
const promise = Promise.resolve(dataSource);
const config: LayerConfig = {
load() {return promise;},
load() { return promise; },
label: name,
layer,
promise: promise,
Expand Down
4 changes: 0 additions & 4 deletions ui/src/ngm-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,6 @@ export class NgmApp extends LitElementI18n {
<ngm-map-chooser .hidden=${this.mobileView} class="ngm-bg-chooser-map"
.initiallyOpened=${false}></ngm-map-chooser>
</div>
<a class="contact-mailto-link" target="_blank"
href="mailto:[email protected]">${i18next.t('contact_mailto_text')}</a>
<a class="disclaimer-link" target="_blank"
href="${i18next.t('disclaimer_href')}">${i18next.t('disclaimer_text')}</a>
</div>
${this.showCesiumToolbar ? html`
<cesium-toolbar></cesium-toolbar>` : ''}
Expand Down
4 changes: 1 addition & 3 deletions ui/src/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,7 @@ ngm-voxel-filter .ngm-action-btn.ui.button {
position: absolute;
z-index: 2;
left: 5px;
font-size: 12px;
color: #fff;
text-shadow: 0 0 2px #000;
color: #357183;
}
.contact-mailto-link {
bottom: 60px;
Expand Down
8 changes: 8 additions & 0 deletions ui/src/style/ngm-side-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ ngm-side-bar {
overflow-y: auto;
}

.inner-toolbar-settings {
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 10px;
margin-top: 14px;
}

.ngm-side-bar-panel.ngm-large-panel {
width: calc(100vw - 144px);
}
Expand Down

0 comments on commit 50611f6

Please sign in to comment.