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

Feature/state benchmark #581

Merged
merged 20 commits into from
Jan 2, 2023
Merged

Feature/state benchmark #581

merged 20 commits into from
Jan 2, 2023

Conversation

Dassderdie
Copy link
Collaborator

@Dassderdie Dassderdie commented Dec 17, 2022

  • The first commit moves the state migrations from the backend to shared
  • The benchmark itself is in an extra package that imports shared. I tried to include it directly in shared (problems with node typings and different code endpoints) and the root (Not a big advantage over the new package and potential problems with root, as the parent package, depending on a child folder)
  • Because we might have exercise states for which we want to run the benchmarks but which are also confidential (https://github.com/hpi-sam/digital-fuesim-manv_test-scenarios), there is a data folder. The benchmark will be run for all exercises in the folder. Files with .permanent.json will be included by git; all others will be ignored.
  • There are a lot more benchmarks that could be useful. The ones that are currently implemented should be enough to spot significant performance regressions. To benchmark the impact of optimizations one would probably need to add more.

FYI: Possible performance improvements

I'm thinking about refactoring the patient-health and the tick action. Instead of changing the health of each patient every tick, each patient gets an internalHealth property and a currentHealthChangePerSecond and currentHealthChangeStartTime. The health of the patient can then be calculated via health = internalHealth + (exerciseState.currentTime - currentHealthChangeStartTime) * currentHealthChangePerSecond. The tick action would then only include patients, whose currentHealthChangePerSecond changed. This would drastically reduce the size of the export, the time needed for the validation, and the time needed for the ExerciseTick.
This could be implemented together with #490

Current exemplary output
C:\Users\julia\Documents\Studium\Bachelorproject\digital-fuesim-manv>npm run benchmark

> digital-fuesim-manv@0.0.0 benchmark
> cd benchmark && npm run benchmark


> digital-fuesim-manv-benchmark@0.0.0 benchmark
> (pwd && npm run benchmark:linux-macos) || npm run benchmark:windows

'pwd' is not recognized as an internal or external command,
operable program or batch file.

> digital-fuesim-manv-benchmark@0.0.0 benchmark:windows
> set NODE_ENV=production&& node --experimental-specifier-resolution=node --loader ts-node/esm src/app.ts

(node:7000) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time(Use `node --trace-warnings ...` to show where the warning was created)
(node:7000) ExperimentalWarning: The Node.js specifier resolution flag is experimental. It could change or be removed at any time.

System Information:
  OS:      Windows 10 Pro 10.0.22621
  #CPUs:   16
  RAM:     31976MB
  Node.js: v16.16.0


empty-state-version-14.permanent.json
  migrate:                    14ms      8ms       8ms
  validateExercise:           71ms      56ms      40ms
  newImmerDraft:              2ms       0ms       0ms
  sameImmerDraft:             2ms       0ms       0ms
  noImmerDraft:               2ms       3ms       2ms
  benchmarkActions: [Client] Add client: 0.28ms,
    The summed up time of all actions is 0.30 times the time of the direct benchmark ("newImmerDraft").
  numberOfActionsPerType: [Client] Add client: 1,

exercise-state-2022-05-31-small-demo.json
  migrate:                    190ms     163ms     153ms
  validateExercise:           346ms     286ms     286ms
  newImmerDraft:              805ms     851ms     897ms
  sameImmerDraft:             131ms     100ms     106ms
  noImmerDraft:               11ms      9ms       9ms
  benchmarkActions: [Exercise] Tick: 797.11ms, [Personnel] Move personnel: 15.69ms, [Patient] Move patient: 9.76ms, [Material] Move material: 4.40ms, [Vehicle] Unload vehicle: 3.09ms, [Vehicle] Add vehicle: 2.69ms, [Patient] Set Visible Status: 2.62ms, [Vehicle] Move vehicle: 1.66ms, [Transfer] Add to transfer: 1.63ms, [Vehicle] Load vehicle: 0.85ms, [Hospital] Transport patient to hospital: 0.64ms, [Client] Remove client: 0.43ms, [Transfer] Edit transfer: 0.39ms, [Client] Restrict to viewport: 0.28ms, [Client] Set waitingroom: 0.24ms, [Client] Add client: 0.20ms, [TransferPoint] Move TransferPoint: 0.18ms, [Exercise] Pause: 0.11ms, [Exercise] Start: 0.10ms,
  numberOfActionsPerType: [Exercise] Tick: 1079, [Personnel] Move personnel: 29, [Patient] Move patient: 18, [Vehicle] Move vehicle: 15, [Patient] Set Visible Status: 11, [Transfer] Add to transfer: 10, [Material] Move material: 10, [Vehicle] Add vehicle: 9, [Vehicle] Unload vehicle: 5, [Client] Add client: 3, [Client] Restrict to viewport: 3, [Client] Set waitingroom: 3, [Transfer] Edit transfer: 3, [Client] Remove client: 2, [Exercise] Start: 2, [Exercise] Pause: 2, [TransferPoint] Move TransferPoint: 2, [Vehicle] Load vehicle: 1, [Hospital] Transport patient to hospital: 1,

exercise-state-2022-05-31-workshop-babz-großes-szenario.json
  migrate:                    1145ms    1157ms    1118ms
  validateExercise:           2616ms    2468ms    2450ms
  newImmerDraft:              8983ms    9071ms    8997ms
  sameImmerDraft:             719ms     724ms     719ms
  noImmerDraft:               127ms     135ms     131ms
  benchmarkActions: [Exercise] Tick: 7741.20ms, [Patient] Move patient: 340.76ms, [Personnel] Move personnel: 279.63ms, [Material] Move material: 148.56ms, [AlarmGroup] Edit AlarmGroupVehicle: 121.18ms, [Vehicle] Unload vehicle: 49.39ms, [Vehicle] Move vehicle: 48.09ms, [Vehicle] Load vehicle: 46.23ms, [Vehicle] Add vehicle: 28.37ms, [Patient] Add patient: 27.06ms, [Patient] Set Visible Status: 25.46ms, [Transfer]Edit transfer: 18.17ms, [Transfer] Add to transfer: 16.71ms, [Hospital] Rename hospital: 16.57ms, [Hospital] Transport patient to hospital: 16.51ms, [TransferPoint] Move TransferPoint: 7.45ms, [TransferPoint]Connect hospital: 5.81ms, [AlarmGroup] Add AlarmGroupVehicle: 5.47ms, [TransferPoint] Rename TransferPoint: 5.07ms, [TransferPoint] Connect TransferPoints: 4.99ms, [Client] Add client: 4.99ms, [MapImage] Add MapImage: 4.92ms, [AlarmGroup] Rename AlarmGroup: 4.28ms, [Client] Remove client: 3.96ms, [Vehicle] Rename vehicle: 3.59ms, [MapImage] Move MapImage: 3.02ms, [Hospital] Edit transportDuration to hospital: 2.83ms, [Transfer] Toggle pause transfer: 2.67ms, [TransferPoint] Add TransferPoint: 2.11ms, [Viewport] Resize viewport: 1.66ms, [MapImage] Scale MapImage: 1.38ms, [Viewport] Move viewport: 1.28ms, [Hospital] Add hospital: 1.08ms, [Client] Restrict to viewport: 1.04ms, [Client] Set waitingroom: 0.76ms, [Viewport] Rename viewport: 0.71ms, [MapImageTemplate] Edit mapImageTemplate: 0.41ms, [AlarmGroup] Add AlarmGroup: 0.40ms, [Vehicle] Remove vehicle: 0.39ms, [AlarmGroup] Remove AlarmGroupVehicle: 0.38ms, [Viewport] Add viewport: 0.36ms, [Configuration] Set bluePatientsEnabled: 0.12ms, [MapImage] Remove MapImage: 0.11ms, [MapImageTemplate] Add mapImageTemplate: 0.09ms, [Configuration] Set tileMapProperties: 0.07ms, [AlarmGroup] Remove AlarmGroup: 0.07ms, [Exercise] Pause: 0.06ms, [Exercise] Start: 0.05ms,
  numberOfActionsPerType: [Exercise] Tick: 2905, [AlarmGroup] Edit AlarmGroupVehicle: 1098, [Personnel] Move personnel: 274, [Vehicle] Move vehicle: 244, [Patient] Move patient: 218, [Hospital] Rename hospital: 203, [Material] Move material: 159, [Transfer] Edit transfer: 95, [Transfer] Add to transfer: 78, [AlarmGroup] Rename AlarmGroup: 64, [TransferPoint] Move TransferPoint: 59, [Client] Add client: 57, [AlarmGroup] Add AlarmGroupVehicle: 57, [TransferPoint] Rename TransferPoint: 55, [Vehicle] Add vehicle: 55, [Client] Remove client: 48, [TransferPoint] Connect hospital: 43, [Patient] Set Visible Status: 43, [Patient] Add patient: 41, [Vehicle] Load vehicle: 40, [TransferPoint] Connect TransferPoints: 38, [Hospital] Edit transportDuration to hospital: 36, [Vehicle] Unload vehicle: 29, [MapImage] Move MapImage: 28, [MapImage] Add MapImage: 27, [TransferPoint] Add TransferPoint: 20, [Viewport] Resize viewport: 19, [Hospital] Transport patient to hospital: 15, [Viewport] Move viewport: 14, [Transfer] Toggle pause transfer: 13, [Client] Restrict to viewport: 12, [Hospital] Add hospital: 12, [MapImage] Scale MapImage: 12, [Viewport] Rename viewport: 10, [Client] Set waitingroom: 10, [Vehicle] Rename vehicle: 9, [AlarmGroup] Add AlarmGroup: 6, [Viewport] Add viewport: 5, [MapImageTemplate] Edit mapImageTemplate: 5, [AlarmGroup] Remove AlarmGroupVehicle: 4, [Configuration] Set bluePatientsEnabled: 2, [Configuration] Set tileMapProperties: 1, [AlarmGroup] Remove AlarmGroup: 1, [MapImageTemplate] Add mapImageTemplate: 1, [MapImage] Remove MapImage: 1, [Exercise] Start: 1, [Vehicle] Remove vehicle: 1, [Exercise] Pause: 1,

exercise-state-2022-07-27-workshop-malteser-großes-szenario.json
  migrate:                    1267ms    1150ms    1154ms        Not deterministic!
  validateExercise:           2041ms    2087ms    2063ms
  newImmerDraft:              6709ms    6820ms    6567ms        Not deterministic!
  sameImmerDraft:             916ms     918ms     943ms         Not deterministic!
  noImmerDraft:               94ms      86ms      84ms          Not deterministic!
  The endStates of the previous three steps are not equal!
  This most likely means that a reducer is either not deterministic or makes some assumptions about immer specific stuff (use of "original()").
  To further debug this, you should log the endStates of the respective exercises and can compare them directly in vscode via "Compare file with".
  benchmarkActions: [Exercise] Tick: 6118.13ms, [Patient] Move patient: 175.44ms, [Personnel] Move personnel: 119.72ms, [Transfer] Edit transfer: 72.18ms, [Material] Move material: 47.38ms, [Vehicle] Load vehicle: 26.01ms, [Vehicle] Unload vehicle: 23.44ms, [Patient] Set Visible Status: 22.42ms, [Vehicle] Move vehicle: 21.11ms, [Vehicle] Add vehicle: 19.80ms, [Hospital] Transport patient to hospital: 19.09ms, [Transfer] Add to transfer: 10.04ms, [TransferPoint] Connect hospital: 7.80ms, [Patient] Add patient: 4.14ms, [AlarmGroup] Edit AlarmGroupVehicle: 3.47ms, [TransferPoint] Disconnect hospital: 2.95ms, [Client] Remove client: 2.83ms, [Client] Add client: 2.65ms, [Emergency Operation Center] Add Log Entry: 2.32ms, [MapImage] Scale MapImage: 2.07ms, [Patient] Remove patient: 2.03ms, [TransferPoint] Move TransferPoint: 1.40ms, [Viewport] Resize viewport: 1.24ms, [Transfer] Toggle pause transfer: 1.10ms, [MapImage] Move MapImage: 0.96ms, [Client] Restrict to viewport: 0.94ms, [TransferPoint] Remove TransferPoint: 0.84ms, [Vehicle] Remove vehicle: 0.77ms, [Client] Set waitingroom: 0.68ms, [Viewport] Move viewport: 0.64ms, [MapImage] Add MapImage: 0.41ms, [AlarmGroup] Remove AlarmGroupVehicle: 0.36ms, [TransferPoint] Connect TransferPoints: 0.29ms, [Viewport] Add viewport: 0.26ms, [Hospital] Rename hospital: 0.22ms, [MapImage] Remove MapImage: 0.22ms, [Viewport] Remove viewport: 0.21ms, [AlarmGroup] Add AlarmGroupVehicle: 0.16ms, [Viewport] Rename viewport: 0.15ms, [TransferPoint] Disconnect TransferPoints: 0.14ms, [TransferPoint] Add TransferPoint: 0.12ms, [MapImage] Reconfigure Url: 0.06ms, [Exercise] Pause: 0.06ms, [Exercise] Start: 0.05ms,
  numberOfActionsPerType: [Exercise] Tick: 3181, [Transfer] Edit transfer: 667, [Personnel] Move personnel: 159, [Vehicle] Move vehicle: 149, [Patient] Move patient: 134, [Material] Move material: 65, [Transfer] Add to transfer: 60, [TransferPoint] Connect hospital: 47, [Vehicle] Add vehicle: 43, [Patient] Set Visible Status: 35, [Vehicle] Load vehicle: 33, [Emergency Operation Center] Add Log Entry: 22, [AlarmGroup] Edit AlarmGroupVehicle: 20, [Client] Add client: 19, [TransferPoint] Disconnect hospital: 19, [Client] Remove client: 18, [Vehicle] Unload vehicle: 18, [Hospital] Transport patient to hospital: 17, [MapImage] Scale MapImage: 15, [Viewport] Resize viewport: 13, [TransferPoint] Move TransferPoint: 11, [Client] Restrict to viewport: 9, [Transfer] Toggle pause transfer: 8, [Client] Set waitingroom: 7, [Viewport] Move viewport: 7, [MapImage] Move MapImage: 7, [Patient] Add patient: 7, [Patient] Remove patient: 7, [AlarmGroup] Remove AlarmGroupVehicle: 3, [Viewport] Add viewport: 3, [Viewport] Remove viewport: 3, [Viewport] Rename viewport: 2, [TransferPoint] Connect TransferPoints: 2, [Hospital] Rename hospital: 2, [Vehicle] Remove vehicle: 2, [MapImage] Add MapImage: 2, [MapImage] Remove MapImage: 2, [AlarmGroup] Add AlarmGroupVehicle: 1, [Exercise] Start: 1, [Exercise] Pause: 1, [TransferPoint] Add TransferPoint: 1, [TransferPoint] Disconnect TransferPoints: 1, [TransferPoint] Remove TransferPoint: 1, [MapImage] Reconfigure Url:1,


┌──────────────────────────────────────────────────────────────────┬───────────┬──────────┬──────────────────┬───────────────┬────────────────┬──────────────┬───────────────────────────────┬──────────┐
│                             (index)                              │ fileSize  │ migrate  │ validateExercise │ newImmerDraft │ sameImmerDraft │ noImmerDraft │      mostExpensiveAction      │ #actions │
├──────────────────────────────────────────────────────────────────┼───────────┼──────────┼──────────────────┼───────────────┼────────────────┼──────────────┼───────────────────────────────┼──────────┤
│              empty-state-version-14.permanent.json               │ '0.084MB' │  '10ms'  │      '56ms'      │     '1ms'     │     '1ms'      │    '2ms'     │ '[Client] Add client 100.00%' │    1     │
│            exercise-state-2022-05-31-small-demo.json             │  '2.3MB'  │ '169ms'  │     '306ms'      │    '851ms'    │    '112ms'     │    '10ms'    │   '[Exercise] Tick 94.66%'    │   1208   │
│   exercise-state-2022-05-31-workshop-babz-großes-szenario.json   │  '19MB'   │ '1140ms' │     '2511ms'     │   '9017ms'    │    '720ms'     │   '131ms'    │   '[Exercise] Tick 86.06%'    │   6169   │
│ exercise-state-2022-07-27-workshop-malteser-großes-szenario.json │  '16MB'   │ '1190ms' │     '2064ms'     │   '6699ms'    │    '926ms'     │    '88ms'    │   '[Exercise] Tick 91.09%'    │   4825   │
└──────────────────────────────────────────────────────────────────┴───────────┴──────────┴──────────────────┴───────────────┴────────────────┴──────────────┴───────────────────────────────┴──────────┘

C:\Users\julia\Documents\Studium\Bachelorproject\digital-fuesim-manv>

Copy link
Contributor

@ClFeSc ClFeSc left a comment

Choose a reason for hiding this comment

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

Just a few notes from skimming the code.

benchmark/.gitignore Show resolved Hide resolved
benchmark/package.json Outdated Show resolved Hide resolved
benchmark/src/benchmark-file.ts Outdated Show resolved Hide resolved
benchmark/src/benchmark-file.ts Outdated Show resolved Hide resolved
benchmark/src/benchmark-file.ts Outdated Show resolved Hide resolved
benchmark/src/print-error.ts Outdated Show resolved Hide resolved
shared/src/state-migrations/restore-error.ts Outdated Show resolved Hide resolved
@ClFeSc ClFeSc mentioned this pull request Dec 26, 2022
3 tasks
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
benchmark/src/step.ts Outdated Show resolved Hide resolved
benchmark/src/step.ts Outdated Show resolved Hide resolved
benchmark/src/steps.ts Outdated Show resolved Hide resolved
benchmark/src/steps.ts Outdated Show resolved Hide resolved
benchmark/src/steps.ts Outdated Show resolved Hide resolved
shared/README.md Outdated Show resolved Hide resolved
shared/src/state-migrations/migration-functions.ts Outdated Show resolved Hide resolved
shared/src/state-migrations/restore-error.ts Outdated Show resolved Hide resolved
@Dassderdie Dassderdie marked this pull request as ready for review December 29, 2022 13:04
@Dassderdie Dassderdie requested a review from ClFeSc December 29, 2022 13:04
Copy link
Contributor

@ClFeSc ClFeSc left a comment

Choose a reason for hiding this comment

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

Just two small comments from looking at the code. I'll try it out later.

benchmark/src/app.ts Outdated Show resolved Hide resolved
shared/src/utils/sort-object.spec.ts Show resolved Hide resolved
Copy link
Contributor

@ClFeSc ClFeSc left a comment

Choose a reason for hiding this comment

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

After a closer look and some testing, I've got some more comments.

benchmark/src/app.ts Outdated Show resolved Hide resolved
benchmark/src/steps.ts Outdated Show resolved Hide resolved
benchmark/src/steps.ts Outdated Show resolved Hide resolved
benchmark/src/steps.ts Outdated Show resolved Hide resolved
benchmark/src/steps.ts Show resolved Hide resolved
benchmark/src/benchmark-step.ts Outdated Show resolved Hide resolved
benchmark/src/benchmark-step.ts Outdated Show resolved Hide resolved
benchmark/src/benchmark.ts Outdated Show resolved Hide resolved
benchmark/src/benchmark.ts Show resolved Hide resolved
benchmark/src/benchmark.ts Outdated Show resolved Hide resolved
benchmark/src/step.ts Outdated Show resolved Hide resolved
@Dassderdie Dassderdie requested a review from ClFeSc December 30, 2022 11:21
Copy link
Contributor

@ClFeSc ClFeSc left a comment

Choose a reason for hiding this comment

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

Not much from my side now. Looks good!

shared/src/state-migrations/migration-functions.ts Outdated Show resolved Hide resolved
@Dassderdie Dassderdie requested a review from ClFeSc January 2, 2023 16:43
Copy link
Contributor

@ClFeSc ClFeSc left a comment

Choose a reason for hiding this comment

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

I haven't tested it again, but the changes look good to me.

@Dassderdie Dassderdie merged commit e5f194f into dev Jan 2, 2023
@Dassderdie Dassderdie deleted the feature/state-benchmark branch January 2, 2023 17:14
Nils1729 added a commit to Nils1729/digital-fuesim-manv that referenced this pull request Feb 22, 2023
* Improve validation (hpi-sam#125)

* Improve validation by introducing multiple new validation decorators

* `IsIdMap` for types of the form `{ readonly [key: UUID]: T }`. This transforms the object, so using instance objects (instead of plain objects) will no longer be supported.

* `IsLiteralUnion` for literal unions of types `number | string | symbol` (e.g. `participant | trainer`). Uses `isIn` internally.

* `IsReachableTransferPoints` for `ReachableTransferPoints` used in `TransferPoint`. Very specific but necessary due to the unique structure of this type.

* `IsUUIDSet` for `UUIDSet`

* `IsValue` for *simple* values that are required for a property. For example, when a `type` property has to have the value `'partial'`, one can use `@IsValue('partial')` for this. Allowed are the types `bigint | boolean | number | string | symbol | null | undefined`. The reason is that this validator also uses `isIn` internally, which in turn uses `===` which might produce incorrect results for `object` values.

* All validators are required to be applied to correctly types properties by the use of `GenericPropertyDecorator`. Using e.g. `@IsLiteralUnion({ partial: true, complete: true })` on a property typed `string` raises a TypeScript error.

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Feature/state benchmark (hpi-sam#581)

* Move state migrations to shared
* Add benchmark package
* Update readmes
* Make problem with duplicated RestoreError more obvious

* Feature/improve eslint rules (hpi-sam#591)

* Disallow imports from "*/dist/*"
* Improve smaller eslint rules
* Update documentation

* Update packages to mitigate GHSA-9c47-m6qq-7p4h (hpi-sam#592)

* Update dependencies (hpi-sam#595)

* Update dependencies

* typescript@4.9 (satisfies-operator and watch-performance-improvements)
* angular@15.1
* Else only patch and minor version bumps
* Fix version of @types/node in benchmark and frontend (18 -> 16)

* Run prettier

* Add simulated regions that can be placed on the map (hpi-sam#601)

* Add simulated regions that can be placed on the map

* Fix naming

* Add migration

* Fix linter error

* Move simulated region to separate heading in trainer map editor

* Turn isInSimulatedRegion into a stub method

* Refactor ol-map-manager to reuse some features from viewport in simulatedRegion

* Ignore vs code config files (hpi-sam#606)

* Rename VS Code configs to `.example`

* Add new "Start all but database" task

* Explain changes in readme

* Refactor viewport-modify to resize-rectangle-interaction (hpi-sam#604)

* Instead of using some parts of the `Modify` interaction (side-effect in the style function) a new custom Interaction has been created.
* Previously, one could switch between resizing and translating a viewport via pressing `Shift`. Instead, now one ***resizes*** if one drags an edge of the viewport (+ a bit around it), and ***translates*** if one drags any other part. This should enable touch users to resize viewports
* The code should now be more readable and extendable
* The unnecessary `viewportTranslateInteraction` has been removed
* `feature.dispose()` now gets called when it gets deleted - this could have been a memory leak?

* Add link to main branch in readme (hpi-sam#611)

* Close popups with esc (hpi-sam#610)

* Add keydown handler to close popups on escape

* Ensure input is saved even after less than 600ms

* Cast event inline

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Add new image for big material and material (hpi-sam#544)

* Add new image for big material and material

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix CVE-2022-25901 (hpi-sam#618)

* Feature/597 regions can contain personnel and patients (hpi-sam#607)

* Add MetaPosition type

* Add MetaPosition to Vehicle

* Add MetaPosition ro Personnel

* Add MetaPosition to Material

* Add MetaPosition to Patient

* Add Classes for different Position Types

* Use create when applicable and fix in MetaPosition

* Add migration for addition of MetaPosition

* refactor literals to start with lowercase

* Change nested if else to else if

* Make metaPosition not optional

* Fix failing Tests

* Update shared/src/models/material.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/personnel.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/utils/calculate-treatments.spec.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Prettier Errors

* Change Validation to Allow

* Put personnel and material in vehicle on creation

* Update shared/src/store/action-reducers/transfer.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Pipeline dependencies

* Update shared/src/state-migrations/16-add-meta-position.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix linter Error

* Add validators to MetaPositions

* Remove unused imports

* Fix Validators

* Add/Fix Action Migrations

* Add Exports to Index.ts

* Update shared/src/store/action-reducers/utils/spatial-elements.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Lint

Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Initialize the optimisticUpdateHandler only after the store has the exercise (hpi-sam#622)

* Fixes "Features disappear from the map in imported exercises" hpi-sam#621
* Can be observed when two actions are simultaneously optimistically proposed, and the client didn't receive any other action from the server before

* Patients are automatically triaged without any personnel on the map (hpi-sam#624)

* Fix incorrect import of isEmpty

This caused "Patients are automatically triaged without any personnel on the map" hpi-sam#623

* Disallow isEmpty imports from class-validator via eslint

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH) (hpi-sam#619)

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH)

* Fix linter

* Mention JUH in Readme

* Scale down the malteser logo and add the new 22/23 project team to the landing page

* Add our year to the landing page

* Feature/603 use opaque fill style for simulated regions (hpi-sam#608)

* Refactor viewports and simulated regions to be polygons instead of lines

* Add opaque fill to simulated regions

* Fix linter

* WIP

* Refactor Coordinates and Points to Compositions

* Update readme accordingly

* Change default type of SubstituteCoordinateForPoint to never as it should never happen

* Fix typo

* Increase alpha value to 80%

* Fix bug where features did not sync their movement to other clients

* Fix linter

* Refactor lambda function to geometry helpers and refactor ElementFeature
ElementFeature (which had to extend Feature<FeatureType>) has been replaced by Feature<FeatureType>
because according to ol docs there are no classes extending Feature

* Remove ElementManager.recreateFeature()

* Refactor lambdas to function in Geometry Helper subclasses

* Rename getNextPosition to interpolateCoordinates

* Refactor polygon geometry helper names in map lambda function

* Remove comment and type cast

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Change functions to arrow functions in Geometry Helpers to preserve `this` (hpi-sam#629)

* Add type property to elements in the state (hpi-sam#616)

* WIP

* Pick specific selectors from TypeSelectorMap

* Fix linter

* Remove type property from feature

* Fix bug after merge

* Rename selector map to plural map and add validation

* Simplify featureKeys

* Fix tests by adding type property to demo objects

* WIP: Add migration

* Update shared/src/utils/type-state-selector-map.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Rename file to reflect variable name change

* Replace type literals by element property

* Run prettier

* Finish migration

* Fix migration to set correct type on EocLogEntry

* Make imports consistent

* Reuse literal union from transfer in exercise

* Fix linter

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Remove unsupportedChangeProperties (hpi-sam#630)

* Fix the Bug (hpi-sam#635)

* Remove generic type LineString | Point in favor of the default Geometry (hpi-sam#634)

* Remove generic type LineString | Point in favor of the default Geometry

* Fix linter

* Refactoring/612 refactor position (hpi-sam#625)

* Add MetaPosition Helpers

* Remove position property

* Fix Lint

* Unify access onto metaPosition

* Fix Frontend

* Remove Position Class

* Remove Position from Tests

* Rename MetaPosition to Position

* Add Migration (not for Add vehicle Action)

* complete the renaming

* Fix Tests

* Remove Transfer Property

* Add Migration for Add Vehicle Action

* Fix Small Bug

* Use type properties instead of passed strings

* Add comments

* Fix Test

* Fix Test

* Fix Transfer Overview

* Refactor Helper Methods to avoid duplicate Code

* Change Names of Helper Functions

* Added Comments to unused vars

* Fix GHSA-rc47-6667-2j5j (hpi-sam#645)

* Allow elements to be added to simulated regions (hpi-sam#626)

* Allow elements to be added to simulated regions

* Adapt Add to Simulated Region Action to type tags

* Make linter happy

* Use new position and bugfixes

* Use proper function to create position

* Refactor Start Point Literals (hpi-sam#642)

* Refactor Start Point Literals

* Add Migration

* Enable Migration

* Implement Feedback

* Remove not needed types

* Add footer and about pages (hpi-sam#643)

* Add basic footer and empty about pages

* Refactor structure of about pages

* Add footer to 404 page

* Add links from footer to exercise page

* Run prettier

* Display version number

* Explain overwriting the pages in Docker deployment

* Do not lint HTML files for about pages

* Refactor template component

* Rename title property since it's an html attribute

* Make content observable

* Rename template component

Avoids confusion with angular concepts

* Remove accidentally committed imprint dummy file

* Remove commented-out footer from exercise page

* Make Map movable on Drag with Pop Up (hpi-sam#649)

* Make Map movable on Drag with Pop Up

* Update pipeline actions to node 16 (hpi-sam#627)

* Update pipeline actions to node 16

The old actions were based on Node 12, which has reached EOL.
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

* Test previous version of cypress action again

* Try cypress action v3

* Do not use cached cypress

* Try a Cypress Config without actually calling Cypress

* Try some more stuff...

* Add Cypress as DevDependency to root

* Re-enable default cypress tests

* Remove version tag from cypress cache

The tag was there for debugging purposes only

* Invoke cypress in frontend subfolder

* Try working-directory for cypress

* Try --prefix for start

* Retry --prefix before 'run'

* Restore 5a9692d

* Update package-lock.json

---------

Co-authored-by: ClFeSc <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>

* Change mail address to feedback mailing list (hpi-sam#659)

* Adapt treatment system to account for simulated regions (hpi-sam#658)

* Adapt treatment system to account for simulated regions

The treatment system no longer asserts that patients can only be treated
on the map.

* Please linter

* Enable patient ticking in simulated regions

* Fix extent calculation of viewports and simulated regions (hpi-sam#663)

* Include simulated regions when fitting to view

Also fixing a bug with negative extents

* Fix viewport restriction with negative extent

* Rename fit view method

* Rename function at all occurrences

* Fix isInViewport for negative extents

* Satisfy linter

* Avoid duplication in type definitions

* Refactoring/609 refactor functionality from olmapmanager to featuremanagers (hpi-sam#662)

* WIP

* Move Layer Creation to Feature Managers

* Move Registration into Feature managers

* Complete Merge

* Move Interactions to Interaction Manager

* Move Popup Handling to Popup Manager

* Move Satellite Layer to Satellite Layer manager

* Minor Cleanup

* Move files

* Move Files

* More Cleanup

* More Cleanup

* Fix a bug in participant mode

* Clean up Map Interactions manager

* Clean up Satellite Layer Manager

* Fix Lint

* Implement Feedback

* Implement Feedback and change Parameter Order in onFeatureDropped

* Implement Feedback and change Parameter Order in onFeatureDropped

---------

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Adjust nginx configuration for about pages (hpi-sam#657)

* Adjust nginx configuration for about pages

* Redirect invalid requests for a uniform 404 page

* Add link to landing page on about pages

* Improve error pages in nginx setup

The error pages do not rely on a non-existing URL any longer

---------

Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>

* Set up simulation framework (hpi-sam#664)

* Create draft for simulation data types

* WIP: Simulate unloading of vehicles

* WIP add debug helpers and make simulation work

* WIP add typings and lint

* Validate events

* Fix never parameter in activity and behavior functions

* Validate activities and behaviors

* Introduce pseudo randomness for deterministic uuids

* Add migrations for simulation

* Rename SimulationActivity.terminate to onTerminate

* Remove simulatedRegionId from VehicleArrivedEvent

* Slight improvement to debugging buttons

* Fix typo

* Validate state in AddBehaviorAction

* Incorporate suggestions from review

* Fix randomness

* Add generic DelayEventActivity

* Fix DelayEventActivity

* Please linter

* Remove debug UI

* Dragging onto the Map now triggers Drop Events (hpi-sam#671)

* Dragging onto the Map now triggers Drop Events

* Add our names to the readme (hpi-sam#672)

* Use @noble/hashes instead of hash.js (hpi-sam#674)

* Use @noble/hashes instead of hash.js

* Fix install:all script

* Add release workflow

* Populate CHANGELOG.md

* Update create-release-pr.yml

* trigger pipeline

* Prepare release v0.0.1-review

---------

Co-authored-by: Clemens <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>
Co-authored-by: Lukas Hagen <43916057+Greenscreen23@users.noreply.github.com>
Co-authored-by: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com>
Co-authored-by: benn02 <82985280+benn02@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>
Co-authored-by: GitHub Actions <noreply@github.com>
Nils1729 added a commit to Nils1729/digital-fuesim-manv that referenced this pull request Feb 23, 2023
* Improve validation (hpi-sam#125)

* Improve validation by introducing multiple new validation decorators

* `IsIdMap` for types of the form `{ readonly [key: UUID]: T }`. This transforms the object, so using instance objects (instead of plain objects) will no longer be supported.

* `IsLiteralUnion` for literal unions of types `number | string | symbol` (e.g. `participant | trainer`). Uses `isIn` internally.

* `IsReachableTransferPoints` for `ReachableTransferPoints` used in `TransferPoint`. Very specific but necessary due to the unique structure of this type.

* `IsUUIDSet` for `UUIDSet`

* `IsValue` for *simple* values that are required for a property. For example, when a `type` property has to have the value `'partial'`, one can use `@IsValue('partial')` for this. Allowed are the types `bigint | boolean | number | string | symbol | null | undefined`. The reason is that this validator also uses `isIn` internally, which in turn uses `===` which might produce incorrect results for `object` values.

* All validators are required to be applied to correctly types properties by the use of `GenericPropertyDecorator`. Using e.g. `@IsLiteralUnion({ partial: true, complete: true })` on a property typed `string` raises a TypeScript error.

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Feature/state benchmark (hpi-sam#581)

* Move state migrations to shared
* Add benchmark package
* Update readmes
* Make problem with duplicated RestoreError more obvious

* Feature/improve eslint rules (hpi-sam#591)

* Disallow imports from "*/dist/*"
* Improve smaller eslint rules
* Update documentation

* Update packages to mitigate GHSA-9c47-m6qq-7p4h (hpi-sam#592)

* Update dependencies (hpi-sam#595)

* Update dependencies

* typescript@4.9 (satisfies-operator and watch-performance-improvements)
* angular@15.1
* Else only patch and minor version bumps
* Fix version of @types/node in benchmark and frontend (18 -> 16)

* Run prettier

* Add simulated regions that can be placed on the map (hpi-sam#601)

* Add simulated regions that can be placed on the map

* Fix naming

* Add migration

* Fix linter error

* Move simulated region to separate heading in trainer map editor

* Turn isInSimulatedRegion into a stub method

* Refactor ol-map-manager to reuse some features from viewport in simulatedRegion

* Ignore vs code config files (hpi-sam#606)

* Rename VS Code configs to `.example`

* Add new "Start all but database" task

* Explain changes in readme

* Refactor viewport-modify to resize-rectangle-interaction (hpi-sam#604)

* Instead of using some parts of the `Modify` interaction (side-effect in the style function) a new custom Interaction has been created.
* Previously, one could switch between resizing and translating a viewport via pressing `Shift`. Instead, now one ***resizes*** if one drags an edge of the viewport (+ a bit around it), and ***translates*** if one drags any other part. This should enable touch users to resize viewports
* The code should now be more readable and extendable
* The unnecessary `viewportTranslateInteraction` has been removed
* `feature.dispose()` now gets called when it gets deleted - this could have been a memory leak?

* Add link to main branch in readme (hpi-sam#611)

* Close popups with esc (hpi-sam#610)

* Add keydown handler to close popups on escape

* Ensure input is saved even after less than 600ms

* Cast event inline

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Add new image for big material and material (hpi-sam#544)

* Add new image for big material and material

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix CVE-2022-25901 (hpi-sam#618)

* Feature/597 regions can contain personnel and patients (hpi-sam#607)

* Add MetaPosition type

* Add MetaPosition to Vehicle

* Add MetaPosition ro Personnel

* Add MetaPosition to Material

* Add MetaPosition to Patient

* Add Classes for different Position Types

* Use create when applicable and fix in MetaPosition

* Add migration for addition of MetaPosition

* refactor literals to start with lowercase

* Change nested if else to else if

* Make metaPosition not optional

* Fix failing Tests

* Update shared/src/models/material.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/personnel.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/utils/calculate-treatments.spec.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Prettier Errors

* Change Validation to Allow

* Put personnel and material in vehicle on creation

* Update shared/src/store/action-reducers/transfer.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Pipeline dependencies

* Update shared/src/state-migrations/16-add-meta-position.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix linter Error

* Add validators to MetaPositions

* Remove unused imports

* Fix Validators

* Add/Fix Action Migrations

* Add Exports to Index.ts

* Update shared/src/store/action-reducers/utils/spatial-elements.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Lint

Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Initialize the optimisticUpdateHandler only after the store has the exercise (hpi-sam#622)

* Fixes "Features disappear from the map in imported exercises" hpi-sam#621
* Can be observed when two actions are simultaneously optimistically proposed, and the client didn't receive any other action from the server before

* Patients are automatically triaged without any personnel on the map (hpi-sam#624)

* Fix incorrect import of isEmpty

This caused "Patients are automatically triaged without any personnel on the map" hpi-sam#623

* Disallow isEmpty imports from class-validator via eslint

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH) (hpi-sam#619)

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH)

* Fix linter

* Mention JUH in Readme

* Scale down the malteser logo and add the new 22/23 project team to the landing page

* Add our year to the landing page

* Feature/603 use opaque fill style for simulated regions (hpi-sam#608)

* Refactor viewports and simulated regions to be polygons instead of lines

* Add opaque fill to simulated regions

* Fix linter

* WIP

* Refactor Coordinates and Points to Compositions

* Update readme accordingly

* Change default type of SubstituteCoordinateForPoint to never as it should never happen

* Fix typo

* Increase alpha value to 80%

* Fix bug where features did not sync their movement to other clients

* Fix linter

* Refactor lambda function to geometry helpers and refactor ElementFeature
ElementFeature (which had to extend Feature<FeatureType>) has been replaced by Feature<FeatureType>
because according to ol docs there are no classes extending Feature

* Remove ElementManager.recreateFeature()

* Refactor lambdas to function in Geometry Helper subclasses

* Rename getNextPosition to interpolateCoordinates

* Refactor polygon geometry helper names in map lambda function

* Remove comment and type cast

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Change functions to arrow functions in Geometry Helpers to preserve `this` (hpi-sam#629)

* Add type property to elements in the state (hpi-sam#616)

* WIP

* Pick specific selectors from TypeSelectorMap

* Fix linter

* Remove type property from feature

* Fix bug after merge

* Rename selector map to plural map and add validation

* Simplify featureKeys

* Fix tests by adding type property to demo objects

* WIP: Add migration

* Update shared/src/utils/type-state-selector-map.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Rename file to reflect variable name change

* Replace type literals by element property

* Run prettier

* Finish migration

* Fix migration to set correct type on EocLogEntry

* Make imports consistent

* Reuse literal union from transfer in exercise

* Fix linter

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Remove unsupportedChangeProperties (hpi-sam#630)

* Fix the Bug (hpi-sam#635)

* Remove generic type LineString | Point in favor of the default Geometry (hpi-sam#634)

* Remove generic type LineString | Point in favor of the default Geometry

* Fix linter

* Refactoring/612 refactor position (hpi-sam#625)

* Add MetaPosition Helpers

* Remove position property

* Fix Lint

* Unify access onto metaPosition

* Fix Frontend

* Remove Position Class

* Remove Position from Tests

* Rename MetaPosition to Position

* Add Migration (not for Add vehicle Action)

* complete the renaming

* Fix Tests

* Remove Transfer Property

* Add Migration for Add Vehicle Action

* Fix Small Bug

* Use type properties instead of passed strings

* Add comments

* Fix Test

* Fix Test

* Fix Transfer Overview

* Refactor Helper Methods to avoid duplicate Code

* Change Names of Helper Functions

* Added Comments to unused vars

* Fix GHSA-rc47-6667-2j5j (hpi-sam#645)

* Allow elements to be added to simulated regions (hpi-sam#626)

* Allow elements to be added to simulated regions

* Adapt Add to Simulated Region Action to type tags

* Make linter happy

* Use new position and bugfixes

* Use proper function to create position

* Refactor Start Point Literals (hpi-sam#642)

* Refactor Start Point Literals

* Add Migration

* Enable Migration

* Implement Feedback

* Remove not needed types

* Add footer and about pages (hpi-sam#643)

* Add basic footer and empty about pages

* Refactor structure of about pages

* Add footer to 404 page

* Add links from footer to exercise page

* Run prettier

* Display version number

* Explain overwriting the pages in Docker deployment

* Do not lint HTML files for about pages

* Refactor template component

* Rename title property since it's an html attribute

* Make content observable

* Rename template component

Avoids confusion with angular concepts

* Remove accidentally committed imprint dummy file

* Remove commented-out footer from exercise page

* Make Map movable on Drag with Pop Up (hpi-sam#649)

* Make Map movable on Drag with Pop Up

* Update pipeline actions to node 16 (hpi-sam#627)

* Update pipeline actions to node 16

The old actions were based on Node 12, which has reached EOL.
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

* Test previous version of cypress action again

* Try cypress action v3

* Do not use cached cypress

* Try a Cypress Config without actually calling Cypress

* Try some more stuff...

* Add Cypress as DevDependency to root

* Re-enable default cypress tests

* Remove version tag from cypress cache

The tag was there for debugging purposes only

* Invoke cypress in frontend subfolder

* Try working-directory for cypress

* Try --prefix for start

* Retry --prefix before 'run'

* Restore 5a9692d

* Update package-lock.json

---------

Co-authored-by: ClFeSc <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>

* Change mail address to feedback mailing list (hpi-sam#659)

* Adapt treatment system to account for simulated regions (hpi-sam#658)

* Adapt treatment system to account for simulated regions

The treatment system no longer asserts that patients can only be treated
on the map.

* Please linter

* Enable patient ticking in simulated regions

* Fix extent calculation of viewports and simulated regions (hpi-sam#663)

* Include simulated regions when fitting to view

Also fixing a bug with negative extents

* Fix viewport restriction with negative extent

* Rename fit view method

* Rename function at all occurrences

* Fix isInViewport for negative extents

* Satisfy linter

* Avoid duplication in type definitions

* Refactoring/609 refactor functionality from olmapmanager to featuremanagers (hpi-sam#662)

* WIP

* Move Layer Creation to Feature Managers

* Move Registration into Feature managers

* Complete Merge

* Move Interactions to Interaction Manager

* Move Popup Handling to Popup Manager

* Move Satellite Layer to Satellite Layer manager

* Minor Cleanup

* Move files

* Move Files

* More Cleanup

* More Cleanup

* Fix a bug in participant mode

* Clean up Map Interactions manager

* Clean up Satellite Layer Manager

* Fix Lint

* Implement Feedback

* Implement Feedback and change Parameter Order in onFeatureDropped

* Implement Feedback and change Parameter Order in onFeatureDropped

---------

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Adjust nginx configuration for about pages (hpi-sam#657)

* Adjust nginx configuration for about pages

* Redirect invalid requests for a uniform 404 page

* Add link to landing page on about pages

* Improve error pages in nginx setup

The error pages do not rely on a non-existing URL any longer

---------

Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>

* Set up simulation framework (hpi-sam#664)

* Create draft for simulation data types

* WIP: Simulate unloading of vehicles

* WIP add debug helpers and make simulation work

* WIP add typings and lint

* Validate events

* Fix never parameter in activity and behavior functions

* Validate activities and behaviors

* Introduce pseudo randomness for deterministic uuids

* Add migrations for simulation

* Rename SimulationActivity.terminate to onTerminate

* Remove simulatedRegionId from VehicleArrivedEvent

* Slight improvement to debugging buttons

* Fix typo

* Validate state in AddBehaviorAction

* Incorporate suggestions from review

* Fix randomness

* Add generic DelayEventActivity

* Fix DelayEventActivity

* Please linter

* Remove debug UI

* Dragging onto the Map now triggers Drop Events (hpi-sam#671)

* Dragging onto the Map now triggers Drop Events

* Add our names to the readme (hpi-sam#672)

* Use @noble/hashes instead of hash.js (hpi-sam#674)

* Use @noble/hashes instead of hash.js

* Fix install:all script

* Add release workflow

* Populate CHANGELOG.md

* Update create-release-pr.yml

* trigger pipeline

* Prepare release v0.0.1-review (#3)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v123-test (#5)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v1.2.3-test2 (#7)

Co-authored-by: GitHub Actions <noreply@github.com>

* Update create-release-pr.yml

debug

* Update create-release-pr.yml

debug

* debug

* Prepare release v1.2.3-test4 (#11)

Co-authored-by: GitHub Actions <noreply@github.com>

* diff

* Debug v1.2.3-test6 (#13)

Co-authored-by: GitHub Actions <noreply@github.com>

* Debug v1.2.3-test7 (#15)

Co-authored-by: GitHub Actions <noreply@github.com>

* Fix npm i

* Debug v1.2.3-test8 (#17)

Co-authored-by: GitHub Actions <noreply@github.com>

* call pipeline from release

* fix permissions

* remove auto pipeline

* Debug v1.2.3-test12

---------

Co-authored-by: Clemens <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>
Co-authored-by: Lukas Hagen <43916057+Greenscreen23@users.noreply.github.com>
Co-authored-by: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com>
Co-authored-by: benn02 <82985280+benn02@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <noreply@github.com>
Nils1729 added a commit to Nils1729/digital-fuesim-manv that referenced this pull request Feb 23, 2023
* Improve validation (hpi-sam#125)

* Improve validation by introducing multiple new validation decorators

* `IsIdMap` for types of the form `{ readonly [key: UUID]: T }`. This transforms the object, so using instance objects (instead of plain objects) will no longer be supported.

* `IsLiteralUnion` for literal unions of types `number | string | symbol` (e.g. `participant | trainer`). Uses `isIn` internally.

* `IsReachableTransferPoints` for `ReachableTransferPoints` used in `TransferPoint`. Very specific but necessary due to the unique structure of this type.

* `IsUUIDSet` for `UUIDSet`

* `IsValue` for *simple* values that are required for a property. For example, when a `type` property has to have the value `'partial'`, one can use `@IsValue('partial')` for this. Allowed are the types `bigint | boolean | number | string | symbol | null | undefined`. The reason is that this validator also uses `isIn` internally, which in turn uses `===` which might produce incorrect results for `object` values.

* All validators are required to be applied to correctly types properties by the use of `GenericPropertyDecorator`. Using e.g. `@IsLiteralUnion({ partial: true, complete: true })` on a property typed `string` raises a TypeScript error.

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Feature/state benchmark (hpi-sam#581)

* Move state migrations to shared
* Add benchmark package
* Update readmes
* Make problem with duplicated RestoreError more obvious

* Feature/improve eslint rules (hpi-sam#591)

* Disallow imports from "*/dist/*"
* Improve smaller eslint rules
* Update documentation

* Update packages to mitigate GHSA-9c47-m6qq-7p4h (hpi-sam#592)

* Update dependencies (hpi-sam#595)

* Update dependencies

* typescript@4.9 (satisfies-operator and watch-performance-improvements)
* angular@15.1
* Else only patch and minor version bumps
* Fix version of @types/node in benchmark and frontend (18 -> 16)

* Run prettier

* Add simulated regions that can be placed on the map (hpi-sam#601)

* Add simulated regions that can be placed on the map

* Fix naming

* Add migration

* Fix linter error

* Move simulated region to separate heading in trainer map editor

* Turn isInSimulatedRegion into a stub method

* Refactor ol-map-manager to reuse some features from viewport in simulatedRegion

* Ignore vs code config files (hpi-sam#606)

* Rename VS Code configs to `.example`

* Add new "Start all but database" task

* Explain changes in readme

* Refactor viewport-modify to resize-rectangle-interaction (hpi-sam#604)

* Instead of using some parts of the `Modify` interaction (side-effect in the style function) a new custom Interaction has been created.
* Previously, one could switch between resizing and translating a viewport via pressing `Shift`. Instead, now one ***resizes*** if one drags an edge of the viewport (+ a bit around it), and ***translates*** if one drags any other part. This should enable touch users to resize viewports
* The code should now be more readable and extendable
* The unnecessary `viewportTranslateInteraction` has been removed
* `feature.dispose()` now gets called when it gets deleted - this could have been a memory leak?

* Add link to main branch in readme (hpi-sam#611)

* Close popups with esc (hpi-sam#610)

* Add keydown handler to close popups on escape

* Ensure input is saved even after less than 600ms

* Cast event inline

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Add new image for big material and material (hpi-sam#544)

* Add new image for big material and material

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix CVE-2022-25901 (hpi-sam#618)

* Feature/597 regions can contain personnel and patients (hpi-sam#607)

* Add MetaPosition type

* Add MetaPosition to Vehicle

* Add MetaPosition ro Personnel

* Add MetaPosition to Material

* Add MetaPosition to Patient

* Add Classes for different Position Types

* Use create when applicable and fix in MetaPosition

* Add migration for addition of MetaPosition

* refactor literals to start with lowercase

* Change nested if else to else if

* Make metaPosition not optional

* Fix failing Tests

* Update shared/src/models/material.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/personnel.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/utils/calculate-treatments.spec.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Prettier Errors

* Change Validation to Allow

* Put personnel and material in vehicle on creation

* Update shared/src/store/action-reducers/transfer.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Pipeline dependencies

* Update shared/src/state-migrations/16-add-meta-position.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix linter Error

* Add validators to MetaPositions

* Remove unused imports

* Fix Validators

* Add/Fix Action Migrations

* Add Exports to Index.ts

* Update shared/src/store/action-reducers/utils/spatial-elements.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Lint

Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Initialize the optimisticUpdateHandler only after the store has the exercise (hpi-sam#622)

* Fixes "Features disappear from the map in imported exercises" hpi-sam#621
* Can be observed when two actions are simultaneously optimistically proposed, and the client didn't receive any other action from the server before

* Patients are automatically triaged without any personnel on the map (hpi-sam#624)

* Fix incorrect import of isEmpty

This caused "Patients are automatically triaged without any personnel on the map" hpi-sam#623

* Disallow isEmpty imports from class-validator via eslint

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH) (hpi-sam#619)

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH)

* Fix linter

* Mention JUH in Readme

* Scale down the malteser logo and add the new 22/23 project team to the landing page

* Add our year to the landing page

* Feature/603 use opaque fill style for simulated regions (hpi-sam#608)

* Refactor viewports and simulated regions to be polygons instead of lines

* Add opaque fill to simulated regions

* Fix linter

* WIP

* Refactor Coordinates and Points to Compositions

* Update readme accordingly

* Change default type of SubstituteCoordinateForPoint to never as it should never happen

* Fix typo

* Increase alpha value to 80%

* Fix bug where features did not sync their movement to other clients

* Fix linter

* Refactor lambda function to geometry helpers and refactor ElementFeature
ElementFeature (which had to extend Feature<FeatureType>) has been replaced by Feature<FeatureType>
because according to ol docs there are no classes extending Feature

* Remove ElementManager.recreateFeature()

* Refactor lambdas to function in Geometry Helper subclasses

* Rename getNextPosition to interpolateCoordinates

* Refactor polygon geometry helper names in map lambda function

* Remove comment and type cast

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Change functions to arrow functions in Geometry Helpers to preserve `this` (hpi-sam#629)

* Add type property to elements in the state (hpi-sam#616)

* WIP

* Pick specific selectors from TypeSelectorMap

* Fix linter

* Remove type property from feature

* Fix bug after merge

* Rename selector map to plural map and add validation

* Simplify featureKeys

* Fix tests by adding type property to demo objects

* WIP: Add migration

* Update shared/src/utils/type-state-selector-map.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Rename file to reflect variable name change

* Replace type literals by element property

* Run prettier

* Finish migration

* Fix migration to set correct type on EocLogEntry

* Make imports consistent

* Reuse literal union from transfer in exercise

* Fix linter

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Remove unsupportedChangeProperties (hpi-sam#630)

* Fix the Bug (hpi-sam#635)

* Remove generic type LineString | Point in favor of the default Geometry (hpi-sam#634)

* Remove generic type LineString | Point in favor of the default Geometry

* Fix linter

* Refactoring/612 refactor position (hpi-sam#625)

* Add MetaPosition Helpers

* Remove position property

* Fix Lint

* Unify access onto metaPosition

* Fix Frontend

* Remove Position Class

* Remove Position from Tests

* Rename MetaPosition to Position

* Add Migration (not for Add vehicle Action)

* complete the renaming

* Fix Tests

* Remove Transfer Property

* Add Migration for Add Vehicle Action

* Fix Small Bug

* Use type properties instead of passed strings

* Add comments

* Fix Test

* Fix Test

* Fix Transfer Overview

* Refactor Helper Methods to avoid duplicate Code

* Change Names of Helper Functions

* Added Comments to unused vars

* Fix GHSA-rc47-6667-2j5j (hpi-sam#645)

* Allow elements to be added to simulated regions (hpi-sam#626)

* Allow elements to be added to simulated regions

* Adapt Add to Simulated Region Action to type tags

* Make linter happy

* Use new position and bugfixes

* Use proper function to create position

* Refactor Start Point Literals (hpi-sam#642)

* Refactor Start Point Literals

* Add Migration

* Enable Migration

* Implement Feedback

* Remove not needed types

* Add footer and about pages (hpi-sam#643)

* Add basic footer and empty about pages

* Refactor structure of about pages

* Add footer to 404 page

* Add links from footer to exercise page

* Run prettier

* Display version number

* Explain overwriting the pages in Docker deployment

* Do not lint HTML files for about pages

* Refactor template component

* Rename title property since it's an html attribute

* Make content observable

* Rename template component

Avoids confusion with angular concepts

* Remove accidentally committed imprint dummy file

* Remove commented-out footer from exercise page

* Make Map movable on Drag with Pop Up (hpi-sam#649)

* Make Map movable on Drag with Pop Up

* Update pipeline actions to node 16 (hpi-sam#627)

* Update pipeline actions to node 16

The old actions were based on Node 12, which has reached EOL.
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

* Test previous version of cypress action again

* Try cypress action v3

* Do not use cached cypress

* Try a Cypress Config without actually calling Cypress

* Try some more stuff...

* Add Cypress as DevDependency to root

* Re-enable default cypress tests

* Remove version tag from cypress cache

The tag was there for debugging purposes only

* Invoke cypress in frontend subfolder

* Try working-directory for cypress

* Try --prefix for start

* Retry --prefix before 'run'

* Restore 5a9692d

* Update package-lock.json

---------

Co-authored-by: ClFeSc <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>

* Change mail address to feedback mailing list (hpi-sam#659)

* Adapt treatment system to account for simulated regions (hpi-sam#658)

* Adapt treatment system to account for simulated regions

The treatment system no longer asserts that patients can only be treated
on the map.

* Please linter

* Enable patient ticking in simulated regions

* Fix extent calculation of viewports and simulated regions (hpi-sam#663)

* Include simulated regions when fitting to view

Also fixing a bug with negative extents

* Fix viewport restriction with negative extent

* Rename fit view method

* Rename function at all occurrences

* Fix isInViewport for negative extents

* Satisfy linter

* Avoid duplication in type definitions

* Refactoring/609 refactor functionality from olmapmanager to featuremanagers (hpi-sam#662)

* WIP

* Move Layer Creation to Feature Managers

* Move Registration into Feature managers

* Complete Merge

* Move Interactions to Interaction Manager

* Move Popup Handling to Popup Manager

* Move Satellite Layer to Satellite Layer manager

* Minor Cleanup

* Move files

* Move Files

* More Cleanup

* More Cleanup

* Fix a bug in participant mode

* Clean up Map Interactions manager

* Clean up Satellite Layer Manager

* Fix Lint

* Implement Feedback

* Implement Feedback and change Parameter Order in onFeatureDropped

* Implement Feedback and change Parameter Order in onFeatureDropped

---------

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Adjust nginx configuration for about pages (hpi-sam#657)

* Adjust nginx configuration for about pages

* Redirect invalid requests for a uniform 404 page

* Add link to landing page on about pages

* Improve error pages in nginx setup

The error pages do not rely on a non-existing URL any longer

---------

Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>

* Set up simulation framework (hpi-sam#664)

* Create draft for simulation data types

* WIP: Simulate unloading of vehicles

* WIP add debug helpers and make simulation work

* WIP add typings and lint

* Validate events

* Fix never parameter in activity and behavior functions

* Validate activities and behaviors

* Introduce pseudo randomness for deterministic uuids

* Add migrations for simulation

* Rename SimulationActivity.terminate to onTerminate

* Remove simulatedRegionId from VehicleArrivedEvent

* Slight improvement to debugging buttons

* Fix typo

* Validate state in AddBehaviorAction

* Incorporate suggestions from review

* Fix randomness

* Add generic DelayEventActivity

* Fix DelayEventActivity

* Please linter

* Remove debug UI

* Dragging onto the Map now triggers Drop Events (hpi-sam#671)

* Dragging onto the Map now triggers Drop Events

* Add our names to the readme (hpi-sam#672)

* Use @noble/hashes instead of hash.js (hpi-sam#674)

* Use @noble/hashes instead of hash.js

* Fix install:all script

* Add release workflow

* Populate CHANGELOG.md

* Update create-release-pr.yml

* trigger pipeline

* Prepare release v0.0.1-review (#3)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v123-test (#5)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v1.2.3-test2 (#7)

Co-authored-by: GitHub Actions <noreply@github.com>

* Update create-release-pr.yml

debug

* Update create-release-pr.yml

debug

* debug

* Prepare release v1.2.3-test4 (#11)

Co-authored-by: GitHub Actions <noreply@github.com>

* diff

* Debug v1.2.3-test6 (#13)

Co-authored-by: GitHub Actions <noreply@github.com>

* Debug v1.2.3-test7 (#15)

Co-authored-by: GitHub Actions <noreply@github.com>

* Fix npm i

* Debug v1.2.3-test8 (#17)

Co-authored-by: GitHub Actions <noreply@github.com>

* call pipeline from release

* fix permissions

* remove auto pipeline

* fix changelog

* Debug v1.2.3-test13

---------

Co-authored-by: Clemens <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>
Co-authored-by: Lukas Hagen <43916057+Greenscreen23@users.noreply.github.com>
Co-authored-by: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com>
Co-authored-by: benn02 <82985280+benn02@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <noreply@github.com>
Nils1729 added a commit to Nils1729/digital-fuesim-manv that referenced this pull request Feb 23, 2023
* Improve validation (hpi-sam#125)

* Improve validation by introducing multiple new validation decorators

* `IsIdMap` for types of the form `{ readonly [key: UUID]: T }`. This transforms the object, so using instance objects (instead of plain objects) will no longer be supported.

* `IsLiteralUnion` for literal unions of types `number | string | symbol` (e.g. `participant | trainer`). Uses `isIn` internally.

* `IsReachableTransferPoints` for `ReachableTransferPoints` used in `TransferPoint`. Very specific but necessary due to the unique structure of this type.

* `IsUUIDSet` for `UUIDSet`

* `IsValue` for *simple* values that are required for a property. For example, when a `type` property has to have the value `'partial'`, one can use `@IsValue('partial')` for this. Allowed are the types `bigint | boolean | number | string | symbol | null | undefined`. The reason is that this validator also uses `isIn` internally, which in turn uses `===` which might produce incorrect results for `object` values.

* All validators are required to be applied to correctly types properties by the use of `GenericPropertyDecorator`. Using e.g. `@IsLiteralUnion({ partial: true, complete: true })` on a property typed `string` raises a TypeScript error.

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Feature/state benchmark (hpi-sam#581)

* Move state migrations to shared
* Add benchmark package
* Update readmes
* Make problem with duplicated RestoreError more obvious

* Feature/improve eslint rules (hpi-sam#591)

* Disallow imports from "*/dist/*"
* Improve smaller eslint rules
* Update documentation

* Update packages to mitigate GHSA-9c47-m6qq-7p4h (hpi-sam#592)

* Update dependencies (hpi-sam#595)

* Update dependencies

* typescript@4.9 (satisfies-operator and watch-performance-improvements)
* angular@15.1
* Else only patch and minor version bumps
* Fix version of @types/node in benchmark and frontend (18 -> 16)

* Run prettier

* Add simulated regions that can be placed on the map (hpi-sam#601)

* Add simulated regions that can be placed on the map

* Fix naming

* Add migration

* Fix linter error

* Move simulated region to separate heading in trainer map editor

* Turn isInSimulatedRegion into a stub method

* Refactor ol-map-manager to reuse some features from viewport in simulatedRegion

* Ignore vs code config files (hpi-sam#606)

* Rename VS Code configs to `.example`

* Add new "Start all but database" task

* Explain changes in readme

* Refactor viewport-modify to resize-rectangle-interaction (hpi-sam#604)

* Instead of using some parts of the `Modify` interaction (side-effect in the style function) a new custom Interaction has been created.
* Previously, one could switch between resizing and translating a viewport via pressing `Shift`. Instead, now one ***resizes*** if one drags an edge of the viewport (+ a bit around it), and ***translates*** if one drags any other part. This should enable touch users to resize viewports
* The code should now be more readable and extendable
* The unnecessary `viewportTranslateInteraction` has been removed
* `feature.dispose()` now gets called when it gets deleted - this could have been a memory leak?

* Add link to main branch in readme (hpi-sam#611)

* Close popups with esc (hpi-sam#610)

* Add keydown handler to close popups on escape

* Ensure input is saved even after less than 600ms

* Cast event inline

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Add new image for big material and material (hpi-sam#544)

* Add new image for big material and material

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix CVE-2022-25901 (hpi-sam#618)

* Feature/597 regions can contain personnel and patients (hpi-sam#607)

* Add MetaPosition type

* Add MetaPosition to Vehicle

* Add MetaPosition ro Personnel

* Add MetaPosition to Material

* Add MetaPosition to Patient

* Add Classes for different Position Types

* Use create when applicable and fix in MetaPosition

* Add migration for addition of MetaPosition

* refactor literals to start with lowercase

* Change nested if else to else if

* Make metaPosition not optional

* Fix failing Tests

* Update shared/src/models/material.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/personnel.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/utils/calculate-treatments.spec.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Prettier Errors

* Change Validation to Allow

* Put personnel and material in vehicle on creation

* Update shared/src/store/action-reducers/transfer.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Pipeline dependencies

* Update shared/src/state-migrations/16-add-meta-position.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix linter Error

* Add validators to MetaPositions

* Remove unused imports

* Fix Validators

* Add/Fix Action Migrations

* Add Exports to Index.ts

* Update shared/src/store/action-reducers/utils/spatial-elements.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Lint

Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Initialize the optimisticUpdateHandler only after the store has the exercise (hpi-sam#622)

* Fixes "Features disappear from the map in imported exercises" hpi-sam#621
* Can be observed when two actions are simultaneously optimistically proposed, and the client didn't receive any other action from the server before

* Patients are automatically triaged without any personnel on the map (hpi-sam#624)

* Fix incorrect import of isEmpty

This caused "Patients are automatically triaged without any personnel on the map" hpi-sam#623

* Disallow isEmpty imports from class-validator via eslint

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH) (hpi-sam#619)

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH)

* Fix linter

* Mention JUH in Readme

* Scale down the malteser logo and add the new 22/23 project team to the landing page

* Add our year to the landing page

* Feature/603 use opaque fill style for simulated regions (hpi-sam#608)

* Refactor viewports and simulated regions to be polygons instead of lines

* Add opaque fill to simulated regions

* Fix linter

* WIP

* Refactor Coordinates and Points to Compositions

* Update readme accordingly

* Change default type of SubstituteCoordinateForPoint to never as it should never happen

* Fix typo

* Increase alpha value to 80%

* Fix bug where features did not sync their movement to other clients

* Fix linter

* Refactor lambda function to geometry helpers and refactor ElementFeature
ElementFeature (which had to extend Feature<FeatureType>) has been replaced by Feature<FeatureType>
because according to ol docs there are no classes extending Feature

* Remove ElementManager.recreateFeature()

* Refactor lambdas to function in Geometry Helper subclasses

* Rename getNextPosition to interpolateCoordinates

* Refactor polygon geometry helper names in map lambda function

* Remove comment and type cast

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Change functions to arrow functions in Geometry Helpers to preserve `this` (hpi-sam#629)

* Add type property to elements in the state (hpi-sam#616)

* WIP

* Pick specific selectors from TypeSelectorMap

* Fix linter

* Remove type property from feature

* Fix bug after merge

* Rename selector map to plural map and add validation

* Simplify featureKeys

* Fix tests by adding type property to demo objects

* WIP: Add migration

* Update shared/src/utils/type-state-selector-map.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Rename file to reflect variable name change

* Replace type literals by element property

* Run prettier

* Finish migration

* Fix migration to set correct type on EocLogEntry

* Make imports consistent

* Reuse literal union from transfer in exercise

* Fix linter

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Remove unsupportedChangeProperties (hpi-sam#630)

* Fix the Bug (hpi-sam#635)

* Remove generic type LineString | Point in favor of the default Geometry (hpi-sam#634)

* Remove generic type LineString | Point in favor of the default Geometry

* Fix linter

* Refactoring/612 refactor position (hpi-sam#625)

* Add MetaPosition Helpers

* Remove position property

* Fix Lint

* Unify access onto metaPosition

* Fix Frontend

* Remove Position Class

* Remove Position from Tests

* Rename MetaPosition to Position

* Add Migration (not for Add vehicle Action)

* complete the renaming

* Fix Tests

* Remove Transfer Property

* Add Migration for Add Vehicle Action

* Fix Small Bug

* Use type properties instead of passed strings

* Add comments

* Fix Test

* Fix Test

* Fix Transfer Overview

* Refactor Helper Methods to avoid duplicate Code

* Change Names of Helper Functions

* Added Comments to unused vars

* Fix GHSA-rc47-6667-2j5j (hpi-sam#645)

* Allow elements to be added to simulated regions (hpi-sam#626)

* Allow elements to be added to simulated regions

* Adapt Add to Simulated Region Action to type tags

* Make linter happy

* Use new position and bugfixes

* Use proper function to create position

* Refactor Start Point Literals (hpi-sam#642)

* Refactor Start Point Literals

* Add Migration

* Enable Migration

* Implement Feedback

* Remove not needed types

* Add footer and about pages (hpi-sam#643)

* Add basic footer and empty about pages

* Refactor structure of about pages

* Add footer to 404 page

* Add links from footer to exercise page

* Run prettier

* Display version number

* Explain overwriting the pages in Docker deployment

* Do not lint HTML files for about pages

* Refactor template component

* Rename title property since it's an html attribute

* Make content observable

* Rename template component

Avoids confusion with angular concepts

* Remove accidentally committed imprint dummy file

* Remove commented-out footer from exercise page

* Make Map movable on Drag with Pop Up (hpi-sam#649)

* Make Map movable on Drag with Pop Up

* Update pipeline actions to node 16 (hpi-sam#627)

* Update pipeline actions to node 16

The old actions were based on Node 12, which has reached EOL.
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

* Test previous version of cypress action again

* Try cypress action v3

* Do not use cached cypress

* Try a Cypress Config without actually calling Cypress

* Try some more stuff...

* Add Cypress as DevDependency to root

* Re-enable default cypress tests

* Remove version tag from cypress cache

The tag was there for debugging purposes only

* Invoke cypress in frontend subfolder

* Try working-directory for cypress

* Try --prefix for start

* Retry --prefix before 'run'

* Restore 5a9692d

* Update package-lock.json

---------

Co-authored-by: ClFeSc <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>

* Change mail address to feedback mailing list (hpi-sam#659)

* Adapt treatment system to account for simulated regions (hpi-sam#658)

* Adapt treatment system to account for simulated regions

The treatment system no longer asserts that patients can only be treated
on the map.

* Please linter

* Enable patient ticking in simulated regions

* Fix extent calculation of viewports and simulated regions (hpi-sam#663)

* Include simulated regions when fitting to view

Also fixing a bug with negative extents

* Fix viewport restriction with negative extent

* Rename fit view method

* Rename function at all occurrences

* Fix isInViewport for negative extents

* Satisfy linter

* Avoid duplication in type definitions

* Refactoring/609 refactor functionality from olmapmanager to featuremanagers (hpi-sam#662)

* WIP

* Move Layer Creation to Feature Managers

* Move Registration into Feature managers

* Complete Merge

* Move Interactions to Interaction Manager

* Move Popup Handling to Popup Manager

* Move Satellite Layer to Satellite Layer manager

* Minor Cleanup

* Move files

* Move Files

* More Cleanup

* More Cleanup

* Fix a bug in participant mode

* Clean up Map Interactions manager

* Clean up Satellite Layer Manager

* Fix Lint

* Implement Feedback

* Implement Feedback and change Parameter Order in onFeatureDropped

* Implement Feedback and change Parameter Order in onFeatureDropped

---------

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Adjust nginx configuration for about pages (hpi-sam#657)

* Adjust nginx configuration for about pages

* Redirect invalid requests for a uniform 404 page

* Add link to landing page on about pages

* Improve error pages in nginx setup

The error pages do not rely on a non-existing URL any longer

---------

Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>

* Set up simulation framework (hpi-sam#664)

* Create draft for simulation data types

* WIP: Simulate unloading of vehicles

* WIP add debug helpers and make simulation work

* WIP add typings and lint

* Validate events

* Fix never parameter in activity and behavior functions

* Validate activities and behaviors

* Introduce pseudo randomness for deterministic uuids

* Add migrations for simulation

* Rename SimulationActivity.terminate to onTerminate

* Remove simulatedRegionId from VehicleArrivedEvent

* Slight improvement to debugging buttons

* Fix typo

* Validate state in AddBehaviorAction

* Incorporate suggestions from review

* Fix randomness

* Add generic DelayEventActivity

* Fix DelayEventActivity

* Please linter

* Remove debug UI

* Dragging onto the Map now triggers Drop Events (hpi-sam#671)

* Dragging onto the Map now triggers Drop Events

* Add our names to the readme (hpi-sam#672)

* Use @noble/hashes instead of hash.js (hpi-sam#674)

* Use @noble/hashes instead of hash.js

* Fix install:all script

* Add release workflow

* Populate CHANGELOG.md

* Update create-release-pr.yml

* trigger pipeline

* Prepare release v0.0.1-review (#3)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v123-test (#5)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v1.2.3-test2 (#7)

Co-authored-by: GitHub Actions <noreply@github.com>

* Update create-release-pr.yml

debug

* Update create-release-pr.yml

debug

* debug

* Prepare release v1.2.3-test4 (#11)

Co-authored-by: GitHub Actions <noreply@github.com>

* diff

* Debug v1.2.3-test6 (#13)

Co-authored-by: GitHub Actions <noreply@github.com>

* Debug v1.2.3-test7 (#15)

Co-authored-by: GitHub Actions <noreply@github.com>

* Fix npm i

* Debug v1.2.3-test8 (#17)

Co-authored-by: GitHub Actions <noreply@github.com>

* call pipeline from release

* fix permissions

* remove auto pipeline

* fix changelog

* more permissions

* Debug v1.2.3-test14

---------

Co-authored-by: Clemens <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>
Co-authored-by: Lukas Hagen <43916057+Greenscreen23@users.noreply.github.com>
Co-authored-by: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com>
Co-authored-by: benn02 <82985280+benn02@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <noreply@github.com>
Nils1729 added a commit to Nils1729/digital-fuesim-manv that referenced this pull request Feb 23, 2023
* Improve validation (hpi-sam#125)

* Improve validation by introducing multiple new validation decorators

* `IsIdMap` for types of the form `{ readonly [key: UUID]: T }`. This transforms the object, so using instance objects (instead of plain objects) will no longer be supported.

* `IsLiteralUnion` for literal unions of types `number | string | symbol` (e.g. `participant | trainer`). Uses `isIn` internally.

* `IsReachableTransferPoints` for `ReachableTransferPoints` used in `TransferPoint`. Very specific but necessary due to the unique structure of this type.

* `IsUUIDSet` for `UUIDSet`

* `IsValue` for *simple* values that are required for a property. For example, when a `type` property has to have the value `'partial'`, one can use `@IsValue('partial')` for this. Allowed are the types `bigint | boolean | number | string | symbol | null | undefined`. The reason is that this validator also uses `isIn` internally, which in turn uses `===` which might produce incorrect results for `object` values.

* All validators are required to be applied to correctly types properties by the use of `GenericPropertyDecorator`. Using e.g. `@IsLiteralUnion({ partial: true, complete: true })` on a property typed `string` raises a TypeScript error.

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Feature/state benchmark (hpi-sam#581)

* Move state migrations to shared
* Add benchmark package
* Update readmes
* Make problem with duplicated RestoreError more obvious

* Feature/improve eslint rules (hpi-sam#591)

* Disallow imports from "*/dist/*"
* Improve smaller eslint rules
* Update documentation

* Update packages to mitigate GHSA-9c47-m6qq-7p4h (hpi-sam#592)

* Update dependencies (hpi-sam#595)

* Update dependencies

* typescript@4.9 (satisfies-operator and watch-performance-improvements)
* angular@15.1
* Else only patch and minor version bumps
* Fix version of @types/node in benchmark and frontend (18 -> 16)

* Run prettier

* Add simulated regions that can be placed on the map (hpi-sam#601)

* Add simulated regions that can be placed on the map

* Fix naming

* Add migration

* Fix linter error

* Move simulated region to separate heading in trainer map editor

* Turn isInSimulatedRegion into a stub method

* Refactor ol-map-manager to reuse some features from viewport in simulatedRegion

* Ignore vs code config files (hpi-sam#606)

* Rename VS Code configs to `.example`

* Add new "Start all but database" task

* Explain changes in readme

* Refactor viewport-modify to resize-rectangle-interaction (hpi-sam#604)

* Instead of using some parts of the `Modify` interaction (side-effect in the style function) a new custom Interaction has been created.
* Previously, one could switch between resizing and translating a viewport via pressing `Shift`. Instead, now one ***resizes*** if one drags an edge of the viewport (+ a bit around it), and ***translates*** if one drags any other part. This should enable touch users to resize viewports
* The code should now be more readable and extendable
* The unnecessary `viewportTranslateInteraction` has been removed
* `feature.dispose()` now gets called when it gets deleted - this could have been a memory leak?

* Add link to main branch in readme (hpi-sam#611)

* Close popups with esc (hpi-sam#610)

* Add keydown handler to close popups on escape

* Ensure input is saved even after less than 600ms

* Cast event inline

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Add new image for big material and material (hpi-sam#544)

* Add new image for big material and material

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix CVE-2022-25901 (hpi-sam#618)

* Feature/597 regions can contain personnel and patients (hpi-sam#607)

* Add MetaPosition type

* Add MetaPosition to Vehicle

* Add MetaPosition ro Personnel

* Add MetaPosition to Material

* Add MetaPosition to Patient

* Add Classes for different Position Types

* Use create when applicable and fix in MetaPosition

* Add migration for addition of MetaPosition

* refactor literals to start with lowercase

* Change nested if else to else if

* Make metaPosition not optional

* Fix failing Tests

* Update shared/src/models/material.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/personnel.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/utils/calculate-treatments.spec.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Prettier Errors

* Change Validation to Allow

* Put personnel and material in vehicle on creation

* Update shared/src/store/action-reducers/transfer.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Pipeline dependencies

* Update shared/src/state-migrations/16-add-meta-position.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix linter Error

* Add validators to MetaPositions

* Remove unused imports

* Fix Validators

* Add/Fix Action Migrations

* Add Exports to Index.ts

* Update shared/src/store/action-reducers/utils/spatial-elements.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Lint

Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Initialize the optimisticUpdateHandler only after the store has the exercise (hpi-sam#622)

* Fixes "Features disappear from the map in imported exercises" hpi-sam#621
* Can be observed when two actions are simultaneously optimistically proposed, and the client didn't receive any other action from the server before

* Patients are automatically triaged without any personnel on the map (hpi-sam#624)

* Fix incorrect import of isEmpty

This caused "Patients are automatically triaged without any personnel on the map" hpi-sam#623

* Disallow isEmpty imports from class-validator via eslint

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH) (hpi-sam#619)

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH)

* Fix linter

* Mention JUH in Readme

* Scale down the malteser logo and add the new 22/23 project team to the landing page

* Add our year to the landing page

* Feature/603 use opaque fill style for simulated regions (hpi-sam#608)

* Refactor viewports and simulated regions to be polygons instead of lines

* Add opaque fill to simulated regions

* Fix linter

* WIP

* Refactor Coordinates and Points to Compositions

* Update readme accordingly

* Change default type of SubstituteCoordinateForPoint to never as it should never happen

* Fix typo

* Increase alpha value to 80%

* Fix bug where features did not sync their movement to other clients

* Fix linter

* Refactor lambda function to geometry helpers and refactor ElementFeature
ElementFeature (which had to extend Feature<FeatureType>) has been replaced by Feature<FeatureType>
because according to ol docs there are no classes extending Feature

* Remove ElementManager.recreateFeature()

* Refactor lambdas to function in Geometry Helper subclasses

* Rename getNextPosition to interpolateCoordinates

* Refactor polygon geometry helper names in map lambda function

* Remove comment and type cast

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Change functions to arrow functions in Geometry Helpers to preserve `this` (hpi-sam#629)

* Add type property to elements in the state (hpi-sam#616)

* WIP

* Pick specific selectors from TypeSelectorMap

* Fix linter

* Remove type property from feature

* Fix bug after merge

* Rename selector map to plural map and add validation

* Simplify featureKeys

* Fix tests by adding type property to demo objects

* WIP: Add migration

* Update shared/src/utils/type-state-selector-map.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Rename file to reflect variable name change

* Replace type literals by element property

* Run prettier

* Finish migration

* Fix migration to set correct type on EocLogEntry

* Make imports consistent

* Reuse literal union from transfer in exercise

* Fix linter

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Remove unsupportedChangeProperties (hpi-sam#630)

* Fix the Bug (hpi-sam#635)

* Remove generic type LineString | Point in favor of the default Geometry (hpi-sam#634)

* Remove generic type LineString | Point in favor of the default Geometry

* Fix linter

* Refactoring/612 refactor position (hpi-sam#625)

* Add MetaPosition Helpers

* Remove position property

* Fix Lint

* Unify access onto metaPosition

* Fix Frontend

* Remove Position Class

* Remove Position from Tests

* Rename MetaPosition to Position

* Add Migration (not for Add vehicle Action)

* complete the renaming

* Fix Tests

* Remove Transfer Property

* Add Migration for Add Vehicle Action

* Fix Small Bug

* Use type properties instead of passed strings

* Add comments

* Fix Test

* Fix Test

* Fix Transfer Overview

* Refactor Helper Methods to avoid duplicate Code

* Change Names of Helper Functions

* Added Comments to unused vars

* Fix GHSA-rc47-6667-2j5j (hpi-sam#645)

* Allow elements to be added to simulated regions (hpi-sam#626)

* Allow elements to be added to simulated regions

* Adapt Add to Simulated Region Action to type tags

* Make linter happy

* Use new position and bugfixes

* Use proper function to create position

* Refactor Start Point Literals (hpi-sam#642)

* Refactor Start Point Literals

* Add Migration

* Enable Migration

* Implement Feedback

* Remove not needed types

* Add footer and about pages (hpi-sam#643)

* Add basic footer and empty about pages

* Refactor structure of about pages

* Add footer to 404 page

* Add links from footer to exercise page

* Run prettier

* Display version number

* Explain overwriting the pages in Docker deployment

* Do not lint HTML files for about pages

* Refactor template component

* Rename title property since it's an html attribute

* Make content observable

* Rename template component

Avoids confusion with angular concepts

* Remove accidentally committed imprint dummy file

* Remove commented-out footer from exercise page

* Make Map movable on Drag with Pop Up (hpi-sam#649)

* Make Map movable on Drag with Pop Up

* Update pipeline actions to node 16 (hpi-sam#627)

* Update pipeline actions to node 16

The old actions were based on Node 12, which has reached EOL.
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

* Test previous version of cypress action again

* Try cypress action v3

* Do not use cached cypress

* Try a Cypress Config without actually calling Cypress

* Try some more stuff...

* Add Cypress as DevDependency to root

* Re-enable default cypress tests

* Remove version tag from cypress cache

The tag was there for debugging purposes only

* Invoke cypress in frontend subfolder

* Try working-directory for cypress

* Try --prefix for start

* Retry --prefix before 'run'

* Restore 5a9692d

* Update package-lock.json

---------

Co-authored-by: ClFeSc <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>

* Change mail address to feedback mailing list (hpi-sam#659)

* Adapt treatment system to account for simulated regions (hpi-sam#658)

* Adapt treatment system to account for simulated regions

The treatment system no longer asserts that patients can only be treated
on the map.

* Please linter

* Enable patient ticking in simulated regions

* Fix extent calculation of viewports and simulated regions (hpi-sam#663)

* Include simulated regions when fitting to view

Also fixing a bug with negative extents

* Fix viewport restriction with negative extent

* Rename fit view method

* Rename function at all occurrences

* Fix isInViewport for negative extents

* Satisfy linter

* Avoid duplication in type definitions

* Refactoring/609 refactor functionality from olmapmanager to featuremanagers (hpi-sam#662)

* WIP

* Move Layer Creation to Feature Managers

* Move Registration into Feature managers

* Complete Merge

* Move Interactions to Interaction Manager

* Move Popup Handling to Popup Manager

* Move Satellite Layer to Satellite Layer manager

* Minor Cleanup

* Move files

* Move Files

* More Cleanup

* More Cleanup

* Fix a bug in participant mode

* Clean up Map Interactions manager

* Clean up Satellite Layer Manager

* Fix Lint

* Implement Feedback

* Implement Feedback and change Parameter Order in onFeatureDropped

* Implement Feedback and change Parameter Order in onFeatureDropped

---------

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Adjust nginx configuration for about pages (hpi-sam#657)

* Adjust nginx configuration for about pages

* Redirect invalid requests for a uniform 404 page

* Add link to landing page on about pages

* Improve error pages in nginx setup

The error pages do not rely on a non-existing URL any longer

---------

Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>

* Set up simulation framework (hpi-sam#664)

* Create draft for simulation data types

* WIP: Simulate unloading of vehicles

* WIP add debug helpers and make simulation work

* WIP add typings and lint

* Validate events

* Fix never parameter in activity and behavior functions

* Validate activities and behaviors

* Introduce pseudo randomness for deterministic uuids

* Add migrations for simulation

* Rename SimulationActivity.terminate to onTerminate

* Remove simulatedRegionId from VehicleArrivedEvent

* Slight improvement to debugging buttons

* Fix typo

* Validate state in AddBehaviorAction

* Incorporate suggestions from review

* Fix randomness

* Add generic DelayEventActivity

* Fix DelayEventActivity

* Please linter

* Remove debug UI

* Dragging onto the Map now triggers Drop Events (hpi-sam#671)

* Dragging onto the Map now triggers Drop Events

* Add our names to the readme (hpi-sam#672)

* Use @noble/hashes instead of hash.js (hpi-sam#674)

* Use @noble/hashes instead of hash.js

* Fix install:all script

* Add release workflow

* Populate CHANGELOG.md

* Update create-release-pr.yml

* trigger pipeline

* Prepare release v0.0.1-review (#3)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v123-test (#5)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v1.2.3-test2 (#7)

Co-authored-by: GitHub Actions <noreply@github.com>

* Update create-release-pr.yml

debug

* Update create-release-pr.yml

debug

* debug

* Prepare release v1.2.3-test4 (#11)

Co-authored-by: GitHub Actions <noreply@github.com>

* diff

* Debug v1.2.3-test6 (#13)

Co-authored-by: GitHub Actions <noreply@github.com>

* Debug v1.2.3-test7 (#15)

Co-authored-by: GitHub Actions <noreply@github.com>

* Fix npm i

* Debug v1.2.3-test8 (#17)

Co-authored-by: GitHub Actions <noreply@github.com>

* call pipeline from release

* fix permissions

* remove auto pipeline

* fix changelog

* more permissions

* Update pr creation steps

* add checkout

* maybe fix pr comment

* Debug v1.2.3-test17

---------

Co-authored-by: Clemens <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>
Co-authored-by: Lukas Hagen <43916057+Greenscreen23@users.noreply.github.com>
Co-authored-by: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com>
Co-authored-by: benn02 <82985280+benn02@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <noreply@github.com>
Nils1729 added a commit to Nils1729/digital-fuesim-manv that referenced this pull request Feb 23, 2023
* Improve validation (hpi-sam#125)

* Improve validation by introducing multiple new validation decorators

* `IsIdMap` for types of the form `{ readonly [key: UUID]: T }`. This transforms the object, so using instance objects (instead of plain objects) will no longer be supported.

* `IsLiteralUnion` for literal unions of types `number | string | symbol` (e.g. `participant | trainer`). Uses `isIn` internally.

* `IsReachableTransferPoints` for `ReachableTransferPoints` used in `TransferPoint`. Very specific but necessary due to the unique structure of this type.

* `IsUUIDSet` for `UUIDSet`

* `IsValue` for *simple* values that are required for a property. For example, when a `type` property has to have the value `'partial'`, one can use `@IsValue('partial')` for this. Allowed are the types `bigint | boolean | number | string | symbol | null | undefined`. The reason is that this validator also uses `isIn` internally, which in turn uses `===` which might produce incorrect results for `object` values.

* All validators are required to be applied to correctly types properties by the use of `GenericPropertyDecorator`. Using e.g. `@IsLiteralUnion({ partial: true, complete: true })` on a property typed `string` raises a TypeScript error.

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Feature/state benchmark (hpi-sam#581)

* Move state migrations to shared
* Add benchmark package
* Update readmes
* Make problem with duplicated RestoreError more obvious

* Feature/improve eslint rules (hpi-sam#591)

* Disallow imports from "*/dist/*"
* Improve smaller eslint rules
* Update documentation

* Update packages to mitigate GHSA-9c47-m6qq-7p4h (hpi-sam#592)

* Update dependencies (hpi-sam#595)

* Update dependencies

* typescript@4.9 (satisfies-operator and watch-performance-improvements)
* angular@15.1
* Else only patch and minor version bumps
* Fix version of @types/node in benchmark and frontend (18 -> 16)

* Run prettier

* Add simulated regions that can be placed on the map (hpi-sam#601)

* Add simulated regions that can be placed on the map

* Fix naming

* Add migration

* Fix linter error

* Move simulated region to separate heading in trainer map editor

* Turn isInSimulatedRegion into a stub method

* Refactor ol-map-manager to reuse some features from viewport in simulatedRegion

* Ignore vs code config files (hpi-sam#606)

* Rename VS Code configs to `.example`

* Add new "Start all but database" task

* Explain changes in readme

* Refactor viewport-modify to resize-rectangle-interaction (hpi-sam#604)

* Instead of using some parts of the `Modify` interaction (side-effect in the style function) a new custom Interaction has been created.
* Previously, one could switch between resizing and translating a viewport via pressing `Shift`. Instead, now one ***resizes*** if one drags an edge of the viewport (+ a bit around it), and ***translates*** if one drags any other part. This should enable touch users to resize viewports
* The code should now be more readable and extendable
* The unnecessary `viewportTranslateInteraction` has been removed
* `feature.dispose()` now gets called when it gets deleted - this could have been a memory leak?

* Add link to main branch in readme (hpi-sam#611)

* Close popups with esc (hpi-sam#610)

* Add keydown handler to close popups on escape

* Ensure input is saved even after less than 600ms

* Cast event inline

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Add new image for big material and material (hpi-sam#544)

* Add new image for big material and material

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix CVE-2022-25901 (hpi-sam#618)

* Feature/597 regions can contain personnel and patients (hpi-sam#607)

* Add MetaPosition type

* Add MetaPosition to Vehicle

* Add MetaPosition ro Personnel

* Add MetaPosition to Material

* Add MetaPosition to Patient

* Add Classes for different Position Types

* Use create when applicable and fix in MetaPosition

* Add migration for addition of MetaPosition

* refactor literals to start with lowercase

* Change nested if else to else if

* Make metaPosition not optional

* Fix failing Tests

* Update shared/src/models/material.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/personnel.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/utils/calculate-treatments.spec.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Prettier Errors

* Change Validation to Allow

* Put personnel and material in vehicle on creation

* Update shared/src/store/action-reducers/transfer.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Pipeline dependencies

* Update shared/src/state-migrations/16-add-meta-position.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix linter Error

* Add validators to MetaPositions

* Remove unused imports

* Fix Validators

* Add/Fix Action Migrations

* Add Exports to Index.ts

* Update shared/src/store/action-reducers/utils/spatial-elements.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Lint

Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Initialize the optimisticUpdateHandler only after the store has the exercise (hpi-sam#622)

* Fixes "Features disappear from the map in imported exercises" hpi-sam#621
* Can be observed when two actions are simultaneously optimistically proposed, and the client didn't receive any other action from the server before

* Patients are automatically triaged without any personnel on the map (hpi-sam#624)

* Fix incorrect import of isEmpty

This caused "Patients are automatically triaged without any personnel on the map" hpi-sam#623

* Disallow isEmpty imports from class-validator via eslint

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH) (hpi-sam#619)

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH)

* Fix linter

* Mention JUH in Readme

* Scale down the malteser logo and add the new 22/23 project team to the landing page

* Add our year to the landing page

* Feature/603 use opaque fill style for simulated regions (hpi-sam#608)

* Refactor viewports and simulated regions to be polygons instead of lines

* Add opaque fill to simulated regions

* Fix linter

* WIP

* Refactor Coordinates and Points to Compositions

* Update readme accordingly

* Change default type of SubstituteCoordinateForPoint to never as it should never happen

* Fix typo

* Increase alpha value to 80%

* Fix bug where features did not sync their movement to other clients

* Fix linter

* Refactor lambda function to geometry helpers and refactor ElementFeature
ElementFeature (which had to extend Feature<FeatureType>) has been replaced by Feature<FeatureType>
because according to ol docs there are no classes extending Feature

* Remove ElementManager.recreateFeature()

* Refactor lambdas to function in Geometry Helper subclasses

* Rename getNextPosition to interpolateCoordinates

* Refactor polygon geometry helper names in map lambda function

* Remove comment and type cast

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Change functions to arrow functions in Geometry Helpers to preserve `this` (hpi-sam#629)

* Add type property to elements in the state (hpi-sam#616)

* WIP

* Pick specific selectors from TypeSelectorMap

* Fix linter

* Remove type property from feature

* Fix bug after merge

* Rename selector map to plural map and add validation

* Simplify featureKeys

* Fix tests by adding type property to demo objects

* WIP: Add migration

* Update shared/src/utils/type-state-selector-map.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Rename file to reflect variable name change

* Replace type literals by element property

* Run prettier

* Finish migration

* Fix migration to set correct type on EocLogEntry

* Make imports consistent

* Reuse literal union from transfer in exercise

* Fix linter

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Remove unsupportedChangeProperties (hpi-sam#630)

* Fix the Bug (hpi-sam#635)

* Remove generic type LineString | Point in favor of the default Geometry (hpi-sam#634)

* Remove generic type LineString | Point in favor of the default Geometry

* Fix linter

* Refactoring/612 refactor position (hpi-sam#625)

* Add MetaPosition Helpers

* Remove position property

* Fix Lint

* Unify access onto metaPosition

* Fix Frontend

* Remove Position Class

* Remove Position from Tests

* Rename MetaPosition to Position

* Add Migration (not for Add vehicle Action)

* complete the renaming

* Fix Tests

* Remove Transfer Property

* Add Migration for Add Vehicle Action

* Fix Small Bug

* Use type properties instead of passed strings

* Add comments

* Fix Test

* Fix Test

* Fix Transfer Overview

* Refactor Helper Methods to avoid duplicate Code

* Change Names of Helper Functions

* Added Comments to unused vars

* Fix GHSA-rc47-6667-2j5j (hpi-sam#645)

* Allow elements to be added to simulated regions (hpi-sam#626)

* Allow elements to be added to simulated regions

* Adapt Add to Simulated Region Action to type tags

* Make linter happy

* Use new position and bugfixes

* Use proper function to create position

* Refactor Start Point Literals (hpi-sam#642)

* Refactor Start Point Literals

* Add Migration

* Enable Migration

* Implement Feedback

* Remove not needed types

* Add footer and about pages (hpi-sam#643)

* Add basic footer and empty about pages

* Refactor structure of about pages

* Add footer to 404 page

* Add links from footer to exercise page

* Run prettier

* Display version number

* Explain overwriting the pages in Docker deployment

* Do not lint HTML files for about pages

* Refactor template component

* Rename title property since it's an html attribute

* Make content observable

* Rename template component

Avoids confusion with angular concepts

* Remove accidentally committed imprint dummy file

* Remove commented-out footer from exercise page

* Make Map movable on Drag with Pop Up (hpi-sam#649)

* Make Map movable on Drag with Pop Up

* Update pipeline actions to node 16 (hpi-sam#627)

* Update pipeline actions to node 16

The old actions were based on Node 12, which has reached EOL.
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

* Test previous version of cypress action again

* Try cypress action v3

* Do not use cached cypress

* Try a Cypress Config without actually calling Cypress

* Try some more stuff...

* Add Cypress as DevDependency to root

* Re-enable default cypress tests

* Remove version tag from cypress cache

The tag was there for debugging purposes only

* Invoke cypress in frontend subfolder

* Try working-directory for cypress

* Try --prefix for start

* Retry --prefix before 'run'

* Restore 5a9692d

* Update package-lock.json

---------

Co-authored-by: ClFeSc <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>

* Change mail address to feedback mailing list (hpi-sam#659)

* Adapt treatment system to account for simulated regions (hpi-sam#658)

* Adapt treatment system to account for simulated regions

The treatment system no longer asserts that patients can only be treated
on the map.

* Please linter

* Enable patient ticking in simulated regions

* Fix extent calculation of viewports and simulated regions (hpi-sam#663)

* Include simulated regions when fitting to view

Also fixing a bug with negative extents

* Fix viewport restriction with negative extent

* Rename fit view method

* Rename function at all occurrences

* Fix isInViewport for negative extents

* Satisfy linter

* Avoid duplication in type definitions

* Refactoring/609 refactor functionality from olmapmanager to featuremanagers (hpi-sam#662)

* WIP

* Move Layer Creation to Feature Managers

* Move Registration into Feature managers

* Complete Merge

* Move Interactions to Interaction Manager

* Move Popup Handling to Popup Manager

* Move Satellite Layer to Satellite Layer manager

* Minor Cleanup

* Move files

* Move Files

* More Cleanup

* More Cleanup

* Fix a bug in participant mode

* Clean up Map Interactions manager

* Clean up Satellite Layer Manager

* Fix Lint

* Implement Feedback

* Implement Feedback and change Parameter Order in onFeatureDropped

* Implement Feedback and change Parameter Order in onFeatureDropped

---------

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Adjust nginx configuration for about pages (hpi-sam#657)

* Adjust nginx configuration for about pages

* Redirect invalid requests for a uniform 404 page

* Add link to landing page on about pages

* Improve error pages in nginx setup

The error pages do not rely on a non-existing URL any longer

---------

Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>

* Set up simulation framework (hpi-sam#664)

* Create draft for simulation data types

* WIP: Simulate unloading of vehicles

* WIP add debug helpers and make simulation work

* WIP add typings and lint

* Validate events

* Fix never parameter in activity and behavior functions

* Validate activities and behaviors

* Introduce pseudo randomness for deterministic uuids

* Add migrations for simulation

* Rename SimulationActivity.terminate to onTerminate

* Remove simulatedRegionId from VehicleArrivedEvent

* Slight improvement to debugging buttons

* Fix typo

* Validate state in AddBehaviorAction

* Incorporate suggestions from review

* Fix randomness

* Add generic DelayEventActivity

* Fix DelayEventActivity

* Please linter

* Remove debug UI

* Dragging onto the Map now triggers Drop Events (hpi-sam#671)

* Dragging onto the Map now triggers Drop Events

* Add our names to the readme (hpi-sam#672)

* Use @noble/hashes instead of hash.js (hpi-sam#674)

* Use @noble/hashes instead of hash.js

* Fix install:all script

* Add release workflow

* Populate CHANGELOG.md

* Update create-release-pr.yml

* trigger pipeline

* Prepare release v0.0.1-review (#3)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v123-test (#5)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v1.2.3-test2 (#7)

Co-authored-by: GitHub Actions <noreply@github.com>

* Update create-release-pr.yml

debug

* Update create-release-pr.yml

debug

* debug

* Prepare release v1.2.3-test4 (#11)

Co-authored-by: GitHub Actions <noreply@github.com>

* diff

* Debug v1.2.3-test6 (#13)

Co-authored-by: GitHub Actions <noreply@github.com>

* Debug v1.2.3-test7 (#15)

Co-authored-by: GitHub Actions <noreply@github.com>

* Fix npm i

* Debug v1.2.3-test8 (#17)

Co-authored-by: GitHub Actions <noreply@github.com>

* call pipeline from release

* fix permissions

* remove auto pipeline

* fix changelog

* more permissions

* Update pr creation steps

* add checkout

* maybe fix pr comment

* Use other release action

* Use other name for dev PR

* Debug v1.2.3-test18

---------

Co-authored-by: Clemens <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>
Co-authored-by: Lukas Hagen <43916057+Greenscreen23@users.noreply.github.com>
Co-authored-by: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com>
Co-authored-by: benn02 <82985280+benn02@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <noreply@github.com>
Nils1729 added a commit to Nils1729/digital-fuesim-manv that referenced this pull request Feb 23, 2023
* Improve validation (hpi-sam#125)

* Improve validation by introducing multiple new validation decorators

* `IsIdMap` for types of the form `{ readonly [key: UUID]: T }`. This transforms the object, so using instance objects (instead of plain objects) will no longer be supported.

* `IsLiteralUnion` for literal unions of types `number | string | symbol` (e.g. `participant | trainer`). Uses `isIn` internally.

* `IsReachableTransferPoints` for `ReachableTransferPoints` used in `TransferPoint`. Very specific but necessary due to the unique structure of this type.

* `IsUUIDSet` for `UUIDSet`

* `IsValue` for *simple* values that are required for a property. For example, when a `type` property has to have the value `'partial'`, one can use `@IsValue('partial')` for this. Allowed are the types `bigint | boolean | number | string | symbol | null | undefined`. The reason is that this validator also uses `isIn` internally, which in turn uses `===` which might produce incorrect results for `object` values.

* All validators are required to be applied to correctly types properties by the use of `GenericPropertyDecorator`. Using e.g. `@IsLiteralUnion({ partial: true, complete: true })` on a property typed `string` raises a TypeScript error.

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Feature/state benchmark (hpi-sam#581)

* Move state migrations to shared
* Add benchmark package
* Update readmes
* Make problem with duplicated RestoreError more obvious

* Feature/improve eslint rules (hpi-sam#591)

* Disallow imports from "*/dist/*"
* Improve smaller eslint rules
* Update documentation

* Update packages to mitigate GHSA-9c47-m6qq-7p4h (hpi-sam#592)

* Update dependencies (hpi-sam#595)

* Update dependencies

* typescript@4.9 (satisfies-operator and watch-performance-improvements)
* angular@15.1
* Else only patch and minor version bumps
* Fix version of @types/node in benchmark and frontend (18 -> 16)

* Run prettier

* Add simulated regions that can be placed on the map (hpi-sam#601)

* Add simulated regions that can be placed on the map

* Fix naming

* Add migration

* Fix linter error

* Move simulated region to separate heading in trainer map editor

* Turn isInSimulatedRegion into a stub method

* Refactor ol-map-manager to reuse some features from viewport in simulatedRegion

* Ignore vs code config files (hpi-sam#606)

* Rename VS Code configs to `.example`

* Add new "Start all but database" task

* Explain changes in readme

* Refactor viewport-modify to resize-rectangle-interaction (hpi-sam#604)

* Instead of using some parts of the `Modify` interaction (side-effect in the style function) a new custom Interaction has been created.
* Previously, one could switch between resizing and translating a viewport via pressing `Shift`. Instead, now one ***resizes*** if one drags an edge of the viewport (+ a bit around it), and ***translates*** if one drags any other part. This should enable touch users to resize viewports
* The code should now be more readable and extendable
* The unnecessary `viewportTranslateInteraction` has been removed
* `feature.dispose()` now gets called when it gets deleted - this could have been a memory leak?

* Add link to main branch in readme (hpi-sam#611)

* Close popups with esc (hpi-sam#610)

* Add keydown handler to close popups on escape

* Ensure input is saved even after less than 600ms

* Cast event inline

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Add new image for big material and material (hpi-sam#544)

* Add new image for big material and material

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix CVE-2022-25901 (hpi-sam#618)

* Feature/597 regions can contain personnel and patients (hpi-sam#607)

* Add MetaPosition type

* Add MetaPosition to Vehicle

* Add MetaPosition ro Personnel

* Add MetaPosition to Material

* Add MetaPosition to Patient

* Add Classes for different Position Types

* Use create when applicable and fix in MetaPosition

* Add migration for addition of MetaPosition

* refactor literals to start with lowercase

* Change nested if else to else if

* Make metaPosition not optional

* Fix failing Tests

* Update shared/src/models/material.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/personnel.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/utils/calculate-treatments.spec.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Prettier Errors

* Change Validation to Allow

* Put personnel and material in vehicle on creation

* Update shared/src/store/action-reducers/transfer.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Pipeline dependencies

* Update shared/src/state-migrations/16-add-meta-position.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix linter Error

* Add validators to MetaPositions

* Remove unused imports

* Fix Validators

* Add/Fix Action Migrations

* Add Exports to Index.ts

* Update shared/src/store/action-reducers/utils/spatial-elements.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Lint

Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Initialize the optimisticUpdateHandler only after the store has the exercise (hpi-sam#622)

* Fixes "Features disappear from the map in imported exercises" hpi-sam#621
* Can be observed when two actions are simultaneously optimistically proposed, and the client didn't receive any other action from the server before

* Patients are automatically triaged without any personnel on the map (hpi-sam#624)

* Fix incorrect import of isEmpty

This caused "Patients are automatically triaged without any personnel on the map" hpi-sam#623

* Disallow isEmpty imports from class-validator via eslint

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH) (hpi-sam#619)

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH)

* Fix linter

* Mention JUH in Readme

* Scale down the malteser logo and add the new 22/23 project team to the landing page

* Add our year to the landing page

* Feature/603 use opaque fill style for simulated regions (hpi-sam#608)

* Refactor viewports and simulated regions to be polygons instead of lines

* Add opaque fill to simulated regions

* Fix linter

* WIP

* Refactor Coordinates and Points to Compositions

* Update readme accordingly

* Change default type of SubstituteCoordinateForPoint to never as it should never happen

* Fix typo

* Increase alpha value to 80%

* Fix bug where features did not sync their movement to other clients

* Fix linter

* Refactor lambda function to geometry helpers and refactor ElementFeature
ElementFeature (which had to extend Feature<FeatureType>) has been replaced by Feature<FeatureType>
because according to ol docs there are no classes extending Feature

* Remove ElementManager.recreateFeature()

* Refactor lambdas to function in Geometry Helper subclasses

* Rename getNextPosition to interpolateCoordinates

* Refactor polygon geometry helper names in map lambda function

* Remove comment and type cast

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Change functions to arrow functions in Geometry Helpers to preserve `this` (hpi-sam#629)

* Add type property to elements in the state (hpi-sam#616)

* WIP

* Pick specific selectors from TypeSelectorMap

* Fix linter

* Remove type property from feature

* Fix bug after merge

* Rename selector map to plural map and add validation

* Simplify featureKeys

* Fix tests by adding type property to demo objects

* WIP: Add migration

* Update shared/src/utils/type-state-selector-map.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Rename file to reflect variable name change

* Replace type literals by element property

* Run prettier

* Finish migration

* Fix migration to set correct type on EocLogEntry

* Make imports consistent

* Reuse literal union from transfer in exercise

* Fix linter

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Remove unsupportedChangeProperties (hpi-sam#630)

* Fix the Bug (hpi-sam#635)

* Remove generic type LineString | Point in favor of the default Geometry (hpi-sam#634)

* Remove generic type LineString | Point in favor of the default Geometry

* Fix linter

* Refactoring/612 refactor position (hpi-sam#625)

* Add MetaPosition Helpers

* Remove position property

* Fix Lint

* Unify access onto metaPosition

* Fix Frontend

* Remove Position Class

* Remove Position from Tests

* Rename MetaPosition to Position

* Add Migration (not for Add vehicle Action)

* complete the renaming

* Fix Tests

* Remove Transfer Property

* Add Migration for Add Vehicle Action

* Fix Small Bug

* Use type properties instead of passed strings

* Add comments

* Fix Test

* Fix Test

* Fix Transfer Overview

* Refactor Helper Methods to avoid duplicate Code

* Change Names of Helper Functions

* Added Comments to unused vars

* Fix GHSA-rc47-6667-2j5j (hpi-sam#645)

* Allow elements to be added to simulated regions (hpi-sam#626)

* Allow elements to be added to simulated regions

* Adapt Add to Simulated Region Action to type tags

* Make linter happy

* Use new position and bugfixes

* Use proper function to create position

* Refactor Start Point Literals (hpi-sam#642)

* Refactor Start Point Literals

* Add Migration

* Enable Migration

* Implement Feedback

* Remove not needed types

* Add footer and about pages (hpi-sam#643)

* Add basic footer and empty about pages

* Refactor structure of about pages

* Add footer to 404 page

* Add links from footer to exercise page

* Run prettier

* Display version number

* Explain overwriting the pages in Docker deployment

* Do not lint HTML files for about pages

* Refactor template component

* Rename title property since it's an html attribute

* Make content observable

* Rename template component

Avoids confusion with angular concepts

* Remove accidentally committed imprint dummy file

* Remove commented-out footer from exercise page

* Make Map movable on Drag with Pop Up (hpi-sam#649)

* Make Map movable on Drag with Pop Up

* Update pipeline actions to node 16 (hpi-sam#627)

* Update pipeline actions to node 16

The old actions were based on Node 12, which has reached EOL.
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

* Test previous version of cypress action again

* Try cypress action v3

* Do not use cached cypress

* Try a Cypress Config without actually calling Cypress

* Try some more stuff...

* Add Cypress as DevDependency to root

* Re-enable default cypress tests

* Remove version tag from cypress cache

The tag was there for debugging purposes only

* Invoke cypress in frontend subfolder

* Try working-directory for cypress

* Try --prefix for start

* Retry --prefix before 'run'

* Restore 5a9692d

* Update package-lock.json

---------

Co-authored-by: ClFeSc <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>

* Change mail address to feedback mailing list (hpi-sam#659)

* Adapt treatment system to account for simulated regions (hpi-sam#658)

* Adapt treatment system to account for simulated regions

The treatment system no longer asserts that patients can only be treated
on the map.

* Please linter

* Enable patient ticking in simulated regions

* Fix extent calculation of viewports and simulated regions (hpi-sam#663)

* Include simulated regions when fitting to view

Also fixing a bug with negative extents

* Fix viewport restriction with negative extent

* Rename fit view method

* Rename function at all occurrences

* Fix isInViewport for negative extents

* Satisfy linter

* Avoid duplication in type definitions

* Refactoring/609 refactor functionality from olmapmanager to featuremanagers (hpi-sam#662)

* WIP

* Move Layer Creation to Feature Managers

* Move Registration into Feature managers

* Complete Merge

* Move Interactions to Interaction Manager

* Move Popup Handling to Popup Manager

* Move Satellite Layer to Satellite Layer manager

* Minor Cleanup

* Move files

* Move Files

* More Cleanup

* More Cleanup

* Fix a bug in participant mode

* Clean up Map Interactions manager

* Clean up Satellite Layer Manager

* Fix Lint

* Implement Feedback

* Implement Feedback and change Parameter Order in onFeatureDropped

* Implement Feedback and change Parameter Order in onFeatureDropped

---------

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Adjust nginx configuration for about pages (hpi-sam#657)

* Adjust nginx configuration for about pages

* Redirect invalid requests for a uniform 404 page

* Add link to landing page on about pages

* Improve error pages in nginx setup

The error pages do not rely on a non-existing URL any longer

---------

Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>

* Set up simulation framework (hpi-sam#664)

* Create draft for simulation data types

* WIP: Simulate unloading of vehicles

* WIP add debug helpers and make simulation work

* WIP add typings and lint

* Validate events

* Fix never parameter in activity and behavior functions

* Validate activities and behaviors

* Introduce pseudo randomness for deterministic uuids

* Add migrations for simulation

* Rename SimulationActivity.terminate to onTerminate

* Remove simulatedRegionId from VehicleArrivedEvent

* Slight improvement to debugging buttons

* Fix typo

* Validate state in AddBehaviorAction

* Incorporate suggestions from review

* Fix randomness

* Add generic DelayEventActivity

* Fix DelayEventActivity

* Please linter

* Remove debug UI

* Dragging onto the Map now triggers Drop Events (hpi-sam#671)

* Dragging onto the Map now triggers Drop Events

* Add our names to the readme (hpi-sam#672)

* Use @noble/hashes instead of hash.js (hpi-sam#674)

* Use @noble/hashes instead of hash.js

* Fix install:all script

* Add release workflow

* Populate CHANGELOG.md

* Update create-release-pr.yml

* trigger pipeline

* Prepare release v0.0.1-review (#3)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v123-test (#5)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v1.2.3-test2 (#7)

Co-authored-by: GitHub Actions <noreply@github.com>

* Update create-release-pr.yml

debug

* Update create-release-pr.yml

debug

* debug

* Prepare release v1.2.3-test4 (#11)

Co-authored-by: GitHub Actions <noreply@github.com>

* diff

* Debug v1.2.3-test6 (#13)

Co-authored-by: GitHub Actions <noreply@github.com>

* Debug v1.2.3-test7 (#15)

Co-authored-by: GitHub Actions <noreply@github.com>

* Fix npm i

* Debug v1.2.3-test8 (#17)

Co-authored-by: GitHub Actions <noreply@github.com>

* call pipeline from release

* fix permissions

* remove auto pipeline

* fix changelog

* more permissions

* Update pr creation steps

* add checkout

* maybe fix pr comment

* Use other release action

* Use other name for dev PR

* Use script instead of third party action

---------

Co-authored-by: Clemens <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>
Co-authored-by: Lukas Hagen <43916057+Greenscreen23@users.noreply.github.com>
Co-authored-by: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com>
Co-authored-by: benn02 <82985280+benn02@users.noreply.github.com>
Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <noreply@github.com>
Nils1729 added a commit to Nils1729/digital-fuesim-manv that referenced this pull request Feb 23, 2023
* Improve validation (hpi-sam#125)

* Improve validation by introducing multiple new validation decorators

* `IsIdMap` for types of the form `{ readonly [key: UUID]: T }`. This transforms the object, so using instance objects (instead of plain objects) will no longer be supported.

* `IsLiteralUnion` for literal unions of types `number | string | symbol` (e.g. `participant | trainer`). Uses `isIn` internally.

* `IsReachableTransferPoints` for `ReachableTransferPoints` used in `TransferPoint`. Very specific but necessary due to the unique structure of this type.

* `IsUUIDSet` for `UUIDSet`

* `IsValue` for *simple* values that are required for a property. For example, when a `type` property has to have the value `'partial'`, one can use `@IsValue('partial')` for this. Allowed are the types `bigint | boolean | number | string | symbol | null | undefined`. The reason is that this validator also uses `isIn` internally, which in turn uses `===` which might produce incorrect results for `object` values.

* All validators are required to be applied to correctly types properties by the use of `GenericPropertyDecorator`. Using e.g. `@IsLiteralUnion({ partial: true, complete: true })` on a property typed `string` raises a TypeScript error.

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Feature/state benchmark (hpi-sam#581)

* Move state migrations to shared
* Add benchmark package
* Update readmes
* Make problem with duplicated RestoreError more obvious

* Feature/improve eslint rules (hpi-sam#591)

* Disallow imports from "*/dist/*"
* Improve smaller eslint rules
* Update documentation

* Update packages to mitigate GHSA-9c47-m6qq-7p4h (hpi-sam#592)

* Update dependencies (hpi-sam#595)

* Update dependencies

* typescript@4.9 (satisfies-operator and watch-performance-improvements)
* angular@15.1
* Else only patch and minor version bumps
* Fix version of @types/node in benchmark and frontend (18 -> 16)

* Run prettier

* Add simulated regions that can be placed on the map (hpi-sam#601)

* Add simulated regions that can be placed on the map

* Fix naming

* Add migration

* Fix linter error

* Move simulated region to separate heading in trainer map editor

* Turn isInSimulatedRegion into a stub method

* Refactor ol-map-manager to reuse some features from viewport in simulatedRegion

* Ignore vs code config files (hpi-sam#606)

* Rename VS Code configs to `.example`

* Add new "Start all but database" task

* Explain changes in readme

* Refactor viewport-modify to resize-rectangle-interaction (hpi-sam#604)

* Instead of using some parts of the `Modify` interaction (side-effect in the style function) a new custom Interaction has been created.
* Previously, one could switch between resizing and translating a viewport via pressing `Shift`. Instead, now one ***resizes*** if one drags an edge of the viewport (+ a bit around it), and ***translates*** if one drags any other part. This should enable touch users to resize viewports
* The code should now be more readable and extendable
* The unnecessary `viewportTranslateInteraction` has been removed
* `feature.dispose()` now gets called when it gets deleted - this could have been a memory leak?

* Add link to main branch in readme (hpi-sam#611)

* Close popups with esc (hpi-sam#610)

* Add keydown handler to close popups on escape

* Ensure input is saved even after less than 600ms

* Cast event inline

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Add new image for big material and material (hpi-sam#544)

* Add new image for big material and material

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix CVE-2022-25901 (hpi-sam#618)

* Feature/597 regions can contain personnel and patients (hpi-sam#607)

* Add MetaPosition type

* Add MetaPosition to Vehicle

* Add MetaPosition ro Personnel

* Add MetaPosition to Material

* Add MetaPosition to Patient

* Add Classes for different Position Types

* Use create when applicable and fix in MetaPosition

* Add migration for addition of MetaPosition

* refactor literals to start with lowercase

* Change nested if else to else if

* Make metaPosition not optional

* Fix failing Tests

* Update shared/src/models/material.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/personnel.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/utils/calculate-treatments.spec.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Prettier Errors

* Change Validation to Allow

* Put personnel and material in vehicle on creation

* Update shared/src/store/action-reducers/transfer.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Pipeline dependencies

* Update shared/src/state-migrations/16-add-meta-position.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix linter Error

* Add validators to MetaPositions

* Remove unused imports

* Fix Validators

* Add/Fix Action Migrations

* Add Exports to Index.ts

* Update shared/src/store/action-reducers/utils/spatial-elements.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Lint

Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Initialize the optimisticUpdateHandler only after the store has the exercise (hpi-sam#622)

* Fixes "Features disappear from the map in imported exercises" hpi-sam#621
* Can be observed when two actions are simultaneously optimistically proposed, and the client didn't receive any other action from the server before

* Patients are automatically triaged without any personnel on the map (hpi-sam#624)

* Fix incorrect import of isEmpty

This caused "Patients are automatically triaged without any personnel on the map" hpi-sam#623

* Disallow isEmpty imports from class-validator via eslint

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH) (hpi-sam#619)

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH)

* Fix linter

* Mention JUH in Readme

* Scale down the malteser logo and add the new 22/23 project team to the landing page

* Add our year to the landing page

* Feature/603 use opaque fill style for simulated regions (hpi-sam#608)

* Refactor viewports and simulated regions to be polygons instead of lines

* Add opaque fill to simulated regions

* Fix linter

* WIP

* Refactor Coordinates and Points to Compositions

* Update readme accordingly

* Change default type of SubstituteCoordinateForPoint to never as it should never happen

* Fix typo

* Increase alpha value to 80%

* Fix bug where features did not sync their movement to other clients

* Fix linter

* Refactor lambda function to geometry helpers and refactor ElementFeature
ElementFeature (which had to extend Feature<FeatureType>) has been replaced by Feature<FeatureType>
because according to ol docs there are no classes extending Feature

* Remove ElementManager.recreateFeature()

* Refactor lambdas to function in Geometry Helper subclasses

* Rename getNextPosition to interpolateCoordinates

* Refactor polygon geometry helper names in map lambda function

* Remove comment and type cast

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Change functions to arrow functions in Geometry Helpers to preserve `this` (hpi-sam#629)

* Add type property to elements in the state (hpi-sam#616)

* WIP

* Pick specific selectors from TypeSelectorMap

* Fix linter

* Remove type property from feature

* Fix bug after merge

* Rename selector map to plural map and add validation

* Simplify featureKeys

* Fix tests by adding type property to demo objects

* WIP: Add migration

* Update shared/src/utils/type-state-selector-map.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Rename file to reflect variable name change

* Replace type literals by element property

* Run prettier

* Finish migration

* Fix migration to set correct type on EocLogEntry

* Make imports consistent

* Reuse literal union from transfer in exercise

* Fix linter

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Remove unsupportedChangeProperties (hpi-sam#630)

* Fix the Bug (hpi-sam#635)

* Remove generic type LineString | Point in favor of the default Geometry (hpi-sam#634)

* Remove generic type LineString | Point in favor of the default Geometry

* Fix linter

* Refactoring/612 refactor position (hpi-sam#625)

* Add MetaPosition Helpers

* Remove position property

* Fix Lint

* Unify access onto metaPosition

* Fix Frontend

* Remove Position Class

* Remove Position from Tests

* Rename MetaPosition to Position

* Add Migration (not for Add vehicle Action)

* complete the renaming

* Fix Tests

* Remove Transfer Property

* Add Migration for Add Vehicle Action

* Fix Small Bug

* Use type properties instead of passed strings

* Add comments

* Fix Test

* Fix Test

* Fix Transfer Overview

* Refactor Helper Methods to avoid duplicate Code

* Change Names of Helper Functions

* Added Comments to unused vars

* Fix GHSA-rc47-6667-2j5j (hpi-sam#645)

* Allow elements to be added to simulated regions (hpi-sam#626)

* Allow elements to be added to simulated regions

* Adapt Add to Simulated Region Action to type tags

* Make linter happy

* Use new position and bugfixes

* Use proper function to create position

* Refactor Start Point Literals (hpi-sam#642)

* Refactor Start Point Literals

* Add Migration

* Enable Migration

* Implement Feedback

* Remove not needed types

* Add footer and about pages (hpi-sam#643)

* Add basic footer and empty about pages

* Refactor structure of about pages

* Add footer to 404 page

* Add links from footer to exercise page

* Run prettier

* Display version number

* Explain overwriting the pages in Docker deployment

* Do not lint HTML files for about pages

* Refactor template component

* Rename title property since it's an html attribute

* Make content observable

* Rename template component

Avoids confusion with angular concepts

* Remove accidentally committed imprint dummy file

* Remove commented-out footer from exercise page

* Make Map movable on Drag with Pop Up (hpi-sam#649)

* Make Map movable on Drag with Pop Up

* Update pipeline actions to node 16 (hpi-sam#627)

* Update pipeline actions to node 16

The old actions were based on Node 12, which has reached EOL.
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

* Test previous version of cypress action again

* Try cypress action v3

* Do not use cached cypress

* Try a Cypress Config without actually calling Cypress

* Try some more stuff...

* Add Cypress as DevDependency to root

* Re-enable default cypress tests

* Remove version tag from cypress cache

The tag was there for debugging purposes only

* Invoke cypress in frontend subfolder

* Try working-directory for cypress

* Try --prefix for start

* Retry --prefix before 'run'

* Restore 5a9692d

* Update package-lock.json

---------

Co-authored-by: ClFeSc <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>

* Change mail address to feedback mailing list (hpi-sam#659)

* Adapt treatment system to account for simulated regions (hpi-sam#658)

* Adapt treatment system to account for simulated regions

The treatment system no longer asserts that patients can only be treated
on the map.

* Please linter

* Enable patient ticking in simulated regions

* Fix extent calculation of viewports and simulated regions (hpi-sam#663)

* Include simulated regions when fitting to view

Also fixing a bug with negative extents

* Fix viewport restriction with negative extent

* Rename fit view method

* Rename function at all occurrences

* Fix isInViewport for negative extents

* Satisfy linter

* Avoid duplication in type definitions

* Refactoring/609 refactor functionality from olmapmanager to featuremanagers (hpi-sam#662)

* WIP

* Move Layer Creation to Feature Managers

* Move Registration into Feature managers

* Complete Merge

* Move Interactions to Interaction Manager

* Move Popup Handling to Popup Manager

* Move Satellite Layer to Satellite Layer manager

* Minor Cleanup

* Move files

* Move Files

* More Cleanup

* More Cleanup

* Fix a bug in participant mode

* Clean up Map Interactions manager

* Clean up Satellite Layer Manager

* Fix Lint

* Implement Feedback

* Implement Feedback and change Parameter Order in onFeatureDropped

* Implement Feedback and change Parameter Order in onFeatureDropped

---------

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Adjust nginx configuration for about pages (hpi-sam#657)

* Adjust nginx configuration for about pages

* Redirect invalid requests for a uniform 404 page

* Add link to landing page on about pages

* Improve error pages in nginx setup

The error pages do not rely on a non-existing URL any longer

---------

Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>

* Set up simulation framework (hpi-sam#664)

* Create draft for simulation data types

* WIP: Simulate unloading of vehicles

* WIP add debug helpers and make simulation work

* WIP add typings and lint

* Validate events

* Fix never parameter in activity and behavior functions

* Validate activities and behaviors

* Introduce pseudo randomness for deterministic uuids

* Add migrations for simulation

* Rename SimulationActivity.terminate to onTerminate

* Remove simulatedRegionId from VehicleArrivedEvent

* Slight improvement to debugging buttons

* Fix typo

* Validate state in AddBehaviorAction

* Incorporate suggestions from review

* Fix randomness

* Add generic DelayEventActivity

* Fix DelayEventActivity

* Please linter

* Remove debug UI

* Dragging onto the Map now triggers Drop Events (hpi-sam#671)

* Dragging onto the Map now triggers Drop Events

* Add our names to the readme (hpi-sam#672)

* Use @noble/hashes instead of hash.js (hpi-sam#674)

* Use @noble/hashes instead of hash.js

* Fix install:all script

* Add release workflow

* Populate CHANGELOG.md

* Update create-release-pr.yml

* trigger pipeline

* Prepare release v0.0.1-review (#3)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v123-test (#5)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v1.2.3-test2 (#7)

Co-authored-by: GitHub Actions <noreply@github.com>

* Update create-release-pr.yml

debug

* Update create-release-pr.yml

debug

* debug

* Prepare release v1.2.3-test4 (#11)

Co-authored-by: GitHub Actions <noreply@github.com>

* diff

* Debug v1.2.3-test6 (#13)

Co-authored-by: GitHub Actions <noreply@github.com>

* Debug v1.2.3-test7 (#15)

Co-authored-by: GitHub Actions <noreply@github.com>

* Fix npm i

* Debug v1.2.3-test8 (#17)

Co-authored-by: GitHub Actions <noreply@github.com>

* call pipeline from release

* fix permissions

* remove auto pipeline

* fix changelog

* more permissions

* Update pr creation steps

* add checkout

* maybe fix pr comment

* Use other release action

* Use other name for dev PR

* Use script instead of third party action

* Debug v1.2.3-test19

---------

Co-authored-by: Clemens <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>
Co-authored-by: Lukas Hagen <43916057+Greenscreen23@users.noreply.github.com>
Co-authored-by: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com>
Co-authored-by: benn02 <82985280+benn02@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <noreply@github.com>
Nils1729 added a commit to Nils1729/digital-fuesim-manv that referenced this pull request Feb 25, 2023
* Improve validation (hpi-sam#125)

* Improve validation by introducing multiple new validation decorators

* `IsIdMap` for types of the form `{ readonly [key: UUID]: T }`. This transforms the object, so using instance objects (instead of plain objects) will no longer be supported.

* `IsLiteralUnion` for literal unions of types `number | string | symbol` (e.g. `participant | trainer`). Uses `isIn` internally.

* `IsReachableTransferPoints` for `ReachableTransferPoints` used in `TransferPoint`. Very specific but necessary due to the unique structure of this type.

* `IsUUIDSet` for `UUIDSet`

* `IsValue` for *simple* values that are required for a property. For example, when a `type` property has to have the value `'partial'`, one can use `@IsValue('partial')` for this. Allowed are the types `bigint | boolean | number | string | symbol | null | undefined`. The reason is that this validator also uses `isIn` internally, which in turn uses `===` which might produce incorrect results for `object` values.

* All validators are required to be applied to correctly types properties by the use of `GenericPropertyDecorator`. Using e.g. `@IsLiteralUnion({ partial: true, complete: true })` on a property typed `string` raises a TypeScript error.

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Feature/state benchmark (hpi-sam#581)

* Move state migrations to shared
* Add benchmark package
* Update readmes
* Make problem with duplicated RestoreError more obvious

* Feature/improve eslint rules (hpi-sam#591)

* Disallow imports from "*/dist/*"
* Improve smaller eslint rules
* Update documentation

* Update packages to mitigate GHSA-9c47-m6qq-7p4h (hpi-sam#592)

* Update dependencies (hpi-sam#595)

* Update dependencies

* typescript@4.9 (satisfies-operator and watch-performance-improvements)
* angular@15.1
* Else only patch and minor version bumps
* Fix version of @types/node in benchmark and frontend (18 -> 16)

* Run prettier

* Add simulated regions that can be placed on the map (hpi-sam#601)

* Add simulated regions that can be placed on the map

* Fix naming

* Add migration

* Fix linter error

* Move simulated region to separate heading in trainer map editor

* Turn isInSimulatedRegion into a stub method

* Refactor ol-map-manager to reuse some features from viewport in simulatedRegion

* Ignore vs code config files (hpi-sam#606)

* Rename VS Code configs to `.example`

* Add new "Start all but database" task

* Explain changes in readme

* Refactor viewport-modify to resize-rectangle-interaction (hpi-sam#604)

* Instead of using some parts of the `Modify` interaction (side-effect in the style function) a new custom Interaction has been created.
* Previously, one could switch between resizing and translating a viewport via pressing `Shift`. Instead, now one ***resizes*** if one drags an edge of the viewport (+ a bit around it), and ***translates*** if one drags any other part. This should enable touch users to resize viewports
* The code should now be more readable and extendable
* The unnecessary `viewportTranslateInteraction` has been removed
* `feature.dispose()` now gets called when it gets deleted - this could have been a memory leak?

* Add link to main branch in readme (hpi-sam#611)

* Close popups with esc (hpi-sam#610)

* Add keydown handler to close popups on escape

* Ensure input is saved even after less than 600ms

* Cast event inline

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Add new image for big material and material (hpi-sam#544)

* Add new image for big material and material

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix CVE-2022-25901 (hpi-sam#618)

* Feature/597 regions can contain personnel and patients (hpi-sam#607)

* Add MetaPosition type

* Add MetaPosition to Vehicle

* Add MetaPosition ro Personnel

* Add MetaPosition to Material

* Add MetaPosition to Patient

* Add Classes for different Position Types

* Use create when applicable and fix in MetaPosition

* Add migration for addition of MetaPosition

* refactor literals to start with lowercase

* Change nested if else to else if

* Make metaPosition not optional

* Fix failing Tests

* Update shared/src/models/material.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/models/personnel.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/patient.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/utils/calculate-treatments.spec.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Prettier Errors

* Change Validation to Allow

* Put personnel and material in vehicle on creation

* Update shared/src/store/action-reducers/transfer.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Pipeline dependencies

* Update shared/src/state-migrations/16-add-meta-position.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix linter Error

* Add validators to MetaPositions

* Remove unused imports

* Fix Validators

* Add/Fix Action Migrations

* Add Exports to Index.ts

* Update shared/src/store/action-reducers/utils/spatial-elements.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Update shared/src/store/action-reducers/vehicle.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Fix Lint

Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Initialize the optimisticUpdateHandler only after the store has the exercise (hpi-sam#622)

* Fixes "Features disappear from the map in imported exercises" hpi-sam#621
* Can be observed when two actions are simultaneously optimistically proposed, and the client didn't receive any other action from the server before

* Patients are automatically triaged without any personnel on the map (hpi-sam#624)

* Fix incorrect import of isEmpty

This caused "Patients are automatically triaged without any personnel on the map" hpi-sam#623

* Disallow isEmpty imports from class-validator via eslint

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH) (hpi-sam#619)

* Add Image for Johanniter Akademie NRW, Campus Münster der Johanniter-Unfall-Hilfe e.V. (JUH)

* Fix linter

* Mention JUH in Readme

* Scale down the malteser logo and add the new 22/23 project team to the landing page

* Add our year to the landing page

* Feature/603 use opaque fill style for simulated regions (hpi-sam#608)

* Refactor viewports and simulated regions to be polygons instead of lines

* Add opaque fill to simulated regions

* Fix linter

* WIP

* Refactor Coordinates and Points to Compositions

* Update readme accordingly

* Change default type of SubstituteCoordinateForPoint to never as it should never happen

* Fix typo

* Increase alpha value to 80%

* Fix bug where features did not sync their movement to other clients

* Fix linter

* Refactor lambda function to geometry helpers and refactor ElementFeature
ElementFeature (which had to extend Feature<FeatureType>) has been replaced by Feature<FeatureType>
because according to ol docs there are no classes extending Feature

* Remove ElementManager.recreateFeature()

* Refactor lambdas to function in Geometry Helper subclasses

* Rename getNextPosition to interpolateCoordinates

* Refactor polygon geometry helper names in map lambda function

* Remove comment and type cast

Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>

* Change functions to arrow functions in Geometry Helpers to preserve `this` (hpi-sam#629)

* Add type property to elements in the state (hpi-sam#616)

* WIP

* Pick specific selectors from TypeSelectorMap

* Fix linter

* Remove type property from feature

* Fix bug after merge

* Rename selector map to plural map and add validation

* Simplify featureKeys

* Fix tests by adding type property to demo objects

* WIP: Add migration

* Update shared/src/utils/type-state-selector-map.ts

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Rename file to reflect variable name change

* Replace type literals by element property

* Run prettier

* Finish migration

* Fix migration to set correct type on EocLogEntry

* Make imports consistent

* Reuse literal union from transfer in exercise

* Fix linter

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Remove unsupportedChangeProperties (hpi-sam#630)

* Fix the Bug (hpi-sam#635)

* Remove generic type LineString | Point in favor of the default Geometry (hpi-sam#634)

* Remove generic type LineString | Point in favor of the default Geometry

* Fix linter

* Refactoring/612 refactor position (hpi-sam#625)

* Add MetaPosition Helpers

* Remove position property

* Fix Lint

* Unify access onto metaPosition

* Fix Frontend

* Remove Position Class

* Remove Position from Tests

* Rename MetaPosition to Position

* Add Migration (not for Add vehicle Action)

* complete the renaming

* Fix Tests

* Remove Transfer Property

* Add Migration for Add Vehicle Action

* Fix Small Bug

* Use type properties instead of passed strings

* Add comments

* Fix Test

* Fix Test

* Fix Transfer Overview

* Refactor Helper Methods to avoid duplicate Code

* Change Names of Helper Functions

* Added Comments to unused vars

* Fix GHSA-rc47-6667-2j5j (hpi-sam#645)

* Allow elements to be added to simulated regions (hpi-sam#626)

* Allow elements to be added to simulated regions

* Adapt Add to Simulated Region Action to type tags

* Make linter happy

* Use new position and bugfixes

* Use proper function to create position

* Refactor Start Point Literals (hpi-sam#642)

* Refactor Start Point Literals

* Add Migration

* Enable Migration

* Implement Feedback

* Remove not needed types

* Add footer and about pages (hpi-sam#643)

* Add basic footer and empty about pages

* Refactor structure of about pages

* Add footer to 404 page

* Add links from footer to exercise page

* Run prettier

* Display version number

* Explain overwriting the pages in Docker deployment

* Do not lint HTML files for about pages

* Refactor template component

* Rename title property since it's an html attribute

* Make content observable

* Rename template component

Avoids confusion with angular concepts

* Remove accidentally committed imprint dummy file

* Remove commented-out footer from exercise page

* Make Map movable on Drag with Pop Up (hpi-sam#649)

* Make Map movable on Drag with Pop Up

* Update pipeline actions to node 16 (hpi-sam#627)

* Update pipeline actions to node 16

The old actions were based on Node 12, which has reached EOL.
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

* Test previous version of cypress action again

* Try cypress action v3

* Do not use cached cypress

* Try a Cypress Config without actually calling Cypress

* Try some more stuff...

* Add Cypress as DevDependency to root

* Re-enable default cypress tests

* Remove version tag from cypress cache

The tag was there for debugging purposes only

* Invoke cypress in frontend subfolder

* Try working-directory for cypress

* Try --prefix for start

* Retry --prefix before 'run'

* Restore 5a9692d

* Update package-lock.json

---------

Co-authored-by: ClFeSc <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>

* Change mail address to feedback mailing list (hpi-sam#659)

* Adapt treatment system to account for simulated regions (hpi-sam#658)

* Adapt treatment system to account for simulated regions

The treatment system no longer asserts that patients can only be treated
on the map.

* Please linter

* Enable patient ticking in simulated regions

* Fix extent calculation of viewports and simulated regions (hpi-sam#663)

* Include simulated regions when fitting to view

Also fixing a bug with negative extents

* Fix viewport restriction with negative extent

* Rename fit view method

* Rename function at all occurrences

* Fix isInViewport for negative extents

* Satisfy linter

* Avoid duplication in type definitions

* Refactoring/609 refactor functionality from olmapmanager to featuremanagers (hpi-sam#662)

* WIP

* Move Layer Creation to Feature Managers

* Move Registration into Feature managers

* Complete Merge

* Move Interactions to Interaction Manager

* Move Popup Handling to Popup Manager

* Move Satellite Layer to Satellite Layer manager

* Minor Cleanup

* Move files

* Move Files

* More Cleanup

* More Cleanup

* Fix a bug in participant mode

* Clean up Map Interactions manager

* Clean up Satellite Layer Manager

* Fix Lint

* Implement Feedback

* Implement Feedback and change Parameter Order in onFeatureDropped

* Implement Feedback and change Parameter Order in onFeatureDropped

---------

Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>

* Adjust nginx configuration for about pages (hpi-sam#657)

* Adjust nginx configuration for about pages

* Redirect invalid requests for a uniform 404 page

* Add link to landing page on about pages

* Improve error pages in nginx setup

The error pages do not rely on a non-existing URL any longer

---------

Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>

* Set up simulation framework (hpi-sam#664)

* Create draft for simulation data types

* WIP: Simulate unloading of vehicles

* WIP add debug helpers and make simulation work

* WIP add typings and lint

* Validate events

* Fix never parameter in activity and behavior functions

* Validate activities and behaviors

* Introduce pseudo randomness for deterministic uuids

* Add migrations for simulation

* Rename SimulationActivity.terminate to onTerminate

* Remove simulatedRegionId from VehicleArrivedEvent

* Slight improvement to debugging buttons

* Fix typo

* Validate state in AddBehaviorAction

* Incorporate suggestions from review

* Fix randomness

* Add generic DelayEventActivity

* Fix DelayEventActivity

* Please linter

* Remove debug UI

* Dragging onto the Map now triggers Drop Events (hpi-sam#671)

* Dragging onto the Map now triggers Drop Events

* Add our names to the readme (hpi-sam#672)

* Use @noble/hashes instead of hash.js (hpi-sam#674)

* Use @noble/hashes instead of hash.js

* Fix install:all script

* Add release workflow

* Populate CHANGELOG.md

* Update create-release-pr.yml

* trigger pipeline

* Prepare release v0.0.1-review (#3)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v123-test (#5)

Co-authored-by: GitHub Actions <noreply@github.com>

* Prepare release v1.2.3-test2 (#7)

Co-authored-by: GitHub Actions <noreply@github.com>

* Update create-release-pr.yml

debug

* Update create-release-pr.yml

debug

* debug

* Prepare release v1.2.3-test4 (#11)

Co-authored-by: GitHub Actions <noreply@github.com>

* diff

* Debug v1.2.3-test6 (#13)

Co-authored-by: GitHub Actions <noreply@github.com>

* Debug v1.2.3-test7 (#15)

Co-authored-by: GitHub Actions <noreply@github.com>

* Fix npm i

* Debug v1.2.3-test8 (#17)

Co-authored-by: GitHub Actions <noreply@github.com>

* call pipeline from release

* fix permissions

* remove auto pipeline

* fix changelog

* more permissions

* Update pr creation steps

* add checkout

* maybe fix pr comment

* Use other release action

* Use other name for dev PR

* Use script instead of third party action

* use draft PR workaround

* remove branch requirement

* lint pipelines

* Format changelog

* Debug v1.2.3-test21

---------

Co-authored-by: Clemens <68013019+ClFeSc@users.noreply.github.com>
Co-authored-by: Julian Schmidt <julian.r.schmidt.js@gmail.com>
Co-authored-by: Julian Schmidt <julian.schmidt@student.hpi.de>
Co-authored-by: Lukas Hagen <43916057+Greenscreen23@users.noreply.github.com>
Co-authored-by: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com>
Co-authored-by: benn02 <82985280+benn02@users.noreply.github.com>
Co-authored-by: Nils <45318774+Nils1729@users.noreply.github.com>
Co-authored-by: Marvin <68286419+anonym-HPI@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <noreply@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants