Giter Club home page Giter Club logo

webcomp-mobility-echarging-map's Introduction

webcomp-mobility-echarging-map

This project contains the map web component for the Green Mobility South Tyrol project.

REUSE Compliance CI/CD

Green Mobility South Tyrol wants to split the existing functionalities of the website into reusable and independent components. Using these webcomponents, a developer can easily integrate the functionality of the single components into any website. The data source for the components is the Open Data Hub project.

Table of Contents

Usage

Include the Javascript file dist/map_widget.min.js in your HTML and define the web component like this:

<e-mobility-map-widget></e-mobility-map-widget>

Options

Translations

Add language as attribute, if you want to translate the web component.

<e-mobility-dashboard-widget language="en"></e-mobility-dashboard-widget>

Possible values are currently en, de, it, nl, cs, pl, fr, ru (see /src/translations.js).

Logo

URL of an icon, that will be shown in the lower left corner.

<e-mobility-map-widget logo="https://www.example.com/your-logo.png"></e-mobility-map-widget>

Styling

This web component has only one style variable, namely --e-mobility-widget-map-height, which sets the height of the widget.

For example:

<style>
  e-mobility-map-widget.YOUR_CLASS_NAME {
    --e-mobility-widget-map-height: 200px;
  }
</style>

<e-mobility-map-widget class="YOUR_CLASS_NAME" logo="logo.png" language="it"></e-mobility-map-widget>

The width of this component reacts on regular css rules. Configure the display property accordingly, for instance, as display: block, if you want to hardcode the dimensions.

Getting started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

To build the project, the following prerequisites must be met:

  • Node 12 / NPM 8.1.2

For a ready to use Docker environment with all prerequisites already installed and prepared, you can check out the Docker environment section.

Source code

Get a copy of the repository:

git clone https://github.com/noi-techpark/webcomp-mobility-echarging-map.git

Change directory:

cd webcomp-mobility-echarging-map/

Dependencies

Download all dependencies:

npm install

Build

Build and start the project:

npm run start

The application will be served and can be accessed at http://localhost:8000.

Deployment

To create the distributable files, execute the following command:

npm run build

Docker environment

For the project a Docker environment is already prepared and ready to use with all necessary prerequisites.

These Docker containers are the same as used by the continuous integration servers.

Installation

Install Docker (with Docker Compose) locally on your machine.

Dependenices

First, install all dependencies:

docker-compose run --rm app /bin/bash -c "npm install"

Start and stop the containers

Before start working you have to start the Docker containers:

docker-compose up --build --detach

After finished working you can stop the Docker containers:

docker-compose stop

Running commands inside the container

When the containers are running, you can execute any command inside the environment. Just replace the dots ... in the following example with the command you wish to execute:

docker-compose run --rm app /bin/bash -c "..."

Some examples are:

docker-compose run --rm app /bin/bash -c "npm run build"

Information

Support

ToDo: For support, please contact [email protected].

Contributing

If you'd like to contribute, please follow the following instructions:

  • Fork the repository.

  • Checkout a topic branch from the development branch.

  • Make sure the tests are passing.

  • Create a pull request against the development branch.

A more detailed description can be found here: https://github.com/noi-techpark/documentation/blob/master/contributors.md.

Documentation

More documentation can be found at https://opendatahub.readthedocs.io/en/latest/index.html.

Boilerplate

The project uses this boilerplate: https://github.com/noi-techpark/webcomp-boilerplate.

License

The code in this project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3 license. See the LICENSE.md file for more information.

REUSE

This project is REUSE compliant, more information about the usage of REUSE in NOI Techpark repositories can be found here.

Since the CI for this project checks for REUSE compliance you might find it useful to use a pre-commit hook checking for REUSE compliance locally. The pre-commit-config file in the repository root is already configured to check for REUSE compliance with help of the pre-commit tool.

Install the tool by running:

pip install pre-commit

