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

Bump upstream develop #110

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
d5f593b
init commit, qrcode image generated on pdf
OlofSvahnVbg Sep 22, 2023
d371df9
added expanded logic for qr placement
OlofSvahnVbg Sep 22, 2023
3f06445
Added admin settings and client choice for qr-code
OlofSvahnVbg Sep 22, 2023
5b4e597
minor thing
OlofSvahnVbg Oct 3, 2023
cfe3fd5
added different url logic
OlofSvahnVbg Oct 6, 2023
b34def3
Add conditional rendering for Control button
linusfj Mar 1, 2024
bb65684
Opportunity to disable stroke for drawtypes "Circle" & "Polygon" (#1480)
Albinahmetaj Mar 5, 2024
db647e1
A first step towards implementing RFC 1 and 2 (#1475)
jacobwod Mar 7, 2024
0c6a9fe
The new dotnet backend (#1395)
sweco-semtto Mar 7, 2024
6f144ea
Removed default value from .env for RESTRICT_ADMIN_ACCESS_TO_AD_GROUP…
jacobwod Mar 7, 2024
4536999
Moved the RHEL Dockerfile to our Docker directory.
jacobwod Mar 7, 2024
761fe69
Bumped deps, updated changelog.
jacobwod Mar 7, 2024
eb5be27
Feature: Allow `m` query parameter when no backend is active
Hallbergs Mar 7, 2024
bf7abc1
Added latest change to CHANGELOG.md
Hallbergs Mar 7, 2024
53a8765
Updated README and CONTRIBUTING to reflect recent changes.
jacobwod Mar 7, 2024
a15dcc8
removed print from url, removed getAnchor2 test function
OlofSvahnVbg Mar 8, 2024
15c2bdf
added qr logic to PrintModel
OlofSvahnVbg Mar 8, 2024
207afd2
bug fix in PrintModel
OlofSvahnVbg Mar 8, 2024
49f4bb0
Added qr logic to Anchor
OlofSvahnVbg Mar 8, 2024
40f6326
added enableAppStateInHash-checks for views and models
OlofSvahnVbg Mar 11, 2024
4bd674c
bug fix
OlofSvahnVbg Mar 11, 2024
d28328b
another bug fix
OlofSvahnVbg Mar 11, 2024
a7ce9b0
Changed logic for enableAppStateInHash
OlofSvahnVbg Mar 11, 2024
9a33598
Cross-platform back-end build (#1484)
sweco-semara Mar 11, 2024
3b548b2
Fixed a carelessly created bug when using custom svg and simplified t…
jesade-vbg Mar 11, 2024
de3dc5c
Merge pull request #1485 from hajkmap/fix/1468-bug
jesade-vbg Mar 11, 2024
c2ba663
Added a guide to support admins to migrate to V2 API. Removed the V1 …
jacobwod Mar 12, 2024
73a8820
Reinstalled packages to ensure package-lock is current.
jacobwod Mar 12, 2024
326eb7d
Updated CONTRIBUTE to clearify that git's pull is essentially fetch f…
jacobwod Mar 12, 2024
dae2b1c
Feature/1486 Simple Hajk Dockerfile (#1487)
Hallbergs Mar 12, 2024
5c811c1
Added a list containing Deprecated Plugins.
jacobwod Mar 12, 2024
7b683a9
minor fix - size of img
OlofSvahnVbg Mar 13, 2024
9b52e87
Merge remote-tracking branch 'origin/develop' into feature/1482-QrCode
OlofSvahnVbg Mar 13, 2024
22a5e2a
minor fixes
OlofSvahnVbg Mar 14, 2024
0646491
removed endIcon, added qr warning localobserverer
OlofSvahnVbg Mar 18, 2024
3cc6833
real refactor of localobserver image loading error
OlofSvahnVbg Mar 18, 2024
f2e93a9
Update CHANGELOG.md
OlofSvahnVbg Mar 18, 2024
f7d70fe
Update CHANGELOG.md
OlofSvahnVbg Mar 19, 2024
3469149
removed unused import, package.json qrCode
OlofSvahnVbg Mar 19, 2024
7a57750
Merge branch 'feature/1482-QrCode' of github.com:hajkmap/Hajk into fe…
OlofSvahnVbg Mar 19, 2024
07644e0
Merge pull request #1489 from hajkmap/feature/1482-QrCode
jesade-vbg Mar 19, 2024
ad9ca36
Removed extraneous newline in changelog.
jacobwod Mar 20, 2024
4b08cb4
Added more info to clarify where the changes were introduced.
jacobwod Mar 20, 2024
aabbba0
Feature/1370 print support in timeslider (#1492)
Hallbergs Mar 26, 2024
6fe1bf1
Add support for stand-alone GeoWebCache WMS and improve WMS admin rob…
sweco-semara Mar 27, 2024
97d0e7c
Added new colors for the colorpicker & reset button for default styli…
Albinahmetaj Apr 3, 2024
15be06d
Feature/1220 configurable drawer button (#1491)
linusfj Apr 3, 2024
3d5ea99
Added possibility to buffer from the Sketch plugin (#1460)
Albinahmetaj Apr 3, 2024
49f36f5
New repo structure (#1488)
jacobwod Apr 4, 2024
78c4e8a
Upgrade `ol` to 9.1.0 to fix rendering issues
Hallbergs Apr 4, 2024
e0d0e9f
An attempt to fix #1495.
jacobwod Apr 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 1 addition & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
**/node_modules
**/build
**/.git*
**/.eslint*
**/.prettier*
**/dist
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"editor.formatOnSave": true,
"eslint.workingDirectories": ["./new-admin", "./new-client"]
"eslint.workingDirectories": [
"./apps/admin",
"./apps/client",
"./apps/backend"
]
}
320 changes: 320 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

27 changes: 12 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@

> **A note on backends**
>
> As you probably know by now, Hajk consists of three separate applications: Client, Admin and Backend. If this concept is new to you, please see [the description here](https://github.com/hajkmap/Hajk/wiki/Installation-guide-%28for-pre-packaged-releases%29#the-three-editions-of-hajk).
> As you probably know by now, Hajk consists of three separate applications: Client UI, Admin UI and Backend. If this concept is new to you, please see [the description here](https://github.com/hajkmap/Hajk/wiki/Installation-guide-%28for-pre-packaged-releases%29#the-three-editions-of-hajk).
>
> Prior to 2021, Backend was a .NET project. In the spring of 2021, the _Hajk NodeJS backend_ became available, finally making Hajk an OS-independent webGIS solution. At the time of writing (mid 2021), some features are exclusively available in the NodeJS backend, but otherwise the both backends have similar functionality and API.
> Prior to 2021, Backend implemented as a .NET application. In the spring of 2021, the _Hajk NodeJS backend_ became available, finally making Hajk an OS-independent webGIS solution. At the time of writing (spring 2024), a new .NET Backend became available which intends to implement the same API specification as the NodeJS backend. However, given the current usage statistic, interoperability and developer's activity, the NodeJS backend remains the most widespread and well-tested solution.

### Required tools

- Latest LTS of NodeJS
- Latest Git
- Visual Studio 2019 (for the .NET backend)
- Visual Studio (only for the optional .NET backend)

The Client (`new-client`), Admin (`new-admin`) and NodeJS backend (`new-backend`) applications can be built and deployed on any OS supported by recent Git and Node versions (tested on macOS, Windows and Linux).
All apps reside inside the `apps/` directory. The Client UI (`client`), Admin UI (`admin`) and NodeJS backend (`backend`) applications can be built and deployed on any OS supported by recent Git and Node versions (tested on macOS, Windows and Linux).

The .NET backend (`backend`) component, requires Visual Studio 2019 for Windows.

Please note that if you plan on working on the obsolete [Hajk 2](https://github.com/hajkmap/Hajk/tree/hajk2.x) branch, you must use Visual Studio 2015 instead.
The .NET backend (`backend-dotnet`) component, requires Visual Studio for Windows.

### User documentation

Expand All @@ -35,28 +33,27 @@ Hajk strictly enforces the use of **Git Feature Branch Workflow** as described i
**Create an issue on GitHub.** You will need the issue number to give your branch a good name in the steps that follow.

#### Steps in `git`

In short, developing a new feature, would look something like:

1. Always fetch latest with `git fetch`.
1. Make sure you are in the develop branch by `git checkout develop`.
1. Make sure that you've pulled all latest changes with `git pull`.
1. Create a new branch and give it a name that relates to the issue you created on GitHub. E.g. if you created an issue called _"Add a blue button"_ and it has issue number #1234, your branch should be called `feature/1234-blue-button`. You create this branch by running `git checkout -b feature/1234-blue-button`
1. Make sure that you've merged all upstream changes in `develop` with `git merge`.
1. Create a new branch and give it a name that relates to the issue you created on GitHub. E.g. if you created an issue called _"Add a blue button"_ and it has issue number #1234, your branch should be called `feature/1234-blue-button`. You create this branch by running `git checkout -b feature/1234-blue-button`
1. Don't forget to set upstream so that your newly created branch is pushed to GitHub: `git push --set-upstream origin feature/1234-blue-button`
1. Code… :neckbeard:
1. Regularly commit changes to your branch with `git commit -S -m "A good comment, can be multiline."`. (Note, the `-S` flag [signs your commit](https://help.github.com/en/articles/signing-commits), and signing commits is something you really should be doing.)
1. Regularly push your changes to GitHub with `git push`
1. Regularly merge changes from develop into your branch. That means that you will incorporate recent changes in develop and your local branch will stay up-to-date with latest developments. **This is the really important part.** You can do it like this: `git checkout develop && git fetch && git pull && git checkout feature/1234-blue-button && git merge develop`
1. Regularly push your changes upstream (to GitHub) with `git push`
1. **Regularly merge changes that other developers might be doing, from `develop` into your branch.** That means that you will incorporate recent changes and your local branch will stay up-to-date with the latest developments. **Please don't overlook it. This is a really important part.** You can do it like this: `git stash && git checkout develop && git fetch && git merge && git checkout feature/1234-blue-button && git merge develop && git stash apply`. (If you feel comfortable enough with Git, there are of course shorter way of doing this, such as directly merging the upstream remote branch.)
1. When you're done coding, go to GitHub and create a new pull request. Make sure that you want to merge your branch into `develop`.
1. Administrators overlooking the project will get notified when you create your PR, take a look at the code and if everything looks fine merge it into `develop` and delete your feature branch from GitHub. You will still have a copy of your feature branch locally, but it can be safely removed by running `git branch -d feature/1234-blue-button`.
1. Hajk maintainers will get notified when you create the PR. They will review your PR and either accept and merge your branch (as well as delete it from the remote, as it's no longer needed) or (if the code isn't considered ready) request changes. After a successful merge you will still have a copy of your feature branch locally, but it can be safely removed by running `git branch -d feature/1234-blue-button`.

### Code standard

Hajk uses **ESLint** and **Prettier** to enforce code formatting across the project.

🔥 **Code that gets checked in must follow those rules.** 🔥

The `new-client` directory contains `.eslint` file, so it's easy to follow the rules. The recommended way is to use an editor that has extensions for ESLint and Prettier. It is also highly recommended to make the editor run Prettier on each file save (i.e. in VSCode it can be controlled by the `formatOnSave: true` flag).
The `client` and `backend` directories contain all necessary configuration files. The recommended way is to use an editor that has extensions for ESLint and Prettier installed. It is also highly recommended to make the editor run Prettier on each file save (i.e. in VSCode it can be controlled by the `formatOnSave: true` flag).

**For a simple guide on setting up VSCode with ESLint, Prettier and some , see [this presentation](dokumentation/VSCodeSetup.pdf)**. (Swedish only)

It is also super easy to get Prettier running with almost any editor. Please [refer to the docs](https://prettier.io/).
16 changes: 16 additions & 0 deletions Docker/Dockerfile.hajk-simple.ubi8
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Build the client
FROM registry.redhat.io/rhel9/nodejs-20 as clientBuilder
COPY /apps/client/package*.json ./
USER root
RUN npm install
COPY ./apps/client .
RUN npm run build --ignore-scripts

FROM registry.access.redhat.com/ubi8/nginx-122
USER 0
COPY --from=clientBuilder /opt/app-root/src/build /tmp/src
RUN chown -R 1001:0 /tmp/src
USER 1001

RUN /usr/libexec/s2i/assemble
CMD /usr/libexec/s2i/run
20 changes: 10 additions & 10 deletions Docker/Dockerfile.rhel9-nodejs18
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
# Stage 1 - Building the backend
FROM registry.redhat.io/rhel9/nodejs-18 as backendBuilder
COPY /new-backend/package*.json ./
COPY /apps/backend/package*.json ./
USER root
#RUN npm install npm@latest -g
RUN npm install
COPY ./new-backend .
COPY ./apps/backend .
RUN npm run compile

# Stage 2 - Building the client
FROM registry.redhat.io/rhel9/nodejs-18 as clientBuilder
COPY /new-client/package*.json ./
COPY /apps/client/package*.json ./
USER root
#RUN npm install npm@latest -g
RUN npm install
COPY ./new-client .
COPY ./apps/client .
RUN rm ./public/appConfig.json
RUN mv ./public/appConfig.docker.json ./public/appConfig.json
RUN npm run build --ignore-scripts

# Stage 3 - Building the admin
FROM registry.redhat.io/rhel9/nodejs-18 as adminBuilder
COPY /new-admin/package*.json ./
COPY /apps/admin/package*.json ./
USER root
#RUN npm install npm@latest -g
RUN npm install
COPY ./new-admin .
COPY ./apps/admin .
RUN rm ./public/config.json
RUN mv ./public/config.docker.json ./public/config.json
RUN npm run build --ignore-scripts

# Stage 4 - Combine everything and fire it up
FROM registry.redhat.io/rhel9/nodejs-18-minimal
COPY /new-backend/package*.json ./
COPY /apps/backend/package*.json ./
USER root
#RUN npm install npm@latest -g
RUN npm install --production
USER 1001
COPY --from=backendBuilder /opt/app-root/src/dist ./
COPY /new-backend/.env .
COPY /new-backend/App_Data ./App_Data_tmp
COPY /new-backend/static ./static
COPY /apps/backend/.env .
COPY /apps/backend/App_Data ./App_Data_tmp
COPY /apps/backend/static ./static
COPY --from=clientBuilder /opt/app-root/src/build ./static/client
COPY --from=adminBuilder /opt/app-root/src/build ./static/admin
USER root
Expand Down
28 changes: 14 additions & 14 deletions Dockerfile.ubi8-nodejs → Docker/Dockerfile.ubi8-nodejs
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
# Stage 1 - Building the backend
FROM registry.access.redhat.com/ubi8/nodejs-16 as backendBuilder
COPY /new-backend/package*.json ./
FROM registry.access.redhat.com/ubi8/node-20 as backendBuilder
COPY /apps/backend/package*.json ./
USER root
RUN npm install
COPY ./new-backend .
COPY ./apps/backend .
RUN npm run compile

# Stage 2 - Building the client
FROM registry.access.redhat.com/ubi8/nodejs-16 as clientBuilder
COPY /new-client/package*.json ./
FROM registry.access.redhat.com/ubi8/node-20 as clientBuilder
COPY /apps/client/package*.json ./
USER root
RUN npm install --ignore-scripts
COPY ./new-client .
COPY ./apps/client .
RUN rm ./public/appConfig.json
RUN mv ./public/appConfig.docker.json ./public/appConfig.json
RUN npm run build --ignore-scripts

# Stage 3 - Building the admin
FROM registry.access.redhat.com/ubi8/nodejs-16 as adminBuilder
COPY /new-admin/package*.json ./
FROM registry.access.redhat.com/ubi8/node-20 as adminBuilder
COPY /apps/admin/package*.json ./
USER root
RUN npm install
COPY ./new-admin .
COPY ./apps/admin .
RUN rm ./public/config.json
RUN mv ./public/config.docker.json ./public/config.json
RUN npm run build

# Stage 4 - Combine everything and fire it up
FROM registry.access.redhat.com/ubi8/nodejs-16-minimal
COPY /new-backend/package*.json ./
FROM registry.access.redhat.com/ubi8/node-20-minimal
COPY /apps/backend/package*.json ./
USER root
RUN npm install --production
USER 1001
COPY --from=backendBuilder /opt/app-root/src/dist ./
COPY /new-backend/.env .
COPY /new-backend/App_Data ./App_Data
COPY /new-backend/static ./static
COPY /apps/backend/.env .
COPY /apps/backend/App_Data ./App_Data
COPY /apps/backend/static ./static
COPY --from=clientBuilder /opt/app-root/src/build ./static/client
COPY --from=adminBuilder /opt/app-root/src/build ./static/admin
USER root
Expand Down
22 changes: 11 additions & 11 deletions Docker/backend-and-admin.dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Stage 1 - Building the backend
FROM node:alpine as backendBuilder
FROM node:20-alpine as backendBuilder
WORKDIR /usr/app
COPY /new-backend/package*.json ./
COPY /apps/backend/package*.json ./
RUN npm install
COPY ./new-backend .
COPY ./apps/backend .
RUN npm run compile

# Stage 2 - Building the admin
FROM node:alpine as adminBuilder
FROM node:20-alpine as adminBuilder
WORKDIR /usr/app
COPY /new-admin/package*.json ./
COPY /apps/admin/package*.json ./
RUN npm install
COPY ./new-admin .
COPY ./apps/admin .
RUN rm ./public/config.json
RUN mv ./public/config.docker.json ./public/config.json
RUN npm run build

# Stage 3 - Combine everything and fire it up
FROM node:14-alpine
FROM node:20-alpine
WORKDIR /usr/app
COPY /new-backend/package*.json ./
COPY /apps/backend/package*.json ./
RUN npm install --production
COPY --from=backendBuilder /usr/app/dist ./
COPY /new-backend/.env .
COPY /new-backend/App_Data ./App_Data
COPY /new-backend/static ./static
COPY /apps/backend/.env .
COPY /apps/backend/App_Data ./App_Data
COPY /apps/backend/static ./static
COPY --from=adminBuilder /usr/app/build ./static/admin
VOLUME /usr/app/App_Data
EXPOSE 3002
Expand Down
93 changes: 62 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,75 @@
# Stage 1 - Building the backend
FROM node:18-alpine as backendBuilder
WORKDIR /usr/app
COPY /new-backend/package*.json ./
FROM node:20-alpine AS buildImage

# --- BACKEND --- #
# Start with Backend
WORKDIR /tmp/build/backend
COPY /apps/backend ./
RUN npm ci
COPY ./new-backend .
RUN npm run compile

# Stage 2 - Building the client
FROM node:18-alpine as clientBuilder
WORKDIR /usr/app
COPY /new-client/package*.json ./
RUN npm ci --ignore-scripts
COPY ./new-client .
# Note: Before building Client, we will want to grab the current GIT
# commit hash. So we must copy the .git directory first.
WORKDIR /tmp/build
COPY /.git/ .

# --- BACKEND END --- #

# --- CLIENT --- #
# Next, Client UI
WORKDIR /tmp/build/client
COPY /apps/client .

# Install git, it's needed for the prebuild.js script
RUN apk update
RUN apk add git

# Install packages
RUN npm ci

# Use a special appConfig for Docker
RUN rm ./public/appConfig.json
RUN mv ./public/appConfig.docker.json ./public/appConfig.json
RUN npm run build --ignore-scripts

# Stage 3 - Building the admin
FROM node:18-alpine as adminBuilder
WORKDIR /usr/app
COPY /new-admin/package*.json ./
RUN npm ci --ignore-scripts
COPY ./new-admin .
# Now let's build, including running the prebuild.js script.
# This ensure that some <meta> tags are added to index.html
RUN npm run build
RUN apk del git
# --- CLIENT END --- #

# --- ADMIN --- #
# Next, go on with Admin UI
WORKDIR /tmp/build/admin
COPY /apps/admin .
RUN npm ci
RUN rm ./public/config.json
RUN mv ./public/config.docker.json ./public/config.json
RUN npm run build --ignore-scripts
RUN npm run build
# --- ADMIN --- #

# Stage 4 - Combine everything and fire it up
FROM node:18-alpine
# --- FINAL ASSEMBLY --- #
# Finally, let's assembly it all into another image
FROM node:20-alpine
WORKDIR /usr/app
COPY /new-backend/package*.json ./

# Copy NPM package files from Backend
COPY /apps/backend/package*.json ./
RUN npm ci --production
COPY --from=backendBuilder /usr/app/dist ./
COPY /new-backend/.env .
COPY /new-backend/App_Data ./App_Data
COPY /new-backend/static ./static
COPY --from=clientBuilder /usr/app/build ./static/client
COPY --from=adminBuilder /usr/app/build ./static/admin
VOLUME /usr/app/App_Data
EXPOSE 3002

# Move the built Backend into app's root at /usr/app
COPY --from=buildImage /tmp/build/backend/dist ./

# Copy some more necessary files. There's a great chance that
# they'll be mounted when running anyway, but if someone forgets
# that, it's good to have them around so we get running with the defaults.
COPY /apps/backend/.env .
COPY /apps/backend/App_Data ./App_Data
COPY /apps/backend/static ./static

# Move the built Client and Admin dirs into static
COPY --from=buildImage /tmp/build/client/build ./static/client
COPY --from=buildImage /tmp/build/admin/build ./static/admin
# --- FINAL ASSEMBLY END --- #

# Go!
CMD node index.js

# See HAJK Docker/README.md for example usage
Loading