Then install the pre-commit hook via the config file by running:

pre-commit install

webcomp-mobility-echarging-map's People

Contributors

alexlanz avatar clezag avatar d3liaa avatar dependabot[bot] avatar dulvui avatar henri-egger avatar idm-jenkins avatar lcfd avatar maxglio avatar

Watchers

 avatar  avatar

webcomp-mobility-echarging-map's Issues

Warning during build

When I run yarn, I get the following message:

warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.

Could we remove that file, or is it somehow needed?

Height issue

Issue
Component's height does not fit its respective container's height.
Always displays at the same height: approximatly 700px except width gets really small then around 1080px.

Excpected
Component matches its container's height. Or height parameter for better customization

As a consumer of this web comp, I want to have it integrated in the store with all features described

Prerequisites

Check and fix (email by @rcavaliere)

  • si chiede di ingrandire leggermente le dimensioni del logo embedded (attualmente il logo Green Mobility)

Not done, @Piiit will fix that --> DONE

  • ci hanno segnalato che non sempre tutti i testi sono nella lingua corretta. L'obiettivo sarebbe quello di sistemare i testi in maniera definitiva. Su questo ci può dare una mano la STA.

Not done by Belka, @Piiit will fix that --> DONE

  • the rest can be given to STA (@rcavaliere please check if necessary)
  • abbiamo visto che c'è un piccolo bug: se l'utente attiva la geolocalizzazione e clicca su "Non consentire" l'applicativo continua a caricare a vuoto. Qui sarebbe da lasciare all'utente la visualizzazione di default della mappa.

Checked this, it does not work... If I click on the "my position" icon it does nothing... not even asks me about any permissions --> @rcavaliere Could you please check that also and eventually write to Belka? --> @Piiit fixed it... v1.5.2 contains error messages if something does not work as an overlay box, and disables the spinning icon when something goes wrong

  • sembra che la distinzione tra stazioni pubbliche e private ad accesso pubblico sia sempre più importante. STA propone di colorarle in maniera differente così da differenziarle, così come fatto per la stazione H2. Questo perché anche il tipo di esperienza di servizio offerto all'utente potrebbe essere diverso.

Done with icons that contain a "star", since the types are represented with icons and not colors (using colors here would imply certain states of stations)... is that OK for you @rcavaliere?
Checked: This has not been done

  • il link associato ai POI relativi ad una colonnina di ricarica dovrebbe aprirsi in un altro tab, non nella stessa applicazione.

Checked: Done

  • in caso di utilizzo da mobile, quando uno apre la sezione dei filtri, effettua la sua configurazione e clicca su "Applica" si aspetta che la sezione si chiuda automaticamente e torni alla mappa diversamente configurata. Attualmente invece uno deve chiudere a mano la sezione dei filtri.

Checked: Done

Additionally:

  • Use the new Ninja API for all calls (currently it was mixed with v1 and v2)
  • Only use Italian, German and English
  • Fix test app

Stations are not displayed sometimes

Describe the issue
Sometimes the stations aren't displayed nor found. Error message can be found in console:
Chrome:
Uncaught (in promise) TypeError: Cannot read property 'y' of undefined
at Ee (map_widget.min.js:156)
at map_widget.min.js:889
at Array.filter ()
at HTMLElement.drawMap (map_widget.min.js:889)

To Reproduce
Steps to reproduce the behavior:

  1. Reload the component multiple times until error occurs(In component store, external window or anywhere else).
    note: Chrome seems to have this issue more often than Firefox.
    Also reproducible on phone.

Screenshots
NoChargingStations
Note: Filter was set with those options when opened.

Desktop

  • OS: Windows 10
  • Browser Chrome, Firefox

Smartphone

  • Device: S8+
  • Browser Chrome

charging station power units kW(h)

The power stations should show kW as max power output, not kWh.
Only the charged amount over each individual charge session time (h) will be in kWh then (red marking)

Also the international number formatting seems to be incorrect for DE, IT with dot instead of comma (blue marking)
A charging stations max power for example is either 22,125 kW or 22.125 W. The usual e-charging unit is kW

image

As a tourist I would like to see not only the real-time charging stations present in South Tyrol which are public available, but also the accomodations that offer such service for their guests, so to have a more complete picture of e-charging offer available

Linked to the discussion present here: https://github.com/noi-techpark/odh-tourism/issues/208

Through this API call: http://tourism.opendatahub.bz.it/api/Accommodation?featureidfilter=D9CF8E2D5DD94C22BF0ED0FFB87F8532

we should visualize on the web-component "e-charging map" also this dataset. This should be visualized e.g. with a proper icon and by activating a proper filter in the menù.

The web-component "e-mobility dashboard" should also integrate this dataset. Could be a separate chart so to avoid confusion.

Change Icon in bottom left corner

Issue
In the opendatahub webcomponents store: https://webcomponents.opendatahub.bz.it/webcomponent/98013c75-f27c-414e-aff9-c58ed760e791?from=%2Fsearch%2Fany

When changing the address of the icon, which should be displayed at the bottom left corner, and pressing "enter" or "\n" to confirm it, the whole page gets reloaded instead of the preview.

Excpected result
Preview reloads with new Icon

Changing address and pressing "Update Preview"-button is fine though.

Unbenannt

OS: Windows 10
Browsers : Chrome, Firefox

As Tourismusverein Partschins I would like that e-mobility map web-components shows not only the link to suedtirol.info, but also the link to the POI's web-site

  • Web component adjustments (POI link)
  • Tourist data quality check (POI web site) -> we should say in my opinion to update the source system (TIC Web of LTS?)

Additional request:

wenn möglich bitte die Hotels und Restaurants mit unserer Website verlinken, d.h. bitte die jeweils unten angeführten Links bei der E-Ladestation in Rabland beim jeweiligen Betrieb hinzufügen:

Restaurant Hanswirt: https://www.merano-suedtirol.it/de/partschins-rabland-und-toell/natur-kultur/wasserwelten/trinkwasserauffuellpunkte-brunnen/rid-029415631134860A4F7FE1801A01C3B7-g-restaurant-hanswirt.html

Restaurant Ennemoser: https://www.merano-suedtirol.it/de/partschins-rabland-und-toell/essen-trinken/partschinser-kueche/gastronomiebetriebe/rid-0A14E5A098488EDEB49643107B826512-g-ennemoser.html

Restaurant Rössl: https://www.merano-suedtirol.it/de/partschins-rabland-und-toell/essen-trinken/partschinser-kueche/gastronomiebetriebe/rid-751144E32CB35A66B1DDAFBCED402D25-g-restaurant-cafe-roessl.html

Hotel Hanswirt: https://www.merano-suedtirol.it/de/partschins-rabland-und-toell/hotel-unterkunft/unterkunft-suchen-buchen/unterkuenfte-in-partschins-rabland-und-toell/rid-5DF21204ACF711D1BAAA00805A13E75D-hotel-hanswirt.html

Pension Ennemoser: https://www.merano-suedtirol.it/de/partschins-rabland-und-toell/hotel-unterkunft/unterkunft-suchen-buchen/unterkuenfte-in-partschins-rabland-und-toell/rid-DB1CC909AEB711D1BAAA00805A13E75D-pension-ennemoser.html

Garni Hotel Am Meilenstein: https://www.merano-suedtirol.it/de/partschins-rabland-und-toell/hotel-unterkunft/unterkunft-suchen-buchen/unterkuenfte-in-partschins-rabland-und-toell/rid-DB1CC916AEB711D1BAAA00805A13E75D-garni-hotel-am-meilenstein.html

Zudem bitten wir Euch Rabland als Titel zu nehmen statt Rabla.

@RudiThoeni @dulvui @clezag could you please check this request and give me a feedback?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.